http://www.gnu.org/software/grub/manual ... hine-state
The OSDev Wiki has an article on stacks, however I'm still left with a couple of questions:Multiboot specification wrote:All other processor registers and flag bits are undefined. This includes, in particular:
‘ESP’
The OS image must create its own stack as soon as it needs one.
http://wiki.osdev.org/Stack#Setup_the_stack
What exactly is this warning about? And I admit that I don't know how to set up the DS segment.OSDev Wiki wrote:Take care when implementing your kernel. If you use segmentation, the DS segment should be configured to have it's base at the same address as SS does. Otherwise you may run into problems when passing pointers to local variables into functions, because normal GPRs can't access the stack the way you might think.
Is this the DS register or the data segment as described in the GDT?
Now back to the intended topic: is it a good idea to use the low memory (640 KB) for the stack seen as the kernel is moved at above 1 MB?