os

Cards (152)

  • Application software
    Performs specific task for the user
  • System software

    Operates and controls the computer system and provides a platform to run application software
  • Operating system

    A piece of software that manages all the resources of a computer system, both hardware and software, and provides an environment in which the user can execute his/her programs in a convenient and efficient manner by hiding underlying complexity of the hardware and acting as a resource manager
  • Why OS?

    • Bulky and complex apps (Hardware interaction code must be in app's code base)
    • Resource exploitation by 1 App
    • No memory protection
  • What is an OS made up of?

    • Collection of system software
  • Operating system functions

    • Access to the computer hardware
    • Interface between the user and the computer hardware
    • Resource management (memory, device, file, security, process etc)
    • Hides the underlying complexity of the hardware
    • Facilitates execution of application programs by providing isolation and protection
  • OS goals

    • Maximum CPU utilization
    • Less process starvation
    • Higher priority job execution
  • Types of operating systems

    • Single process operating system
    • Batch-processing operating system
    • Multiprogramming operating system
    • Multitasking operating system
    • Multi-processing operating system
    • Distributed system
    • Real time OS
  • Single process OS
    Only 1 process executes at a time from the ready queue
  • Batch-processing OS

    1. User prepares job using punch cards
    2. User submits job to computer operator
    3. Operator collects jobs from different users and sorts into batches
    4. Operator submits batches to processor one by one
    5. All jobs of one batch are executed together
  • Batch-processing OS

    • Priorities cannot be set if a job comes with higher priority
    • May lead to starvation
    • CPU may become idle in case of I/O operations
  • Multiprogramming
    Increases CPU utilization by keeping multiple jobs (code and data) in the memory so that the CPU always has one to execute in case some job gets busy with I/O
  • Multiprogramming
    • Single CPU
    • Context switching for processes
    • Switch happens when current process goes to wait state
    • CPU idle time reduced
  • Multitasking
    Logical extension of multiprogramming, able to run more than one task simultaneously
  • Multitasking
    • Single CPU
    • Context switching and time sharing used
    • Increases responsiveness
    • CPU idle time is further reduced
  • Multi-processing OS

    More than 1 CPU in a single computer
  • Multi-processing OS

    • Increases reliability, 1 CPU fails, other can work
    • Better throughput
    • Lesser process starvation, (if 1 CPU is working on some process, other can be executed on other CPU)
  • Distributed OS

    • OS manages many bunches of resources, >=1 CPUs, >=1 memory, >=1 GPUs, etc
    • Loosely connected autonomous, interconnected computer nodes
    • Collection of independent, networked, communicating, and physically separate computational nodes
  • RTOS
    Real time error free, computations within tight-time boundaries
  • Program
    An executable file which contains a certain set of instructions written to complete the specific job or operation on your computer
  • Process
    Program under execution, resides in Computer's primary memory (RAM)
  • Thread
    Single sequence stream within a process, an independent path of execution in a process, light-weight process, used to achieve parallelism by dividing a process's tasks which are independent path of execution
  • Multi-Tasking
    The execution of more than one task simultaneously
  • Multi-Threading

    A process is divided into several different sub-tasks called as threads, which has its own path of execution
  • Multi-Tasking

    • Concept of more than 1 processes being context switched
    • No. of CPU 1
    • Isolation and memory protection exists
  • Multi-Threading

    • Concept of more than 1 thread, threads are context switched
    • No. of CPU >= 1 (Better to have more than 1)
    • No isolation and memory protection, resources are shared among threads of that process
  • Thread Scheduling

    Threads are scheduled for execution based on their priority, OS allocates processor time slices to threads
  • Difference between Thread Context Switching and Process Context Switching

    • Thread Context switching: OS saves current state of thread & switches to another thread of same process, doesn't include switching of memory address space
    • Process context switching: OS saves current state of process & switches to another process by restoring its state, includes switching of memory address space
  • Kernel
    The part of the operating system which interacts directly with the hardware and performs the most crucial tasks, the heart of OS/core component, very first part of OS to load on start-up
  • User space

    Where application software runs, apps don't have privileged access to the underlying hardware, it interacts with kernel
  • Shell
    The part of the operating system that receives commands from the users and gets them executed
  • Functions of Kernel

    • Process management
    • Memory management
    • File management
    • I/O management
  • Monolithic kernel

    • All functions are in kernel itself, bulky in size, memory required to run is high, less reliable, high performance as communication is fast
  • Micro Kernel

    Only major functions like memory management and process management are in kernel, file management and I/O management are in user-space, smaller in size, more reliable, more stable, performance is slow, overhead switching between user mode and kernel mode
  • Hybrid Kernel

    Advantages of both monolithic and micro kernels, file management in user space and rest in kernel space, combined approach, speed and design of monolithic, modularity and stability of micro
  • Inter Process Communication (IPC)

    Communication between two processes executing independently, having independent memory space, done by shared memory and message passing
  • System calls

    A mechanism using which a user program can request a service from the kernel for which it does not have the permission to perform, the only way through which a process can go into kernel mode from user mode
  • Types of System Calls

    • Process Control
    • File Management
    • Device Management
    • Information maintenance
    • Communication Management
  • Windows & Unix System calls

    • CreateProcess(), ExitProcess(), WaitForSingleObject() (Windows)
    • fork(), exit(), wait() (Unix)
    • CreateFile(), ReadFile(), WriteFile(), CloseHandle() (Windows)
    • open(), read(), write(), close() (Unix)
    • SetConsoleMode(), ReadConsole(), WriteConsole() (Windows)
    • ioctl(), read(), write() (Unix)
    • GetCurrentProcessID(), SetTimer(), Sleep() (Windows)
    • getpid(), alarm(), sleep() (Unix)
    • CreatePipe(), CreateFileMapping(), MapViewOfFile() (Windows)
    • pipe(), shmget(), mmap() (Unix)
  • PC On

    1. CPU initializes itself and looks for a firmware program (BIOS) stored in BIOS Chip
    2. CPU runs the BIOS which tests and initializes system hardware, loads configuration settings, throws error if something is not appropriate
    3. BIOS will handoff responsibility for booting your PC to your OS's bootloader
    4. Bootloader is a small program that has the large task of booting the rest of the operating system