Well, I finally solved my problems with getting freeldr to boot from a
hard drive. The first is a problem with fat.bin itself. Early during
it's execution it checks to see if the boot sector header specifies a
device ID of 0xff, and if so, it uses the device ID the bios passes in
CL when it invokes the boot sector, otherwise it uses the device ID in
the boot sector header. The device ID field of the boot sector is
inherently unreliable and should NEVER be used. In my case mtools was
leaving it as it was in fat.bin, which is 0, so it was trying to access
the floppy instead of the hard disk. I have fixed this by removing the
check to see if the field is 0xff, so the code will always use the
device passed by the bios.
The second problem was far more stupid. mtools was not specifying
O_BINARY when opening the boot sector template file, and as a result,
cygwin was translating newlines, so it clobbered the boot sector.
I'm all set to check in the fix to fat.asm, but I was never asked by
subversion ( tortoise client ) to log in, so I assume it just used anon
or something. How do I tell subversion to log me in as me?