MTD CVS update: 'mtd/grub doc_stage1.S'
Update of /home/cvs/mtd/grub
In directory infradead.org:/tmp/cvs-serv17114
Modified Files:
doc_stage1.S
Log Message:
Fix the setup of the INT 19h handler so we are no longer using the previously initialised %es register as the segment address of the vector.
Also fix the segment registers in the actual copy, so that we put the right stuff in place, rather than starting our copy at 0000:0000.
I can hardly believe that this has ever worked. It seems that by an amazing coincidence, the IPL ROM sets %es to 0x2000 before jumping to the code - so even though we were using an uninitialised segment address pointer, and our copy of the IRQ handler to the _intended_ location went AWOL, we ended up with the INT 19h handler pointing at the location in memory at which the IPL ROM loads the SPL, before the SPL relocates itself into the reserved area.
So as long as nothing touched that memory later in the startup sequence, it would still be there when the BIOS got round to calling INT 19h to boot. This is why it worked on simple machines like my 386 testbed, but nothing else.
I hereby declare myself to be Today's Official Mr F*** All Good.
To unsubscribe, send "unsubscribe mtd" to [email protected]
Quoted 2 lines · [email protected] said:
Also fix the segment registers in the actual copy, so that we put the right stuff in place, rather than starting our copy at 0000:0000.
It seems I lied about this one - that was right in the previous version, but I removed a 'push cs; pop ds' pair with some debugging cruft and didn't remember that fact when I later noticed that they ought to be there for other reasons. The perils of asm hacking at 2am :)
So I'm not _quite_ as stupid as I thought. Close, though. It _was_ copying the handler to the right place, but just pointing the IRQ vector at the old location.
Oh well, it ought to work now. Now we just need to finish hacking Grub so it can boot a kernel off the NFTL. So far, it finds the hardware and scans if for an NFTL Media Header. The rest should be simple.
--
dwmw2
To unsubscribe, send "unsubscribe mtd" to [email protected]