<?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_14</id>
	<title>Operating Systems 2026F Lecture 14 - 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_14"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_14&amp;action=history"/>
	<updated>2026-11-16T21:37:56Z</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_14&amp;diff=25234&amp;oldid=prev</id>
		<title>Soma at 16:18, 11 November 2026</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_14&amp;diff=25234&amp;oldid=prev"/>
		<updated>2026-11-11T16:18:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:18, 11 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Video==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Video==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video from the lectures given on November &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;5th &lt;/del&gt;and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;6th&lt;/del&gt;, 2026 are now available:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video from the lectures given on November &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;10th &lt;/ins&gt;and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;11th&lt;/ins&gt;, 2026 are now available:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lec13a&lt;/del&gt;-20261110.mp4 Lecture 14A]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lec14a&lt;/ins&gt;-20261110.mp4 Lecture 14A]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lec13b&lt;/del&gt;-20261111.mp4 Lecture 14B]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lec14b&lt;/ins&gt;-20261111.mp4 Lecture 14B]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_14&amp;diff=25233&amp;oldid=prev</id>
		<title>Soma: /* Lecture 14A */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_14&amp;diff=25233&amp;oldid=prev"/>
		<updated>2026-11-11T15:48:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Lecture 14A&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:48, 11 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l116&quot;&gt;Line 116:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 116:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Lecture &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;14A&lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Lecture &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;14B&lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_14&amp;diff=25232&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lectures given on November 5th and 6th, 2026 are now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec13a-20261110.mp4 Lecture 14A] * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec13b-20261111.mp4 Lecture 14B]  ==Notes==  ===Lecture 14A===  &lt;pre&gt; Lecture 14A ----------- eBPF  First, how do you know what a process is doing?  - from the outside?  remember processes are sep...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_14&amp;diff=25232&amp;oldid=prev"/>
		<updated>2026-11-11T15:48:19Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lectures given on November 5th and 6th, 2026 are now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec13a-20261110.mp4 Lecture 14A] * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec13b-20261111.mp4 Lecture 14B]  ==Notes==  ===Lecture 14A===  &amp;lt;pre&amp;gt; Lecture 14A ----------- eBPF  First, how do you know what a process is doing?  - from the outside?  remember processes are sep...&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 5th and 6th, 2026 are now available:&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec13a-20261110.mp4 Lecture 14A]&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec13b-20261111.mp4 Lecture 14B]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
===Lecture 14A===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 14A&lt;br /&gt;
-----------&lt;br /&gt;
eBPF&lt;br /&gt;
&lt;br /&gt;
First, how do you know what a process is doing?&lt;br /&gt;
 - from the outside?&lt;br /&gt;
&lt;br /&gt;
remember processes are separated from each other&lt;br /&gt;
 - separate memory&lt;br /&gt;
 - take turns on the CPU&lt;br /&gt;
&lt;br /&gt;
On UNIX-like systems, there is the ptrace system call&lt;br /&gt;
 - used by gdb, strace, etc&lt;br /&gt;
&lt;br /&gt;
ptrace is great for development, but not good for production&lt;br /&gt;
 - can change how programs behave&lt;br /&gt;
 - programs can observe they are being monitored&lt;br /&gt;
&lt;br /&gt;
Better way to monitor processes (and more!) is eBPF&lt;br /&gt;
 - direct ancestor is DTrace from Solaris&lt;br /&gt;
&lt;br /&gt;
What is eBPF?&lt;br /&gt;
 - &amp;quot;enhanced Berkeley Packet Filter&amp;quot;&lt;br /&gt;
 - but the enhanced is doing a lot of work here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Normal way to monitor network traffic:&lt;br /&gt;
 - a process asks for packets&lt;br /&gt;
 - the kernel gives the process packets&lt;br /&gt;
&lt;br /&gt;
What if 1) the network is fast, and 2) you only want to look at some of the packets?&lt;br /&gt;
 - ideally, the process would only want to get the&lt;br /&gt;
   packets it wants rather than all of them&lt;br /&gt;
   - otherwise performance could be very very bad&lt;br /&gt;
&lt;br /&gt;
What if the kernel could be given the filter, so it would then know what packets the process was interested in?&lt;br /&gt;
 - only the requested data would move out of the kernel&lt;br /&gt;
   and into userspace (the requesting process)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But how can we design an API for filtering arbitrary network packets?&lt;br /&gt;
 - so, let&amp;#039;s let userspace give the kernel a program&lt;br /&gt;
 - the program will specify what packets we are and are not interested in&lt;br /&gt;
