[计算机英语每日翻译] The Linux Kernel (LInux内核原理解析)2


从PC的外部看,最显眼的组成部件是主机、键盘、鼠标和显示器。在主机的前面是一些按钮和一个小的展示区,在这个展示区上有一些数字和一个软盘。现在的大多数系统还拥有一个CD ROM,如果你需要保护你的数据,那么会有备份用的磁带机。这些都被称为外部设备。


尽管CPU全面地控制着系统,但它不是唯一的智能设备。例如,在这些外设中,IDE控制器也有某种程度的智能。在PC内部(图1.1)有一块主板,上面有CPU或微处理器,内存和多个槽(ISA或PCI外设控制器)。一部分控制器,例如IDE 磁盘控制器可能会被直接嵌在系统板上。


1.1  CPU



CUP,或者微处理器,是计算机系统的核心。微处理器通过从内存读入的指令来计算、处理逻辑操作和管理数据流。早期在CPU这一名词诞生的时候,微处理器计算功能的组件是分离的单元(实际上很大)。现代微处理器将这些组件组合到一块电路板上,并将这块电路蚀刻在一块很小的硅晶体上。(CUP、微处理器、和处理器在这本书里是同一意思)。


微处理器处理的对象是二进制数据,这些二进制数据有1和0组成。这些1和0对应电子元件的开和关。就像十进制的42代表4个10和2个1一样,一个二进制数是一系列单个二进制数组成的,其中每位代表2的一个次方(原文power,代表数字被自身乘)10的一次方是10,10的二次方是10*10,10的三次方是10*10*10,以此类推。二进制的0001是十进制的1,二进制的0010是十进制的2,二进制的0011是3,二进制的0100是4,可往下依次类推。所以,十进制的42是二进制的101010 (2 + 8 + 32 or 21 + 23 + 25 )  。计算机程序中除了用二进制来代表数字之外,十六进制也很常用。



附:


Looking at a PC from the outside, the most obvious components are a system box, a keyboard, a mouse and a video monitor. On the front of the system box are some buttons, a little display showing some numbers and a floppy drive. Most systems these days have a CD ROM and if you feel that you have to protect your data, then there will also be a tape drive for backups. These devices are collectively known as the peripherals.

Although the CPU is in overall control of the system, it is not the only intelligent device. All of the peripheral controllers, for example the IDE controller, have some level of intelligence. Inside the PC (Figure  1.1) you will see a motherboard containing the CPU or microprocessor, the memory and a number of slots for the ISA or PCI peripheral controllers. Some of the controllers, for example the IDE disk controller may be built directly onto the system board.


1.1  The CPU

The CPU, or rather microprocessor, is the heart of any computer system. The microprocessor calculates, performs logical operations and manages data flows by reading instructions from memory and then executing them. In the early days of computing the functional components of the microprocessor were separate (and physically large) units. This is when the term Central Processing Unit was coined. The modern microprocessor combines these components onto an integrated circuit etched onto a very small piece of silicon. The terms CPUmicroprocessor and processor are all used interchangeably in this book.

Microprocessors operate on binary data; that is data composed of ones and zeros.

These ones and zeros correspond to electrical switches being either on or off. Just as 42 is a decimal number meaning ``4 10s and 2 units'', a binary number is a series of binary digits each one representing a power of 2. In this context, a power means the number of times that a number is multiplied by itself. 10 to the power 1 ( 101 ) is 10, 10 to the power 2 ( 102 ) is 10x10, 103 is 10x10x10 and so on. Binary 0001 is decimal 1, binary 0010 is decimal 2, binary 0011 is 3, binary 0100 is 4 and so on. So, 42 decimal is 101010 binary or (2 + 8 + 32 or 21 + 23 + 25 ). Rather than using binary to represent numbers in computer programs, another base, hexadecimal is usually used.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
为了透彻理解Linux的工作机理,以及为何它在各种系统上能顺畅运行,你需要深入到内核的心脏。cPu与外部世界的所有交互活动都是由内核处理的,哪些程序会分享处理器的时间,以什么样的顺序来分享。内核不遗余力地管理有限的内存,以使数以千计的进程有效地共享系统资源。内核还精心组织数据传送,使得 cPu不再受限于慢速硬盘。 《深入理解Linux内核》第三版将引领你畅游内核中用到的最主要数据结构、算法和编程技巧。如果你的确想了解计算机内部的实现机理,那么作者透过现象探寻本质,提供了颇有价值的深入分析。本书针对具体的Intel平台,讨论了其重要特征,逐行剖析了相关的代码片段。但是,本书涵盖的内容不仅仅局限于代码的机理,还解释了Linux运作方式的理论支撑。 本书第三版涵盖Linux 2.6,从中可以看到几乎内核每个子系统都有相当大的变化,首当其冲的是内存管理和块设备部分。本书集中讨论了如下内容: 内存管理,包括文件缓冲、进程交换以及直接内存访问(DMA) 虚拟文件系统层和第二及第三扩展文件系统 进程创建及调度   信号、中断及设备驱动程序的主要接口   定时   内核中的同步   进程间通信(IPC)   程序执行   本书将使你熟悉Linux所有的内在工作机理,但本书不仅仅是一种学术演练。你将了解到什么条件会促使Linux产生最佳性能,你还会看到,Linux 在各种环境下如何满足进程调度、文件访问及内存管理期间系统提出的快速响应要求。本书有助于你充分展现Linux系统的魅力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值