[SeaBIOS] Is there a limit on the stack

Kevin O'Connor kevin at koconnor.net
Tue Feb 14 01:30:11 CET 2012

On Tue, Feb 14, 2012 at 08:34:22AM +0900, Daniel Castro wrote:
> Hello All,
> I am manipulating a lot of strings inside in the 32 bit init code,
> mostly by creating a pointer to char on the stack, and allocating the
> memory with malloc_high, but is done more than 20 times in some parts
> of the method. Lately I have seen that whenever I reference a pointer
> that was defined and used in the beginning I will get a fault, so I

I'm not sure what you mean by "fault".  SeaBIOS should be running
without any memory protection, so it shouldn't ever cause a cpu trap
(unless it read/wrote to somewhere above the top of ram).

The 32bit init code runs with a stack at 0x7000 - so this should give
about 26K of stack.  If the code is running in a "thread", then the
stack is 4k.  The 32bit "resume" handler has a ~3K stack.  Finally,
the 16bit code has a severely restrained stack (as little as a couple
hundred bytes).


More information about the SeaBIOS mailing list