Operating System-計算機概論筆記

Shih Jiun Lin Lv4

一定愛配于天立教授開放課程食用:課程連結

Operating System

Batch processing(early era)

  • The process of computer operators entering data to the computers and give the result back to you.

Interactive processing(early era)

  • OS with remote terminals
  • Types of operating system Reference: link
    • Batch(批次)
    • Interactive
    • Real-time
      • Response time is critical.
    • Time-sharing and multitasking
      • Dividing time into intervals.
      • Only one task is being performed at any given time.
    • Multiprocessor
      • Load balancing
      • Scaling
  • Software classification
  • Shells
    • Communication with users
      • Text based
      • GUI(Graphical user interface )

Kernel

  • File manager
    • Directory/folder path
  • Device drivers
  • Memory manager
    • Allocating main memory
    • Paging, virtual memory
  • Schedular
    • The component which selects process to execute.
  • Dispatcher
    • The component which gives control of CPU to execute the process selected by Schedular.

Linux

  • Made by Linus Torvalds
  • Freeware and open-source
  • Many distribution (Ex: Ubuntu,Kali)
  • Linux only means the kernel

How is OS being loaded?

  • BIOS(Basic Input/Output Sytem)is usually stored on a EEPEROM chip(Electrically-Erasable Programable Read-Only Memory)

Process

  • The activity of executing a program
  • Process state
    • Program counter
    • General purpose registers
    • Associated memory cells
  • Process table
    • Memory area assigned to the process
    • Priority
    • Ready/waiting(One process for each core)

Process Administration

  • Schedular
    • Use: Maintaining the process table
    • Introducing new process
    • Removing completed process
    • Deciding whether a process is ready or waiting
  • Dispatcher
    • Use: Getting the process to running state.
    • Controling the allocation of time to the process in the process table.
    • Process switch(interrupt) Multiprogramming between two processes.

Semaphores

  • Meaning of semaphore: A visual sinaling appratus with flags, lights...
  • Test-and-set: Uninterruptible process, it will change the status of false to true and return it.
  • Critical region(臨界區段): A region that is only accessible to a program.
    • Mutual exclusion(互斥鎖): A process that prevents simultaneous access to a shared resource.

Prerequisites for Deadlock

  • Deadlock may occur only if all three of the following conditions(necessary but insufficient) are satisfied
    1. Competition for non-shareable resources
    2. Resources are requested on a partial basis, receiving some resources and return later to request more.
    3. Once a resource has been allocated, it cannot be forcibly retrieved.
  • To prevent Deadlock from happening, we have to avoid the conditions mentioned above being satisfied.

The Consequence of Preventing Deadlock from Happening

  • Starvation: Process cannot get the resources needed for a long time because the resources keep being allocated to other processes.
  • The solution to starvation -> (Aging): Adding an aging factor to the priority of each request.
  • Title: Operating System-計算機概論筆記
  • Author: Shih Jiun Lin
  • Created at : 2023-09-22 16:29:15
  • Updated at : 2023-01-24 01:30:04
  • Link: https://shih-jiun-lin.github.io/2023/09/22/2023-01-17-Operating System(I)/
  • License: This work is licensed under CC BY-NC-SA 4.0.