<?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_12</id>
	<title>Operating Systems 2026F Lecture 12 - 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_12"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_12&amp;action=history"/>
	<updated>2026-11-15T20:21:18Z</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_12&amp;diff=25213&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lectures given on November 3rd and 4th, 2026 are now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec12a-20261103.mp4 Lecture 12A] * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec12b-20261104.mp4 Lecture 12B]  ==Notes==  ===Lecture 12A===  &lt;pre&gt; Lecture 12A ----------- A1 is graded A2 is being graded, almost done Midterm is to be graded   Remember that people made compu...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_12&amp;diff=25213&amp;oldid=prev"/>
		<updated>2026-11-04T15:28:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lectures given on November 3rd and 4th, 2026 are now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec12a-20261103.mp4 Lecture 12A] * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec12b-20261104.mp4 Lecture 12B]  ==Notes==  ===Lecture 12A===  &amp;lt;pre&amp;gt; Lecture 12A ----------- A1 is graded A2 is being graded, almost done Midterm is to be graded   Remember that people made compu...&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 3rd and 4th, 2026 are now available:&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec12a-20261103.mp4 Lecture 12A]&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec12b-20261104.mp4 Lecture 12B]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
===Lecture 12A===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 12A&lt;br /&gt;
-----------&lt;br /&gt;
A1 is graded&lt;br /&gt;
A2 is being graded, almost done&lt;br /&gt;
Midterm is to be graded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember that people made computers work before the Internet (search engines, AI, etc)&lt;br /&gt;
 - how did they do it?&lt;br /&gt;
&lt;br /&gt;
Filesystems&lt;br /&gt;
 - files&lt;br /&gt;
 - and how they are stored&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CPU  &amp;lt;---&amp;gt;  Memory&lt;br /&gt;
       |&lt;br /&gt;
      I/O devices&lt;br /&gt;
&lt;br /&gt;
I/O device directly talks to memory: DMA&lt;br /&gt;
 - direct memory access&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I/O devices&lt;br /&gt;
 - screen&lt;br /&gt;
 - keyboard, mouse, touchscreen&lt;br /&gt;
 - network&lt;br /&gt;
 - storage  &amp;lt;--- our focus&lt;br /&gt;
&lt;br /&gt;
When we talk about storage, we distinguish between&lt;br /&gt;
volatile and non-volatile memory&lt;br /&gt;
 - does it save its contents when power is lost?&lt;br /&gt;
&lt;br /&gt;
volatile storage is pretty simple in structure&lt;br /&gt;
 - RAM, basically&lt;br /&gt;
 - put in an address, get back one or more bytes&lt;br /&gt;
&lt;br /&gt;
How much data do you get from RAM at a time?&lt;br /&gt;
 - at least a &amp;quot;word&amp;quot;, i.e., the size of a register&lt;br /&gt;
   - today, generally 64 bits&lt;br /&gt;
 - but generally you load a cache line worth from main memory&lt;br /&gt;
   - some multiple of the word size&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
memory hierarchy&lt;br /&gt;
 - computers have many ways to store information&lt;br /&gt;
 - each method of storage involves a trade-off between&lt;br /&gt;
   durability, speed, &amp;amp; cost&lt;br /&gt;
   - speed involving latency and bandwidth&lt;br /&gt;
 - so to make things fast but use lots of storage,&lt;br /&gt;
   you have to play a balancing game&lt;br /&gt;
 &lt;br /&gt;
What storage do we have? (from fastest to slowest)&lt;br /&gt;
 - registers&lt;br /&gt;
 - TLB &amp;lt;-- for virtual memory, later discussion&lt;br /&gt;
 - cache (L1, L2, L3, ?)&lt;br /&gt;
 - RAM (DRAM)&lt;br /&gt;
 - SSD&lt;br /&gt;
 - hard drives&lt;br /&gt;
 - tapes&lt;br /&gt;
&lt;br /&gt;
Tapes -&lt;br /&gt;
 - cheap: just tape!&lt;br /&gt;
 - big: just add more tape!&lt;br /&gt;
 - slow: sequential can be okay, but random access is SLOW&lt;br /&gt;
&lt;br /&gt;
hard drives -&lt;br /&gt;
 - not so cheap: magnetic platters&lt;br /&gt;
 - big because of high density recording (also for tapes)&lt;br /&gt;
 - but also kinda slow (for random access)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Why do we care about the technology of hard drives?&lt;br /&gt;
 - because it informs the design of filesystems&lt;br /&gt;
&lt;br /&gt;
How do we store data in a way that makes the best use of the performance characteristics of the device?&lt;br /&gt;
&lt;br /&gt;
For RAM, we just have address spaces&lt;br /&gt;
 - not much difference between sequential and random access&lt;br /&gt;
   (in theory), so maps well&lt;br /&gt;
    - but actually random access of RAM is slow,&lt;br /&gt;
      but we deal with that in other ways&lt;br /&gt;
