当前位置:网站首页>UCORE overview
UCORE overview
2022-07-03 16:45:00 【Focus on web0 years】
brief introduction
In this paper, the knowledge of the operating system is roughly studied according to the Muke materials
ucore Course documentation
Course address
lab Answer address
Some answers have questions , But it can be used for reference
The first order
CPU Initialization will be carried out after power on , Then read the first instruction in memory . Part of the memory is ROM、 Part of it is RAM. After power failure RAM Information will disappear , however ROM The content is always .
The first instruction to read is CS:IP Address to ( The value should be the default ), Just powered on CPU be in 16 In bit real mode , The addressing space size is 2 Of 20 Power (1MB),CS、IP All are 16 Bit .CS*16+IP(0xFFFF0) Is the address of the first instruction , meanwhile CS:IP To be in 2 Of 20 In the addressing space of the power . The first instruction is at the bottom 1MB In space . This first instruction and its following instructions are BIOS, It should provide some services , then CPU To access disk devices .
BIOS
BIOS Read boot sector from disk (512 byte ) Loader in , Write it to memory 0x7c00, then CS:IP Jump there and execute the loader (bootloader).
Say in detail ,BIOS Only run in real mode , It first checks the hardware , Perform device initialization . When repairing the computer , The display does not work , You can guess that there is a memory problem . because BIOS Check the memory first , It doesn't need to be checked later , Also don't start the system . Then check the inserted U disc 、 Disk or something . The information generated by inspection becomes BIOS data . although ROM The data will not disappear , But because the hardware inserted each time is different , therefore BIOS Will change these data . Finally, read the first sector of our disk .BIOS First read the main boot sector of the disk (512 byte ). Because the information provided by this thing can help us choose which operating system in the boot disk . Select and read the active partition according to the information of the primary boot sector ( Partition boot sector ). First execute the jump instruction of the partition boot sector , Jump to the startup code and start the loader .
Loader
The loader puts the disk's ucore Operating system data and code are loaded into memory , Jump to ucore Initial address . Give control to the operating system .
In detail , The loader will first read the boot configuration information from the file system , Based on this information, decide how to load the kernel , In this place, if we can get an option on the display ( Start menu ), It's good to change the parameters . Finally, skip to the kernel .

Not detailed enough
It's still rough to know these , If you write an actual program , Also based on CPU manual 、BIOS standard ( Where to read the first , Above is 0xFFFF0). So you still need to check a lot of information to write your own operating system .
System startup specification
BIOS
The hard disk partition table of the primary boot sector here has only four partition information , Information of each partition 16 byte (BIOS-MBR).BIOS-GPT Support more than four partitions .PXE It's network startup , Download data from the server to the disk to start , here BIOS There should be network download function ,BIOS It's complicated . What I said earlier is to start on the local disk .
UEFI
Start the operating system consistently on all platforms . Boot any system on the disk . For the sake of safety , Check whether the boot record is credible . Only read the boot record that meets the signature .
Check information
边栏推荐
- To resist 7-Zip, list "three sins"? Netizen: "is the third key?"
- utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
- Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
- 2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
- What is the material of sa302grc? American standard container plate sa302grc chemical composition
- 爱可可AI前沿推介(7.3)
- Preventing/catching “IllegalArgumentException: parameter must be a descendant of this view” error
- Develop team OKR in the way of "crowdfunding"
- Deep understanding of grouping sets statements in SQL
- PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
猜你喜欢

Unreal_ Datatable implements ID self increment and sets rowname

Explore Netease's large-scale automated testing solutions see here see here

线程池执行定时任务

Visual SLAM algorithms: a survey from 2010 to 2016

What is the maximum number of concurrent TCP connections for a server? 65535?

MySQL Basics

Aike AI frontier promotion (7.3)

8个酷炫可视化图表,快速写出老板爱看的可视化分析报告

一台服务器最大并发 tcp 连接数多少?65535?

Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford
随机推荐
NLP四范式:范式一:非神经网络时代的完全监督学习(特征工程);范式二:基于神经网络的完全监督学习(架构工程);范式三:预训练,精调范式(目标工程);范式四:预训练,提示,预测范式(Prompt工程)
What is the material of sa302grc? American standard container plate sa302grc chemical composition
Data driving of appium framework for mobile terminal automated testing
MySQL user management
Explore Netease's large-scale automated testing solutions see here see here
What material is 12cr1movr? Chemical property analysis of pressure vessel steel plate 12cr1movr
What is the material of 13mnnimor? 13mnnimor steel plate for medium and low temperature pressure vessels
PHP CI(CodeIgniter)log级别设置
Shentong express expects an annual loss of nearly 1billion
Interpretation of several important concepts of satellite antenna
utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
爱可可AI前沿推介(7.3)
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
[combinatorics] polynomial theorem (polynomial theorem | polynomial theorem proof | polynomial theorem inference 1 item number is the number of non negative integer solutions | polynomial theorem infe
Summary of three methods of PHP looping through arrays list (), each (), and while
Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
Client does not support authentication protocol requested by server; consider upgrading MySQL client
Visual SLAM algorithms: a survey from 2010 to 2016
Thinking about telecommuting under the background of normalization of epidemic | community essay solicitation