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.


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?