I was doing a hello world project to run on my x86 bare metal physical machine , but the code didn't run (boot) and the machine proceded for the next boot device, I wrote the code in assembly , the following steps was what I have done :
step 1 : code to display characters A abd B by Bios calls
.L1 :
mov %ah,0x0E
mov %bh,0x00
mov %bl,0x07
mov %al,65
INT $0x10
mov %ah,0x0E
mov %bh,0x00
mov %bl,0x07
mov %al,66
INT $0x10
jmp .L1
step 2 :
assembling the code and producing the code in binary format :
as -o Code Code.txt
objcopy -O binary Code binfile
step 3 :
opened HxD and displayed the binary form of the assembly code and padded it with zeros till the last two bytes of the first 512 byte which i padded them with 55AA (in hex) to look like :
step 4 :
copied the image to the flash memory:
dd bs=512 count=1 if=binfile of="\\.\e:"
(Note : I am using dd on windows)
Note : relied on the fact that the bootstrap code in the first sector will display the two characters didn't use anu further boot loader cause thats my first project so i manged to keep it simple.
The chacters are not displayed and a message invalid bootable device is displayed, the device skip to next device and boot windows normally .. what I am missing here ?