GitHub - FooAuto/Distributed_Unix_V6PP: The course design of Operating System ( 2025 spring, Tongji University ) | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

FooAuto/Distributed_Unix_V6PP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnixV6++ 离散化修改说明

一. 使用位示图管理核心和用户页表分配与回收

1. 核心思路

核心和用户页表分配与回收位于 src\mm\PageManager.cpp中的AllocMemory(unsigned long size)FreeMemory(unsigned long size, unsigned long startAddress)两个函数发生。模仿现有空闲表方法,需要准备位示图替换原有空闲表。位示图初始化可以方在两个继承类的Initialize()函数中。

2. 主要修改内容

  1. src\include\MapNode.h 中新增 BitMap 类。记录对应页表区的起始地址和负责多少页框

  2. src\include\Allocator.h中新增BitMapAllocator类,并在src\mm\Allocator.cpp中实现基于位示图管理的页框分配与回收

  3. src\include\PageManager.h中新增 public 变量bitmap,核心态和用户态分别使用一个独立的页表。页表具体参数由子类初始化时设置

  4. Kernel.cpp PageManager.cpp 文件中做对应调整

二、把相对表当真正的页表用

写完了前两个步骤(把 base 改为物理页框号,修改 MapToPageTable() 逻辑),主要修改三个部分,修改 NewProc 部分使得创建子进程时,子进程复制父进程的相对表,在函数中完成物理页框号的赋值;修改 EstablishUserPageTable()MapToPageTable 赋值逻辑

第三步栈扩展时,主要修改了SStack()函数的逻辑,不再需要复制内存。同时,为了防止连续新的栈段的页表在EstablishUserPageTable()被连续映射,手动进行内存总占用空间核验。新增StableExpand()函数,模仿Expand()函数实现,但是通过调用EstablishSStackUserPageTable()函数实现新增栈空间的地址映射。

TODO: 第四步,堆扩展

About

The course design of Operating System ( 2025 spring, Tongji University )

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.