"Modern Operating Systems" Section 1.3 notes

A simple computer model can be abstracted to FIG. CPU, memory, I / O devices, etc. are connected by a system bus, the bus communicate with each other.
Here Insert Picture Description

1.3.1 Processor

1, CPU: the computer's "brain."
2, the internal CPU registers some common: to store variables and temporary results.
3, the internal CPU specialized programmer visible registers:

Program Counter : save the address of the next instruction to be fetched, updated to point to the instruction fetch subsequent instructions.

  • Stack Pointer : the current point to the top of the memory stack, the stack frame holds the relevant input parameters, local variables and temporary variables are not stored in the register.
  • The program status word (Program Status Word, PSW): contains the condition code bits, the priority control bit CPU, kernel mode / user mode and the like.
4, in order to improve efficiency, many modern CPU mechanism having a plurality of instructions simultaneously removed

Accomplished by internal fetch unit, decoder, execution unit three parts. When the CPU executes instructions n, n + 1 can decode the instruction and the read instruction n + 2, so that, when executing the instruction n, without waiting, can be executed directly n + 1, then n + 2, such mechanism, called the pipeline (pipeline)
Here Insert Picture Description

4, each CPU has its own special set of instructions executable by a

Intel's X86 processor can not perform sun's SPARC program, SPARC can not execute a program of X86.

5, moles (Moore) Law

The number of transistors chip doubles every 18 months.

6, multi-threaded meaning and defects in the operating system

(1) meaning : Each thread in the operating system seems like a single CPU, consider a practical two-CPU system, there are two threads per CPU, operating system, so it seems there are four CPU.
(2) Defect : On the specific point in time, can only sustain two CPU busy workload, so scheduling two threads on the same CPU, while another CPU is completely idle, such efficiency is far less than high running a thread on each CPU efficiency.

1.3.2 Memory

Here Insert Picture Description
Storage system is the top layer of the CPU registers, and CPU it uses the same materials, as fast as the CPU, there is no access delay. Typical storage capacity: 32 bit CPU for the 32x32, 64x64 bit to 64-bit CPU,

The next level is the cache, the CPU reads the data, if the data in the cache line, then a cache hit occurs. Enhance the cache hit conducive to enhancing efficiency.

1.3.3 disk (HDD)

Compared with the disk RAM, low cost per bit is two orders of magnitude or more, the capacity is large and expensive, but the reading speed is low.

The disk has one or more metal discs rotate at different speeds, the information written on the disk on a series of concentric circles. Start with a mechanical edge cross hanging on the disk, in any given position of the arm, each of the heads can read some annular area, referred to as a track (Track) . All tracks on a given position of the arm combined together to form a cylinder (Cylinder) .

Each track is divided into several sectors , the sector is typically 512 bytes.

Each disk has a head for reading and writing data. Arm is moved from a cylinder adjacent to the cylinder takes about 1ms, randomly move to a certain time of a typical cylinder 5-10ms.
Here Insert Picture Description
Here Insert Picture Description

1.3.4 Tape

The last layer of the memory system, such media is often used for backup disk, and can save a very large data sets.

1.3.5 I / O devices

1, the concept of

Input and output devices, such as a keyboard, mouse, printer, hard drive light. I / O device generally comprises two parts: a device controller and i / o device itself. The controller was inserted in a circuit board or a chip set.

2, the device driver (device driver)

Each device controller type is different, requires different control software, special dialogue with the controller issuing a command and a response receiving software called a device driver (device driver).

3, there are three ways to realize the input and output

(1) The user program issues a system call, then perform I / O processes, CPU has been waiting for I / O data until data processing and returns the results after processed, CPU before continuing with other matters. This is known as busy waiting.

(2) through the interrupt mechanism, need I / O, let the I / O device to perform the corresponding operation, CPU does not need to wait for this time and continue to do other things, if the I / O executed, to get the data, and this time by the interrupt controller CPU initiates an interrupt, the data processing I / O obtained. CPU processing vernacular is to let other things get when the I / O data, telling CPU, you look at the first stop on the thing at hand now, you just want the data is ready, and now to you, you deal with next.

(3) using the chip direct memory access (DMA, Direct Memory Access), direct control of the bit stream, the DMA data obtained will initiate an interrupt to the CPU.
Here Insert Picture Description

1.3.6 Bus

Here Insert Picture Description
** a universal serial bus (Universal Serial Bus, USB) ** is used to set all the slow I / O devices, such as a keyboard and a mouse, connected to the computer. All USB devices to share a USB device driver, you do not need a new USB device to install a new device driver, and that is without a reboot you can add a USB device to the computer.

1.3.7 Start the computer

Pentium brief start-up process

(1) each have a parent board Pentium, referred to above has a basic input output system (Basic Input Output System, BIOS) program. There are underlying I / O software, including reading the keyboard, screen writing, the I / O as well as other processes within the BIOS.
(2) BIOS is running, checking the number of RAM, each I / O device has been installed and a normal response. Then start scanning for ISA and PCI bus and find all devices attached to the above (either legacy equipment or Plug and Play device ). If different devices when the existing equipment and the last start, then configure the new device.
(3) have decided to launch the device in the device list CMOS memory and BIOS by trying storage. Now the user can enter a BIOS configuration program at system has just started, the list of equipment to be modified.
(4) operating system asks BIOS, to obtain configuration information. Once you have all of the device drivers, they will be transferred to the operating system kernel. Then initialize the relevant forms, create any background process requires, and start the login program or GUI on each terminal.

Published 131 original articles · won praise 81 · views 60000 +

Guess you like

Origin blog.csdn.net/weixin_43469047/article/details/104740645