Current location - Education and Training Encyclopedia - Graduation thesis - Translation of graduation thesis documents! Urgent! ! ! Optimal Management of Fresh Department of Chain Supermarket
Translation of graduation thesis documents! Urgent! ! ! Optimal Management of Fresh Department of Chain Supermarket
operating system

An operating system is a program that acts as an interface between computer users and computer hardware. The purpose of operating system is to provide an environment in which users can execute programs. Therefore, the main goal of the operating system is to make the computer system easy to use. The second goal is to use computer hardware in an effective way.

Operating system is an important part of almost every computer system. The computer system can be roughly divided into four parts:

. Hardware (cpu, memory, I/O devices).

. Operating system.

. Applications (compilers, database systems, video games, business programs).

. User (person, machine or other computer).

Hardware provides basic computing resources. The application defines how to use these resources to solve user computing problems. There may be many different users trying to solve different problems. Therefore, there may be many different applications. The operating system controls and coordinates the use of hardware in various applications of various users.

The operating system is similar to the government. The basic resources of a computer system are provided by its hardware, software and data, and the operating system provides the methods to use these resources correctly in the operation of the computer system. Like the government, the operating system itself does not perform any useful functions. It just provides an environment in which other programs can do useful work.

We can think of an operating system as a resource allocator. A computer system has many resources (hardware and software) needed to solve problems: cpu time, memory space, file storage space, input/output (I/O) devices and so on. The operating system acts as the manager of these resources.

operating system

An operating system is a program that acts as an interface between computer users and computer hardware. The purpose of operating system is to provide an environment for users to execute programs. Therefore, the main goal of the operating system is to make the computer system easy to use. The second goal is to make effective use of computer hardware.

Operating system is an important part of almost every computer system. The computer system can be roughly divided into four parts:

Hardware (CPU, memory, input/output devices);

. Operating system;

Applications (compilers, database systems, video games, business programs);

User (person, machine or other computer).

Hardware provides basic computing resources. The application specifies how to use these resources to solve the user's computing problems. There may be many different users trying to solve different problems. Therefore, there may be many different applications. The operating system controls and coordinates the use of hardware in various applications of different users.

The operating system is like a government. The basic resources of a computer system are provided by its hardware, software and data. The operating system provides a way to use these resources reasonably when the computer system is running. Like the government, the operating system itself can't do anything useful. It just provides an environment where other programs can do useful work.

We can think of the operating system as a resource allocator. The computer system has many resources (hardware and software) needed to solve problems: CPI time, memory space, file storage space, I/O equipment, etc. The operating system acts as the administrator of these resources and assigns these resources to specific programs and users as necessary resources to complete tasks. Because there may be many conflicting resource requirements, the operating system must decide how to allocate resources in order for the computer system to run reasonably and efficiently.

It may be easier to define an operating system with "what to do" than with "what". The main purpose of the operating system is to facilitate users. Operating systems exist because it is easier to calculate with an operating system than without one. This is even clearer when you look at the operating system of a small personal computer.

The second purpose of the operating system is to improve the operating efficiency of the computer system. This is especially important for large time-sharing multi-user systems. Generally speaking, these systems are quite expensive, so it is desirable to make them run as efficiently as possible. Convenience and efficiency are sometimes contradictory. In the past, efficiency considerations were often more important than convenience. Therefore, most operating system theories focus on the optimal use of computer resources.

To understand what operating systems are and what they do, let's first look at how they have developed in the past 30 years. By tracking their evolution, we can find the same parts of the operating system, and we can see how and why they developed.

Operating system and computer structure have great influence on each other. In order to facilitate the use of hardware, an operating system is developed. Because the operating system is designed and used, it has become obvious that the change of hardware design can simplify the operating system. From a brief historical review, we can see how the emergence of new hardware features has substantially solved many operating system problems. At first, there was only computer hardware. Early computers were giants running on the console. Programmers write programs and then run them directly from the operator console. First, the program needs to be manually loaded into the memory from the switch, paper tape or punched card on the front panel. Then, in order to install the starting address and start executing the program, press the corresponding button. When the program is running, the programmer or operator can monitor the execution of the program through the display light on the console. If an error is found, the programmer can stop the program, check the contents of memory and registers and debug the program directly from the console. Print out or punch holes in paper tape or cards for later printing.

The essence of human interaction is an important feature of this running environment, and the programmer is the operator. Most systems use signatures or subscriptions to allocate machine time. If you plan to use the computer, you must fill in the signing form, find out the free time of the computer in the future, and sign up for an appointment.

However, there are some problems with this method. Suppose you register for an hour to run the program you developed. You may encounter a particularly difficult problem, which cannot be completed in an hour. If someone else makes an appointment for the next period of time, you should stop working, clean up your work as much as possible, and come back to continue working after a while. On the other hand, if things go well, you may finish them in 35 minutes. But because you think it may take a long time to get on the computer, you registered for an hour, so the computer may be idle for 25 minutes.