&lt;br /&gt;
  processes&lt;br /&gt;
  --------    &amp;lt;--- kernel/userspace boundary is expensive&lt;br /&gt;
  Kernel           to cross&lt;br /&gt;
  --------&lt;br /&gt;
  Hardware&lt;br /&gt;
&lt;br /&gt;
So how can we pass code to the kernel in a way that the code won&amp;#039;t corrupt the kernel?&lt;br /&gt;
 - we make a (language) virtual machine!&lt;br /&gt;
&lt;br /&gt;
Initially the language of BPF was a simple bytecode language designed for packet filtering&lt;br /&gt;
&lt;br /&gt;
But then some folks thought, what if we could use this virtual machine for more things?&lt;br /&gt;
 - so that&amp;#039;s eBPF&lt;br /&gt;
&lt;br /&gt;
eBPF has a number of...quirks...in order to make it safe and secure&lt;br /&gt;
&lt;br /&gt;
For example, you can&amp;#039;t do arbitrary loops in eBPF&lt;br /&gt;
&lt;br /&gt;
Randomness&lt;br /&gt;
 - how can a computer be random?&lt;br /&gt;
&lt;br /&gt;
Computers can run algorithms that produce pseudo-random number sequences&lt;br /&gt;
 - sequences that look &amp;quot;random&amp;quot; according to statistical tests&lt;br /&gt;
 - but because they are generated by an algorithm,&lt;br /&gt;
   the output is deterministic&lt;br /&gt;
 - they can look random by changing their initial state,&lt;br /&gt;
   i.e., their seed&lt;br /&gt;
&lt;br /&gt;
So how can a computer get a random number?&lt;br /&gt;
 - use the physical world!&lt;br /&gt;
&lt;br /&gt;
The operating system is the part of the system that can observe the physical world in the most direct way&lt;br /&gt;
 - network packets arrival&lt;br /&gt;
 - keyboard events&lt;br /&gt;
 - hard drive access patterns (mainly for spinning metal)&lt;br /&gt;
 - CPU random number generators&lt;br /&gt;
&lt;br /&gt;
These are known as &amp;quot;sources of entropy&amp;quot;&lt;br /&gt;
 - different sources will have different amounts of unpredictability, e.g. entropy&lt;br /&gt;
&lt;br /&gt;
To convert entropy sources to secure &amp;quot;randomness&amp;quot;, we use cryptographically secure pseudo random number generators with the entropy sources as the &amp;quot;seed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When you access /dev/urandom, you get bits from a cryptographically secure pseudo random number generator that has been seeded with entropy from the physical world (ideally)&lt;br /&gt;
&lt;br /&gt;
mmap&lt;br /&gt;
 - just an area of shared memory&lt;br /&gt;
 - can be used instead of read/write&lt;br /&gt;
&lt;br /&gt;
Instead of&lt;br /&gt;
 - open, read/write, close&lt;br /&gt;
&lt;br /&gt;
We can&lt;br /&gt;
 - open, mmap, close&lt;br /&gt;
&lt;br /&gt;
mmap associates part or all of a file with a block of memory&lt;br /&gt;
 - so now you can access the file like it was memory!&lt;br /&gt;
&lt;br /&gt;
But also, mmap can be used to allocate memory that can be&lt;br /&gt;
shared between processes&lt;br /&gt;
 - anonymous mmap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lecture 14A===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 14B&lt;br /&gt;
-----------&lt;br /&gt;
eBPF&lt;br /&gt;
pseudo randomness&lt;br /&gt;
dining philosopher&amp;#039;s problem&lt;br /&gt;
mmap&lt;br /&gt;
&lt;br /&gt;
eBPF&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
strace, gdb, other debugging tools&lt;br /&gt;
 - how can they work in the first place,&lt;br /&gt;
   given the restrictions on processes?&lt;br /&gt;
&lt;br /&gt;
They can work because the kernel provides the functionality for one process to monitor and change the behavior of another&lt;br /&gt;
 - ptrace!&lt;br /&gt;
&lt;br /&gt;
ptrace is great for debugging, but not great for production&lt;br /&gt;
 - very slow&lt;br /&gt;
 - intrusive (i.e., the traced program&amp;#039;s behavior could change&lt;br /&gt;
   due to being monitored)&lt;br /&gt;
 - only one process at a time&lt;br /&gt;
   - but this can be worked around&lt;br /&gt;
&lt;br /&gt;
Solaris first had dtrace&lt;br /&gt;
 - designed to allow very low overhead, robust monitoring of production workloads&lt;br /&gt;
&lt;br /&gt;
So...why eBPF?&lt;br /&gt;
 - stands for enhanced Berkeley Packet Filter&lt;br /&gt;
 - enhanced is doing a lot of work here!&lt;br /&gt;
&lt;br /&gt;
How can you monitor network traffic efficiently?&lt;br /&gt;
&lt;br /&gt;
You can have a monitoring program just ask for all the packets, and it will get them&lt;br /&gt;
 - but for a busy system it will be A LOT (so major performance implications)&lt;br /&gt;
 - and most of the time, you only want some of this traffic, potentially very little&lt;br /&gt;
&lt;br /&gt;
So how can we tell the kernel we only want traffic matching certain criteria? How do we define a filter?&lt;br /&gt;
 - so a userspace program is going to give the kernel a program to run to analyze network traffic?!&lt;br /&gt;
   - which would run IN THE KERNEL?&lt;br /&gt;
&lt;br /&gt;
But it is the best solution because passing data from the kernel to userspace is inherently expensive&lt;br /&gt;
&lt;br /&gt;
So how can we send code to the kernel safely and securely?&lt;br /&gt;
 - use a language virtual machine!&lt;br /&gt;
&lt;br /&gt;
so eBPF defines a bytecode virtual machine&lt;br /&gt;
 - good for packet filtering&lt;br /&gt;
 - but can be used to run almost arbitrary code in the kernel&lt;br /&gt;
    - for the purposes of monitoring kernel behavior&lt;br /&gt;
      and userspace behavior&lt;br /&gt;
&lt;br /&gt;
eBPF code is limited&lt;br /&gt;
 - can only access memory in safe ways&lt;br /&gt;
 - no unbounded loops&lt;br /&gt;
&lt;br /&gt;
Concurrency &amp;amp; deadlock&lt;br /&gt;
&lt;br /&gt;
when we deal with concurrency, we have to deal with coordination between executing processes &amp;amp; threads (and other things)&lt;br /&gt;
&lt;br /&gt;
key example here is producer/consumer, but there are MANY patterns&lt;br /&gt;
&lt;br /&gt;
the dining philosopher&amp;#039;s problem is an abstraction of the kind of systems that can have deadlock and other concurrency issues&lt;br /&gt;
 - involving shared resources&lt;br /&gt;
&lt;br /&gt;
mmap is another way of interacting with files&lt;br /&gt;
 - access file contents as memory rather than with read/write&lt;br /&gt;
 - e.g.&lt;br /&gt;
    open-&amp;gt;read/write-&amp;gt;close vs.&lt;br /&gt;
    open-&amp;gt;mmap-&amp;gt;mess with memory-&amp;gt;close&lt;br /&gt;
&lt;br /&gt;
so with mmap, a range of memory is associated with a range of&lt;br /&gt;
bytes in a file&lt;br /&gt;
 - potentially at an offset, and a subset&lt;br /&gt;
&lt;br /&gt;
So you can access a data structure directly rather than copying it to memory and then writing it to disk once you&amp;#039;re done&lt;br /&gt;
&lt;br /&gt;
mmap is really useful for interacting with large, sparse files&lt;br /&gt;
 - don&amp;#039;t have to load all of it into memory&lt;br /&gt;
 - can access parts randomly without seeks&lt;br /&gt;
&lt;br /&gt;
But mmap has other tricks&lt;br /&gt;
 - lets us bypass the copy memory functionality of fork,&lt;br /&gt;
   - share memory between processes&lt;br /&gt;
&lt;br /&gt;
Randomness&lt;br /&gt;
 - how can a computer be random?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are algorithms that can produce pseudo-random numbers&lt;br /&gt;
 - the numbers look random according to statistical tests&lt;br /&gt;
 - but, the algorithms always produce the same values&lt;br /&gt;
   given the same initial state (so they aren&amp;#039;t random)&lt;br /&gt;
   (the seed)&lt;br /&gt;
&lt;br /&gt;
cryptographically secure pseudo random number generator&lt;br /&gt;
 - no known way to efficiently predict the next number in the sequence&lt;br /&gt;
&lt;br /&gt;
But we still need a good source of randomness&lt;br /&gt;
 - if anything, to seed a cryptographically secure pseudo random number generator&lt;br /&gt;
&lt;br /&gt;
Ultimate source of randomness? the physical world. And the OS can interact with the physical world through devices&lt;br /&gt;
 - keyboard events&lt;br /&gt;
 - network packet arrival&lt;br /&gt;
 - hard drive settling time (for spinning disks)&lt;br /&gt;
 - special CPU instructions&lt;br /&gt;
   - which they tell us are random!&lt;br /&gt;
&lt;br /&gt;
Feed these inputs into a cryptographically secure pseudo random number generator, and you get something you can rely on for almost any purpose&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>