Androv wrote:
BIOS returns the floppy drive = 231 not 0 as I read floppy should be = 0 so when replacing dl with 0 in read: it fails to read the disk but when it replacing dl in reset: it resets successfully so which drive is reset while the floppy drive = 0
You can reset the floppy drive even when there's no disk in the floppy drive. Are you sure DL is 231? It should be 128 for a hard disk.
Androv wrote:
When I put pusha in print_string before the rest of the code and popa in print_done before ret after running the program it only prints bootmsg
Perhaps the stack provided by the BIOS is too small. Perhaps you need to set BX before calling INT 0x10.
Androv wrote:
When replacing 0x0F00 with 0x1000 and 0xF000 with 0x10000 it doesn't print Hello World but it prints S I don't know why
Your assembler should tell you exactly why: the SI register is 16 bits, and 0x10000 doesn't fit in 16 bits.
Androv wrote:
When replacing 0x0F00 with 0x1000 and 0xF000 with es:bx (while it must be equivalent to 0x10000) it doesn't Hello World nor S
But LODSB uses DS:SI, not ES:BX. You'll have to show your code if you want help with this.
Androv wrote:
Command qemu-system-x86_64 -drive format=raw,file=%FILE%.img makes bios return drive 231 so what it boots as
It will boot as a hard disk, but it should be drive 128. Are you sure DL is 231?
Androv wrote:
Someone told me to replace it with this command qemu-system-x86_64 -drive file=%FILE%.img,if=floppy,index=0,media=disk,format=raw it made bios returns drive number 0 which is the expected floppy number but bios prints this error Boot failed : could not read the boot disk while if the working version of the code as it is it prints Hello World despite this error
QEMU tries to boot the hard disk, then displays the error message because it can't boot the hard disk, then boots your floppy disk. You can make the error message go away by adding "-boot order=a" to your command line.
Androv wrote:
Code:
read:
...
pop dx ;get the drive number into dl
...
jc read ;if failed try again.
This loop repeatedly pops from the stack.