Computer Systems
                                                                                           CSA Showcase I...
Upcoming SlideShare
Loading in …5

Computer Systems


Published on

basic introduction to computer systems

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Computer Systems

  1. 1. Computer Systems CSA Showcase Illumination Initial Computers Process of Translation Supporting Multiple Process Supporting Multiple Process Hardware circuits operated on data stored in Often users want to execute multiple programs some of the issues are memory. Initial circuits were hardwired. One has to The user gives the program in terms of high level (process) on the CPU. When a Running process rewire the circuit to change the program. Then language like C++. This has to be translated to issues a IO call (for example), that program is Mutual Exclusion: Shared programmable systems allowed users to easily. instructions understandable by the CPU. The suspended ( put into Waiting state ). Meanwhile memory and devices are critical This device can be used to perform any compiler does this job. The compiler allocates other process can utilize the CPU. regions whose access must be computation , depending on which switches are memory locations for variables in the program, regulated. The figure shows closed. converts high level language statements into what happens if access to machine code. terminal is not regulated Synchronization: When multiple processes are run, there may be need to synchronize . For eg. CPU can produce data faster than a terminal can accept (consume). This is modeled as producer consumer problem with buffer as the critical This means process can be swapped in and out of resource to avoid buffer overflow/underflow. A memory to disk. Thus addressing within a process process requests permission to use the resource should not be tied to a specific physical address. So and releases it after using it .If the request cannot logical address is used in the process and the be satisfied, the process is put onto a queue of The Linker combines the executable from hardware (MMU) converts the logical address into waiting process. This is an example of simple various programs into memory. physical address. semaphore mechanism. Von Neumann Computers The Loader loads the final executable into . memory. When you type a.out the loader is Handling Mutual Exclusion: Each process von Neumann realized invoked. executes a primitive called Reserve, which that not only data, but allocates the resource if available or waits until also the instructions The Linker combines executables of multiple programs it becomes available. could be stored in How the Memory looks at runtime and combines them into a single one. The loaders loads memory. The CPU themThe memory is divided into various segments. into memory The virtual address space is larger than the physical process Pi operates on data and address space, allowing programs to use a larger { instructions to produce The stack like behavior of functions leads to an address space, so the programmer/compiler can elegant mechanism for handling local variables while( true ) output produce code without worrying about the actual { (which are destroyed when a function returns) memory size of the system. Space allocated by malloc / new remains in Reserve if the instruction sequence is move,add,mul the heap unless freed Use Critical Resource programmer would write [1000,0100,0001] . Release Instead of loading the entire program into the Non Critical code However it was realized that 00,01,10,11 would be memory at once, we can load the required chunks of sufficient to encode. Thus it becomes necessary } memory as and when necessary. This is called } to decode the instruction before executing. demand paging. Since transfer of pages from disk to memory is costly, demand paging reduces this cost. This Reserve and Release can be handled using Semaphore mechanism, which acts like lock variable, but instead of busy waiting Activation Record of a function includes a scheduling mechanism that puts the The OS is waiting process on the queue. Thus the job of CPU is to fetch instructions from responsible for main memory, decode them, and execute them.To maintaining the page minimize logic gates used the number of The state of main() when table and also for control passes to f() is stored Deadlock: This occurs when processes wait instructions the CPU can recognize is kept small. protecting processes in activation record. for each other to release resources. Frequently accessed data and instructions are from accessing kept in cache. If the program is too big to be kept memory of another All these issues must be handled by OS An activation record holds in the main memory then only the required information relevant to the sections of the program are loaded from disk to activation of a procedure. the main memory