MIT 6.S081 Lecture 4: Page tables
发表于|更新于|操作系统
|总字数:156|阅读时长:1分钟|浏览量:
Reading
- Read Chapter3
- read code
Address Spaces
-
每个进程拥有专属的地址空间
-
Page table实现了同一个物理内存,不同的地址空间
-
读写satp寄存器是特殊权限指令
-
PT H/W
-
不为每个地址(1Byte)创建表单条目,而为每个Page(通常4KB,Offset12位)创建一个表单条目
-
VA -> PA
Real paging H/W (RISC-V)
-
三级缓存的RISC-V Page
TLB: Translation Lookaside Buffer
-
cache of PTE(page table entry)
-
When switch PT, clear TLB
OS and PTE
-
OS可以操纵PTE
-
Page Fault很有用
-
虚拟地址映射到内存和I/O设备
- 高于0x80000000 -> DRAM
- 低于0x80000000 -> I/O
相关推荐
2023-05-03
MIT 6.S081 Lab thread
Compulsory exercises Preparation reading To start the lab, switch to the thread branch: 123git fetchgit checkout threadmake clean Uthread: switching between threads (moderate) Using threads (moderate) Barrier(moderate) Optional challenge exercises The user-level thread package interacts badly with the operating system in several ways. For example, if one user-level thread blocks in a system call, another user-level thread won’t run, because the user-level threads scheduler doesn’t know th...
2023-04-28
MIT 6.S081 Lecture 17: Virtual memory for applications
Reading Read Virtual Memory Primitives for User Programs (1991)
2023-04-23
MIT 6.S081 Lab cow
Compulsory exercises Preparation To start the lab, switch to the cow branch: 123git fetchgit checkout cowmake clean OS真不是人写的把😭 Implement copy-on write(hard) 当xv6 fork一个子进程时,需要复制父进程的地址空间,这不仅占用了空间,也消耗了时间,你的任务是采用写时复制,fork()时child使用parent的内存空间,即子进程映射到父进程的物理空间上,当进程要写时,触发Page Fault 实现COW 修改uvmcopy()以在fork()时不分配新page,而映射到父进程 vm.c uvmcopy()1234567891011121314151617181920212223242526272829303132intuvmcopy(pagetable_t old, pagetable_t new, uint64 sz){ pte_t *pte; uint64 pa, i; uint fla...
2023-04-22
MIT 6.S081 Lecture 16: File system performance and fast crash recovery
Reading Read Journaling the Linux ext2fs Filesystem (1998) Information 第一节OS论文的阅读讲座 ext3 “log” = journal ext3 = ext2 + journal xv6 log review ext3 log ext3 log format ASYNC Batching Concurrency ext3 code steps in commit
2023-04-22
MIT 6.S081 Lecture 15: Crash recovery
Reading Read logging sections of “File system” read code Information 最后一节关于xv6的讲座了,后面的重点会放在操作系统论文的阅读上 再见了所有的xv6 😭 Problem crash如电源中断,系统重启等 crash会使得建立在磁盘上的文件系统进入不正确的的状态,怎样保证crash后维持正确的状态呢? 解决方案是logging Risk 文件系统的操作是多步的 如果crash后重启,很可能要么再次crash,要么读写了错误的数据 logging log的步骤 log writes commit op install clean log log能够保证文件系统操作的原子性,并提供快速恢复的能力,在不同步骤crash都有不同的恢复方案 log的内容 内存中有磁盘中log的cache Challenges eviction 不要驱逐正在log的block fs operation must fit log log限制了文件系统一...
2023-04-20
MIT 6.S081 Lecture 14: File systems
Reading Read Chapter8 read code File System User-friendly names/pathnames Share files between users/process Persistence/durability Why intersting? Abstraction is useful Crash safety Disk layout Performance -> Storage devices are slow -> to be fast storage -> buffercache device -> concurrency API example xv6文件系统提供的API实现了文件系统基本的用户级操作 FS structure inode含有文件的信息,代表一个独立的文件 inode的大小是64Bytes FS Layer 文件系统的多层结构抽象了硬件,并为软件提供了接口 Storage devices 这里需要...