我来我网
https://5come5.cn
您尚未
登录
注册
|
菠菜
|
软件站
|
音乐站
|
邮箱1
|
邮箱2
|
风格选择
|
更多 »
vista
鍙よ壊涔﹂
card
wind
绮夌孩濂抽儙
帮助
统计与排行
无图版
我来我网·5come5 Forum
»
电脑技术
»
Linux专区
»
看了下GRUB的引导,转一篇其关于它引导机制的简单介绍(Come from it's doc)
交 易
投 票
本页主题:
看了下GRUB的引导,转一篇其关于它引导机制的简单介绍(Come from it's doc)
显示签名
|
打印
|
加为IE收藏
|
收藏主题
|
上一主题
|
下一主题
goon83
∷
性别:
∷
状态:
∷
等级:
品行端正
∷
发贴:
349
∷
威望:
0
∷
浮云:
1146
∷
在线等级:
∷
注册时间: 2005-11-05
∷
最后登陆: 2009-03-10
【
复制此帖地址
只看此人回复
】
5come5帮你背单词 [
dull
/d
Λ
l/
a. 枯燥的,迟钝的,(天气等)阴郁的,(颜色等)暗淡的
]
看了下GRUB的引导,转一篇其关于它引导机制的简单介绍(Come from it's doc)
有兴趣的可以看看它的文档,不过不太全,最好是看它的源代码:~ ^~:
D.5 The bootstrap mechanism used in GRUB
The disk space can be used in a boot loader is very restricted because a MBR (see section The structure of Master Boot Record) is only 512 bytes but it also contains a partition table (see section The format of partition tables) and a BPB. So the question is how to make a boot loader code enough small to be fit in a MBR.
However, GRUB is a very large program, so we break GRUB into 2 (or 3) distinct components, Stage 1 and Stage 2 (and optionally Stage 1.5). See section The memory map of various components, for more information.
We embed Stage 1 in a MBR or in the boot sector of a partition, and place Stage 2 in a filesystem. The optional Stage 1.5 can be installed in a filesystem, in the boot loader area in a FFS or a ReiserFS, and in the sectors right after a MBR, because Stage 1.5 is enough small and the sectors right after a MBR is normally an unused region. The size of this region is the number of sectors per head minus 1.
Thus, all Stage1 must do is just load Stage2 or Stage1.5. But even if Stage 1 needs not to support the user interface or the filesystem interface, it is impossible to make Stage 1 less than 400 bytes, because GRUB should support both the CHS mode and the LBA mode (see section INT 13H disk I/O interrupts).
The solution used by GRUB is that Stage 1 loads only the first sector of Stage 2 (or Stage 1.5) and Stage 2 itself loads the rest. The flow of Stage 1 is:
1. Initialize the system briefly.
2. Detect the geometry and the accessing mode of the loading drive.
3. Load the first sector of Stage 2.
4. Jump to the starting address of the Stage 2.
The flow of Stage 2 (and Stage 1.5) is:
1. Load the rest of itself to the real starting address, that is, the starting address plus 512 bytes. The block lists are stored in the last part of the first sector.
2. Long jump to the real starting address.
Note that Stage 2 (or Stage 1.5) does not probe the geometry or the accessing mode of the loading drive, since Stage 1 has already probed them.
Posted: 2006-12-26 09:47 |
[楼 主]
快速跳至
|- 站务管理
|- 惩罚,奖励公布区
|- 会员咨询意见区
|- 申请区
|- 已批准申请区
|- 威望和荣誉会员推荐区
|- 5come5名人堂·Hall of Fame
>> 休闲娱乐
|- 灌水乐园 大杂烩
|- 精水区
|- 幽默天地
|- 开怀大笑(精华区)
|- 灵异空间
|- 运动新时空·菠菜交流
|- 动之风.漫之舞
|- 新货上架
|- 古董挖挖
|- 唯美贴图
|- 创意&美化&设计
|- 5COME5头像及签名档图片引用专区
|- 艺术摄影
|- 音乐咖啡屋
|- 音道乐经
>> 热点讨论
|- 工作交流
|- 求职信息
|- 就业精华区
|- 同城联谊
|- 留学专版
|- 情感物语
|- 情感物语精华区
|- 带走一片银杏叶
|- 精华区
|- 新闻直通车
|- 众志成城,抗震救灾
|- 衣食住行
|- 跳蚤市场
|- 旅游出行
>> 学术交流
|- 学业有成
|- 智力考场
|- 考研专版
|- 外语乐园
|- 考试·毕业设计
|- 电子设计·数学建模
|- 学生工作·社团交流·RX
|- 电脑技术
|- 电脑F.A.Q.
|- 软件交流
|- 硬件·数码
|- 程序员之家
|- Linux专区
|- 舞文弄墨
|- 历史&文化
|- 军临天下
|- 军事精华区
|- 财经频道
>> 游戏新干线[电子竞技俱乐部]
|- Blizz@rd游戏特区
|- WarCraft III
|- 魔兽区档案库
|- 魔兽争霸3博彩专区
|- StarCraft(new)
|- 暗黑专区
|- 休闲游戏区
|- PC GAME综合讨论区
|- 实况足球专区
|- Counter-Strike专区
|- TV GAME& 模拟器
|- 网络游戏
>> 资源交流
|- 恋影部落
|- 连续剧天地
|- 综艺开心档
|- 书香小筑
|- 小说发布
|- 资源交流
|- 综艺、体育、游戏资源发布
|- 音乐资源发布区
|- 电影电视剧发布区
|- 字幕园地
我来我网·5come5 Forum
»
Linux专区
Total 0.006944(s) query 4, Time now is:12-23 10:42, Gzip enabled
Powered by PHPWind v5.3, Localized by
5come5 Tech Team
,
黔ICP备16009856号