Operating system installation and startup principles

Source: Internet
Author: User
   

I. Basic Concepts
1. BIOS Concept
BiOS (Basic Input/Output System, Basic Input/Output System) is short for ROM-BIOS, is a read-only memory Basic Input/Output System, it is actually a group of solidified into the computer, a program that provides the lowest-level and most direct hardware control for a computer. It is a hub connecting software programs and hardware devices, BIOS is a "converter" or interface between hardware and software programs (although it is only a program), responsible for solving the real-time requirements of hardware, perform the operation according to the software's hardware operation requirements.
Bios, which plays a very important role in computer systems. The performance of a motherboard is superior, depending on whether the BIOS management function on the motherboard is advanced.
The BIOS chip is a long or positive chip on the motherboard. It is mainly stored in the BIOS:
1. Self-diagnosis program: Read the content in cmos ram to Identify hardware configurations, and perform self-check and Initialization on them;
2. CMOS setup program: During the boot process, special hotkeys are used to start and set the program, which is then stored in the cmos ram;
3. System bootstrap loader: After the self-check is successful, the boot program of the disk relative to 0 sectors and 0 sectors is loaded into the memory, so that the boot program runs to load the DOS system; drivers and service interruptions for main I/O devices;
Because BIOS directly deals with system hardware resources, it is always targeted at a certain type of hardware system, and various hardware systems are different, so there are various types of bios, with the development of hardware technology, different versions of the same BIOS have emerged. The new version of BIOS is more powerful than the old version.
2. MBR Concept
The primary Boot Sector is located in the hard disk's 0 track 0 cylindrical 1 sector, a total of 512 bytes, composed of three parts:
Hard drive Master Boot Record MBR (Master Boot Record) accounts for 446 bytes
Partition Table DPT (Disk Partition Table) occupies 64 bytes
The hard disk valid identifier (magic number) occupies 2 bytes. AA and 55 are called magic numbers. When Bois reads MBR, it always checks whether there are these two magic numbers. If not, it is considered as a hard disk not partitioned.
The MBR, DPT, and Mn in the primary Boot Sector are independent of the operating system and exist on each hard disk. MBR is an executable program, different Operating Systems write different codes. The MBR storage space is limited to 446 bytes. The only thing MBR does is to load the second boot loader. Windows-generated MBR mounts and runs PBR; grub-generated MBR mounts and runs grldr.
3. Operating System Boot Process
Master Boot Record (MBR): 512 bytes, located in the first sector of the hard disk. It can store a small program and a primary partition table. The MBR Boot Code occupies the first 446 bytes, and the subsequent 64 bytes are DPT (Disk Partition Table, hard disk partition table ).
During the boot process of the XP system, after the BIOS self-check, DPT gives the system control to the PBR (Partition Boot Record) of the first partition of the hard disk, and the xp pbr will find the ntldr of the partition, followed by boot. INI, select the started system and load the registry, hand in control to ntoskrnl, then load the driver, system configuration, and so on.
In Vista, PBR no longer looks for ntldr, but for bootmgr. This file is stored in the root directory of the first partition on the hard disk. then, bootmgr goes to \ Boot \ BCD in the same path. the BCD file is actually a registry file, and the data in it stores the system boot information. If it is a multi-system boot, it will provide the boot interface content. if it is a single vistasystem, the control permission will be handed over to winload.exe, and then go to ntoskrnl.exe.
Extendedbootrecord (EBR): 512 bytes. It is located in the first sector of the extended partition and stores the logic partition information.
Partition Guide (PBR): 512 bytes, located in each non-extended primary partition and the first sector of each logical partition; can store small programs.
Activepartition: identifies one of all primary and logical partitions as active, indicating that the partitions that run the PBR program are loaded when the system starts.
DBR: the DOS Boot Record is called the obr (OS Boot Record), which indicates the PBR of the active partition, that is, the OS Boot Record.

Ii. Partition Concept
A hard disk has three types of partitions: Primary (primary partition), extended partition, and logical (logical partition.
1. Primary Partition
If you only have one hard disk, the hard disk must have one primary partition. Previously, DOS must be started in the primary partition. The maximum purpose of creating a primary partition is to install the operating system. If you have multiple primary partitions, only one can be set to active ), the operating system starts from this partition. Of course, only one active partition is allowed. The so-called "Activate partition" means to set a primary partition as an active partition.
2. Extended partitions
Because primary partitions have inherent limitations (up to four), extended partitions are designed to address these limitations, but remember that they cannot be used to store data directly, the main function of extended partitions is to allow you to create logical partitions. In fact, you can only create more than 20 partitions.
3. Logical Partitioning (logical drive)
From the above introduction, you can understand that a logical partition is not an independent partition. It is a level-2 partition built in an extended partition, and in DOS/windows, such a logical partition corresponds to a logical driver :........ this type of logical drive is generally used.
4. Partition restrictions
A hard disk can be divided into up to four primary partitions, or an extended partition can be added to three primary partitions, because at the beginning of the hard disk, that is, the primary boot sector occupies 512 bytes of MBR, The DPT Partition Table occupies 64 bytes, and the hard disk effective mark occupies 2 bytes. Because the record space is only that large, therefore, only information about the four partitions can be recorded.

Iii. Generally, the startup process of a single operating system
1. the BIOS loads and starts the boot program stored in the hard disk MBR. This boot program is generally written during operating system installation.
2. the MBR boot program scans all the partition tables to find the active partitions. (windowsmbr only searches for the active partitions in the Partition Table of the MBR. That is, Windows can only be installed in the primary partition. Linux does not have this restriction)
3. the MBR boot program loads and starts the boot program stored in the active partition PBR.
For Linux, locate and execute the vmlinuz-xxx kernel image ). Obviously, PBR boot programs are closely related to the operating system and are generally written during operating system installation.
Summary: BIOS-> MBr->; PBR-> OS files

4. Modify the standard process to enable the specified operating system as needed
Use software such as bootloader to replace the boot program in MBR or the boot program in PBR, such as ntboot loader in windows and Lilo and grub in Linux. Windows ntboot loader is generally used to install multiple Windows systems on one machine. Lilo or grub is used to install multiple Linux systems on one machine or install both Linux and Windows systems.

V. MBR damage and repair
Damage to MBR will not endanger the data, and the re-operation is very simple. Rewriting MBR means that the fdisk/MBR under DOS can be used to modify the DOS boot. tools such as diskgen can easily modify MBR.

6. Start the operating system from a USB flash drive or mobile hard drive
1. After formatting the USB flash disk (both FAT32 and NTFS are supported), activate the USB flash disk into an active partition (diskgenius hard disk partitioning software can be used)
2. Write the PBR into the active partition of the USB flash drive to read the bootmgr file by PBR (you can use the bootsect.exe file that comes with Vista or Windows 7 for operations)
3. Copy the boot file to the root directory of the USB flash drive.
4. Modify the BIOS boot sequence to start from the USB flash drive.
Mobile hard drive: boot recognized as USB-HDD
In XP format into FAT32, NTFS format U Disk: boot appears in the BIOS of The Removable device, identified as a USB-ZIP, default to the primary partition of the non-active partition. You can use diskgenius to activate the active partition, and then identify it as USB-HDD after the boot.
Production into hdd u Disk: boot appears in the hard disk bios, identified as a USB-HDD, automatically set to active partition by default.

Operating system installation and startup principles

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.