how to boot a computer?


How to boot a computer?


It's a interesting question. I searched internet and found the answer maybe like below:


step 1,

    1), when you pressed the power-on button, the CPU will recieve a reset signal.

    2), read the ROM which contenting the BIOS (basic input/output systerm).

    3), POST (power-on self test).

    4), boot sequence.


step 2,

    issue 1,  read MBR  0x55 0xAA      ->0x7c000

        issue A, for primary partition, read VBR (value boot record)

        issue B, extend && logic partition, read EBR (extend boot record)  64 byte

        issue C, boot loader

            eg , GRUB

                GRUB && GRUB2 is different.

            stage1,   446bytes, source code is grub's source code:  stage1/stage1.S, assembled as a 512bytes file  boot.img, 

                            it was recorded in the 0 side 0 track 1st sector of the disk,    (MBR? the content is almost the same as MBR)

                            the boot.img is used to copy the content of the side 0 track 2nd sector of the disk to the memory's 0x8000, then run 0x8000.

                                   ps: the 0 side 0 track 2nd sector's curent was the code stage1/start.S' assembled result, it will run the stage1.5 or stage2.

            stage1.5, only for grub not grub2

                file:  xx_stage1_5 && nbgrub && pxegrub

                   xx: e2fs(for ext2/ext3) /fat /jfs /minix /reiserfs / vstafs /xfs

               Fseek 0 side 0 track 3rd sector, size more than 11k.

                     stage 1.5 process is content a boot partitions file systerm for searching the core.img from the path /boot/grub/

            stage 2, Entry: stage2/asm.s : initialize a c language environment , then load configuration and run command.


      issue 2, GPT

             the GPT partition table's boot progress ls similar like MBR.



REFERENCE:

计算机是如何启动的——阮一峰

grub之stage1分析

计算机的启动过程详解

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值