freebsd之bios和boot

power on

// initialization with biso
set eip, 0xfffffff0    // points to code to be executed by the processor.

                                // if (physic memory < 4G) hardware translate to BIOS memory block, jmp POST;

                                // POST(power on self test):  memory check, system bus check, low-level initialization, select boot device

                                //         int 0x19:  the int 0x19 handler reads 512 bytes from the first sector of boot device into the memory at address 0x7c00

set cr0, 0               // control register cr0's PE bit, indicates whether the processor is run.ning in 32-bit protected mode or 16-bit real mode

                                // | pg | 000000000000000 | 00000000000 | et | ts | em | mp | pe |          cr 0.

                                // current running in real mode, because backwards compatibility / bios running in real mode / service provided bios

// mbr program

        // boot0 copy itself to address 0x600

        // boot0.s complile as boot.img (master boot record)

        // boot0 scan partition stable, let the user choose which partition to boot from.

    mbr(master boot record) struct:

    0              440  444  446       510   512

    |     code      |flag|null| dpt info|flag|

                      |            |      |

                (select disk flag) |   (vaild flag)

                                   |

                     (1  1       6          8        byte)

                     _______________________________  (descriptor table information)

                  1 |f1|f2| chs format | lba format

                  2 | ...                           |

                  3 | ...                           | 

                  4 |_______________________________| 

f1(file system type)    f2(bootable flag)

chs(sylinder/head/sector): first and last coordinates (end with 0xaa55).

lba(logic block addr): partition stable start position and length (end with 0xaa55).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值