深入浅出PINTOS 又名 零基础学PINTOS ——哈哈重在恶搞
忙活了一个周末,废寝忘食地啃特那保姆写的《现代操作作系统》,pintos 的第一个实验才仅仅算是初见端倪
斯坦福阿斯坦福,你把这个pintos 搞的这么难,坑爹阿
能独立完成这个实验的孩子你们伤不起阿
言归正传,把我知道的一点点pintos 实验project1 的做法全都抖落出来,分享一下
已经会的大牛不要嫌我嘚瑟阿
一、在pintos 源码中找到最基本的概念: 本次实验至少需要阅读 thread
h,tread
c,interrup
h,time
c 这四个文件
pintos 在thread
h 中定义了一个结构体 struct thread,这个结构体就存方了有关进程的基本信息
struct thread { tid_t tid; /* Thread identifier
*/ enum thread_status status; /* Thread state
*/ char name[16]; /* Name (for debugging purposes)
*/ uint8_t *stack; /* Saved stack pointer
*/ int priority; /* Priority
*/ struct list_elem allelem; /* List element for all threads list
*/ /* Shared between thread
c and synch
*/ struct list_elem elem; /* List element
*/ #ifdef USERPROG /* Owned by userprog/process
*/ uint32_t *pagedir; /* Page