Brendan Ang

Search

Search IconIcon to open search

2005 Operating Systems

Last updated Nov 7, 2022 Edit Source

# Operating Systems

#moc Essentially a piece of code which controls and coordinates the use of hardware among various programs for various users.

# The Boot Process

When you turn on a computer, it begins executing firmware code that is stored in motherboard ROM. This code performs a power-on self-test, detects available RAM, and pre-initializes the CPU and hardware. Afterwards, it looks for a bootable disk and starts booting the operating system kernel.

# Boot Process Firmware

On x86, there are two firmware standards: the “Basic Input/Output System“ ( BIOS) and the newer “Unified Extensible Firmware Interface” ( UEFI). The BIOS standard is old and outdated, but simple and well-supported on any x86 machine since the 1980s. UEFI, in contrast, is more modern and has much more features, but is more complex to set up

# Bootloaders

When you turn on a computer, it loads the BIOS from some special flash memory located on the motherboard. The BIOS runs self-test and initialization routines of the hardware, then it looks for bootable disks. If it finds one, control is transferred to its bootloader, which is a 512-byte portion of executable code stored at the disk’s beginning. Most bootloaders are larger than 512 bytes, so bootloaders are commonly split into a small first stage, which fits into 512 bytes, and a second stage, which is subsequently loaded by the first stage.

The bootloader has to determine the location of the kernel image on the disk and load it into memory. It also needs to switch the CPU from the 16-bit real mode first to the 32-bit protected mode, and then to the 64-bit long mode, where 64-bit registers and the complete main memory are available. Its third job is to query certain information (such as a memory map) from the BIOS and pass it to the OS kernel.

# Types of OS

  1. Batch Systems: batch similar jobs which automatically transfers control from one job to another
    • Only 1 job in memory at any time
    • When job waits for IO, the CPU is idle
  2. Multiprogram / Time-sharing Systems: several jobs are kept in main memory at the same time
    • Goal: Improve CPU utilization by running more than one program concurrently even in a single-core CPU
    • Different from multiprocessing: increase computing power with parallel architectures
    • __Requires OS to be able to handle memory management, CPU and I/O scheduling for efficiency
  3. Embedded Systems: physical systems where operations are controlled by computing
    • Examples:
    • Real time systems: have jobs that must complete without well-defined fixed time constraints (e.g. car airbag deployment)
    • Handheld systems

# Functions of the OS

  1. IO Subsystem
  2. Direct Memory Access
  3. Interrupts
  4. Multitasking
  5. Hardware Protection
  6. Handle Processes
  7. Process scheduling
  8. Process Synchronization
  9. Deadlocks
  10. Real Time Operating Systems
  11. Virtualization
  12. Memory Organisation
  13. Virtual Memory
  14. Allocators
  15. File Systems
  16. OS Security

# References

# Operating Systems Concepts

Exercise solutions: