I am currently trying to implement paging for user processes.
I have already successfully identity paged the first 4 MB to the kernel.
When creating a new process I:
Request a new page for the kernel
load the process to that new page
load a loader function on top of the process code that will reload cr3 with the processes page directory pointer and jump to the entry label of the process.
I then create a new page directory for the process which contains just one table with one page (the one the process is loaded on) mapped to 0x0 virtual address.
Finally i jump to the loader function.
However, right after loading the page dir. to cr3 i get a "physical adress not available" from bochs and the system reboots.
Code: Select all
<bochs:14> s
Next at t=538301714
(0) [0x000000400027] 0008:0000000000400027 (unk. ctxt): mov cr3, eax ; 0f22d8
<bochs:15> s
Next at t=538301715
(0).[538301715] ??? (physical address not available)
<bochs:16> info tab
cr3: 0x000000106000
0x0000000000000000-0x0000000000000fff -> 0x000000400000-0x000000400fff
<bochs:17> r
CPU0:
rax: 00000000_00106000
rbx: 00000000_00000000
rcx: 00000000_00104f84
rdx: 00000000_00000002
rsp: 00000000_00104ef8
rbp: 00000000_00102208
rsi: 00000000_00000002
rdi: 00000000_0002cf09
r8 : 00000000_00000000
r9 : 00000000_00000000
r10: 00000000_00000000
r11: 00000000_00000000
r12: 00000000_00000000
r13: 00000000_00000000
r14: 00000000_00000000
r15: 00000000_00000000
rip: 00000000_0040002a
eflags: 0x00000206: id vip vif ac vm rf nt IOPL=0 of df IF tf sf zf af PF cf
<bochs:18> s
(0).[538301715] ??? (physical address not available)
Next at t=538301716
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0
Thanks for any suggestions.