&lt;br /&gt;
Virtual memory&lt;br /&gt;
 - make volatile storage fast&lt;br /&gt;
 - and account for not having enough of it&lt;br /&gt;
  &lt;br /&gt;
filesystems&lt;br /&gt;
 - make persistent storage useful and fast&lt;br /&gt;
 - so need to encourage sequential data access and&lt;br /&gt;
   discourage random data access&lt;br /&gt;
 - and when random data access happens, want to limit&lt;br /&gt;
   the randomness&lt;br /&gt;
&lt;br /&gt;
Files and directories work well for this&lt;br /&gt;
 - mostly programs read only a small fraction of files on a system&lt;br /&gt;
 - and for those files, they are mostly accessed sequentially&lt;br /&gt;
&lt;br /&gt;
This abstraction isn&amp;#039;t essential&lt;br /&gt;
 - disk storage is an array of blocks&lt;br /&gt;
   (as an abstraction)&lt;br /&gt;
 - a block is a fixed unit of storage&lt;br /&gt;
   - 512 bytes or a multiple (4K, 8K)&lt;br /&gt;
&lt;br /&gt;
caching&lt;br /&gt;
&lt;br /&gt;
what is a cache?&lt;br /&gt;
 - faster storage that stores copies of data&lt;br /&gt;
&lt;br /&gt;
cache is never authoritative, it is just a fast copy&lt;br /&gt;
 - higher in the memory hierarchy&lt;br /&gt;
&lt;br /&gt;
a cached copy is normally disposable&lt;br /&gt;
 - can throw it away if you need the space&lt;br /&gt;
&lt;br /&gt;
On Linux, filesystems are abstractions over block storage&lt;br /&gt;
 - provide extensive caching infrastructure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So what layers are we talking about with filesystems?&lt;br /&gt;
 - storage &amp;lt;- the device that actually stores the data&lt;br /&gt;
 - volume management &amp;lt;- reorganize storage&lt;br /&gt;
 - interface &amp;lt;- block device, way we get the data&lt;br /&gt;
 - filesystem &amp;lt;- abstraction over block device,&lt;br /&gt;
                 turns it into files&lt;br /&gt;
&lt;br /&gt;
From a user&amp;#039;s perspective, a filesystem is a hierarchical key value store&lt;br /&gt;
 - /path/to/something =&amp;gt; data&lt;br /&gt;
&lt;br /&gt;
But what if I want to use multiple filesystems at the same time?&lt;br /&gt;
 - how do I name the filesystems?&lt;br /&gt;
&lt;br /&gt;
On MS-DOS and older windows -&lt;br /&gt;
  filesystems would have letter names&lt;br /&gt;
&lt;br /&gt;
In UNIX, we mount filesystems&lt;br /&gt;
 - associate a directory with a filesystem&lt;br /&gt;
   - so all files and directories in the filesystem are under that directory&lt;br /&gt;
   - the mountpoint directory is where the filesystem&amp;#039;s files are integrated as part of the mount&lt;br /&gt;
     - if the mountpoint directory has any files...&lt;br /&gt;
       they get hidden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lecture 12B===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 12B&lt;br /&gt;
-----------&lt;br /&gt;
A1 is graded (uploading today)&lt;br /&gt;
A2 is being graded, should be done soon&lt;br /&gt;
Then we&amp;#039;ll be grading the midterm&lt;br /&gt;
&lt;br /&gt;
Remember you need to be able to solve problems without a search engine or AI&lt;br /&gt;
 - figure out the right questions to ask: answers are easy, questions are hard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Filesystems&lt;br /&gt;
&lt;br /&gt;
CPU  &amp;lt;---&amp;gt;  RAM&lt;br /&gt;
       |&lt;br /&gt;
   I/O devices&lt;br /&gt;
&lt;br /&gt;
Real picture is much more complicated&lt;br /&gt;
 - I/O devices can be entire computers&lt;br /&gt;
 - really, everything but the simplest embedded system&lt;br /&gt;
   is a network of computers, but pretending to act&lt;br /&gt;
   like the above&lt;br /&gt;
&lt;br /&gt;
Recall I/O devices are&lt;br /&gt;
 - keyboard, mouse, touchscreen&lt;br /&gt;
 - screen/GPU&lt;br /&gt;
 - disks &amp;lt;--- filesystems&lt;br /&gt;
 - network&lt;br /&gt;
&lt;br /&gt;
Memory hierarchy&lt;br /&gt;
 - many different kinds of storage technologies&lt;br /&gt;
 - different trade-offs between speed, durability, and cost&lt;br /&gt;
 - speed is relevant in sequential vs random access to data&lt;br /&gt;