Over time, other software and hardware were developed. Card readers, line printers and magnetic tapes have become common. In order to simplify the programming task, assembler, loader and connector are designed. A general function library is established. Some commonly used functions can be copied into new programs without rewriting.

Programs that complete input and output tasks are particularly important. Each new input/output device has its own characteristics and needs careful programming. Write a special subroutine for each input and output device. This subroutine is called device driver. Device drivers know how to use buffers, flag bits, registers, control bits and status bits of a specific device. Each different type of device has its own driver. Simple tasks such as reading characters from a keyboard may involve a series of complex operations related to the device. Just use the device drivers in the library, instead of writing the required programs every time.

Since then, compilers in Fortran, Cobol and other languages have appeared, which greatly simplifies the programming task, but the operation of the computer is more complicated. For example, in order to prepare for the execution of Fortran programs, first programmers need to install Fortran compilers in their computers. Usually, compilers are stored on floppy disks. Therefore, it is necessary to insert a suitable floppy disk into its drive. Fortran compilers generate assembly language output, and then assemble it. You need to associate the output of the assembler with its supporting library program. Finally, the binary object code of the program is formed and can be executed. Load it into memory and adjust it.

Operating systems provide services in many different ways. The two basic methods are system call and system program, both of which have their own advantages.

system call

More basic service levels are handled by using system calls. System call provides an interface between the running program and the operating system. Usually, these calls are provided in the form of assembly language instructions, which are usually listed in the manuals used by assembly language programmers.

System calls can be roughly divided into three categories: process or job control, device and file operation, and information maintenance. In the following discussion, we briefly explain the types of system calls provided by the operating system. Unfortunately, our description may seem a little simple, because most of the system calls at this moment involve or are supported by some concepts and functions to be discussed later.

Process and job control

A running program should not only be able to stop its operation normally (end), but also be able to stop its operation abnormally (terminate abnormally). If a program finds an error in its input and wants to stop the program abnormally, it may also want to define an error level. More serious errors can be indicated by higher-level parameters. Therefore, by defining normal termination as zero-order abnormal termination, normal termination and abnormal termination can be linked.

The process or job of executing one program may require an installer to execute another program. An interesting related question is where the control should be returned when the installer's program is terminated. This problem is related to whether the existing program is lost, saved or allowed to continue execution concurrently with the new program.

If control returns to the existing program at the end of the new program, we must save the memory image of the existing program and effectively establish a mechanism that allows one program to call another program. If two programs can continue at the same time, we have established a multi-program job or process. There is usually a system call (create a process or provide a job) dedicated to this purpose.

If we create a new job or process, or even a group of jobs or processes, we should be able to control its execution. This control requires that the attributes of a job or process can be determined and reset, including priority, maximum allowable execution time, etc. (Get process properties and set process properties). If we find that it is incorrect or no longer needed, we may also want to stop the operation or process we have established (terminate the process).

After creating new jobs or processes, you need to wait for them to complete. It may take some time (waiting time), but it is more likely to wait for a specific event (waiting event). When this event occurs, the job or process should signal (signal event). This system call to coordinate concurrent processes will be discussed in detail later.

Many systems provide time analyzers for programs. This indicates the time required for a program to be executed in a specific location or a specific set of units. Every time a timer interrupt occurs, the value of the program counter is recorded. When the frequency of timer interruption is high enough, the statistical chart of the time spent by each part of the program can be obtained.

Document function

First, you should be able to create or delete files. This system call requires a file name and possibly some attributes. Once you create a file, you need to open it and use it. You may need to read, write and reposition. Finally, we still need to close the file, indicating that we no longer use it.

If the file system is a directory structure, you must prepare the same set of operations for the directory. In addition, whether it is a file or a directory, we should be able to determine the values of various attributes, and we may need to reset the attributes if necessary. File attributes include file name, file type, protection code, counting information, etc. In order to have this function, there are two system calls: get file properties and set file properties.

facility management

A file can be regarded as an abstract or virtual device. Therefore, many file system calls also require devices. However, if the system is multi-user, we must first apply for equipment to ensure that we can monopolize the equipment. If we don't use this equipment, we must release it. These functions are similar to system calls to open or close files.

Once a device is requested (and assigned to us), it can be read, written and relocated just like a file. In fact, the similarity between input/output devices and files is so great that many operating systems combine them into a combined file/device structure. In this case, the input/output device is identified by a special file name.

Information maintenance

Many system calls are only for passing information between the user program and the operating system. For example, most systems have system calls that return the current time and date. Other system calls may return information about the system, such as the current number of users, the version number of the operating system, the remaining capacity of memory or disk space and so on.

In addition, the operating system keeps all information about its jobs and processes, and there are system calls to access this information. Generally speaking, there are also calls to reset this information (get process properties and establish process properties).

system program

File operations: These programs create, delete, copy, rename, print, dump, list and perform general operations of files and directories.

Status information: Some programs only need the operating system to provide date, time, available memory or disk space, number of users or similar status information. Then, the information is formatted and printed on a terminal or other output device or file.

File modification: There are several text editors that can create and modify file contents on disk.

