less than 1 minute read

pintos

memory layout

           |           kernel space           |
 PHYS_BASE +----------------------------------+
           |            user stack            |
           |                |                 |
           |                |                 |
           |                V                 |
           |           grows downward         |
           |                                  |
           |                                  |
           |                                  |
           |                                  |
           |           grows upward           |
           |                ^                 |
           |                |                 |
           |                |                 |
           +----------------------------------+
           | uninitialized data segment (BSS) |
           +----------------------------------+
           |     initialized data segment     |
           +----------------------------------+
           |           code segment           |
0x08048000 +----------------------------------+
           |                                  |
           |                                  |
           |                                  |
           |                                  |
           |                                  |
         0 +----------------------------------+
  • kernel space is always mapped the same way, in pintos virtual memory is mapped one-to-one, PHYS_BASE + 0x1234(virtual address) -> 0x1234(physicall address)

  • page fault:

    1. access kernel virual memory
    2. access memory at unmapped virtual address

Tags: ,

Categories:

Updated: