Lab 1: Booting a PC

终于又开始了,不求速度,但求理解的透彻。目标成为内核 hanker

 

http://pdos.csail.mit.edu/6.828/2009/

Part 1: PC Bootstrap

Getting Started with x86 assembly

reference:Computer Systems A Programmer's Perspective  Chapter 3 (19:32--14:51)

 

Inline Assembly

在没有 overwrite-list 是 编译器默认使用%eax存储 a;

当overwrite-list 显示说明%eax时,说明%eax 会再嵌入式汇编这段代码改写。说以编译器不会采用eax 来存放a 的值。

"you can no longer count on the valuesyou loaded into eax to be valid."

以上输出均为 “2”

Simulating the x86  

1.QEMU 安装成功

Exercise 2.

初始化顺序:

Slave DMA controller
Master DMA controller
NMI Enable / Real Time Clock
关中断
拷贝中断向量表 (不能确定)
it sets up an interrupt descriptor table
initializes various devices such as the VGA display
initializing the PCI bus and all the important devices the BIOS knows about
it searches for a bootable device
Eventually, when it finds a bootable disk,
the BIOS reads the boot loader
from the disk and transfers control to i
BootLoader
QUESTION 1: bootloader 做什么?
//myself
内核放到启动位置
real mod -> protection mod 
Because it is only in this mode that software can access all the memory above 1MB in the processor's physical address space.
1: real mod -> protection mod 
为什么  Segment limit 共20 位?
如果G设为1时,limit scaled by 4k when set .
假如 base 为0x00000000 ,limit 为 0x00000 那么段地址空间为:0x0000000~0x00000FFF  不为空。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值