首页 > 其他分享 >Ucore_lab3相关

Ucore_lab3相关

时间:2023-01-22 20:44:49浏览次数:61  
标签:struct mm Ucore vma lab3 int swap 相关 addr

虚拟内存管理

关键的一些结构:

struct vma_struct {
    // the set of vma using the same PDT
    struct mm_struct *vm_mm;
    uintptr_t vm_start; // start addr of vma
    uintptr_t vm_end; // end addr of vma
    uint32_t vm_flags; // flags of vma
    //linear list link which sorted by start addr of vma
    list_entry_t list_link;
};

 

struct mm_struct {
    // linear list link which sorted by start addr of vma
    list_entry_t mmap_list;
    // current accessed vma, used for speed purpose
    struct vma_struct *mmap_cache;
    pde_t *pgdir; // the PDT of these vma
    int map_count; // the count of these vma
    void *sm_priv; // the private data for swap manager
};

 

struct swap_manager
{
     const char *name;
     /* Global initialization for the swap manager */
     int (*init)            (void);
     /* Initialize the priv data inside mm_struct */
     int (*init_mm)         (struct mm_struct *mm);
     /* Called when tick interrupt occured */
     int (*tick_event)      (struct mm_struct *mm);
     /* Called when map a swappable page into the mm_struct */
     int (*map_swappable)   (struct mm_struct *mm, uintptr_t addr, struct Page *page, int swap_in);
     /* When a page is marked as shared, this routine is called to
      * delete the addr entry from the swap manager */
     int (*set_unswappable) (struct mm_struct *mm, uintptr_t addr);
     /* Try to swap out a page, return then victim */
     int (*swap_out_victim) (struct mm_struct *mm, struct Page **ptr_page, int in_tick);
     /* check the page relpacement algorithm */
     int (*check_swap)(void);
};

 

其他内容见博客和指导书以及源码。 

 

标签:struct,mm,Ucore,vma,lab3,int,swap,相关,addr
From: https://www.cnblogs.com/wuyun--wy/p/17064640.html

相关文章

  • Ucore_lab2相关
    优秀的博客:https://kiprey.github.io/2020/08/uCore-2/ 实验书:https://learningos.github.io/ucore_os_webdocs/lab1/lab1_2_1_exercise.html 物理内存管理启动分......
  • Cert Manager 申请SSL证书流程及相关概念-三
    中英文对照表英文英文-K8SCRD中文备注certificatesCertificate证书certificates.cert-manager.io/v1certificateissuersIssuer证书颁发者issuers......
  • 进程相关概念、虚拟内存和物理内存映射关系
    学习地址进程和程序并发分时复用cpu单道程序设计多道程序设计cpu和mmu学习地址mmu在cpu内部虚拟内存和物理内存映射......
  • 指向类的相关指针
    指向类数据成员的指针定义<数据类型><类名>::*<指针名>赋值&初始化<数据类型><类名>::*<指针名>[=&<类名>::<非静态数据成员>]指向非静态数据成员的指针在定义时必须和类相......
  • Cert Manager 申请SSL证书流程及相关概念-二
    中英文对照表英文英文-K8SCRD中文备注certificatesCertificate证书certificates.cert-manager.io/v1certificateissuersIssuer证书颁发者issuers.......
  • Cert Manager 申请SSL证书流程及相关概念-二
    中英文对照表英文英文-K8SCRD中文备注certificatesCertificate证书certificates.cert-manager.io/v1certificateissuersIssuer证书颁发者issuers......
  • 卷积相关知识
    1.卷积后尺寸计算卷积核大小\(F\timesF\)输入图片大小\(W\timesW\)步长Spadding大小P输出特征图大小为\(N\timesN\)\(N=(W-F+2\timesP)/S+1\)2.......
  • 怎样借助WWW理解并较好地实现编程中的相关功能点
    首先分享一个课程https://www.icourse163.org/learn/SICNU-1002031014借助WWW来学习编程知识是必须的路径,那么怎样才能够如标题那样更好地实现呢?首先我们分析一下如果......
  • os_lab3
    https://pdos.csail.mit.edu/6.828/2021/labs/pgtbl.html1.添加一个缓存区Wheneachprocessiscreated,maponeread-onlypageatUSYSCALL(aVAdefinedin meml......
  • Cert Manager 申请 SSL 证书流程及相关概念 - 一
    2022.3.9用cert-manager申请成功通配符证书(*.ewhisper.cn),2022.4.30该证书距离过期还有30天,cert-manager进行自动续期,但是却失败了。......