This section is expected to handle page faults, breakpoints, and system calls
Handling System Page Errors
After the page fault has occurred, enter into the system interrupt, then go through the _alltraps, into the trap, and then through the Trap_dispatch distribution, the interrupt type of T_pgflt interrupt should be processed
Of course, page faults also have kernel page faults and user page errors
Working with breakpoints
In Jos, breakpoint interrupts are "abused", almost a system call, which is used as a monitor for invoking the system and is simple to implement.
System calls
The assembly part of the system call has been written.
An interrupt is thrown, the interrupt number is t_syscall, and the specific system call number is written in Num, which is the register ax, and then in Trap_dispatch, the call to SYSCALL is available.
The implementation of the Syscall is as follows
User-mode Startup
The link into the kernel that was loaded at system boot time is USER/HELLO.C
is to print Hello World and your own environmental information
But there are several interruptions and system calls involved.
The first call to system call Sys_getenvid is
And then after entering the Umain function
It outputs two times, so it generates two system calls
When the Umain function executes and returns to the LibMain function, the Exit function is executed, and the exit function is called inside Env_destroy
So the above interrupts and system calls are explained.
Page Fault and memory protection
Very important content, protect memory, in the memory operation, check the current memory range is not the current process can access, if not, check failed, end process
The code above is a reference to someone else's program.
Check all pages within a given memory range to see if the current user has permission to access
At this time the experiment ended, tossing a day and a half ...
MIT 6.828 Xv6/jos LAB3-PARTB