I've been stuck on this problem for some time now. I'm trying to get a primitive bootloader working using the extended 0x13 calls, 0x41 and 0x42. It works on qemu and bochs, but not on any real PC I have available here.
To isolate the problem the program simply loads (or at least should load) the first sector of the drive at 0x1000:0000 and display the first 80 bytes of this sector. Like I said, this is no problem on either qemu or bochs.
It might be something pretty stupid that I'm overlooking here. However, I can't see it.
Things I considered:
On real computers, this is booting from a usb-stick. I made sure the stick is recognized as a hard disk, legacy mode enabled (uefi). The emulators use a copy of the first 64MiB of this stick.
I've read somewhere the alignment of the DAP might be important. It should be in memory at location 0x7DE0, 16 byte alignment. Is this really important?
I might have taken a register value for granted or messed up a segment, but I can't find such an error myself.
I'm not too familiar with filesystems yet. The idea is to have the stick formatted as FAT32, loading further files via the filesystem instead of hardcoded hidden sectors.
So on the emulators, the expected happens: It prints the first 80 bytes, recognisable by the "FUBUKI" name among other things. On real systems though (3 tested, at least two are uefi, to be honest not sure about the third one) it displays garbage which certainly isn't from the usb-stick. Trying to read past the first sector doesn't even give garbage, just 80 spaces. (Sector 1 of the stick has the supposed second stage bootloader, so it should be recongisable)
The source:
http://pastebin.com/Z2jHj84d
I thought it would be better to do it this way to keep the post clean. Or should I just paste it in code tags here?
The stack location is perhaps not the best, but it should work. I have of course searched for solutions, not only on this site. Some good threads came up, but not specific enough to this problem.
Perhaps I've done something stupid. I don't know. I'd really appreciate some input though
