kernel vs user space question
Posted: Fri Aug 21, 2020 4:28 am
I have 2 gdt segments for kernel, one for code, the other for data
I have 2 gdt segments for user space, one for code, the other for data
all segments span the entire 4gb address space
Now my kernel data and code is mapped into virtual address space by setting the page table bit to supervisory only... (not accessed by all)
now I transitioned my kernel process into user mode and tries to make syscalls.... I got an error saying that page fault
for the stack I am trying to access...
The segment selector value is 0x23
last 2 bit is rpl which is segment selector indicates it is user mode... after switch to user mode, is my cpl 3?
what did I do wrong? I find that rpl, dpl and cpl confusing...
should I set kernel code and data to supervisory or to all? will that make user code able to execute kernel code??
I am drowning in questions ! pulling me out of my misery!!!
I have 2 gdt segments for user space, one for code, the other for data
all segments span the entire 4gb address space
Now my kernel data and code is mapped into virtual address space by setting the page table bit to supervisory only... (not accessed by all)
now I transitioned my kernel process into user mode and tries to make syscalls.... I got an error saying that page fault
for the stack I am trying to access...
The segment selector value is 0x23
last 2 bit is rpl which is segment selector indicates it is user mode... after switch to user mode, is my cpl 3?
what did I do wrong? I find that rpl, dpl and cpl confusing...
should I set kernel code and data to supervisory or to all? will that make user code able to execute kernel code??
I am drowning in questions ! pulling me out of my misery!!!