>I don't think you understand what I was trying to do. I figured it
>was better to make a special real-mode stack for calling interrupts
>than to fuss with the protected-mode stack. This has nothing to do
>with the way that the loaders was called--I read ifdef's just fine.
This would have been the better solution, and is in fact what Eric has
implemented in 5.1.2+ by rewriting all the BIOS stub routines, which
frees Etherboot to live anywhere. However the real-mode stack still has
to be in the bottom 1MB for obvious reasons, which means that somewhere
a RM stack has to be allocated. Given that start32/first32 is just a
small trampoline segment that has to live under 1MB anyway, it's ok to
use the less elegant approach of putting the text and the stack all
within the same 6kB segment. You maximise the use of the space by
starting the stack right at the top of the 6kB.
>Instead, it had to do with the fact that the loader was crashing when
>transitioning to real-mode to make interrupt calls.
Which is due to the PM stack, which doubles as the RM stack, starting
off out of range of the RM code. So the solution is either to divorce
the two stacks or to ensure that the PM stack is suitable as a RM stack.
Those BIOS stubs with inline mode switching go all the way back to the
roots of Etherboot in BSD Netboot. Evidently it was the easy thing to do
then. But Etherboot has outgrown that straitjacket now, thanks to Eric.
|