From: Ben Pfaff Date: Mon, 20 Sep 2004 19:06:58 +0000 (+0000) Subject: Comments. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f459d6b791bc527aa791960d09f4f4a4add40ec5;p=pintos-anon Comments. --- diff --git a/src/threads/mmu.h b/src/threads/mmu.h index 2af85bc..4d4aa6a 100644 --- a/src/threads/mmu.h +++ b/src/threads/mmu.h @@ -93,6 +93,16 @@ static inline void *pg_round_down (const void *va) { return (void *) ((uintptr_t) va & ~PGMASK); } +/* Base address of the 1:1 physical-to-virtual mapping. Physical + memory is mapped starting at this virtual address. Thus, + physical address 0 is accessible at PHYS_BASE, physical + address address 0x1234 at (uint8_t *) PHYS_BASE + 0x1234, and + so on. + + This address also marks the end of user programs' address + space. Up to this point in memory, user programs are allowed + to map whatever they like. At this point and above, the + virtual address space belongs to the kernel. */ #define PHYS_BASE ((void *) LOADER_PHYS_BASE) /* Returns kernel virtual address at which physical address PADDR diff --git a/src/userprog/exception.c b/src/userprog/exception.c index dead766..4f3e4f9 100644 --- a/src/userprog/exception.c +++ b/src/userprog/exception.c @@ -101,7 +101,8 @@ kill (struct intr_frame *f) #define PF_U 0x4 /* 0: kernel, 1: user process. */ /* Page fault handler. This is a skeleton that must be filled in - to implement virtual memory. + to implement virtual memory. Some solutions to project 2 may + also require modifying this code. At entry, the address that faulted is in CR2 (Control Register 2) and information about the fault, formatted as described in