Virtual Memory

ewillwin·2022년 10월 29일
0

Operating System

목록 보기
3/3
post-thumbnail

xv6 Memory Layout

process의 virtual address space와 physical address space가 mapping 되어 있음


How Physical Memories Initialized in xv6

  • physical memory 할당은 main 함수의 kinit1, kinit2 함수를 통해 이루어짐

  • 모든 physical memory가 boot time에 kmem의 free list에 포함됨
  • kinit1() sets up for lock-less allocation in the first 4MB
  • kinit2() arranges for more memory (until PHYSTOP) to be allocatable (224MB)
  • freerange() kfree() with page size unit
  • kfree() fills page with 1s, and put it into freelist (page pool)

  • fork() 함수는 부모와 완전히 동일한 메모리 컨텐츠를 갖는 자식을 생성함
  • allockproc()를 통해 kernel stack을 할당
  • copyuvm()을 통해 부모의 page table을 복사함

Project 3: Implement Simple mmap()

    1. mmap() syscall
    1. Page fault handler
    1. munmap() syscall
    1. freemem() syscall
profile
Software Engineer @ LG Electronics

0개의 댓글