I've written a bootloader and Basic kernel as a fun side project while i'm learning 2 stage bootloaders, I want to load my bootloader at sector 1 (or the MBR) of the USB and the Kernel at sector 2. I've compiled both into Bootloader.bin & Kernel.bin using NASM. I just need a little help on actually writing them onto the USB. I have access to both Windows and Linux so any answers a appreciated.
Bootloader.asm
[BITS 16]
[ORG 0x7C00]
ResetDisk:
XOR AH, AH
INT 0x13
JC ResetDisk
ReadDisk:
MOV BX, 0x8000
MOV ES, BX
MOV BX, 0x0000
MOV AH, 0x02
MOV AL, 1
MOV CH, 0x00
MOV CL, 0x02
MOV DH, 0x00
INT 0x13
JC ResetDisk
JMP 0x8000:0x0000
TIMES 510-($-$$) DB 0
DW 0xAA55
Kernel.asm
[BITS 16]
[ORG 0x8000]
MOV SI, HelloString
CALL PrintString
JMP $
PrintChar:
MOV AH, 0x0E
MOV BH, 0x00
MOV BL, 0x0F
RET
PrintString:
MOV AL, [SI]
INC SI
OR AL, AL
JZ Exit
CALL PrintChar
JMP PrintString
Exit:
RET
HelloString DB 'Hello World!',0
TIMES 512-($-$$) DB 0