title: How can I write a bootloader of my operating system to a USB stick?
body: <p>I tried to make a bootloader for my own operating system. I tried to write it to a USB stick with <strong>imageusb</strong> program (from format: img, iso and bin, nothing works). Then I tried to boot it, but I didn't find it in the BIOS boot menu. I coded it with assembly. How can I boot the operating system using my own bootloader?</p>
  
  <p>Here is part of my code:</p>
  
  <pre><code>[BITS 16]
  [ORG 0x7C00]
  
  JMP Main
  
  Main:
  
  MOV SI, Text
  CALL PrintString
  CALL NextLine
  
  MOV SI, PressKeyForBoot
  CALL PrintString
  CALL Boot
  JMP $
  
  PrintCharacter:
  MOV AH, 0x0E
  MOV BH, 0x00
  MOV BL, 0x07
  
  INT 0x10
  RET
  
  NextLine:
  MOV AL, 0
  stosb
  mov AH, 0x0E
  MOV AL, 0x0D
  INT 0x10
  MOV AL, 0x0A
  INT 0x10
  ret
  
  Boot:
  CALL RebootKey
  db 0x0ea
  dw 0x0000
  dw 0xffff
  
  RebootKey:
  mov ah, 0
  int 0x16  
  cmp ah, 01h
  jne RebootKey
  
  PrintString:
  next_character:
  MOV AL, [SI]
  INC SI
  OR AL, AL
  JZ exit_function
  CALL PrintCharacter
  JMP next_character
  exit_function:
  RET
  
  
  Text db 'Loading...', 0
  PressKeyForBoot db 'Press ESC key to reboot.', 0
  TIMES 510 - ($ - $$) db 0
  DW 0xAA55
  </code></pre>