Computer Science Basics (1)

本文介绍了计算机系统的几个关键概念,包括DMA与多程序设计的作用、计算机家族的概念、超线程与超标量CPU的区别、陷阱指令的功能、策略与机制的分离以及微内核与宏内核操作系统的区别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

 

 

转载于:https://my.oschina.net/u/158589/blog/80138

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值