Operating system guidance

Source: Internet
Author: User
Article Title: operating system guidance. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Preface
This article does not aim to fully discuss how a multi-boot system program can guide different operating systems, but only intends to talk about how computers start from power-on from the perspective of operating systems, from scratch, the operating system will run up and will be described in detail as much as possible from the real mode to the protection mode of the transition, the purpose is only to be able to learn more with the majority of fans, leave some information for your friends who want to develop the operating system, and leave some experience for them. This article will take the developing pyos system boot program as an example. pyos is an experimental operating system in development, and it does not intend to use any operating system as the mode currently, I only want to write an operating system from start to end by myself to learn the knowledge and accumulate the technology. If you are interested, please join us! This article is purely a bit of experience in the learning process. If you find any errors or mistakes, I hope you will send me a letter of advice.

I. What have computers done since power-on?

When the power key of the computer is pressed, the electrical signal line associated with this key will send an electrical signal to the motherboard, the main board will send this electrical signal to the power supply system, the power supply system starts to work, power the entire system, and send an electrical signal to the BIOS, notifying the BIOS that the power supply system is ready. Then the BIOS starts a program to perform host self-check and host

The main task of self-check is to ensure that each part of the system is powered by power. The internal memory, other chips on the motherboard, keyboard, mouse, disk controller, and some I/O ports are available normally, after that, the self-check program returns control to BIOS. Next, the BIOS reads the BIOS settings, obtains the boot drive sequence, and checks the sequence until you find the drive that can be used for boot (or the disk that can be used for boot, including floppy disk, hard disk, and CD), and then call the Boot Sector of the disk on the drive for boot. How does the BIOS know or tell which disk can be used for boot?

2. Understanding the guiding Program

The BIOS loads the first sector (0000 B) of the disk to the memory and places it at 0 x: 0x7c00 (see). If the last two bytes of the sector are "55 AA ", this is a boot sector, and this disk is a bootable disk. Generally, a program of B is called a boot program ). If the last two bytes are not "55AA", the BIOS checks the next disk drive. Through the above expression, I can summarize the characteristics of the following three Bootstrap programs:

1. It is 512B in size and cannot contain more than one byte, because the BIOS only reads 512B to the memory.

2. The end two bytes must be "55 AA", which is the identifier of the boot sector.

3. It is always placed on the first sector of the disk (0 head, 0 track, 1 sector), because the BIOS is read-only

The first sector.

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]... Next page>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.