您的位置:首页 > 其它

操作系统学习笔记(28)--初始化进程调度

2010-06-01 22:28 417 查看
 

内核进程

 

1 初始化一个进程

2 开始IDLE进程

3 开始Reaper进程

 

进程队列、进程等待队列、进程等待清理队列。

 

进程有用户、优先级、计数值、引用值(默认有自己的一个)。

 

有一个当前的进程全局变量

struct Kernel_Thread {
ulong_t esp;			 /* offset 0 */
volatile ulong_t numTicks;		 /* offset 4 */
int priority;
DEFINE_LINK(Thread_Queue, Kernel_Thread);
void* stackPage;
struct User_Context* userContext;
struct Kernel_Thread* owner;
int refCount;

/* These fields are used to implement the Join() function */
bool alive;
struct Thread_Queue joinQueue;
int exitCode;

/* The kernel thread id; also used as process id */
int pid;

/* Link fields for list of all threads in the system. */
DEFINE_LINK(All_Thread_List, Kernel_Thread);

/* Array of MAX_TLOCAL_KEYS pointers to thread-local data. */
#define MAX_TLOCAL_KEYS 128
const void* tlocalData[MAX_TLOCAL_KEYS];


 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息