美文网首页
开机流程

开机流程

作者: 半步江南 | 来源:发表于2018-11-27 17:05 被阅读4次

涉及的硬件与程序如下:
硬件:cpu、内存、硬盘
程序:BIOS、mbr、内核

开机

cpu通电后第一时间读取BIOS。
BIOS提供默认或指定的启动硬盘的编号
BIOS读取硬盘开头的512字节内容(MBR),写入内存0x7c00处。
BIOS结束生命周期,将控制权转交给0x7c00处的程序(MBR)。
mbr依照自己携带的分区表,读取硬盘其他区域的内容,写入指定位置,结束生命周期。
cpu的指针被指向上面被指定的内存位置,从此进入内核初始化周期。

硬盘如何工作?
Mechanically, hard disk drives contain one or more stacked platters that spin under a
read/write head, much like an old record player, only potentially, to increase capacity,
with several records stacked one above the other, where a head moves in and out to get
coverage of the whole of a particular spinning platter's surface; and since a particular
platter may be readible and writable on both of its surfaces, one read/write head may
float above and another below it. Figure 1 shows the inside of a typical hard disk
drive, with the stack of platters and heads exposed. Note that the same idea applies to
oppy disk drives, which, instead of several stacked hard platters, usually have a single,
two-sided oppy disk medium.
The metalic coating of the platters give them the property that specic areas of their
surface can be magnetised or demagnetised by the head, electively allowing any state
to be recorded permanently on them . It is therefore important to be able to describe
the exact place on the disk's surface where some state is to be read or written, and
so Cylinder-Head-Sector (CHS) addressing is used, which electively is a 3D coordinate
system (see Figure 3.9):
Cylinder: the cylinder describes the head's discrete distance from the outer edge
of the platter and is so named since, when several platters are stacked up, you
can visualise that all of the heads select a cylinder through all of the platters
Head: the head describes which track (i.e. which specic platter surface within
the cylinder) we are interested in.
Sector: the circular track is divided into sectors, usually of capacity 512 bytes,
which can be referenced with a sector index.


image.png image.png
;
; A simple boot sector program that demonstrates segment offsetting
;
mov ah , 0 x0e                               ; int 10/ ah = 0eh -> scrolling teletype BIOS routine
mov al , [ the_secret ]
int 0x10                                     ; Does this print an X?
mov bx , 0 x7c0                              ; Can 't set ds directly , so set bx
mov ds , bx                                  ; then copy bx to ds.
mov al , [ the_secret ]
int 0x10                                     ; Does this print an X?
mov al , [es: the_secret ]                   ; Tell the CPU to use the es ( not ds) segment.
int 0x10                                     ; Does this print an X?
mov bx , 0 x7c0
mov es , bx
mov al , [es: the_secret ]
int 0x10                                     ; Does this print an X?
jmp $                                        ; Jump forever.
the_secret :
db "X"
; Padding and magic BIOS number.
times 510 -($-$$) db 0
dw 0 xaa55

相关文章

  • day22-Linux系统服务

    1. 开机启动流程 1.1 CentOS6开机启动流程CentOS6开机启动流程内核引导:当计算机打开电源后,首先...

  • Linux系统服务--Linux下救援模式--day23

    一、开机启动流程 1.1、CentOs6开机启动流程 1.2、CentOs7开机启动流程 1.3、c6和c7的区别...

  • Android系统启动-Init进程

    Android开机启动流程 如图1所示,是Android开机启动大致流程,其中流程大致为加载BootLoader ...

  • centos6和7的开机流程-面试题

    linux系统开机流程为企业面试题,本次笔记从图和文字记录centos6的开机流程。 开机加电自检 --- 检查...

  • 开机流程

    涉及的硬件与程序如下:硬件:cpu、内存、硬盘程序:BIOS、mbr、内核 开机 cpu通电后第一时间读取BIOS...

  • Day22-系统服务(开机启动流程、系统运行级别、sytemd使

    Linux开机启动流程 CentOS 6和CentOS 7开机流程 Linux运行级别 1.什么是运行级别,运行级...

  • [Boot]硬件上电到Bootloader

    概述 ​ 本系列简要介绍Android开机流程,用于整体了解Android的启动流程。进一步为开机优化...

  • Centos6启动问题排查

    开机流程 要排查问题,首先要了解启动流程。我们先看一下centos6的开机流程: 1. POST加电自检 ROM:...

  • android 启动总览

    开机启动流程 启动一个Android手机的步骤是: 按电源键 进入开机动画 经过漫长的等待 开机动画结束 正式开机...

  • Android开机流程

    最近回顾的一些知识,补充了一下。 源码标准:API : 29「Android 10.0」 android手机是怎么...

网友评论

      本文标题:开机流程

      本文链接:https://www.haomeiwen.com/subject/ovrgqqtx.html