Chapter 2: Introduction to Operating Systems

Intro


The Von Neumann model of computing

    All a running program does is execute instructions.

  •     The processor fetches, decodes, then executes the instruction.

  • The Operating system (OS) is a body of software that intends to make the system easy to use. It also is in charge of making sure the system runs correctly and efficiently. It can also take physical resources like the processor, memory, or a disk and transform it into a more general, powerful, and easy-to-use virtual form using Virtualization, which gives us another way of referring to the OS, a Virtual Machine, or a Resource Manager.

    • Seemingly allow multiple programs at once

    • Allow programs to share memory

    • Enable programs to interact with devices

The typical OS provides interfaces (APIs) that you can call, system calls available to applications to run programs, access memory and devices, or other related actions. We say the OS provides a Standard Library to applications.


2.1    Virtualizing the CPU

As part of virtualizing the CPU, the OS turns a single CPU into a seemingly infinite number of virtual CPUs, therefore allowing many programs to run at once.


2.2    Virtualizing Memory

Memory in modern machines is just an array of bytes, therefore specifying the address is necessary to access the data stored there, read the memory. To write/update memory, you also must specify the data to be written to the address. Each instruction of the program is also in memory; thus, memory is accessed on each instruction fetch.

    When Virtualizing Memory, the OS can give each running program its own private memory. Meaning the same address in different programs will not interact with other running programs if they have the same address. Giving each process its own private virtual address space/address space which is mapped onto the physical memory.


2.3    Concurrency

A thread is a function that runs within the same memory space as other functions, with more than one of them being active at a time. instructions are executed one at a time. If instructions are not executed atomically (all at once), strange things can happen.

2.4    Persistence

We should be able to store data persistently in case of any issues where data may be lost.