About the device drivers of UNIX operating systems

Source: Internet
Author: User

[E liangshi Yiyou network] in the UNIX operating system, access to I/O devices is performed through a set of fixed entry points, this set of entry points are provided by the device drivers for each device. Generally, the drivers of devices provide the following entry points:

1. Open entry point. Open the device to prepare for the I/O operation. When you open a special device file, the open entry point of the device is called. The open subroutine must make necessary preparations for the I/O operations to be performed, such as clearing the buffer zone. If the device is exclusive, that is, only one program can access the device at the same time, the open subroutine must set some signs to indicate that the device is busy.

2. Close the entry point. Disable a device. After the last device termination, call the close subroutine. An exclusive device must be marked as a device that can be used again.

3. Read entry point. Read data from the device. For I/O operations with a buffer, data is generally read from the buffer. The read subroutine is called to read special device files.

4. Write entry point. Write Data to the device. For I/O operations with a buffer, data is generally written into the buffer. The write subprogram is called to write special device files.

5. IOCTL entry point. Perform operations other than read and write operations.

6. select entry point. Check the device to see whether the data is readable or whether the device can be used to write data. The Select system calls the select entry point when checking the file descriptors related to the device's special files. If the device driver does not provide one of the above entry points, the system will use the default subroutine instead. There are also some other entry points for different UNIX operating systems.

For more information about the basic structure of device drivers in UNIX operating systems, we will explain it here today. We hope to have more opportunities to discuss with you later. MoreSystem O & M tutorialLog on to the E-mentor Yiyou network with relevant knowledge.

About the device drivers of UNIX operating systems

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.