setup.s流程
硬件参数列表
1.获取游标的行列位置、拓展内存大小、显卡参数、硬盘参数,具体见上表格
2.移动system文件从(0x1000~0x9000)->(0x0000~0x8000)
3.执行lidt,lgdt指定描述表的基址(the byte 0 of the table)+limit(nr of bytes in the table),便于后文保护模式寻址
注:On power up or reset of the processor, the base address is set to the default value of 0 and the limit is set to 0FFFFH. A new base address must
be loaded into the GDTR as part of the processor initialization process for protected-mode operation.
3.打开A20地址线,让cpu可以访问1MB以上的地址空间
4.对8295中断控制器进行编程。
5.使能cr0.PE,进入保护模式jmpi 0,8 这里cs:8 ip:0 cs为段选择符,用于选择具体描述符;这里会跳转到head.s开始处执行;
0000 0000 0000 1000这里结合GDTR中的base选择的是GDT表中第一个表项,然后根据CS段描述符确定段的起始地址,最后根据IP来确定线性地址;