PKUOS - Pintos
Pintos source browser for PKU Operating System course
Macros | Functions
exception.h File Reference
This graph shows which files directly or indirectly include this file:

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...
 

Macro Definition Documentation

◆ PF_P

#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.

◆ PF_U

#define PF_U   0x4

0: kernel, 1: user process.

Definition at line 7 of file exception.h.

◆ PF_W

#define PF_W   0x2

0: read, 1: write.

Definition at line 6 of file exception.h.

Function Documentation

◆ exception_init()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exception_print_stats()

void exception_print_stats ( void  )

userprog/exception.h

userprog/exception.h

Definition at line 65 of file exception.c.

References page_fault_cnt, and printf().

Referenced by print_stats().

Here is the call graph for this function:
Here is the caller graph for this function: