您的位置:首页 > 其它

Computer Science Basics (1)

2012-09-24 00:00 344 查看
1) DMA and multiprogramming

DMA, or Direct Memory Acess, is a technique to speed up memory acess. With DMA, contents in memory could be transferred without CPU, thus leaving CPU free while doing I/O. Otherwise, the CPU would be busy coping bytes back and forth.

Multiprogramming is the rapid switching of the CPU between several processes. Its main purpose is to keep CPU busy while waiting for some I/O to complete.

We can deduce from the upper two that if a computer has no DMA, its multiprogramming feature would have little significance, because the CPU is still busy while doing some I/O.

2) The idea of computer family

A computer family refers to a series of computers whose programs are compatitable and only differs in performance and price. For example, Intel's Pentium I, II, III and 4.

3) Hyperthreading and Superscalar CPU

Superscalar CPU architecture is an advanced pipeline design. It enables instruction level parallelism by offering mutiple execution units. Superscalar architecture does not mean that two or more threads could be executed simutaneously. It only leads to more fast execution of some thead.

Hyperthreading, or multithreading is the idea of the same CPU holding two or more state of threads at the same time. Hence, thread switching time would be reduced to the order or a nanosecond. Also, hyperthreading does not mean two or more threads could be executed at the same time! It only speed up thread switching.

4) trap instruction

A trap instruction switches the execution mode of CPU from user mode to kernel mode. This instruction allows a user program to invoke functions in the operating system kernel.

5) Seperation of policy and mechanism

Put mechanism for doing something in kernel, not policy.

Consider a process scheduling algorithm. Mechanism: looking for the highest priority process to run. Policy: assign priorities to processes.

6) Microkernel-based operating system V.S. Monolithic operating systems

Monolithic: all drivers are in the kernel, a buggy driver may result in a kernel crash by referencing an invaild memory address

Microkernel: splitting the operating system up into small, well defined modules, only one of which -- the microkernel -- runs in kernel mode. This design is aimed at high reliability.

Linux is a monolithic operating system with microkernel design philosophy.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  computer science basics