Discuss the BIOS startup phase of Linux kernel startup

Source: Internet
Author: User

There are many things worth learning about Linux kernel startup. Here we mainly introduce the BIOS startup phase, including instructions on the instruction register CS: EIP.

The Linux kernel startup code is complex and huge, making it difficult to get started. It is precisely because of its complexity that any textbook will classify and explain relevant content, such as Interrupt Processing and file systems. However, when reading relevant chapters, do you often want to figure out when a related data structure was created? When was it initialized? This chapter describes the BIOS startup phase.

BIOS startup phase for Linux kernel startup

During CPU power-on initialization, the command register CS: EIP is always initialized to a fixed value, which is the address of the first command after CPU reset. After a power failure, the content in the memory will be lost, so this command must be stored in the non-Easy memory. This type of memory includes ROM, PROM, EPROM, or Nor Flash. Early BIOS is stored in read-only memory, which is inconvenient to modify. Currently, both EPROM and Nor Flash can be erased and programmed to write data by means of electricity. Therefore, the BIOS is usually upgraded to use the electrical erasable programming feature of the BIOS chip.

For a 32-bit address bus system, a 4 GB physical address space is divided into at least two parts, one part of which is the memory address space, another part of the address space is used to address the BIOS chip storage unit. In addition, with the increase of external system devices and the increase of the onboard storage space of devices, the 64 kB I/O address space of a 16-bit 8086 processor is already insufficient (I/O port accessed through in/out Assembly commands .), In fact, a part of the 4 GB physical memory address space is used for addressing the on-board storage space of external devices. After x86 is reset, it works in real mode. In this mode, the addressing space of the CPU is 1 MB. CS: the IP address reset value is FFFF: 0000, and the physical value is FFFF0. The motherboard designer must ensure that the physical address is mapped to the BIOS chip, rather than the RAM.

Early ibm pc address space ing 4.1 is shown. Among them, the read-only storage space with a height of KB is mapped to the BIOS chip, and the 128KB VVD in the middle is mapped to the storage space of the video card. The pixels on the screen are controlled by this area, the remaining 640KB is mapped to RAM. It can be seen that for hardware system designers, physical address space is also a kind of resource, and the ing mentioned here is the allocation of physical address resources in hardware mode.

The 640KB RAM is a free zone for BIOS designers. How to Use it depends on the BIOS software designer. The CPU executes the BIOS code to initialize the system, and sets the interrupt vector table in solid mode in 1 kb memory starting from the physical address 0, later, some of the memory is used to save the hardware information detected by the BIOS during startup. In addition, the BIOS code needs to use a later part of the memory during execution. Finally, the BIOS will load the first sector of the boot device to the physical address 0x07C00 according to the configuration, and then jump here to continue execution. Usually this is the Boot Loader code. Boot Loader then loads the kernel into the memory. As mentioned earlier, the arch/x86/boot/tools/build tool combines setup and vmlinux into a bzImage. Setup is the real-mode code, while vmlinux is the protection mode code. The above explains the BIOS startup phase of Linux kernel startup.

  1. In-depth introduction to linux Ext3 File System
  2. Sunflower collection in linux vi Editor
  3. Happy Learning Linux Virtual Machine VMware
  4. Linux: linux Nautilus
  5. How to kill a process in linux

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.