USB Boot with assembly
Posted: Sun Sep 07, 2008 4:23 pm
hi , i was trying to follow the steps in the : http://wiki.osdev.org/Babystep2
the idea is to create a bootloader that will display a message on the screen this is the code i used and i named the file "boot.asm"
i did follow the steps from the WIKI babystep1 to get the "boot.bin" file and then i used this Command to make a bootable Floppy :
and it did work perfectly , but then i looked for 2 days to find a way to make a bootable USB with this "boot.bin" file but sadly i didn't find any good tutorial or sample so i just used the same command but this time i used my USB drive with this command :
where sdb1 is my USB drive , then i tested my USB with my laptop and it made it reboot each time it reads from the USB !! ??
anyway all i need is a way to make my USB drive bootable with a message in the screen ... so if anyone can find what is best way to do this please help .
by the way i formated my 2GB USB flash disk with fdisk , Primary partition , 1 , default size , active , bootable , FAT16.
thanks in advance
the idea is to create a bootloader that will display a message on the screen this is the code i used and i named the file "boot.asm"
Code: Select all
; boot.asm
mov ax, 0x07c0
mov ds, ax
mov si, msg
ch_loop:lodsb
or al, al ; zero=end or str
jz hang ; get out
mov ah, 0x0E
int 0x10
jmp ch_loop
hang:
jmp hang
msg db 'Welcome to Macintosh', 13, 10, 0
times 510-($-$$) db 0
db 0x55
db 0xAA
Code: Select all
dd if=boot.bin of=/dev/fd0
Code: Select all
dd if=boot.bin of=/dev/sdb1
anyway all i need is a way to make my USB drive bootable with a message in the screen ... so if anyone can find what is best way to do this please help .
by the way i formated my 2GB USB flash disk with fdisk , Primary partition , 1 , default size , active , bootable , FAT16.
thanks in advance