Touge Operating System Classroom Exercise 4.3: Segmented Page Memory Management Answer No Analysis

Level 1: Changes in page directories and page tables before and after process creation

programming requirements

Find the answer through gdb and dbg debugging, and fill in the answer of the first level /data/workspace/myshixun/第一关.txt.
This task analyzes the kernel of version 1 to answer questions:
1. Before process 0 executes the fork system call, what is the mapping relationship between linear address space and physical address space?
2. When process 0 has just executed the fork system call, what is the mapping relationship between the linear address space and the physical address space?
3. Before and after process 0 executes the fork system call, what changes have taken place in the page directory?

For version 1 kernel environment configuration details, please move to the first few levels~ Touge Operating System Homework 3.1: Process Description and Status

Start the gdb debugger:

b 145
c
n

x/5i $eip

p &current
p current
quit

 

Then start the dbg debugger:

b 0x6908
c
x/wx 0x1fa20

info tab
x/40wx 0x0
next
info tab
x/40wx 0x0

 

 The answer to the first level document (be careful not to type more or less 0) :

 

Level 2: The first modification of the mynext variable by process 1

programming requirements

Find the answer through gdb and dbg debugging, and fill in the answer of the second level /data/workspace/myshixun/第二关.txt.
This task analyzes the version 1 kernel to answer the question:
What is the address of the instruction that process No. 1.1 modifies the mynext variable?
2. What is the linear address of the variable mynext of process number 1?
3. Before process 1 modifies the mynext variable for the first time, what is the value of the page table entry corresponding to the above linear address? What is the physical address (old physical address) that this linear address is mapped to?
4. When process No. 1 modifies the mynext variable for the first time, a page fault will be triggered. What is the value of the CR2 register when the page fault handler starts to execute?
5. What is the address of the recovery point when returning to the recovery point after the fault on this page is resolved? What is the value of the page table entry corresponding to the above linear address at this time? What is the physical address (new physical address) to which this linear address is mapped?
6. After the execution of the recovery point instruction, what is the value at the above new physical address? What is the value at the above old physical address?

The environment configuration version 1.3 kernel is the same as before. For details, please move to the following link~ Touge Operating System Classroom Exercise 4.1: Segmented Memory Management Answer_Blueberry Cream Dumpling Blog-CSDN Blog

Start the gdb debugger:

b 156
c

x/8i $eip
p &mynext
quit

 Start the dbg debugger:

b 0x6988
c
sreg

x/wx 0x17:0x2282c
x/wx 0x0+16*4
x/wx 0xffe000+34*4
s
creg
u/26

b 0xb1d5
c
s
s
x/wx 0x0+16*4
x/wx 0xffe000+34*4
s
xp/wx 0xffc82c
xp/wx 0x2282c

The answer of the second level document (be careful not to type more or less 0) :

 

Guess you like

Origin blog.csdn.net/kercii/article/details/130607223