LearningOS / uCore-Tutorial-Guide-2022S

GNU General Public License v3.0
18 stars 5 forks source link

uCore-RV-64-doc/chapter3/2proc-basic #13

Open utterances-bot opened 11 months ago

utterances-bot commented 11 months ago

进程基础结构 - uCore-Tutorial-Guide-2022S 0.1 文档

https://ucore-rv-64.github.io/uCore-RV-64-doc/chapter3/2proc-basic.html

mengmengjiang1999 commented 11 months ago

进程的基本管理 在我们的OS之中,我们采用了非常朴素的进程池方式来存放进程:

 1// os/trap.c
 2
 3struct proc pool[NPROC];    // 全局进程池
 4struct proc idle;           // boot 进程
 5struct proc* current_proc;  // 指示当前进程
 6
 7// 由于还有没内存管理机制,静态分配一些进程资源
 8char kstack[NPROC][PAGE_SIZE];
 9__attribute__((aligned(4096))) char ustack[NPROC][PAGE_SIZE];
10__attribute__((aligned(4096))) char trapframe[NPROC][PAGE_SIZE];

好像应该在proc.c里面