Page 1 of 1

CS Selector is Null

Posted: Sat Sep 21, 2002 8:43 am
by PlayOS
Hi,

Does anyone know what things can cause bochs to return the error ''iret : return CS Selector null'.

I am assuming that it is a problem with my IDT, except that I only get this error if I set my stack (esp) to point to 0x100000 (1MB). I havent tried all addresses but I dont get the error if I set my stack (esp) to 0x600000 (6MB).

thanks

Re:CS Selector is Null

Posted: Sat Sep 21, 2002 8:52 am
by Whatever5k
Could you please show us your code...?
When GRUB sais that the CS selector is null, I'd better believe it ;)
Perhaps, you haven't updatet your segment registers. Which bootloader are you using? To which address is your kernel loaded, etc. etc. etc.

Re:CS Selector is Null

Posted: Sat Sep 21, 2002 9:18 am
by PlayOS
[attachment deleted by admin]

Re:CS Selector is Null

Posted: Sat Sep 21, 2002 9:47 am
by Slasher
hi,
you have to check if the stack is being overwritten by some code. I had a similar problem with my stack when i was implementing Stack based task switching. My stack started at 2mb and was crashing but when i moved it so 4mb, it worked fine. I know that i wasn't overwriting it cause my code was less than 10kb and started at 0x4000,still investigating it! Attach you code and it will be easier for us to help!
you might like to check this thread and see if it helps
http://www.mega-tokyo.com/forum/index.p ... eadid=1374

Re:CS Selector is Null

Posted: Sat Sep 21, 2002 10:35 am
by PlayOS
Code is attached above in my second post. :)