CH 04 : Operating Systems And Computer Architecture
Operating Systems
- ==Operating System(OS)==: It is a computer software running in the background when the computer is on, and performs various operations.
- It is also responsible for the communication between hardware and software.
- Operating systems make it alot easier to use computers.
- Some of the tasks an OS performs:
- Multitasking
- Multiprogramming
- Error handling
- Loading and running software
- Memory management
- Security (passwords etc)
- Input and output control
- Windows and Linux are examples of OS.
- When a computer is turned on:
- The initial starting programs are loaded from ==Read Only Memory(ROM),==
- Different components of the computer are checked for errors,
- The OS is loaded into the computer memory.
Interrupts And Buffers
- ==Interrupt==: It is a signal sent to the Processor from a device or software, to make the Processor ^^temporarily^^ stop its current operation and service another.
- An Interrupt is sent when for example, a page is jammed in the printer, or when a software error occurs.
- Interrupts allow computers to ^^multitask^^.
- When an Interrupt occurs, the status of the currently running task is saved using an ==Interrupt Handler.== so that the processor can resume it after the Interrupt is serviced.
- ==Buffer==: It is a ^^temporary^^ memory area.
- Buffers are filled from computer memory and emptied to the hardware, allowing the processor to perform other tasks in the meanwhile.
- Example to explain how Buffers and Interrupts are used together, while a printer is being used:

Computer Architecture
- ==Von Neumann Architecture==: A computer system which can store programs in a memory. The idea was developed by ^^John von Neumann^^.
- Before Neumann, computers had to be fed data while they were running, so for every task the data had to be fed immediately before-hand.
- In a von Neumann system, a ==Memory Unit, Processor(containing a Control Unit)== and the hardware are connected through ==Buses== to perform different tasks.

- ==Buses==: The connections which transport data around the system and also maintain data ^^synchronization^^.
- ==Address Bus:== ^^Unidirectional^^ Bus carrying signal related to the addresses of the memory contents.
- ==Data Bus:== ^^Bidirectional^^ Bus responsible for moving the data and contents of the memory around the system.
- ==Control Bus==^^: Unidirectional^^ Bus carrying signals related to control and coordination of all activities in the computer.
- ==Registers==: High speed storage areas within the computer system, which are needed to store and ^^manipulate^^ data.
- ==Memory Address Register(MAR)==: Address which contains the location of the memory contents.
- ==Memory Data Register(MDR)==: Register which contains the content from memory.
- ==Arithmetic Logic Unit(ALU)==: Register which allows the ^^calculations and logic operations^^ to be performed within the computer.
- ==Program Counter(PC)==: Register which contains the instructions for the next task to be performed.
- ==Current Instruction Register(CIR)==: Register which contains the instructions for the current task.

- ==Memory Unit:== It contains all the data to be processed and its addresses as well.
- ==Processor==: The part where data is processed and the necassary logic operations are carried out.
- ==Control Unit==: It controls the operation of the memory, processor and input/output devices.
- Control Unit reads an instruction from memory and tells the other components how to function, through Control Bus.
- ==Input/Output Devices==: Ways of feeding data into a computer and/or getting it out.
Fetch-Execute Cycle
- To perform a task, instructions for the said task are ^^Fetched^^ from the memory and Processed before being ^^Executed^^.
- ==Fetch==:
- Instructions for the next task are fetched from the PC and put into CIR through Data Bus.
- PC is ^^incremented^^ by 1.
- Instructions are sent to the Processor(through Data Bus) to be decoded.
- ==Execute==:
- Processor sends the decoded instructions as ^^control signals^^ using the Control Bus, to other components of the system, so that the instructions can be executed.