3rd exceptions and my stack base...
Posted: Fri Feb 21, 2003 12:00 am
'lo all,
I setup a stack for my kernel. The limit was 4kb (granularity on) the base was 1mb, type as read/write data, P, DPL-0, S-1, B-1
Typically it looked like this in my %define's...
%define K_STACK1_DWORD2 0x00C09210
%define K_STACK1_DWORD1 0x00000001
These being layed out on screen as they are in the intel manual 3 with the base+limit on the bottom define and all the mixture of everything else on the top one.
I did load them the opposite way around. K_STACK1_DWORD1 loaded before K_STACK1_DWORD2 making it correct in the gdt, my gdtr was loaded correctly with a pointer, ss and esp was loaded without any problems but using the stack caused 3rd exceptions. Untill i changed my base address from 1mb to somewhere at 1.2kb - 500h to be exact when it worked, i had a working stack. But why? I have nothing at 1mb, my kernel is loaded at 16mb and i haven't arranged or loaded anything at 1mb and it fails.
Is my base set correctly for 1mb (100000h) in the descriptor shown above?
Brill.
I setup a stack for my kernel. The limit was 4kb (granularity on) the base was 1mb, type as read/write data, P, DPL-0, S-1, B-1
Typically it looked like this in my %define's...
%define K_STACK1_DWORD2 0x00C09210
%define K_STACK1_DWORD1 0x00000001
These being layed out on screen as they are in the intel manual 3 with the base+limit on the bottom define and all the mixture of everything else on the top one.
I did load them the opposite way around. K_STACK1_DWORD1 loaded before K_STACK1_DWORD2 making it correct in the gdt, my gdtr was loaded correctly with a pointer, ss and esp was loaded without any problems but using the stack caused 3rd exceptions. Untill i changed my base address from 1mb to somewhere at 1.2kb - 500h to be exact when it worked, i had a working stack. But why? I have nothing at 1mb, my kernel is loaded at 16mb and i haven't arranged or loaded anything at 1mb and it fails.
Is my base set correctly for 1mb (100000h) in the descriptor shown above?
Brill.