In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
What this article shares to you is about what is the interface provided by the operating system to programmers. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it with the editor.
The interface provided by the operating system to the programmer is: system call. System call is a set of all system calls provided by operating system implementation, namely program interface or application programming interface (Application Programming Interface,API); it is the interface between application program and system.
System call is the only interface that the operating system provides to programmers.
The main function of the operating system is to manage hardware resources and provide a good environment for application developers to make applications more compatible. In order to achieve this, the kernel provides a series of multi-kernel functions with predetermined functions, which are presented to users through a set of interfaces called system calls (system call). The system call sends the request of the application to the kernel, calls the corresponding kernel function to complete the required processing, and returns the processing result to the application.
Modern operating systems usually have the function of multitasking, which is usually realized by processes. Because the operating system quickly switches between processes, everything looks like it's going to be simultaneous.
At the same time, this also brings a lot of security problems, for example, one process can easily modify the data in the memory space of the process to make another process abnormal or achieve some goals, so the operating system must ensure that each process can be executed safely. The solution to this problem is to add the base address register and the bound register to the processor.
The contents of these two registers use hardware to restrict the address of the memory accessed by the access instruction to the memory. In this way, the contents of these two registers can be written to the address range assigned by the process when the system switches the process, thus avoiding malware.
In order to prevent the user program from modifying the contents of the base register and the bound register to access other memory space, these two registers must be accessed through some special instructions. In general, the processor has two modes: "user mode" and "kernel mode", which identify what mode you are currently in by a tag bit. Some instructions, such as modifying the contents of the base register, can only be executed in kernel mode, while in user mode the hardware directly skips this instruction and moves on to the next one.
Similarly, for security reasons, some instructions for Ihand O operations are limited to only kernel mode, so it is necessary for the operating system to provide interfaces for applications such as reading data from a certain location on the disk. These interfaces are called system calls.
When the operating system receives the system call request, it will put the processor into kernel mode to perform instructions such as Istroke O operation and modify the contents of the base address register, and when the system call content is processed, the operating system will let the processor return to user mode to execute the user code.
These are the interfaces that the operating system provides to programmers, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.