Reason why the program cannot be detached from the Operating System

Source: Internet
Author: User
The reason why the program cannot be separated from the operating system-Linux general technology-Linux programming and kernel information. The following is a detailed description. The operating system plays the following two roles:

1. Collect all system resources and allocate them to user processes as needed in order to coordinate the requests of many processes to system resources;

2. Provide functions required by any user process. For example, maintain a page table, such as disk IO. This is because of the first reason and simplified programming. Therefore, these programs cannot be executed without the operating system.

The Program for writing the "off" operating system is mainly to complete the initialization of CPU and peripherals. After the initialization is complete, try to read the program from the ROM to the main memory and initialize the CPU register, point the command counter (a combination of CS: IP on i386) to the beginning of the program code to start running. For convenience, the i386 series CPU can work in the real mode, saving the trouble of working in the protection mode.

The system initialization and register initialization are system-related throughout the process. Refer to the initialization code of lilo and Linux kernel.

All of the above are the cases where the system runs only one process at a time. If multiple processes run concurrently, you need to write a piece of scheduling and coordination code, which is an operating system.
Related Article

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.