Programming language support: Operating systems often provide compilers, assemblers and interpreters for general programming languages (such as Fortran, Cobol, Pascal, Basic, etc.). Recently, many of these programs have also been sold separately.

Program loading and execution: Once a program is assembled or compiled, it must be loaded into memory for execution. The system can provide absolute loader, floating loader, link editor and overlay loader. At the same time, a debugging system in higher-level language or machine language is needed.

Applications: In addition, most operating systems have programs useful for solving some unique problems, such as compilers, text formatters, drawing software packages, database systems, statistical analysis software packages, and so on.

Disk Operating System (DOS) is a set of programs that help you run your personal computer and manage disks. DOS controls memory, processor, external storage devices and input/output devices (monitor, keyboard, mouse, etc.). ) personal computer, so that your programs will not conflict with each other in time and space. This happened without your knowledge. When you run a program (for example, a word processor or a spreadsheet), it runs under DOS, and DOS always controls the use of the program on your computer.

In addition, DOS also includes some utilities that let you manage your disk and other resources. For example, you can use the DOS utility to copy, print and erase files. These utilities are the basic human-computer interaction between you and DOS.

DOS has existed for a long time ("long" is about 10 years for PC). It dominates the operating system field of IBM compatible PC. Now, in the fifth edition: DOS 5, it provides some meaningful new functions and improves many old functions. These new and old features of DOS will be discussed in the next section.

Characteristics of DOS 5

Let's discuss the special problems of DOS to you and your computer function.

Dual user interface: The user interface is the means for you to interact with the program. The traditional command interface of DOS requires you to type commands on an almost blank screen (everything is monochrome). The more modern DOS shell uses Windows, menus and dialogs (just like Microsoft's Windows) to let you select functions and see the results immediately. The results are presented in bright colors (if your monitor can handle them).

Disk management: DOS organizes the data on the disk so that each program can find the data it needs without accidentally losing the data of another program. It includes utilities that allow you to copy, move, print and delete files, and manage the disk itself and its directories. You can use the command interface or DOS shell to access many DOS utilities.

Hardware management: DOS helps other programs access your hardware effectively. There are some practical software (and other functions), so you can modify the hardware environment to meet your needs.

Memory management: DOS controls all access to memory, so there will be no overlap when multiple programs need memory space at the same time. As a user, you have some control over the use of memory. New functions of DOS 5: Many functions can be realized by expanding/expanding memory.

Program management: DOS gives you the ability to start any program you need. New function of DOS 5: You can run several programs at the same time and switch between them at will.

Batch file: A batch file contains one or more commands. You can put several commands into a batch file and then execute the file without executing the commands separately. Once you save the file on disk, you can reuse it and send it to your colleagues, customers, etc. There is a special batch file ((AUTOEXEC. BAT)), automatically executed at startup. You can put your own commands into this file.

Full-screen editor: The new feature of DOS 5 is that the full-screen editor is a utility that allows you to create and edit text files using the keyboard.

Programmer's tools: DOS contains many features that can help programmers develop new software under DOS (programmer's tools are beyond the scope of this study).

Of course, DOS has many other functions, and here are just some you often encounter.

bootstrap program

Suppose you have installed DOS 5 on the hard disk of your personal computer. If not, please follow the instructions in the documentation to install DOS before the next step.

When you start your system, the first thing to start is the operating system, so that it can be controlled by people. In our example, it is DOS 5. The system checks memory and many external devices, and then starts the operating system.

Booting from the hard disk is easy. If there is a disk in drive A, eject it (3.5-inch disk) or unlock the drive (5.25-inch drive). (If the disk in drive A is ready, DOS will try to attract users from drive A.. Then, turn on the power of the computer and monitor, if each has its own power switch. Observe the information on the screen. Depending on how the system is installed and the commands that are automatically processed at startup, this information will be different. However, in the end, you will see a DOS shell screen or command prompt. Either way, it means that the system has been successfully started.

This book is full of steps to help you test the imported technology. If you get on the computer and follow these steps, you will learn more about DOS. The following practical exercises will let you know the process of computer boot step by step.

1. If the machine is on, turn it off;

2. If there is a disk in drive A, please eject it (3.5-inch drive) or open the door lock (5.25-inch drive) in order to

DOS cannot start from drive a;

3. Turn on the host power;

4. If the power switch of the monitor is separated from the host, please turn on the power of the monitor; To printers and other places

There is a hardware connected to the PC.

You should be able to see and hear the computer start. During the memory check, there may be some information on the display. You may see information about ROM-BIOS, which is a very basic program that is permanently stored in the computer and starts the boot process. Then, when the system checks each drive, you will see the LED of that drive flashing. During the process of loading DOS 5 from disk into memory, the indicator light of hard disk drive is always on. With the setting of the operating system hardware, another set of information may appear. Finally, either the DOS shell starts automatically or a DOS command prompt appears. The command prompt is as follows:

C:, >

If you can't successfully start DOS, stop and consult someone who knows how to do it. Don't read the rest of this book until you successfully start DOS.