I use following commands to create an image of my code. its just a simple code prints 'Hello' on screen.
Code: Select all
nasm -f bin printhello.asm -o boot.bin
dd if=boot.bin of=boot.img
I used the following command to write image on my usb.
Code: Select all
sudo dd if=boot.img of=/dev/sdb
If you ask why i formatted after writing image because if i format first then write my code BIOS doesnt see my usb as bootable device.
I reboot my computer and choose usb to boot from. when press enter nothing happens and boot device selection screen comes again. when i select usb and press enter again it boots to my regular operating system but not my code. I am using ubuntu 15.10. i have done a lot of research but couldnt find any solution. I installed ubuntu on my computer with same usb before. My print code is below.
Code: Select all
mov al,'H'
mov ah,0x0E
int 0x10
mov al,'e'
mov ah,0x0E
int 0x10
mov al,'l'
mov ah,0x0E
int 0x10
mov al,'l'
mov ah,0x0E
int 0x10
mov al,'o'
mov ah,0x0E
int 0x10
hang:
jmp hang
times 510-($-$$) db 0
db 0x55
db 0xAA