CHAPTER 1 A Tour of Computer Systems

1.4.1 Hardware Organization of a System

014 Hardware organization of a typical system.png

Buses

Buses are typically designed to transfer fixed-sized chunks of bytes known as words.The number of bytes in a word (the word size) is a fundamental system parameter that varies across systems. Most machines today have word sizes of either 4 bytes (32 bits) or 8 bytes (64 bits). We will assume a word size of 4 bytes, and we will assume that buses transfer only one word at a time. (bus: 想象是32根数据引脚线)

I/O Devices

015 IO controller and adapter.png

Processor

At its core is a word-sized storage device (or register) called the program counter(PC).


016 processor --- instruction set architecture.png

1.7 The Operating System Manages the Hardware

017 Abstractions provided by an operating system.png

processes

The operating system keeps track of all the state information that the process needs in order to run. This state, which is known as the context, includes information such as the current values of the PC, the register file, and the contents of main memory.

Threads

In modern systems a process can actually consist of multiple execution units, called threads, each running in the context of the process and sharing the same code and global data.

Virtual Memory

Virtual memory is an abstraction that provides each process with the illusion that it has exclusive use of the main memory. Each process has the same uniform view of memory, which is known as its virtual address space.

018 Process Virtual Address Space.png

For virtual memory to work, a sophisticated interaction is required between the hardware and the operating system software, including a hardware translation of every address generated by the processor. (MMU)

Files

A file is a sequence of bytes, nothing more and nothing less.

This simple and elegant notion of a file is nonetheless very powerful because it provides applications with a uniform view of all of the varied I/O devices that might be contained in the system. (应用程序调用open, read, write接口操作设备。操作系统提供对应的drv_read, drv_write)

1.9.2 The Importance of Abstractions in Computer Systems

On the processor side, the instruction set architecture provides an abstraction of the actual processor hardware. With this abstraction, a machine-code program behaves as if it were executed on a processor that performs just one instruction at a time.

On the operating system side, we have introduced three abstractions: files as an abstraction of I/O, virtual memory as an abstraction of program memory, and processes as an abstraction of a running program.

The virtual machine, providing an abstraction of the entire computer.

019 Some abstractions provided by a computer system.png

The operating system kernel serves as an intermediary between the application and the hardware. It provides three fundamental abstractions: (1) Files are abstractions for I/O devices. (2) Virtual memory is an abstraction for both main
memory and disks. (3) Processes are abstractions for the processor, main memory, and I/O devices.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容