摘要: [仅供自己参考]1 第一个进程的书写思路:前提:申请好相应gdt,idt,tss的内存(可用C写),并进行必要的初始化。申请好proc_table的内存,proc_table包涵了stack_frame(进程切换时候用于存放cpu状态的地方)和ldt表(这个进程对应的ldt)和 ldt_sel(GDT表中的selector)。对proc_table进行必要的初始化(这个进程第一次运行之前当然得初始化我们希望进程开始时候的cpu状态)调入一个叫restart的函数,它做得主要工作是:将此进程的ldt赋值为p_proc_ready的ldt_sel.将tss中的esp赋值为自己的proc_table 阅读全文
posted @ 2011-09-06 22:13 Jack204 阅读(419) 评论(0) 推荐(0) 编辑
摘要: One of the "big picture" issues in looking at compiled C code is thefunction-calling conventions. These are the methods that a callingfunction and a called function agree on how parameters and return valuesshould be passed between them, and how the stack is used by the functionitself. The 阅读全文
posted @ 2011-09-06 11:21 Jack204 阅读(346) 评论(0) 推荐(0) 编辑