OS Fundamentals / Intro (Session 1)

Posted on 5 mins

Session Operating Systems

Intro

Session 1 ran on Thursday, 24th September in AT7.14. The session covered the fundamentals of Operating Systems. This session was ran by Kacper and Archie.

Session Content + Resources

Session Slides (Click Me!) Session slides were made with content generally available on the internet + some content from Operating System Concepts 10th Edition (2018) by A.Silberschatz.

Call for Committee members, speakers & presentations

If you’re someone who would like to help us run BitSIG, please let us know by pinging us in our Discord server (linked at the bottom of this post). Similarly, if you’re already very experienced in OS, low-level programming and other areas that BitSIG involves itself in and would like to give a talk or presentation about your research and/or experience, please let us know! We wanna hear from you!

Semester 1 Schedule

Meetings take place every Thursday, 18:00-19:00 in AT 7.14. We may sometimes run until 8pm if people are very interested, and otherwise we might go out to Teviot or some other social after the session.

We have an alternating schedule each week, where one week we’ll run a discussion / theory session and then the next week will be a more practical workshop (e.g. code-writing). Since this week is a theory / discussion session week, the next session will be a practical workshop. This scheduling gives us time to prepare workshop materials which require more effort than the theory sessions.

What are Operating Systems?

Some examples of Operating Systems include MSDOS, macOS, Windows, Linux, iOS, Android. See this xkcd comic .

The structure of operating systems tends to revolve around a ‘stack’ approach, where applications communicate with the Kernel, and the Kernel acts as the bridge between the applications and hardware like the CPU, Memory, I/O and other devices.

Key components of a Computer System

Interaction with Hardware

Let’s dive a bit deeper:

Interrupts

The solution: Interrupts. They’re called that because they ‘interrupt’ the CPU’s work to tell it that another resource needs the CPU. For example, a device controller for a keyboard may signal to the CPU that it requires processing, thus taking the CPU out of the work it was currently doing and switching it to ‘interrupt handling’. When the interrupt is handled, the CPU no longer needs to work on the ‘interrupt’ and the past state of the CPU is usually restored.

Context Switching & PCBs

Working with interrupts, we have the idea of context switching. This is where the OS switches which process is currently being executed / worked on by the CPU(s). Note that context switching can also refer to when the CPU switches from operating in user mode to kernel mode (i.e. from restricted app code to privileged OS code).

When the context switches, we need a way of storing the state of the registers of the previous context so we can restore them once we want to switch back. Otherwise we’d get lost or have to start over with processes that got interrupted, and that’s not very efficient. We can store this information by using PCBs (Process Control Blocks, not Printed Circuit Boards) which are maintained by the Operating System.

Kernel Space (don’t touch)

Kernel space is the most highly-privileged region of memory in a Computer. This is where the Kernel (OS) manages system resources, CPU scheduling, memory mapping + more.

User apps do not run in Kernel space and instead run in User Space; a crash in Kernel space can really screw things up (kernel panics: if the kernel can’t trust its own state, it stops as that is usually the safer thing to do than still going).

Kernel design & tradeoffs (monolithic, microkernels and hybrids)

Monolithic Kernels:

Microkernels:

Hybrid Kernels:

Next time:

Practical workshop (bring laptop) on writing a minimal Rust Kernel (with Phil Oppermann’s blog).

Same time, same place next week!

We’re going to Teviot after this session :-)

End of Post

If you have any questions, join our discord and ask away!

42 49 54 53 49 47 20 3C 33 20 59 4F 55