BIOS和Bootloader部分 Linux系统引导过程( 三 )


图LILO运行后的计算机内存布局
KEMIN:这个过程远没详尽LILO的引导过程 。过程中出现很多神秘的信息,比如描述表、参数行数据、软盘启动扇区、setup()函数所在扇区,这里没有讲LILO是怎么知道这些数据的位置的 。
LILO怎么找到内核的?
When Lilo boots the , it uses BIOS calls to load the Linuxoff the disk (IDE drive,or ). , themust live in some place that can beby the bios.
At boot time, Lilo is not able to readdata, and anyyou put in /etc/lilo.conf isattime (when you/sbin/lilo).time is when thethethat list whichare used by the files used to load the. As a , all of these files must live in athat can beby the BIOS (the files arein the /boot , this means that only the rootof your Linuxneeds to bevia the BIOS).
of being BIOS-based is that you mustthe(i.e., you must/sbin/lilo) any time youthe Lilo setup.youyourandyour old image you mustLilo.
由此可见,LILO是事先生成启动所需的所有数据,并生成一个元数据文件(map file);并且可看出来,lilo与操作系统的亲缘性强度胜于与BIOS的强度 。当然,也别忘记操作系统本身就与硬件是相关的 。
LINUX引导磁盘制作
Linux内核经裁减(通过重新配置内核组成的模块并编译)后可被装进一张1.44M的软盘 。这张可引导的磁盘布局很简单,引导扇区(也就是第一个扇区)存放[引导程序](源码是/arch/i386/boot/.S),接着就是内核镜像 。当我们编译一个新内核的时候,引导代码只是简单地放在内核镜像的前面,这样只需要把内核镜像从磁盘的第一个扇区开始整个拷进去就可以制作出一张可引导的磁盘了 。
【BIOS和Bootloader部分Linux系统引导过程】参考