Thursday, 10 March 2022

operating system full notes

What is an Operating System? 
Intermediate between Hardware and Software applications.
Hides hardware complexity (Read/write file storage, send/receive socket network) Handles resource management (CPU scheduling, Memory management) 
Provide isolation and protection (allocate different parts of memory to different applications so that applications don't overwrite other memory locations)

 Operating System definition: 
An Operating System is a layer of systems software that: 
directly has privileged access to the underlying hardware; 
hides the hardware complexity;
manages hardware on behalf of one or more application according to some predefined policies. In addition, it ensures that applications are isolated and protected from one another. 

Operating System examples: 

 OS Elements 
Abstractions (corresponds to applications that OS executes) 
process, thread, file, socket, memory page 
Mechanisms (on top of Abstractions)
 create, schedule, open, write, allocate 
Policies (how mechanisms are used to manage underlying hardware) 
Least Recently Used (LRU) , Earliest Deadline First (EDF), etc. 

Example : Memory Management: Abstractions: Memory page Mechanisms: Allocate, map to a process Policies: LRU OS Design Principles Seperation of mechanism and policy implement flexible mechanisms to support many policies e.g. LRU, LFU, random Optimize for common case Where will the OS be used? What will the user want to execute on that machine? What are the workload requirements? User/ Kernel Protection Boundary user-level => applications [underprivileged mode] kernel-level => OS Kernel [privileged access, hardware access] userkernelprotectionboundary User-Kernel switch is supported by hardware. using trap instructions system calls like: open (file) send (socket) malloc (memory) signals System call Flowchart systemcallflowchart To make a system call, an application must: write arguments save relevant data ast well defined location make system calls using system call number In synchronous mode : wait until system call completes. Basic OS services process management file management device management memory management storage management security Linux System Calls Task Commands Process Control fork (); exit(); 
wait(); 
File Manipulation open(); 
read(); 
write(); 
Device Manipulation ioctl(); 
read(); 
write(); 
Information Maintenance getpid(); 
alarm(); 
sleep(); 
Communication pipe(); 
shmget(); 
mmap(); 
Protection chmod(); 
umask(); 
chown(); 

No comments:

Post a Comment

My Feelings for death

 Kyu hoti hai kisi ki death, I don't know but why. M aaj tak nhi samjh pae ki ensan ki death kyu hoti hai. Kisi se bhi pucho to ye jawab...