<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2026F_Lecture_16</id>
	<title>Operating Systems 2026F Lecture 16 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2026F_Lecture_16"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_16&amp;action=history"/>
	<updated>2026-11-23T15:48:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_16&amp;diff=25269&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lectures given on November 17th and 18th, 2026 are now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec16a-20261117.mp4 Lecture 16A] * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec16b-20261118.mp4 Lecture 16B]  ==Notes==  ===Lecture 16A===  &lt;pre&gt; Lecture 16A -----------  How does the kernel start running?  - we want to run it early  - but, how can we get it loaded when...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_16&amp;diff=25269&amp;oldid=prev"/>
		<updated>2026-11-18T15:15:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lectures given on November 17th and 18th, 2026 are now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec16a-20261117.mp4 Lecture 16A] * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec16b-20261118.mp4 Lecture 16B]  ==Notes==  ===Lecture 16A===  &amp;lt;pre&amp;gt; Lecture 16A -----------  How does the kernel start running?  - we want to run it early  - but, how can we get it loaded when...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
Video from the lectures given on November 17th and 18th, 2026 are now available:&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec16a-20261117.mp4 Lecture 16A]&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec16b-20261118.mp4 Lecture 16B]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
===Lecture 16A===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 16A&lt;br /&gt;
-----------&lt;br /&gt;
&lt;br /&gt;
How does the kernel start running?&lt;br /&gt;
 - we want to run it early&lt;br /&gt;
 - but, how can we get it loaded when the kernel&lt;br /&gt;
   is the part of the system that understands how to load&lt;br /&gt;
   data into memory (along with lots of other things?)&lt;br /&gt;
&lt;br /&gt;
You need a boot loader&lt;br /&gt;
 - code that is initially loaded by your computer in order to load an operating system&lt;br /&gt;
 - could be the operating system itself, but generally isn&amp;#039;t for multiple reasons&lt;br /&gt;
&lt;br /&gt;
So how can that initial code be loaded?&lt;br /&gt;
&lt;br /&gt;
The original IBM PC design would just load the first sector of&lt;br /&gt;
the boot disk, treat that code as 16-bit 8086 code. And that was it&lt;br /&gt;
 - that code could make use of other code that was built into the&lt;br /&gt;
   system, the BIOS (basic input output system)&lt;br /&gt;
This wasn&amp;#039;t much code, like less than 512 bytes&lt;br /&gt;
&lt;br /&gt;
Note that 16 bit code stuck around until systems were 32 and even 64 bit systems!&lt;br /&gt;
&lt;br /&gt;
The old PC BIOS was replaced with EFI&lt;br /&gt;
 - have a full OS built into the computer that could be used&lt;br /&gt;
   to load an operating system&lt;br /&gt;
 - &amp;quot;extensible firmware interface&amp;quot; - so the code could be extended&lt;br /&gt;
&lt;br /&gt;
After EFI loads, it has to load a boot loader&lt;br /&gt;
 - for most Linux systems, that is GRUB&lt;br /&gt;
&lt;br /&gt;
GRUB then loads the linux kernel + the inital ram disk (initrd)&lt;br /&gt;
 - initrd has modules needed to mount the real root filesystem&lt;br /&gt;
&lt;br /&gt;
Then the linux kernel runs, loads the modules it needs, mounts the root filesystem, and runs init.&lt;br /&gt;
 - init then loads the rest of userspace&lt;br /&gt;
&lt;br /&gt;
task is a concept that more comes from Mach&lt;br /&gt;
 - represents kernel-level procesess &amp;amp; threads&lt;br /&gt;
 - it has all the data associated with a running process or thread&lt;br /&gt;
   - pid, parent pid&lt;br /&gt;
   - address space&lt;br /&gt;
   - and LOTS of other things&lt;br /&gt;
&lt;br /&gt;
One task struct is always special: current&lt;br /&gt;
 - the task that made the system call that is being processed&lt;br /&gt;
 - (so if the kernel isn&amp;#039;t processing a system call,&lt;br /&gt;
    current isn&amp;#039;t defined)&lt;br /&gt;
&lt;br /&gt;
Scheduling&lt;br /&gt;
 - what task should a CPU core run next?&lt;br /&gt;
&lt;br /&gt;
Basic flow of control&lt;br /&gt;
&lt;br /&gt;
 user space runs -&amp;gt; kernel runs -&amp;gt; user space runs&lt;br /&gt;
&lt;br /&gt;
we switch from userspace to the kernel because&lt;br /&gt;
 - a hardware event happened (timer, network packet, etc)&lt;br /&gt;
 - user space made a system call&lt;br /&gt;
&lt;br /&gt;
When a system call happens&lt;br /&gt;
 - system call dispatcher runs&lt;br /&gt;
 - system call-specific code runs&lt;br /&gt;
 - scheduler runs&lt;br /&gt;
   - chooses user space task to run next&lt;br /&gt;
&lt;br /&gt;
How to choose?&lt;br /&gt;
 - first come first serve?&lt;br /&gt;
   - but are all tasks equally important?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lecture 16B===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 16B&lt;br /&gt;
-----------&lt;br /&gt;
&lt;br /&gt;
How does a computer start up? And where does the kernel fit in?&lt;br /&gt;
&lt;br /&gt;
The kernel contains the software needed to run applications. But what software does the kernel need?&lt;br /&gt;
 - has to be loaded from storage (HD, ssd, network, etc)&lt;br /&gt;
&lt;br /&gt;
Key insight: there&amp;#039;s software built into your computer&lt;br /&gt;
 - older PCs: BIOS&lt;br /&gt;
 - current PCs: EFI&lt;br /&gt;
 - other platforms: varies&lt;br /&gt;
&lt;br /&gt;
So the infrastructure provided for booting an operating system varies. Today we&amp;#039;ll talk about PCs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BIOS ruled PCs for decades&lt;br /&gt;
 - first PCs were in the early 1980&amp;#039;s&lt;br /&gt;
 - EFI was only started in 2006&lt;br /&gt;
&lt;br /&gt;
BIOS - basic input output system&lt;br /&gt;
 - code built in to a PC&lt;br /&gt;
 - enough code to load a bit of code from disk&lt;br /&gt;
&lt;br /&gt;
how little? less than 512 bytes!&lt;br /&gt;
 - size of a sector (block)&lt;br /&gt;
&lt;br /&gt;
In that block there should be an 8086 program that loads the rest of the system&lt;br /&gt;
 - can rely on the BIOS&lt;br /&gt;
 - but still not much there&lt;br /&gt;
&lt;br /&gt;
The boot sequence on a classic PC has multiple stages&lt;br /&gt;
 - each one implementing more functionality so more code&lt;br /&gt;
   can be loaded&lt;br /&gt;
&lt;br /&gt;
So what you put in those 512 bytes is the first part of the boot loader&lt;br /&gt;
 - software designed to load operating systems&lt;br /&gt;
&lt;br /&gt;
EFI is the replacement for the PC BIOS&lt;br /&gt;
 - extensible firmware interface&lt;br /&gt;
 - an entire OS that loads before your OS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is trusted computing?&lt;br /&gt;
 - set of mechanisms designed to ensure running code is &amp;quot;trusted&amp;quot;&lt;br /&gt;
 - here, trusted means the code has been signed by an entity that is trusted&lt;br /&gt;
   - code can still have bugs, vulnerabilities, or could even be malware if the trusted party makes a mistake or is compromised&lt;br /&gt;
&lt;br /&gt;
So, the code should all have been digitally signed by the right keys&lt;br /&gt;
&lt;br /&gt;
To have a system be trusted, all code has to be properly signed, from the bootloader on up!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>