01 Device Drivers

Source: Internet
Author: User
Tags network function

The role of a device driver is to provide a mechanism, not a policy.The so-called mechanism is "What functions need to be provided"; the so-called "policy" is "how to use these functions ". The former is designed to focus on details. The latter implements calls without knowing any hardware-related information.Different environments require different methods to use hardware. However, a device driver cannot write a policy for each method for underlying hardware. Therefore, we allow the driver to provide a mechanism, while the system's top layer to provide a policy. Of course, sometimes we need to implement some strategies in the driver. For example, a digital I/O driver only provides a way to access hardware in bytes, which avoids the trouble of writing additional code to process a single data bit.1) synchronous and asynchronous operations are supported; 2) the driver can be opened multiple times; 3) hardware features are fully utilized; 4) does not have a software layer for "Simplifying tasks" or providing policy-related software. In fact, many device drivers are released together with user programs. These user programs are mainly used to help configure and access the target device. A client library is also included with the release, which provides features that do not need to be implemented in the driver itself. #2 kernel function divisionProcess Management: processes are created and destroyed, process processing, inter-process communication, and process scheduling. Memory Management: the kernel creates a virtual address space for each process on top of limited available resources, different parts of the kernel use a set of function calls when interacting with the memory management subsystem. File System: the kernel constructs a structured file system on an unstructured hardware, file abstraction is widely used in the entire system. A file system is a software driver that maps underlying data structures to high-level data structures. Device Control: almost every system operation is mapped to a physical device. Except for a few objects, all the device control operations are completed by the Code related to the controlled device, this piece of code is called a driver; network function: Because packet input is an asynchronous event, most network operations are irrelevant to specific processes and must be completed by the kernel; #3 Classification of loadable modules and modulesThe features provided by the kernel can be expanded at runtime. Extensions include addition and removal. These extensible codes are called "modules". Each module consists of the target code, we can use insmod to connect the module to the running kernel, or use rmmod to remove the connection. functions implemented in the kernel in the module mode: file System type, block device, character device, IF drivers, etc.; 1) character device: a character device is a device that can be accessed like a byte stream, for example: /dev/tty1 and/dev/lp0; the only difference between a character device file and a common file is that the access to a common file can be moved before and after; 2) block devices: Like character devices, Block devices are also accessed through file system nodes under/dev. The difference is that block devices can accommodate file systems ;, these are not transparent to users. 3) network devices (interfaces): Any network transaction is formed by a network interface. network interfaces are driven by the network subsystem in the kernel, sends and receives data packets, but does not involve data packet ing; #4 Linux kernel version numberKernel version:Take version 2.6.9-5. ELsmp as an example:

R: 2, main version number

X: 6, minor version number, even number indicates stable version, odd number indicates development version

Y: 9. indicates the version number, indicating the number of modifications.

The first two digits can be combined to describe the kernel series. For example, the stable version 2.6.0 is the kernel series of version 2.6.

-5: indicates the 5th patch fine-tuning of the current version.

ELsmp: indicates that the current kernel is specially tuned for EL and smp.

EL: Enterprise Linux; smp: multi-processor supported

In addition, bigmem or hugemem that supports large memory versions

 

 

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.