What is operating system? Computer = set of resources –Processor(s), memory, I/O & communication devices OS –Enables use of resources –Manages resources –The low-level software that supports a computer’s basic functions, such as scheduling tasks and controlling peripherals Resources not limited to hardware Shift from –Pure efficient use of resources to –Enhance user experience Operating System Model As you can see in the above diagram the application runs on top of the OS. Only the OS has full access to the underlying hardware. What is the kernel? A kernel is a central component of an operating system. It acts as ...
Read more
Finite number of resources to be distributed among a number of competing processes A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. The Deadlock Problem Example –System has 2 tape drives. –P1 and P2 each hold one tape drive and each needs another one. Example –semaphores A and B, initialized to 1 P0 P1 wait (A); wait(B) wait (B); wait(A) Bridge Crossing Example Traffic only in one direction. Each section of a bridge can be viewed as ...
Read more
A thread is the smallest unit of processing that can be performed in an OS. In most modern operating systems, a thread exists within a process – that is, a single process may contain multiple threads A thread has its own: Program counter System registers Stack A thread shares following information with peer threads: Code segment Data segment Open files A basic unit of CPU utilization. It consists of a thread ID, a program counter, a register set, and a stack. It is a single sequential flow of control within a program If a process has multiple threads of control, ...
Read more
SHELL Interface between user application or user and kernel (operating system) The shell reads a command line from its standard input and interprets it according to a fixed set of rules. The standard input and standard output file descriptors for the login shell are usually the terminal on which the user logged in If the shell recognizes the input string as a built-in command (for example, commands cd, for, while and others), it executes the command internally without creating new processes https://play.google.com/store/apps/details?id=com.pratikkataria.positivityhub Types of Shell Bourne shell (sh) C shell (csh) Korn shell (ksh) Functions of shell: Acts as command ...
Read more
What is a Process? A program in execution An instance of a program running on a computer The entity that can be assigned to and executed on a processor A unit of activity characterized by the execution of a sequence of instructions, a current state, and an associated set of system instructions The system consists of a set of processes: user processes (performed by user code) and OS processes (running system code). Program is passive entity stored on disk, process is active -Program becomes process when executable file loaded into memory Process Elements A process is comprised of: -Program code ...
Read more
SVR4 and Solaris use two separate schemes: paging system kernel memory allocator Paging system provides a virtual memory capability that allocates page frames in main memory to processes allocates page frames to disk block buffers Kernel Memory Allocator allocates memory for the kernel UNIX SVR4 Memory Management Formats Page Replacement The page frame data table is used for page replacement Pointers are used to create lists within the table all available frames are linked together in a list of free frames available for bringing in pages when the number of available frames drops below a certain threshold, the kernel will ...
Read more
VIRTUAL MEMORY Virtual Memory is a technique that allows the execution of processes that may not be completely in memory Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution Logical address space can therefore be much larger than physical address space Allows address spaces to be shared by several processes Virtual memory can be implemented via: Demand paging Demand Segmentation Virtual Memory that is larger than Physical Memory Advantages of execution of program loaded partially in Memory A program is no longer be constrained by amount ...
Read more
SWAPPING A process must be loaded into memory in order to execute What If there is not enough memory available?? APPROACHES FOR MEMORY ALLOCATION Contiguous Memory Allocation Paging Segmentation Loading Program into Main Memory (Contiguous Memory Location) It is assumed that OS occupies some fixed portion of memory and rest is available to user processes. Based on requirement and functionality different memory management methods are adopted. –Should the process be allocated memory in contiguous manner? FIXED PARTITIONING Main memory is divided into number of fixed size partition at system generation time. A processes can be loaded into a partition of ...
Read more
Memory is a large array of words or bytes. CPU can only access content from main memory and registers (built into processor) Data / instruction can not be read from secondary storage by processor . It needs to be moved from secondary storage to main memory. Memory Management Tasks managing Primary Memory moving processes back and forth between main memory and disk during execution keeping track of allocated and free memory decides which process will get memory at what time Is the task carried out by the OS and hardware to accommodate multiple processes in main memory If only a ...
Read more
NEED OF MAKE TOOLS Problems: Long files are harder to manage (for both programmers and machines) Every change requires long compilation Many programmers can not modify the same file simultaneously Solution: divide project to multiple files Good division to components Minimum compilation when something is changed Easy maintenance of project structure, dependencies and creation make Make: productivity enhancement utility and a program management tool Useful for managing the development of large-sized programs (very large number of functions and many developers) For big projects- common definitions hold across all the functions under development This is true regardless of number of persons ...
Read more