Jex
Operating System Learning

Operating System Learning

Convince and Efficiency

types

linux | ubantu | macOS | windows | Android

sources

CPU、Memory、I/O devices

How to Work

All controllers and CPU are sharing memory(RAM), can execute concurrently competing for the memory cycle.

—— To ensure orderly access to the shared memory, a memory controller is provided whose function is to synchronize access to memory.
image.png

Terms

  1. Boostrap Program - 引导程序
    1. The initial program that runs when a computer is powered up or rebooted
    2. It is stored in the ROM
    3. It must know how to load the OS and start executing the system
    4. It must locate and load into memory the OS kernel
  2. Interrupt - 中断
    1. The occurence of an event is ususally signaled by an interrupt form the hardware or the software
    2. hardware may trigger an interrupt at any time by sending a signal to the CPU, usually by the way of the system bus.
  3. System Call(Monitor Call) - 系统调用(监控调用)
    1. Software may trigger an interrupt by executing a special operation called System Call

When the CPU is interrupted

当中断发生时,CPU将其执行转移到中断服务程序,中断结束后,CPU会恢复它原来的执行

  1. stop what it is doing and immediately transfers execution to a fixed location(contains the starting address where the Service Routine of the interrupt is located)
  2. The Interrupt Service Routine executes
  3. On completion, the CPU resumes the interrupted computation.

Storage Structure

image.png
Registers - 寄存器, store data in bits that means in 0 or 1
Cache - 缓存 a little bigger and slowly than registers
Main Memory - 主内存 random access memory or RAM
Electron Disk - 电子磁盘
Magnetic Disk - 磁盘
Optical Disk - 光盘
Magnetic Tapes - 磁带

Input/Output Devices

image.png

-> The divice controller maintains tow things

  • local buffer storage 本地缓冲存储
  • set of special-purpose registers 专用寄存器组

-> Typically, operating system have a device driver(设备驱动程序) for each device controller
-> This device driver understands the device controller and presents a uniform interface to the device to the reset of the operating system

I/O Operation

image.png

  • To start an I/O operation, the device driver loads the appropriate registers within the device controller(设备驱动)