Responsibilities of programs and programmers (from the philosophical and systemic perspectives)

Source: Internet
Author: User
Responsibilities of programs and programmers (from the philosophical and systemic perspectives)
Liu Jianwen, http://blog.csdn.net/keminlau
) What is the task of writing the driver to accomplish?

What is the purpose of writing a driver? That is, what are the responsibilities and tasks driving programmers? To answer this question, we need to clarify the definition of the driver as the creative object of the driver programmer.

What is the device driver?

What is the device driver? First, the device driver is a computing program that assists high-level applications in communication and collaboration with low-level hardware devices. Second, the device driver (representing the CPU) it must communicate with the mounted device on the bus through the computer's main line. Third, the task of the device driver is to convert advanced commands from the top level into the hardware operation commands of the lower layer. If there is a data stream in the opposite direction, the device driver is also responsible for high-level program processing.

Driver responsibilities

The device driver is part of the kernel and implements the following functions:

  1. Device initialization and release;
  2. Transfers data from the kernel to the hardware and reads data from the hardware;
  3. Reads the data transmitted by the application to the device file and the data requested by the application;
  4. Detects and processes device errors.

Device Drivers are usually related to hardware and operating systems, because from the perspective of logical commands, first, device drivers translate the logic commands of high-level programs into inherent commands of hardware devices, therefore, the device driver is hardware-related. Second, the device driver calls the memory commands of the operating system or other operating system resources when using the memory, so the device driver is related to the operating system. The current operating system has greatly simplified the programming tasks for communication between high-level programs and hardware by standardizing the "command interface" between device drivers and high-level programs. With the standard instruction interface, programmers can make complete assumptions about hardware communication tasks and develop the software logic part of high-level programs independently.

Based on the interconnection of processors, communication ports (device controllers), and electronic lines, the "Driver programmer" writes instructions to implement "management" and "communication" tasks (Kemin: that is, programming it.
) To help the system implement the work! "Management" tasks are embodied in driver Responsibilities 1 and 4; "communication" tasks are embodied in responsibilities 2 and 3.

Since the processors, communication devices, and electronic lines have been deployed, why do we still need program instructions? What is lacking in these hardware tasks for "doing work? As a metaphor, if a restaurant is ready for all its utensils and kitchenware, it is still not allowed to "work" for business. It is necessary to have a job as a cook or as a waiter, it can be seen that the completion of a system's "work" must also involve soft elements that can change dynamically in time.

Evidence of the time of doing work can be seen in the "programmable" clause. Programming is the process of knitting operations!

Since Linux has made the serial communication framework, some serial hardware (such as uart_driver) drivers, and link control modules (such as PPP), let's learn about the serial communication framework. Where is the programming? How many are there?

First, direct programming for high-level applications (with a solid framework, it does reduce the programmable space, but if the programmable space is beyond the control of people, programming becomes too complex, );

Second, write your own communication framework;

Physical and logical layers of communication tasks

Computing and communication tasks are viewed from the physical layer of computer systems. binary digits flow between devices through the bus. On the logic layer, digits have different context semantics. From the perspective of system theory, if the two "logical communication systems" have been established, digits flow at the boundaries of the two logical systems. If one of the logical systems is not yet established, some digits are used to "initialize" a logical system. For example, if the operating system goes from the real mode to the virtual mode, the device driver module generally consists of the initialization function and the communication function. In addition, the establishment of the "logical Communication System" requires a lot of status information, such as a subsystem will have a proper "configuration data structure" resident in the memory.

Initialization

Why is initialization required? To understand what Initialization is required, you must first understand what is a "complete operating environment 』. The operating environment is also an information environment with a certain agreed state.

The operating environment has a logical high-level and low-level distinction, because of this hierarchical difference, the low-level operating environment is often only used to build a (initial) higher-level operating environment, it does not directly interact with users. Users are generally too advanced. The operating system itself is an advanced operating environment.

How to understand the operating environment, but also complete? What is the agreed status?

Who will perform the operation in the operating environment? This must have an operator. This subject is a system with certain logic judgment capabilities. It can be seen that the "complete operating environment" is used to explain why the initialization process of computer software systems is incomplete. It should be detailed around the "System. However, the system definition here is troublesome. The computer hardware and software system misperforms multiple dimensions, such as hardware and software, logical and physical, management, and managed.

We take the system as the core to understand various programming tasks. First, the "System" has certain logic judgment capabilities (that is, computing). The hardware basis of these capabilities is the processor (including low-intelligence controllers). Second, the system is not only physical, but also logical in modern computers. These logical systems have many predefined states (these are generally stored in the primary storage), so they need to be initialized, therefore, configuration is required. Once again, the "System" must be able to communicate with other "systems", so addressing is required. Therefore, address space is required.

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.