09 2012 档案
摘要:进程0是一个特殊的进程,它是所有其它进程的祖先进程,所有其它的进程都是fork通过系统调用,复制进程0或者其后代进程产生的。但是进程0却不是通过fork调用产生的。进程0的代码就是内核system模块的代码,所以可以认为系统一启动进程0就开始运行。但是此时并不是真正的进程0,应为此时gdt中还没有设置tss和ldt描述符,直到sched_init()中才设置了tss和ldt并且把tss加载到tr寄存器,所以在此时应该算是进入真正的进程0,之前可以认为是进程0的初始化设置,可以说进程0是手动设置的。step1、手工设置进程控制块、页目录和页表 进程控制块是直接手工设置好的,在sched.c第1.
阅读全文
摘要:Linux0.11版源代码中,main.c在代码中的位置十分重要,完成系统的初始化,并启动进程。涉及到进程、内存管理、文件管理等等。尽管这部分代码看起来十分简单,但是分析起来,难度很大。 目前基本完成该部分代码的分析,但内容比较多,此处仅记录该文件的基本分析注释,相关部分的分析整理后再发布。/* * linux/init/main.c * * (C) 1991 Linus Torvalds */#define __LIBRARY__#include <unistd.h>#include <time.h>/* * we need this inline - forking
阅读全文
摘要:Linux0.11版源代码分析第三篇,head.s源码注释分析。/* * linux/boot/head.s * * (C) 1991 Linus Torvalds *//* * head.s contains the 32-bit startup code. * * NOTE!!! Startup happens at absolute address 0x00000000, which is also where * the page directory will exist. The startup code will be overwritten by * the page d...
阅读全文
摘要:Linux0.11版源码分析第二篇,setup.s注释分析。!! setup.s (C) 1991 Linus Torvalds!! setup.s is responsible for getting the system data from the BIOS,! and putting them into the appropriate places in system memory.! both setup.s and system has been loaded by the bootblock.!! This code asks the bios for memory/disk/o.
阅读全文

浙公网安备 33010602011771号