boot bios傻傻分不清

bios是加电完成后执行的指令,boot是BIOS执行完成后的指令(算是操作系统内部指令)
即BIOS 加电到 选择系统,  boot是选择系统之后(装了多个系统的师傅应该了解,开机到一半有个选择操作系统)
想去了解系统加电过程,于是安装了一个qemu进行调试

不能单步执行,n,s都不行
系统停在了0xFFFF FFF0  //可以通过断点知道
通过dump 内存 0x0000 0000 - 0x000F FFFF
和 0xFFF0 0000 - 0xFFFF FFFF 发现大部分是一致的

0x0000 0000 – 0x000D FFFF 全0                  //boot 在0x7c00 目前是全0

0xFFF0 0000 – 0xFFFD EF8F 全0
0xFFFD EF90 – 0xFFFD FFFF 未知数据
先看初值

然后看第一条指令
0xfffffff0: ljmp   $0xf000,$0xe05b
inter 手册
To insure that the base address in the CS register remains unchanged until the EPROM based software-initialization code is completed, the code must not contain a far jump or far call or allow an interrupt to occur (which would cause the CS selector value to be changed).
bios连在南桥上,将bios映射到内存上
然后看芯片手册 EPROM应该是在加电后已经加载完毕了,所以才能进行ljmp
然后ljmp修改了cs:base值  0xFFFF 0000 -> 0x000F 0000
跳转到了0x000F E05B  //BIOS正式函数  //估摸着bios 是要在最后写ljmp   $0xf000,$0xe05b
然后bios执行硬件检查 ,并且把boot加载到0x7c00
然后执行boot指令,开启系统

总结:系统加电  芯片组至reset  等待CPU加电并稳定频率(HZ) 这时候BIOS(ROM) 芯片组(主板芯片组映射表)也完成
cs:base + EIP = 0xFFFF FFF0 长跳转至0x000F e05b执行bios程序
bios硬件检查,并将boot移动到0x0000 7c00 
然后跳转至0x0000 7c00 操作系统开始

Compaq Computer Corporation Phoenix Technologies Ltd. Intel Corporation BIOS Boot Specification 1.0 INTRODUCTION 5 1.1 REVISION HISTORY 5 1.2 RELATED DOCUMENTS 5 1.3 PURPOSE 5 1.4 TERMS 6 2.0 OVERVIEW 9 2.1 DESCRIPTION 9 3.0 IPL DEVICES 10 3.1 REQUIREMENTS FOR IPL DEVICES 10 3.1.1 IPL TABLE 10 3.1.2 PRODUCT NAME STRING 10 3.2 BAIDS 11 3.3 DEVICES WITH PNP EXPANSION HEADERS 11 3.4 LEGACY IPL DEVICES 12 3.5 IDENTIFYING IPL DEVICES 13 3.5.1 BAIDS 13 3.5.2 PNP EXPANSION HEADER 13 3.5.3 PCI DEVICES 13 3.5.4 IDENTICAL IPL DEVICES 14 4.0 IPL PRIORITY 15 4.1 MAINTAINING THE IPL PRIORITY 15 4.2 IPL PRIORITY PSEUDOCODE 17 5.0 BCV PRIORITY 18 5.1 INTRODUCTION 18 5.2 INT 13H DEVICE CONTROLLERS 18 5.2.1 ATA DRIVE SUPPORT IN THE BIOS 18 5.2.2 PNP CARDS WITH BCVS 19 5.2.3 LEGACY CARDS WITH OPTION ROMS 19 5.2.4 HARD DRIVE BAID 19 5.2.5 CONTROLLER INSTALLATION GUIDELINES 19 5.2.6 NOTES ON INT 13H DEVICES 20 5.3 INSTALLATION ORDERING 20 5.4 POST PSEUDOCODE 22 6.0 POST SEQUENCE 23 6.1 POWER-ON INITIALIZATION 23 6.1.1 INITIALIZING BAIDS 23 6.1.2 PNP BOOT DEVICES 23 6.2 PNP OPTION ROM INITIALIZATION 23 6.3 CHECK IPL PRIORITY AND BCV PRIORITY 24 6.4 INT 13H DEVICE CONTROLLER INSTALLATION 24 6.4.1 BOOT CONNECTION VECTORS 25 6.4.2 DISCONNECT VECTOR 25 6.4.3 LEGACY ROM SCAN 26 6.4.4 ON-BOARD ATA SUPPORT 26 6.5 INT 19H PROCESSING 26 6.5.1 BOOTING FROM BAIDS 27 6.5.2 BOOTING FROM BEVS 27 6.6 INT 19H PSEUDOCODE 28 6.7 INT 18H PSEUDOCODE 28 6.8 NOTES ON THE POST PROCESS 29 APPENDIX A: DATA STRUCTURES 30 A.1 IPL TABLE AND BCV TABLE ENTRY DATA STRUCTURE 30 A.2 PNP OPTION ROM HEADER 31 A.3 PNP EXPANSION HEADER 31 A.4 PCI DATA STRUCTURE 31 APPENDIX B: RUN-TIME FUNCTIONS (OPTIONAL) 32 FUNCTION 60H - GET VERSION AND INSTALLATION CHECK 32 FUNCTION 61H - GET DEVICE COUNT 33 FUNCTION 62H - GET PRIORITY AND TABLE 34 FUNCTION 63H - SET PRIORITY 35 FUNCTION 64H - GET IPL DEVICE FROM LAST BOOT 36 APPENDIX C: BOOT MENU (OPTIONAL) 37 C.1 BOOT MENU POP-UP 37 C.2 BOOT MENU INT 19H PSEUDOCODE 37 C.3 BOOT FIRST RUN-TIME FUNCTIONS 38 FUNCTION 65H - GET BOOT FIRST 38 FUNCTION 66H - SET BOOT FIRST 38 APPENDIX D: RECOMMENDED BOOT SECTOR CHANGES (OPTIONAL) 39 D.1 USE DL FOR DRIVE NUMBER 39 D.2 INT 18H ON BOOT FAILURE 39 APPENDIX E: PCI WITH MULTIPLE PNP HEADERS (OPTIONAL) 40 E.1 DESCRIPTION 40 E.2 REQUIREMENTS 40 E.3 OPTION ROM INITIALIZATION 40 E.3.1 BEFORE OPTION ROM PLACEMENT 40 E.3.2 PLACING THE PCI OPTION ROM 40 E.3.3 CALLING THE PCI OPTION ROM 41 E.3.4 NO DEVICES PRESENT 41 E.3.5 DEVICES ARE PRESENT 41 E.4 ENUMERATING PNP EXPANSION HEADERS 42 E.5 CALLING THE BCVS 42
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值