Excuse me,
I Working At Linux Os,
And I Assembled my bootloader in Nasm with this Command:
Code: Select all
nasm -f bin [myfile.asm] -o [myfile.bin]
then i moved this bootloader to my usb flash memory in this way :
Code: Select all
sudo dd if=[mybootloader] of=/dev/sdc (my flash memory) bs=512 count=1
my workable bootloader is something like this :
Code: Select all
[org 0x7c00]
start: jmp loader
TIMES 0Bh-$+start DB 0
bpbBytesPerSector: DW 512
bpbSectorsPerCluster: DB 1
bpbReservedSectors: DW 1
bpbNumberOfFATs: DB 2
bpbRootEntries: DW 224
bpbTotalSectors: DW 2880
bpbMedia: DB 0xF0
bpbSectorsPerFAT: DW 9
bpbSectorsPerTrack: DW 18
bpbHeadsPerCylinder: DW 2
bpbHiddenSectors: DD 0
bpbTotalSectorsBig: DD 0
bsDriveNumber: DB 0
bsUnused: DB 0
bsExtBootSignature: DB 0x29
bsSerialNumber: DD 0xa0a1a2a3
bsVolumeLabel: DB "MOS FLOPPY "
bsFileSystem: DB "FAT12 "
loader :
;========================== Main Code
mov ax,0xb800
mov es,ax
mov di,0
mov ah,0x3
mov al,'R'
stosw
;==========================
Times 510-($-$$) db 0
dw 0xaa55
if i replace Main code in above with following code my bootloader will not work correctly :
Code: Select all
mov ah,0x0e
mov si,string ; Labels Will Not Work
_loop:
lodsb
int 10h ; this interrupt will not work too
cmp al,0
jne _loop
jmp $
string:
db "Hello World",0
thank you my friend for helping.