Notes_20141001

Computer Systems 1st Chapter

C is the language of choice for system-level programming, and there is a huge installed base of application-level programs as well. However, it is not perfect for all the programmers adn all situations. C pointers are a common source of confusion and programming errors. C also lacks explicit support for useful abstractions such as classes, objects and expectations. Newer languages such as C++ and java address these issues for application-level.

Programs are translated by other programs into dffferent Forms.


hello.c (source program-text)                     >>>> Pre-processor(cpp) >>>>

hello.i (Modified source program-text)        >>>> Compiler(cll)            >>>>

hello.s(Assembly program-text)                  >>>> Assembler(as)         >>>>

hello.o(Relocatable object program-binary)>>>> Linker (ld)                >>>>

+printf.o

hello   (Executable object program-binary)


Reasons to understand how compilation systems work:

1. optimizing program performance

2. Understanding link-time errors

3. Avoiding security holes



Hardware Organization of a System

Buses: Running throughout the system is a collection of electronical conduits called buses that carry bytes of information back and forth between the components. Buses jare typically designed to transfer fixed-sized chunks of bytes known as words.

I/O devices: Input/ Output (I/O) devices are the system's connection to the external world.

Main Memory: The main memory is a temporary storage device that holds both a program and the data it manipulates while the processor is executing the program.

Processor: The CPU  or simply the processori is the engine that interprets or executes instructions stored in main memory.



Cashes Mater:


An important lesson from the simple example is that a system spends a lot of time moving information from one place to another. The machine instructions in the hello program are originally stored on disk. When the program is loaded they are copied to the main memory. As the processor runs the program, instructions are copied from main memory into the processor. Similarly, the data string "hello world\n" originally on diskm is copied to the main memory. and then copied from the main memory to the display device.




A process is the operating system's abstraction for a running program.


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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值