Firstly,we give the hardware organization of a typical computer system:(click)


We have an executable file hello which is generated after compiling the c source file hello.c by gcc:

1.As we type the characters ./hello at the keyboard, the shell reads each one into a register of the CPU,and the stores it in main memory.(click)


2.After we typing the command ./hello and enter on the keyboard, the shell then loads the executable hello file by executing a sequence of instructions that copy the code and data from disk to main memory. It is accomplished using a technique known as DMA(Direct Memory Access).(click)


3.Once the code and data in the hello file are loaded into main memory, the processor starts to execute the machine-language instructions in the hello program's main routine. If it needs to print results or some words, say like "Hello World.", on the screen, the bytes in the string "Hello World." will be copied from memory to regiser, then to the display device.(click)





Some questions involved:
1.Controller and Adapter
Each I/O device is connected to the I/O bus through either a controller or an adapter.
Controller is chip sets in the device itself or on the system's main printed circuit board (motherboard).
Adapter is a card that plugs into a slots on the motherboard.
Their main purpose are both transfer informations back and forth between the I/O device and I/O bus.

2.why 32 bits CPU allows max 4G-sized main memory?
PC(program counter) is a word-sized storage device(or register) in CPU. It points at(contains the address of) some machine-language instructions in main memory.

preload preload preload