Hey,
how big is stack in your OS? I ran into severe problems as mine kernel switches to real mode (APM, some useful bios functions etc) and I had to keep the stack under 640kB. Maybe it's enough you say, but loading SS at e.g. 0x5F and ESP to 0 (very close to CPU vectors BTW) as the stack grows downwards, works, but there are nasty errors like your OS wouldn't work on MS VPC 2007 but it would on Bochs. I've met personally with this. Or e.g. self-rewriting code: on VMware and VPC my OS wouldn't work with some commands, but Bochs worked flawlessly... so I've created at least 20 combinations of SS:ESP, which then had unexpected results. You e.g. can't set SS to 0 and ESP to 0xFFFF (resulting in 32 kB stack size, from 0xffff to 0x7C00) if your kernel is switching to real mode, here's why: 0xF000 and neighbours are ROM BIOS functions .
So I've got really mad and put TIMES 16*1024 DB 0 right in the beginning of the exe kernel, which works.
My question is: what's your stack size? Is 16 kB enough?
[Poll] Stack size
[Poll] Stack size
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
Re: [Poll] Stack size
Unless you are writing something like a recursive descent parser, or storing an awful lot of data on the stack, I would think 16kb is plenty.
The continuous image of a connected set is connected.
Re: [Poll] Stack size
My stacks are all 1K, and I never use more than 300 bytes of them. But I'm not planning on implementing a recursive descent parser in my kernel, either.
Re: [Poll] Stack size
I've got 64 kbs... so that I am always totally sure that (unless an inifite recursion occurred) a problem isn't stack related
-
- Member
- Posts: 79
- Joined: Sun Jun 10, 2007 11:36 am
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: [Poll] Stack size
kernel stacks are currently 3K. Basically, one page with the thread's info subtracted from it.
I even used 256b stacks without problems
I even used 256b stacks without problems