&lt;br /&gt;
Data on tape is stored as magnetic fluxes&lt;br /&gt;
 - very little magnets&lt;br /&gt;
A read/write head allows us to access the bits stored in these magnetic regions&lt;br /&gt;
&lt;br /&gt;
Reading a tape sequentially is very fast&lt;br /&gt;
Reading a tape randomly is very slow&lt;br /&gt;
 - lots of fast forwarding &amp;amp; rewinding&lt;br /&gt;
&lt;br /&gt;
To use this sort of medium, you have to use the right abstractions to make it efficient&lt;br /&gt;
&lt;br /&gt;
Key technologies in the memory hierarchy&lt;br /&gt;
(fastest to slowest, also smallest to biggest)&lt;br /&gt;
&lt;br /&gt;
registers (on the CPU), 64 bits each&lt;br /&gt;
TLB &amp;lt;--- for virtual memory, 64-256K?&lt;br /&gt;
cache (L1, L2, L3) &amp;lt;--- few megabytes&lt;br /&gt;
RAM &amp;lt;--- gigabytes&lt;br /&gt;
SSDs &amp;lt;--- many gigabytes to terabytes&lt;br /&gt;
hard drives &amp;lt;--- terabytes&lt;br /&gt;
tapes &amp;lt;--- as much as you want&lt;br /&gt;
&lt;br /&gt;
Speed is really about latency versus bandwidth&lt;br /&gt;
 - you can always increase bandwidth by duplication&lt;br /&gt;
   (more hard drives, more tapes, etc)&lt;br /&gt;
&lt;br /&gt;
bandwidth: bytes per second&lt;br /&gt;
latency: time for first byte (request to response)&lt;br /&gt;
(seek time)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have two basic abstractions for accessing stored data&lt;br /&gt;
 - address space &amp;lt;--- assumes random access is fast&lt;br /&gt;
 - file &amp;lt;--- assumes random access is slow&lt;br /&gt;
&lt;br /&gt;
In an address space, there is no assumed pattern to which addresses will be access in which order&lt;br /&gt;
 - but in practice, sequential reads are faster!&lt;br /&gt;
   (not part of the abstraction)&lt;br /&gt;
&lt;br /&gt;
But with files, assumption is that any application will only access a small fraction of the files on a system&lt;br /&gt;
 - and, it will want most of the data in those files it accesses&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
address space: address -&amp;gt; byte (or a word)&lt;br /&gt;
filesystem: /path/to/a/file -&amp;gt; stream of bytes&lt;br /&gt;
&lt;br /&gt;
file systems are implemented on block devices:&lt;br /&gt;
 - block number -&amp;gt; block contents (multiple of 512 bytes, typically 4K or 8K)&lt;br /&gt;
&lt;br /&gt;
UNIX abstracts I/O devices into character and block devices&lt;br /&gt;
 - character devices are not cached&lt;br /&gt;
   - not necessarily accessed character by character&lt;br /&gt;
 - block devices are cached&lt;br /&gt;
&lt;br /&gt;
What is cache?&lt;br /&gt;
 - a cache in CS is faster storage that is used to&lt;br /&gt;
   store copies of data from slower storage&lt;br /&gt;
&lt;br /&gt;
Operating systems cache files in RAM to make access to them faster&lt;br /&gt;
&lt;br /&gt;
So what&amp;#039;s a filesystem?&lt;br /&gt;
 - data structure for mapping pathnames to data&lt;br /&gt;
   - typically designed to be persistent and stored in sets of blocks stored on SSDs or hard drives&lt;br /&gt;
   - but could be anything that can map pathnames to data&lt;br /&gt;
&lt;br /&gt;
When you make a filesystem on a block device, you are &amp;quot;formatting&amp;quot; it, i.e., you&amp;#039;re initializing a data structure for storing files&lt;br /&gt;
 - if there was an existing data structure (filesystem), it isn&amp;#039;t there anymore even if most of its data is still technically present - you can&amp;#039;t access it anymore!&lt;br /&gt;
&lt;br /&gt;
But what if you don&amp;#039;t want to use the whole block device for one filesystem?&lt;br /&gt;
 - or, what if you want multiple devices to be combined into one filesystem?&lt;br /&gt;
&lt;br /&gt;
We can split block devices up using partitions&lt;br /&gt;
&lt;br /&gt;
We can join block devices together using logical volume management&lt;br /&gt;
&lt;br /&gt;
What is mounting?&lt;br /&gt;
 - associating a filesystem with a directory&lt;br /&gt;
   - so files and directories in the filesystem&lt;br /&gt;
     now appear under the mountpoint directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>