PKUOS - Pintos
Pintos source browser for PKU Operating System course
|
Go to the source code of this file.
Macros | |
#define | PF_P 0x1 |
Page fault error code bits that describe the cause of the exception. More... | |
#define | PF_W 0x2 |
0: read, 1: write. More... | |
#define | PF_U 0x4 |
0: kernel, 1: user process. More... | |
Functions | |
void | exception_init (void) |
Registers handlers for interrupts that can be caused by user programs. More... | |
void | exception_print_stats (void) |
userprog/exception.h More... | |
#define PF_P 0x1 |
Page fault error code bits that describe the cause of the exception.
0: not-present page. 1: access rights violation.
Definition at line 5 of file exception.h.
#define PF_U 0x4 |
0: kernel, 1: user process.
Definition at line 7 of file exception.h.
#define PF_W 0x2 |
0: read, 1: write.
Definition at line 6 of file exception.h.
void exception_init | ( | void | ) |
Registers handlers for interrupts that can be caused by user programs.
In a real Unix-like OS, most of these interrupts would be passed along to the user process in the form of signals, as described in [SV-386] 3-24 and 3-25, but we don't implement signals. Instead, we'll make them simply kill the user process.
Page faults are an exception. Here they are treated the same way as other exceptions, but this will need to change to implement virtual memory.
Refer to [IA32-v3a] section 5.15 "Exception and Interrupt Reference" for a description of each of these exceptions.
Definition at line 30 of file exception.c.
References INTR_OFF, INTR_ON, intr_register_int(), kill(), and page_fault().
Referenced by pintos_init().
void exception_print_stats | ( | void | ) |
Definition at line 65 of file exception.c.
References page_fault_cnt, and printf().
Referenced by print_stats().