Take the 2-minute tour ×  So I'm working on designing an OS, and
I'm working on designing (not coding yet) the kernel. This is
going to be for an x86 operating system, and my target is for
more modern computers, so RAM can be considered to be at least
256M or more.  My question is this: What is a good size to make
the stack for each thread run on the system? Or better yet,
should I try to design the system in such a way that the stack
can be extended automatically if the max length is reached?  I
think if I remember correctly that a page in RAM is 4k (4096
bytes) and that just doesn't seem like a lot to me. I can
definitely see times, especially when using lots of recursion,
that I would want to have more than 1000 ints in RAM at once.
Now, the real solution would be to have the program doing this
to use malloc and manage its own memory resources a bit, but
really I would like to know the user opinion on this.  Is 4k big
enough for a stack with modern PC programs? Should the stack be
bigger than that? Should