Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Unit_3.doc
Скачиваний:
5
Добавлен:
25.02.2016
Размер:
163.33 Кб
Скачать

Changing bios Settings

To change BIOS settings, you must enter the BIOS setup program during the boot sequence, by pressing a specified key or key combination, such as F2 or ALT+CTRL+ESC. The initial message the BIOS displays will tell you what keys to press. The setup program shows you the current BIOS settings and allows you to change them. It stores the new settings in CMOS memory so they will be available the next time the machine is turned on. Care should be taken when modifying BIOS settings, because the wrong settings can make the computer unusable.

You can learn more about BIOS from the BIOS entry in the PC Guide. If you are planning to change your BIOS settings, read the BIOS Survival Guide first.

3.1.3 Process Control

Another job of the operating system is to keep track of all the processes that are currently trying to execute, assuring that each gets a chance to execute reasonably often. A process is an instance of a running program. It includes a set of memory pages, a set of open file descriptors (if the process does any I/O), a process ID, and several other things. The kernel maintains a list of every process in the system. This includes whatever programs the user is running, plus various programs that implement parts of the operating system outside the kernel, such as printing and network support. Each process can be in one of several states: running, runnable, or blocked. Only one process per CPU can actually be running at a time, although any number can be runnable. A blocked process is one that is waiting for some event to occur. For example, the print spooler is blocked most of the time; it only becomes runnable when the user selects the Print command that activates the process.

On a Windows machine, you can see a list of current tasks and processes by invoking the Task Manager. (In Windows, a task is an application the user is running; it appears on the task bar. A task is implemented by one or more processes.) 3.1.4 Lab: The Task Manager lists the steps needed for you to use the Task Manager. On a UNIX machine, the ps and top commands display process information.

The kernel maintains a queue (also called the run queue), or waiting list of runnable processes. In order to give the illusion that all these processes are running at once, it uses a trick called preemptive multitasking. While there are other types of multitasking, preemptive multitasking creates a better illusion than the rest. This trick depends on having a real-time clock that can generate interrupts at a regular rate. The clock interrupts give the kernel a chance to look at the run queue and see if some other process should be given a chance to run now. If the answer is yes, the currently running process is preempted. Its state is demoted from running to runnable, its execution progress is noted, and its register contents are saved so the process can be resumed later. Processes that become blocked also generate these types of interrupts, but the answer to the preceding question is always yes. Then another process in the run queue is selected to run. If the kernel switches processes frequently enough, it appears to the human user as if all the processes are executing at the same time. Now you know the secret of the illusion!

If preemptive multitasking is a good idea, why not switch processes as frequently as possible, say, after every instruction? The reason the kernel does not do this is that switching from one process to another requires a context switch, which takes a bit of time. To perform a context switch the processor must flush its pipeline of executing instructions, save all the register contents, load a new page table, etc. This imposes a certain amount of overhead on each preemption. So, the optimal strategy is to do context switches only as often as needed to ensure fair service to all processes.

Some applications require multiple processes to perform their function. For example, in order for a Web browser to support multiple windows open simultaneously (each downloading a different page or running a different Java applet) the browser needs to create a process for each window. But, having lots of processes is expensive, because each requires its own address space, page table, file descriptors, etc. And, many applications that implement multitasking do not require this degree of separation between their processes. Therefore, newer operating systems provide for lightweight processes, called threads, which all live in the same address space and share their file descriptors.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]