<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rquaium</id>
	<title>Soma-notes - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rquaium"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php/Special:Contributions/Rquaium"/>
	<updated>2026-05-12T21:37:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21375</id>
		<title>Operating Systems 2017F Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21375"/>
		<updated>2017-12-07T19:10:57Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Written solutions for midterm exam are on the course webpage &amp;lt;br&amp;gt;&lt;br /&gt;
Assignment 4 &amp;lt;br&amp;gt;&lt;br /&gt;
Q2: SSH keygen generates the secret key and the public key file. The private key is stored in the private key file: .ssh/id_rsa  &amp;lt;br&amp;gt;&lt;br /&gt;
Q4: Both lines because first you start from 1 and then increment from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Q11: Only bs because it is write. Would be ibs and bs if it was read. &amp;lt;br&amp;gt;&lt;br /&gt;
Q12: Local kernel forwards the write system call but doesn&#039;t actually make the system call. Kernels don&#039;t make system calls.&amp;lt;br&amp;gt;&lt;br /&gt;
Lecture 23 Prof Notes &amp;lt;br&amp;gt;&lt;br /&gt;
-----------------&lt;br /&gt;
How can you tell when a process has been compromised. &amp;lt;br&amp;gt;&lt;br /&gt;
- from outside the process &amp;lt;br&amp;gt;&lt;br /&gt;
Use signatures &amp;lt;br&amp;gt;&lt;br /&gt;
- is it running &amp;quot;bad code&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
- is it doing &amp;quot;bad things&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
-- For example: password program start modifying files other than etc/password. You could specify rules to prevent this. &amp;lt;br&amp;gt;&lt;br /&gt;
-- bad system calls&amp;lt;br&amp;gt;&lt;br /&gt;
For a process to do damage, it has to make &amp;quot;bad&amp;quot; system calls &amp;lt;br&amp;gt;&lt;br /&gt;
I want to be lazy &amp;lt;br&amp;gt;&lt;br /&gt;
- complex rules are a pain &amp;lt;br&amp;gt; &lt;br /&gt;
- and they don&#039;t work well either &amp;lt;br&amp;gt; &lt;br /&gt;
Make the computer solve this problem &amp;lt;br&amp;gt;&lt;br /&gt;
- Use Machine Learning &amp;lt;br&amp;gt;&lt;br /&gt;
I can&#039;t teach good versus bad if I don&#039;t know what is bad &amp;lt;br&amp;gt;&lt;br /&gt;
But I know how systems behave normally &amp;lt;br&amp;gt;&lt;br /&gt;
How about teaching the system to differentiate normal from abnormal &amp;lt;br&amp;gt;&lt;br /&gt;
- normal is good &amp;lt;br&amp;gt;&lt;br /&gt;
- abnormal may be bad &amp;lt;br&amp;gt;&lt;br /&gt;
abnormal but not bad =&amp;gt; false positive &amp;lt;br&amp;gt;&lt;br /&gt;
False positives can be a big issue because they may cause ppl to not trust the machine&#039;s detection capabilities &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How can we detect abnormal system calls? &amp;lt;br&amp;gt;&lt;br /&gt;
Learn normal patterns of system calls over time &amp;lt;br&amp;gt;&lt;br /&gt;
Once you&#039;ve learned enough, watch for abnormal system calls &amp;lt;br&amp;gt;&lt;br /&gt;
Since I&#039;m lazy, I want to learn it as it runs &amp;lt;br&amp;gt;&lt;br /&gt;
- and automatically decide when it has learned enough &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Could I do the learning in a process (or set of processes)? &amp;lt;br&amp;gt;&lt;br /&gt;
you could, but all data would have to come from the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
Want something fast and simple &amp;lt;br&amp;gt;&lt;br /&gt;
- implement in the kernel &amp;lt;br&amp;gt; &lt;br /&gt;
How simple could it be? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First assumption: ignore arguments &amp;lt;br&amp;gt;&lt;br /&gt;
Second assumption: look at ordering of system calls on a per-thread, per-process basis &amp;lt;br&amp;gt;&lt;br /&gt;
Third Assumption: characterize processes based on the executable they are running &amp;lt;br&amp;gt;&lt;br /&gt;
model per executable, each trained on multiple processes &amp;lt;br&amp;gt;&lt;br /&gt;
How to model the trace of system calls coming from a procesd &amp;lt;br&amp;gt;&lt;br /&gt;
* frequency analysis? &amp;lt;br&amp;gt;&lt;br /&gt;
- on a system call basis &amp;lt;br&amp;gt;&lt;br /&gt;
- high variance &amp;lt;br&amp;gt;&lt;br /&gt;
* what system calls are made (and not made)? &amp;lt;br&amp;gt;&lt;br /&gt;
* short sequence of system calls? 6-10 calls &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21374</id>
		<title>Operating Systems 2017F Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21374"/>
		<updated>2017-12-07T18:58:52Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Written solutions for midterm exam are on the course webpage &amp;lt;br&amp;gt;&lt;br /&gt;
Assignment 4 &amp;lt;br&amp;gt;&lt;br /&gt;
Q2: SSH keygen generates the secret key and the public key file. The private key is stored in the private key file: .ssh/id_rsa  &amp;lt;br&amp;gt;&lt;br /&gt;
Q4: Both lines because first you start from 1 and then increment from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Q11: Only bs because it is write. Would be ibs and bs if it was read. &amp;lt;br&amp;gt;&lt;br /&gt;
Q12: Local kernel forwards the write system call but doesn&#039;t actually make the system call. Kernels don&#039;t make system calls.&amp;lt;br&amp;gt;&lt;br /&gt;
Lecture 23 Prof Notes &amp;lt;br&amp;gt;&lt;br /&gt;
-----------------&lt;br /&gt;
How can you tell when a process has been compromised. &amp;lt;br&amp;gt;&lt;br /&gt;
- from outside the process &amp;lt;br&amp;gt;&lt;br /&gt;
Use signatures &amp;lt;br&amp;gt;&lt;br /&gt;
- is it running &amp;quot;bad code&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
- is it doing &amp;quot;bad things&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
-- For example: password program start modifying files other than etc/password. You could specify rules to prevent this. &amp;lt;br&amp;gt;&lt;br /&gt;
-- bad system calls&amp;lt;br&amp;gt;&lt;br /&gt;
For a process to do damage, it has to make &amp;quot;bad&amp;quot; system calls &amp;lt;br&amp;gt;&lt;br /&gt;
I want to be lazy &amp;lt;br&amp;gt;&lt;br /&gt;
- complex rules are a pain &amp;lt;br&amp;gt; &lt;br /&gt;
- and they don&#039;t work well either &amp;lt;br&amp;gt; &lt;br /&gt;
Make the computer solve this problem &amp;lt;br&amp;gt;&lt;br /&gt;
- Use Machine Learning &amp;lt;br&amp;gt;&lt;br /&gt;
I can&#039;t teach good versus bad if I don&#039;t know what is bad &amp;lt;br&amp;gt;&lt;br /&gt;
But I know how systems behave normally &amp;lt;br&amp;gt;&lt;br /&gt;
How about teaching the system tod ifferentiate normal from abnormal &amp;lt;br&amp;gt;&lt;br /&gt;
- normal is good &amp;lt;br&amp;gt;&lt;br /&gt;
- abnormal may be bad &amp;lt;br&amp;gt;&lt;br /&gt;
abnormal but not bad =&amp;gt; false positive &amp;lt;br&amp;gt;&lt;br /&gt;
False positives can be a big issue because they may cause ppl to not trust the machine&#039;s detection capabilities &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How can we detect abnormal system calls? &amp;lt;br&amp;gt;&lt;br /&gt;
Learn normal patterns of system calls over time &amp;lt;br&amp;gt;&lt;br /&gt;
Once you&#039;ve learned enough, watch for abnormal system calls &amp;lt;br&amp;gt;&lt;br /&gt;
Since I&#039;m lazy, I want to learn it as it runs &amp;lt;br&amp;gt;&lt;br /&gt;
- and automatically decide when it has learned enough &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Could I do the learning in a process (or set of processes)? &amp;lt;br&amp;gt;&lt;br /&gt;
you could, but all data would have to come from the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
Want something fast and simple &amp;lt;br&amp;gt;&lt;br /&gt;
- implement in the kernel &amp;lt;br&amp;gt; &lt;br /&gt;
How simple could it be? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First assumption: ignore arguments &amp;lt;br&amp;gt;&lt;br /&gt;
Second assumption: look at ordering of system calls on a per-thread, per-process basis &amp;lt;br&amp;gt;&lt;br /&gt;
Third Assumption: characterize processes based on the executable they are running &amp;lt;br&amp;gt;&lt;br /&gt;
model per executable, each trained on multiple processes &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21373</id>
		<title>Operating Systems 2017F Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21373"/>
		<updated>2017-12-07T18:39:56Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Written solutions for midterm exam are on the course webpage &amp;lt;br&amp;gt;&lt;br /&gt;
Assignment 4 &amp;lt;br&amp;gt;&lt;br /&gt;
Q2: SSH keygen generates the secret key and the public key file. The private key is stored in the private key file: .ssh/id_rsa  &amp;lt;br&amp;gt;&lt;br /&gt;
Q4: Both lines because first you start from 1 and then increment from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Q11: Only bs because it is write. Would be ibs and bs if it was read. &amp;lt;br&amp;gt;&lt;br /&gt;
Q12: Local kernel forwards the write system call but doesn&#039;t actually make the system call. Kernels don&#039;t make system calls.&amp;lt;br&amp;gt;&lt;br /&gt;
Lecture 23 Prof Notes &amp;lt;br&amp;gt;&lt;br /&gt;
-----------------&lt;br /&gt;
How can you tell when a process has been compromised. &amp;lt;br&amp;gt;&lt;br /&gt;
- from outside the process &amp;lt;br&amp;gt;&lt;br /&gt;
Use signatures &amp;lt;br&amp;gt;&lt;br /&gt;
- is it running &amp;quot;bad code&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
- is it doing &amp;quot;bad things&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
-- For example: password program start modifying files other than etc/password. You could specify rules to prevent this. &amp;lt;br&amp;gt;&lt;br /&gt;
-- bad system calls&amp;lt;br&amp;gt;&lt;br /&gt;
For a process to do damage, it has to make &amp;quot;bad&amp;quot; system calls &amp;lt;br&amp;gt;&lt;br /&gt;
I want to be lazy &amp;lt;br&amp;gt;&lt;br /&gt;
- complex rules are a pain &amp;lt;br&amp;gt; &lt;br /&gt;
- and they don&#039;t work well either &amp;lt;br&amp;gt; &lt;br /&gt;
Make the computer solve this problem &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21372</id>
		<title>Operating Systems 2017F Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21372"/>
		<updated>2017-12-07T18:34:48Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Written solutions for midterm exam are on the course webpage &amp;lt;br&amp;gt;&lt;br /&gt;
Assignment 4 &amp;lt;br&amp;gt;&lt;br /&gt;
Q2: SSH keygen generates the secret key and the public key file. The private key is stored in the private key file: .ssh/id_rsa  &amp;lt;br&amp;gt;&lt;br /&gt;
Q4: Both lines because first you start from 1 and then increment from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Q11: Only bs because it is write. Would be ibs and bs if it was read. &amp;lt;br&amp;gt;&lt;br /&gt;
Q12: Local kernel forwards the write system call but doesn&#039;t actually make the system call. Kernels don&#039;t make system calls.&amp;lt;br&amp;gt;&lt;br /&gt;
Lecture 23 Prof Notes &amp;lt;br&amp;gt;&lt;br /&gt;
-----------------&lt;br /&gt;
How can you tell when a process has been compromised. &amp;lt;br&amp;gt;&lt;br /&gt;
- from outside the process &amp;lt;br&amp;gt;&lt;br /&gt;
Use signatures &amp;lt;br&amp;gt;&lt;br /&gt;
- is it running &amp;quot;bad code&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
- is it doing &amp;quot;bad things&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
-- For example: password program start modifying files other than etc/password. You should specify rules to prevent this. &amp;lt;br&amp;gt;&lt;br /&gt;
-- bad system calls&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21371</id>
		<title>Operating Systems 2017F Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21371"/>
		<updated>2017-12-07T18:29:34Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Written solutions for midterm exam are on the course webpage &amp;lt;br&amp;gt;&lt;br /&gt;
Assignment 4 &amp;lt;br&amp;gt;&lt;br /&gt;
Q2: SSH keygen generates the secret key and the public key file. The private key is stored in the private key file: .ssh/id_rsa  &amp;lt;br&amp;gt;&lt;br /&gt;
Q4: Both lines because first you start from 1 and then increment from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Q11: Only bs because it is write. Would be ibs and bs if it was read. &lt;br /&gt;
Q12: Local kernel forwards the write system call but doesn&#039;t actually make the system call. Kernels don&#039;t make system calls.&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21370</id>
		<title>Operating Systems 2017F Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21370"/>
		<updated>2017-12-07T18:20:54Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Written solutions for midterm exam are on the course webpage &amp;lt;br&amp;gt;&lt;br /&gt;
Assignment 4 &amp;lt;br&amp;gt;&lt;br /&gt;
Q2: SSH keygen generates the secret key and the public key file. The private key is stored in the private key file: .ssh/id_rsa  &amp;lt;br&amp;gt;&lt;br /&gt;
Q4: Both lines because first you start from 1 and then increment from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Q12:&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21368</id>
		<title>Operating Systems 2017F Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21368"/>
		<updated>2017-12-07T18:16:24Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Written solutions for midterm exam are on the course webpage &amp;lt;br&amp;gt;&lt;br /&gt;
Assignment 4 &amp;lt;br&amp;gt;&lt;br /&gt;
Q2: SSH keygen generates the secret key and the public key file. The private key is stored in the private key file: .ssh/id_rsa  &amp;lt;br&amp;gt;&lt;br /&gt;
Q4: Both lines because first you start from 1 and then increment from there. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21363</id>
		<title>Operating Systems 2017F Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21363"/>
		<updated>2017-12-07T18:09:01Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Solutions for midterm exam are on the course webpage &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21362</id>
		<title>Operating Systems 2017F Lecture 23</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_23&amp;diff=21362"/>
		<updated>2017-12-07T18:07:25Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: Created page with &amp;quot; == Additional Notes ==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21322</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21322"/>
		<updated>2017-11-28T19:20:08Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; If you look as lsmod | less you see a ton of modules. Some of the modules are not necessary to mount the root filesystem.&amp;lt;br&amp;gt;&lt;br /&gt;
ls /lib/modules there are directories that store the kernel modules &amp;lt;br&amp;gt;&lt;br /&gt;
You have to have a filesystem that you mount initially that has a bunch of modules in it. Thus, there is an initial root file system that is necessary to load everything else &amp;lt;br&amp;gt;&lt;br /&gt;
This is the initial RAM disk. This filesystem loads the modules needed for the real filesystem. &amp;lt;br&amp;gt;&lt;br /&gt;
To remove a file I need to remove the hardlink from the directory where the hardlink exists &amp;lt;br&amp;gt;&lt;br /&gt;
The password files maps usernames to user id&#039;s (Linux does not care about your username) &amp;lt;br&amp;gt;&lt;br /&gt;
Normal file access permission check br&amp;gt;&lt;br /&gt;
- compare uid, gid of file with uid, gid of process &amp;lt;br&amp;gt;&lt;br /&gt;
But really: &amp;lt;br&amp;gt;&lt;br /&gt;
- compares it with fsuid, fsgid of process &amp;lt;br&amp;gt;&lt;br /&gt;
- which is normally same as euid, egid of process &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21321</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21321"/>
		<updated>2017-11-28T19:17:55Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; If you look as lsmod | less you see a ton of modules. Some of the modules are not necessary to mount the root filesystem.&amp;lt;br&amp;gt;&lt;br /&gt;
ls /lib/modules there are directories that store the kernel modules &amp;lt;br&amp;gt;&lt;br /&gt;
You have to have a filesystem that you mount initially that has a bunch of modules in it. Thus, there is an initial root file system that is necessary to load everything else &amp;lt;br&amp;gt;&lt;br /&gt;
This is the initial RAM disk. This filesystem loads the modules needed for the real filesystem. &amp;lt;br&amp;gt;&lt;br /&gt;
To remove a file I need to remove the hardlink from the directory where the hardlink exists &amp;lt;br&amp;gt;&lt;br /&gt;
The password files maps usernames to user id&#039;s (Linux does nto care about your username) &amp;lt;br&amp;gt;&lt;br /&gt;
Normal file access permission check br&amp;gt;&lt;br /&gt;
- compare uid, gid of file with uid, gid of process &amp;lt;br&amp;gt;&lt;br /&gt;
But really: &amp;lt;br&amp;gt;&lt;br /&gt;
- compares it with fsuid, fsgid of process &amp;lt;br&amp;gt;&lt;br /&gt;
- which is normally same as euid, egid of process &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21320</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21320"/>
		<updated>2017-11-28T19:16:02Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Insert non-formatted text here&amp;lt;/nowiki&amp;gt;== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; If you look as lsmod | less you see a ton of modules. Some of the modules are not necessary to mount the root filesystem.&amp;lt;br&amp;gt;&lt;br /&gt;
ls /lib/modules there are directories that store the kernel modules &amp;lt;br&amp;gt;&lt;br /&gt;
You have to have a filesystem that you mount initially that has a bunch of modules in it. Thus, there is an initial root file system that is necessary to load everything else &amp;lt;br&amp;gt;&lt;br /&gt;
This is the initial RAM disk. This filesystem loads the modules needed for the real filesystem. &amp;lt;br&amp;gt;&lt;br /&gt;
To remove a file I need to remove the hardlink from the directory where the hardlink exists &amp;lt;br&amp;gt;&lt;br /&gt;
The password files maps usernames to user id&#039;s (Linux does nto care about your username) &amp;lt;br&amp;gt;&lt;br /&gt;
Normal file access permission check br&amp;gt;&lt;br /&gt;
- compare uid, gid of file with uid, gid of process &amp;lt;br&amp;gt;&lt;br /&gt;
But really: &amp;lt;br&amp;gt;&lt;br /&gt;
- compares it with fsuid, fsgid of process &amp;lt;br&amp;gt;&lt;br /&gt;
- which is normally same as euid, egid of process &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21319</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21319"/>
		<updated>2017-11-28T19:14:22Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Insert non-formatted text here&amp;lt;/nowiki&amp;gt;== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; If you look as lsmod | less you see a ton of modules. Some of the modules are not necessary to mount the root filesystem.&amp;lt;br&amp;gt;&lt;br /&gt;
ls /lib/modules there are directories that store the kernel modules &amp;lt;br&amp;gt;&lt;br /&gt;
You have to have a filesystem that you mount initially that has a bunch of modules in it. Thus, there is an initial root file system that is necessary to load everything else &amp;lt;br&amp;gt;&lt;br /&gt;
This is the initial RAM disk. This filesystem loads the modules needed for the real filesystem. &amp;lt;br&amp;gt;&lt;br /&gt;
To remove a file I need to remove the hardlink from the directory where the hardlink exists &amp;lt;br&amp;gt;&lt;br /&gt;
The password files maps usernames to user id&#039;s (Linux does nto care about your username) &amp;lt;br&amp;gt;&lt;br /&gt;
Normal file access permission check br&amp;gt;&lt;br /&gt;
- compare uid, gid of file with uid, gid of process &amp;lt;br&amp;gt;&lt;br /&gt;
But really &amp;lt;br&amp;gt;&lt;br /&gt;
- comapres it with fsuid, fs&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21318</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21318"/>
		<updated>2017-11-28T19:05:32Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Insert non-formatted text here&amp;lt;/nowiki&amp;gt;== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
Prof Notes:&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
End of prof notes &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; If you look as lsmod | less you see a ton of modules. Some of the modules are not necessary to mount the root filesystem.&amp;lt;br&amp;gt;&lt;br /&gt;
ls /lib/modules there are directories that store the kernel modules &amp;lt;br&amp;gt;&lt;br /&gt;
You have to have a filesystem that you mount initially that has a bunch of modules in it. Thus, there is an initial root file system that is necessary to load everything else &amp;lt;br&amp;gt;&lt;br /&gt;
This is the initial RAM disk. This filesystem loads the modules needed for the real filesystem. &amp;lt;br&amp;gt;&lt;br /&gt;
To remove a file I need to remove the hardlink from the directory where the hardlink exists &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21317</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21317"/>
		<updated>2017-11-28T18:56:07Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Insert non-formatted text here&amp;lt;/nowiki&amp;gt;== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
Prof Notes:&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
End of prof notes &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; If you look as lsmod | less you see a ton of modules. Some of the modules are not necessary to mount the root filesystem.&amp;lt;br&amp;gt;&lt;br /&gt;
ls /lib/modules there are directories that store the kernel modules &amp;lt;br&amp;gt;&lt;br /&gt;
You have to have a filesystem that you mount initially that has a bunch of modules in it. Thus, there is an initial root file system that is necessary to load everything else &amp;lt;br&amp;gt;&lt;br /&gt;
This is the initial RAM disk. This filesystem loads the modules needed for the real filesystem. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21316</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21316"/>
		<updated>2017-11-28T18:51:30Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Insert non-formatted text here&amp;lt;/nowiki&amp;gt;== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
Prof Notes:&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
End of prof notes &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; If you look as lsmod | less you see a ton of modules. Some of the modules are not necessary to mount the root filesystem.&amp;lt;br&amp;gt;&lt;br /&gt;
ls /lib/modules there are directories that store the kernel modules &amp;lt;br&amp;gt;&lt;br /&gt;
You have to have a filesystem that you mount initially that has a bunch of modules in it. Thus, there is an initial root file system that is necessary to load everything else &amp;lt;br&amp;gt;&lt;br /&gt;
This is the initial RAM disk. This filesystem loads the modules needed for the real filesystem.&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21315</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21315"/>
		<updated>2017-11-28T18:49:19Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Insert non-formatted text here&amp;lt;/nowiki&amp;gt;== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
Prof Notes:&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
End of prof notes &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; If you look as lsmod | less you see a ton of modules. Some of the modules are not necessary to mount the root filesystem.&amp;lt;br&amp;gt;&lt;br /&gt;
ls /lib/modules there are directories that store the kernel modules &amp;lt;br&amp;gt;&lt;br /&gt;
You have to have a filesystem that you mount initially that has a bunch of modules in it. Thus, there is an initial root file system that is necessary to load everything else &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21314</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21314"/>
		<updated>2017-11-28T18:46:38Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
Prof Notes:&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
End of prof notes &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; If you look as lsmod | less you see a ton of modules. Some of the modules are not necessary to mount the root filesystem.&amp;lt;br&amp;gt;&lt;br /&gt;
ls /lib/modules there are directories that store the kernel modules &amp;lt;br&amp;gt;&lt;br /&gt;
You have to have a filesystem that you mount initially that has a bunch of modules in it. Thus, there is an initial root file system that is necessary to load everything else &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21313</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21313"/>
		<updated>2017-11-28T18:39:12Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
Prof Notes:&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
End of prof notes &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21312</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21312"/>
		<updated>2017-11-28T18:38:43Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
Prof Notes[&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;br /&gt;
]&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21311</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21311"/>
		<updated>2017-11-28T18:34:33Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents (via vfs abstraction) &amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE calls the sshfs process that mounted the filesystem&amp;lt;br&amp;gt;&lt;br /&gt;
* sshfs process sends request to remote system &amp;lt;br&amp;gt;&lt;br /&gt;
- via socket system calls&amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives request (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process receives requests (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
- makes open, getdents sytem calls &amp;lt;br&amp;gt;&lt;br /&gt;
- rmeote kernel checks vfs, calls ext4 routines to access data &amp;lt;br&amp;gt;&lt;br /&gt;
* remote sshd process responds to requests  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process receives response  (via system calls) &amp;lt;br&amp;gt;&lt;br /&gt;
* local sshfs process responds to FUSE request  (via system calls)&amp;lt;br&amp;gt;&lt;br /&gt;
* FUSE passes data back to vfs layer, then back to requesting process &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21310</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21310"/>
		<updated>2017-11-28T18:23:09Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;br /&gt;
When we run &amp;quot;ls&amp;quot; on an ssh-mounted filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* ls makes system calls (open, getdents) to the local Linux kernel &amp;lt;br&amp;gt;&lt;br /&gt;
* the local kernel sees the filesystem is FUSE, calls DUSE routines for open, getdents &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21309</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21309"/>
		<updated>2017-11-28T18:20:41Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
When you run strace on ls on the two terminals (ssh connection and the local one) you see similar output &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21308</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21308"/>
		<updated>2017-11-28T18:19:15Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;br /&gt;
Inodes come from filesystem you are acessing &amp;lt;br&amp;gt;&lt;br /&gt;
He used df to find filesystem info &amp;lt;br&amp;gt;&lt;br /&gt;
The used Commands: mount | grep ubuntu and mount | grep vda1 to find type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
In the SSH there is the filesystem type &amp;quot;fuse.sshfs&amp;quot; &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21307</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21307"/>
		<updated>2017-11-28T18:14:30Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Assignment 4 will be autograded and in fill in the blank form. This will not be like the final exam. &amp;lt;br&amp;gt;&lt;br /&gt;
You should think about who is doing what?  Otherwise FUSE won&#039;t make much sense &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Inode numbers completely changed when you use ssh. It starts with 1 from &amp;quot;.&amp;quot; (root) and increments from there. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21306</id>
		<title>Operating Systems 2017F Lecture 20</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_20&amp;diff=21306"/>
		<updated>2017-11-28T18:07:47Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: Created page with &amp;quot; == Additional Notes == What&amp;#039;s Left?&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
What&#039;s Left?&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21265</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21265"/>
		<updated>2017-11-16T19:10:46Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol. Format for usenet was every message stored in individual file. You will have lots of files! &amp;lt;br&amp;gt;&lt;br /&gt;
So we have: &amp;lt;br&amp;gt;&lt;br /&gt;
* superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* inode blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for directories &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for files &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you recover from damage?&amp;lt;br&amp;gt;&lt;br /&gt;
* filesystems never &amp;quot;reboot&amp;quot;, must remain correct over the course of years &amp;lt;br&amp;gt;&lt;br /&gt;
* Errors will happen: bitrot, accidental corruption, computer failiure/memory corruption/hard reboot &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To make filesystems fast, data and meta-data is cached in RAM &amp;lt;br&amp;gt;&lt;br /&gt;
* Bad things happen if this data hasn&#039;t been writen to disk and you reboot &amp;lt;br&amp;gt;&lt;br /&gt;
* Even worse things happen if your RAM is bad and corrupts the data &amp;lt;br&amp;gt; &lt;br /&gt;
* FSCK is like scandisk in Windows 98 &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Also bad...what if you lose the superblock?&amp;lt;br&amp;gt;&lt;br /&gt;
* You could lose EVERYTHING &amp;lt;br&amp;gt;&lt;br /&gt;
* node trunc dd command blew away first bytes of the file system so you could not mount it because you corrupted the superblock. However, fsck fixed this because we have backup superblocks :D &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Old scandisk/fsck was slow because we they had to scan all filesystem metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* Not to recover data, but to fix metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* lost+found might have some files that you might recover. It is a part of the filesystem for fsck to use. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Nowadays fsck is very fast and we rarely lose data due to losing power &amp;lt;br&amp;gt;&lt;br /&gt;
* What this means is we must be writing to disk all the time &amp;lt;br&amp;gt;&lt;br /&gt;
* But isn&#039;t writing slow? All writes aren&#039;t slow particularly on conventional hard disks. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
On Magnetic Hard Disks (not SSD&#039;s) &amp;lt;br&amp;gt;&lt;br /&gt;
* sequential oeprations are fast &amp;lt;br&amp;gt;&lt;br /&gt;
* random access is slow &amp;lt;br&amp;gt;&lt;br /&gt;
** we have to move the read/write head &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
So, on modern systems we update metadata (and sometimes data) by writing sequentially to disk...and then later writing randomly &amp;lt;br&amp;gt;&lt;br /&gt;
* Sequential writes go to the journal &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
On fsck on a journaled filesystem&lt;br /&gt;
* just check the journal for pending operations (replaying the journal) &amp;lt;br&amp;gt; &lt;br /&gt;
There exists filesytems for optimizing writes that are pure journal&amp;lt;br&amp;gt;&lt;br /&gt;
* log-based filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Logs and journal inherently create multiple copies of data and metadata that are hard to track. This makes deletion nearly impossible (at least to guarantee) &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Only way to garauntee...encrypt everything &amp;lt;br&amp;gt;&lt;br /&gt;
* if every file has its own key, you can delete the key and this &amp;quot;delete&amp;quot; the data &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
SSD&#039;s use log-structured sotrage at a level below blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* Writes are coarse-grained (you have to write a lot at once) &amp;lt;br&amp;gt;&lt;br /&gt;
* You don&#039;t want to write to the same cells too often, they will die &amp;lt;br&amp;gt; &lt;br /&gt;
** You have to do &amp;quot;wear-leveling&amp;quot; &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21264</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21264"/>
		<updated>2017-11-16T19:02:47Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol. Format for usenet was every message stored in individual file. You will have lots of files! &amp;lt;br&amp;gt;&lt;br /&gt;
So we have: &amp;lt;br&amp;gt;&lt;br /&gt;
* superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* inode blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for directories &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for files &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you recover from damage?&amp;lt;br&amp;gt;&lt;br /&gt;
* filesystems never &amp;quot;reboot&amp;quot;, must remain correct over the course of years &amp;lt;br&amp;gt;&lt;br /&gt;
* Errors will happen: bitrot, accidental corruption, computer failiure/memory corruption/hard reboot &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To make filesystems fast, data and meta-data is cached in RAM &amp;lt;br&amp;gt;&lt;br /&gt;
* Bad things happen if this data hasn&#039;t been writen to disk and you reboot &amp;lt;br&amp;gt;&lt;br /&gt;
* Even worse things happen if your RAM is bad and corrupts the data &amp;lt;br&amp;gt; &lt;br /&gt;
* FSCK is like scandisk in Windows 98 &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Also bad...what if you lose the superblock?&amp;lt;br&amp;gt;&lt;br /&gt;
* You could lose EVERYTHING &amp;lt;br&amp;gt;&lt;br /&gt;
* node trunc dd command blew away first bytes of the file system so you could not mount it because you corrupted the superblock. However, fsck fixed this because we have backup superblocks :D &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Old scandisk/fsck was slow because we they had to scan all filesystem metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* Not to recover data, but to fix metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* lost+found might have some files that you might recover. It is a part of the filesystem for fsck to use. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Nowadays fsck is very fast and we rarely lose data due to losing power &amp;lt;br&amp;gt;&lt;br /&gt;
* What this means is we must be writing to disk all the time &amp;lt;br&amp;gt;&lt;br /&gt;
* But isn&#039;t writing slow? All writes aren&#039;t slow particularly on conventional hard disks. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
On Magnetic Hard Disks (not SSD&#039;s) &amp;lt;br&amp;gt;&lt;br /&gt;
* sequential oeprations are fast &amp;lt;br&amp;gt;&lt;br /&gt;
* random access is slow &amp;lt;br&amp;gt;&lt;br /&gt;
** we have to move the read/write head &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
So, on modern systems we update metadata (and sometimes data) by writing sequentially to disk...and then later writing randomly &amp;lt;br&amp;gt;&lt;br /&gt;
* Sequential writes go to the journal &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
On fsck on a journaled filesystem&lt;br /&gt;
* just check the journal for pending operations (replaying the journal) &amp;lt;br&amp;gt; &lt;br /&gt;
There exists filesytems for optimizing writes that are pure journal&amp;lt;br&amp;gt;&lt;br /&gt;
* log-based filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Logs and journal inherently create multiple copies of data and metadata that are hard to track. This makes deletion nearly impossible (at least to garauntee) &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Only way to garauntee...encrypt everything &amp;lt;br&amp;gt;&lt;br /&gt;
* if every file has its own key, you can delete the key and this &amp;quot;delete&amp;quot; the data &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21263</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21263"/>
		<updated>2017-11-16T18:55:38Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol. Format for usenet was every message stored in individual file. You will have lots of files! &amp;lt;br&amp;gt;&lt;br /&gt;
So we have: &amp;lt;br&amp;gt;&lt;br /&gt;
* superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* inode blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for directories &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for files &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you recover from damage?&amp;lt;br&amp;gt;&lt;br /&gt;
* filesystems never &amp;quot;reboot&amp;quot;, must remain correct over the course of years &amp;lt;br&amp;gt;&lt;br /&gt;
* Errors will happen: bitrot, accidental corruption, computer failiure/memory corruption/hard reboot &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To make filesystems fast, data and meta-data is cached in RAM &amp;lt;br&amp;gt;&lt;br /&gt;
* Bad things happen if this data hasn&#039;t been writen to disk and you reboot &amp;lt;br&amp;gt;&lt;br /&gt;
* Even worse things happen if your RAM is bad and corrupts the data &amp;lt;br&amp;gt; &lt;br /&gt;
* FSCK is like scandisk in Windows 98 &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Also bad...what if you lose the superblock?&amp;lt;br&amp;gt;&lt;br /&gt;
* You could lose EVERYTHING &amp;lt;br&amp;gt;&lt;br /&gt;
* node trunc dd command blew away first bytes of the file system so you could not mount it because you corrupted the superblock. However, fsck fixed this because we have backup superblocks :D &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Old scandisk/fsck was slow because we they had to scan all filesystem metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* Not to recover data, but to fix metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* lost+found might have some files that you might recover. It is a part of the filesystem for fsck to use. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Nowadays fsck is very fast and we rarely lose data due to losing power &amp;lt;br&amp;gt;&lt;br /&gt;
* What this means is we must be writing to disk all the time &amp;lt;br&amp;gt;&lt;br /&gt;
* But isn&#039;t writing slow? All writes aren&#039;t slow particularly on conventional hard disks. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
On Magnetic Hard Disks (not SSD&#039;s) &amp;lt;br&amp;gt;&lt;br /&gt;
* sequential oeprations are fast &amp;lt;br&amp;gt;&lt;br /&gt;
* random access is slow &amp;lt;br&amp;gt;&lt;br /&gt;
** we have to move the read/write head &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
So, on modern systems we update metadata (and sometimes data) by writing sequentially to disk...and then later writing randomly &amp;lt;br&amp;gt;&lt;br /&gt;
* Sequential writes go to the journal &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21262</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21262"/>
		<updated>2017-11-16T18:53:16Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol. Format for usenet was every message stored in individual file. You will have lots of files! &amp;lt;br&amp;gt;&lt;br /&gt;
So we have: &amp;lt;br&amp;gt;&lt;br /&gt;
* superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* inode blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for directories &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for files &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you recover from damage?&amp;lt;br&amp;gt;&lt;br /&gt;
* filesystems never &amp;quot;reboot&amp;quot;, must remain correct over the course of years &amp;lt;br&amp;gt;&lt;br /&gt;
* Errors will happen: bitrot, accidental corruption, computer failiure/memory corruption/hard reboot &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To make filesystems fast, data and meta-data is cached in RAM &amp;lt;br&amp;gt;&lt;br /&gt;
* Bad things happen if this data hasn&#039;t been writen to disk and you reboot &amp;lt;br&amp;gt;&lt;br /&gt;
* Even worse things happen if your RAM is bad and corrupts the data &amp;lt;br&amp;gt; &lt;br /&gt;
* FSCK is like scandisk in Windows 98 &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Also bad...what if you lose the superblock?&amp;lt;br&amp;gt;&lt;br /&gt;
* You could lose EVERYTHING &amp;lt;br&amp;gt;&lt;br /&gt;
* node trunc dd command blew away first bytes of the file system so you could not mount it because you corrupted the superblock. However, fsck fixed this because we have backup superblocks :D &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Old scandisk/fsck was slow because we they had to scan all filesystem metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* Not to recover data, but to fix metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* lost+found might have some files that you might recover. It is a part of the filesystem for fsck to use. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Nowadays fsck is very fast and we rarely lose data due to losing power &amp;lt;br&amp;gt;&lt;br /&gt;
* What this means is we must be writing to disk all the time &amp;lt;br&amp;gt;&lt;br /&gt;
* But isn&#039;t writing slow? All writes aren&#039;t slow particularly on conventional hard disks. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
On Magnetic Hard Disks (not SSD&#039;s) &amp;lt;br&amp;gt;&lt;br /&gt;
* sequential oeprations are fast &amp;lt;br&amp;gt;&lt;br /&gt;
* random access is slow &amp;lt;br&amp;gt;&lt;br /&gt;
** we have to move the read/write head &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21261</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21261"/>
		<updated>2017-11-16T18:47:55Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol. Format for usenet was every message stored in individual file. You will have lots of files! &amp;lt;br&amp;gt;&lt;br /&gt;
So we have: &amp;lt;br&amp;gt;&lt;br /&gt;
* superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* inode blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for directories &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for files &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you recover from damage?&amp;lt;br&amp;gt;&lt;br /&gt;
* filesystems never &amp;quot;reboot&amp;quot;, must remain correct over the course of years &amp;lt;br&amp;gt;&lt;br /&gt;
* Errors will happen: bitrot, accidental corruption, computer failiure/memory corruption/hard reboot &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To make filesystems fast, data and meta-data is cached in RAM &amp;lt;br&amp;gt;&lt;br /&gt;
* Bad things happen if this data hasn&#039;t been writen to disk and you reboot &amp;lt;br&amp;gt;&lt;br /&gt;
* Even worse things happen if your RAM is bad and corrupts the data &amp;lt;br&amp;gt; &lt;br /&gt;
* FSCK is like scandisk in Windows 98 &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Also bad...what if you lose the superblock?&amp;lt;br&amp;gt;&lt;br /&gt;
* You could lose EVERYTHING &amp;lt;br&amp;gt;&lt;br /&gt;
* node trunc dd command blew away first bytes of the file system so you could not mount it because you corrupted the superblock. However, fsck fixed this because we have backup superblocks :D &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Old scandisk/fsck was slow because we they had to scan all filesystem metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* Not to recover data, but to fix metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* lost+found might have some files that you might recover. It is a part of the filesystem for fsck to use.&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21260</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21260"/>
		<updated>2017-11-16T18:44:32Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol. Format for usenet was every message stored in individual file. You will have lots of files! &amp;lt;br&amp;gt;&lt;br /&gt;
So we have: &amp;lt;br&amp;gt;&lt;br /&gt;
* superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* inode blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for directories &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for files &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you recover from damage?&amp;lt;br&amp;gt;&lt;br /&gt;
* filesystems never &amp;quot;reboot&amp;quot;, must remain correct over the course of years &amp;lt;br&amp;gt;&lt;br /&gt;
* Errors will happen: bitrot, accidental corruption, computer failiure/memory corruption/hard reboot &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To make filesystems fast, data and meta-data is cached in RAM &amp;lt;br&amp;gt;&lt;br /&gt;
* Bad things happen if this data hasn&#039;t been writen to disk and you reboot &amp;lt;br&amp;gt;&lt;br /&gt;
* Even worse things happen if your RAM is bad and corrupts the data &amp;lt;br&amp;gt; &lt;br /&gt;
* FSCK is like scandisk in Windows 98 &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Also bad...what if you lose the superblock?&amp;lt;br&amp;gt;&lt;br /&gt;
* You could lose EVERYTHING &amp;lt;br&amp;gt;&lt;br /&gt;
* node trunc dd command blew away first bytes of the file system so you could not mount it because you corrupted the superblock. However, fsck fixed this because we have backup superblocks :D &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Old scandisk/fsck was slow because we they had to scan all filesystem metadata &amp;lt;br&amp;gt;&lt;br /&gt;
* Not to recover data, but to fix metadata &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21259</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21259"/>
		<updated>2017-11-16T18:43:13Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol. Format for usenet was every message stored in individual file. You will have lots of files! &amp;lt;br&amp;gt;&lt;br /&gt;
So we have: &amp;lt;br&amp;gt;&lt;br /&gt;
* superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* inode blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for directories &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for files &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you recover from damage?&amp;lt;br&amp;gt;&lt;br /&gt;
* filesystems never &amp;quot;reboot&amp;quot;, must remain correct over the course of years &amp;lt;br&amp;gt;&lt;br /&gt;
* Errors will happen: bitrot, accidental corruption, computer failiure/memory corruption/hard reboot &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To make filesystems fast, data and meta-data is cached in RAM &amp;lt;br&amp;gt;&lt;br /&gt;
* Bad things happen if this data hasn&#039;t been writen to disk and you reboot &amp;lt;br&amp;gt;&lt;br /&gt;
* Even worse things happen if your RAM is bad and corrupts the data &amp;lt;br&amp;gt; &lt;br /&gt;
* FSCK is like scandisk in Windows 98 &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Also bad...what if you lose the superblock?&amp;lt;br&amp;gt;&lt;br /&gt;
* You could lose EVERYTHING &amp;lt;br&amp;gt;&lt;br /&gt;
* node trunc dd command blew away first bytes of the file system so you could not mount it because you corrupted the superblock. However, fsck fixed this because we have backup superblocks :D&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21258</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21258"/>
		<updated>2017-11-16T18:40:00Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol. Format for usenet was every message stored in individual file. You will have lots of files! &amp;lt;br&amp;gt;&lt;br /&gt;
So we have: &amp;lt;br&amp;gt;&lt;br /&gt;
* superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* inode blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for directories &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for files &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you recover from damage?&amp;lt;br&amp;gt;&lt;br /&gt;
* filesystems never &amp;quot;reboot&amp;quot;, must remain correct over the course of years &amp;lt;br&amp;gt;&lt;br /&gt;
* Errors will happen: bitrot, accidental corruption, computer failiure/memory corruption/hard reboot &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To make filesystems fast, data and meta-data is cached in RAM &amp;lt;br&amp;gt;&lt;br /&gt;
* Bad things happen if this data hasn&#039;t been writen to disk and you reboot &amp;lt;br&amp;gt;&lt;br /&gt;
* Even worse things happen if your RAM is bad and corrupts the data &amp;lt;br&amp;gt; &lt;br /&gt;
* FSCK is like scandisk in Windows 98 &lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21257</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21257"/>
		<updated>2017-11-16T18:36:42Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol. Format for usenet was every message stored in individual file. You will have lots of files! &amp;lt;br&amp;gt;&lt;br /&gt;
So we have: &amp;lt;br&amp;gt;&lt;br /&gt;
* superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* inode blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for directories &amp;lt;br&amp;gt;&lt;br /&gt;
** data blocks for files &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you recover from damage?&amp;lt;br&amp;gt;&lt;br /&gt;
* filesystems never &amp;quot;reboot&amp;quot;, must remain correct over the course of years &amp;lt;br&amp;gt;&lt;br /&gt;
* Errors will happen: bitrot, accidental corruption&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21256</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21256"/>
		<updated>2017-11-16T18:32:40Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;br /&gt;
Usenet is a worldwide distribute discussion system that is deprecated now because it could not handle the spam people uploaded into it, lol.&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21255</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21255"/>
		<updated>2017-11-16T18:28:44Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
** file command to know file type &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
POSIX is a standard for UNIX &amp;lt;br&amp;gt;&lt;br /&gt;
For POSIX filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* File metadata is stored in INODES&amp;lt;br&amp;gt;&lt;br /&gt;
* most have pre-reserved inodes &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21254</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21254"/>
		<updated>2017-11-16T18:25:13Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
** What filesystem magic number is there &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21253</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21253"/>
		<updated>2017-11-16T18:24:31Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks, you need someway to find the blocks&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;br /&gt;
He opened a .jpg as a binary file to show us the magic number in a file, first several bytes identify type of file. Kernel does not care about file extension. Userspace programs may care about the extension.&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21251</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21251"/>
		<updated>2017-11-16T18:16:26Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do you organize metadata?&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First identify basic characteristics of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You need a &amp;quot;superblock&amp;quot; which is a &amp;quot;summary&amp;quot; block that tells you about everything else&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally the superblock is the first block of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In the superblock &amp;lt;br&amp;gt;&lt;br /&gt;
* Type of filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* Size of the filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* How the filesystem is organized &amp;lt;br&amp;gt;&lt;br /&gt;
* Where can I find the rest of the metadata &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21250</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21250"/>
		<updated>2017-11-16T18:12:36Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A filesystem is a: &amp;lt;br&amp;gt;&lt;br /&gt;
* Persistent data structure &amp;lt;br&amp;gt;&lt;br /&gt;
* Stored in fixed size blocks (at least 512 bytes in size) &amp;lt;br&amp;gt;&lt;br /&gt;
* Maps hierarchical filenames to file contents &amp;lt;br&amp;gt;&lt;br /&gt;
* Has metadata about files somehow &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What&#039;s in a filesystem &amp;lt;br&amp;gt;&lt;br /&gt;
* data blocks &amp;lt;br&amp;gt;&lt;br /&gt;
* metadata blocks &amp;lt;br&amp;gt;&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21249</id>
		<title>Operating Systems 2017F Lecture 18</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_18&amp;diff=21249"/>
		<updated>2017-11-16T18:10:21Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: Created page with &amp;quot; == Additional Notes == Lec 18 &amp;lt;br&amp;gt; * More on filesystems &amp;lt;br&amp;gt; * How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
Lec 18 &amp;lt;br&amp;gt;&lt;br /&gt;
* More on filesystems &amp;lt;br&amp;gt;&lt;br /&gt;
* How can you recover a fs and how do you delete a file? &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21236</id>
		<title>Operating Systems 2017F Lecture 17</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21236"/>
		<updated>2017-11-15T03:19:14Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
The video from the lecture given on Nov. 14, 2017 [http://homeostasis.scs.carleton.ca/~soma/os-2017f/lectures/comp3000-2017f-lec17-14Nov2017.mp4 is now available].&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
===In Class===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 17&lt;br /&gt;
----------&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking?&lt;br /&gt;
&lt;br /&gt;
* Be humble&lt;br /&gt;
  - you don&#039;t know how everything works, and nobody else does&lt;br /&gt;
&lt;br /&gt;
* Verify your assumptions as you go&lt;br /&gt;
  - perform lots of experiments&lt;br /&gt;
  - incremental development, compile and run very often&lt;br /&gt;
&lt;br /&gt;
* Check for errors ALWAYS&lt;br /&gt;
  - will save you from later errors&lt;br /&gt;
  - kernel has to &amp;quot;live cleanly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Find another part of the kernel that is close to what you want to do.&lt;br /&gt;
  Read that code, use their approach where possible&lt;br /&gt;
  - You don&#039;t understand all the abstractions and assumptions, so&lt;br /&gt;
    &amp;quot;pattern match&amp;quot; to minimize trouble&lt;br /&gt;
  - Realize that the assumptions behind code you find don&#039;t necessarily match&lt;br /&gt;
    your own.&lt;br /&gt;
&lt;br /&gt;
* Understand the &amp;quot;flow of control&amp;quot; inside the program&lt;br /&gt;
  - architecture&lt;br /&gt;
  - division of responsibilites&lt;br /&gt;
  - purpose of data structures/objects&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scheduling&lt;br /&gt;
----------&lt;br /&gt;
How does the kernel maintain control?&lt;br /&gt;
 - CPU is given entirely to userspace processes to run most of the time&lt;br /&gt;
&lt;br /&gt;
Kernel needs to run when it needs to run&lt;br /&gt;
 - and no process should be able to stop it&lt;br /&gt;
&lt;br /&gt;
*The interrupt table*&lt;br /&gt;
 - pointers to code that the CPU runs when it receives different hardware&lt;br /&gt;
   or software interrupts&lt;br /&gt;
 - since the kernel runs first, it gets to set the interrupt table&lt;br /&gt;
 - only supervisor code can change the table, not user code&lt;br /&gt;
&lt;br /&gt;
So when the ethernet card receives data...&lt;br /&gt;
...the ethernet card sends an interrupt to the kernel&lt;br /&gt;
...the CPU calls the kernel code for handling ethernet data&lt;br /&gt;
&lt;br /&gt;
When the clock generates a timer interrupt...&lt;br /&gt;
...the CPU calls the kernel code for handling timer interrupts&lt;br /&gt;
&lt;br /&gt;
In order to process an interrupt, an CPU core has to be taken over&lt;br /&gt;
 - that core was probably running a userspace process&lt;br /&gt;
&lt;br /&gt;
Scheduling is all about what to do after having kicked a userspace process&lt;br /&gt;
off of a core&lt;br /&gt;
&lt;br /&gt;
Normally on a core&lt;br /&gt;
* userspace process is running&lt;br /&gt;
* interrupt happens&lt;br /&gt;
* core swiches to supervisor mode, runs kernel code&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run&lt;br /&gt;
* goto top :-)&lt;br /&gt;
&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&lt;br /&gt;
&lt;br /&gt;
Entry and exit to the kernel has to do low-level tasks like changing CPU modes,&lt;br /&gt;
manage CPU registers&lt;br /&gt;
 - must be written in assembly&lt;br /&gt;
&lt;br /&gt;
Most OS kernels minimize this low-level code&lt;br /&gt;
&lt;br /&gt;
What criteria should the scheduler use in deciding what to run?&lt;br /&gt;
 - &amp;quot;fairness&amp;quot;&lt;br /&gt;
   - prevent starvation&lt;br /&gt;
   - absent other conditions, equal allocation of resources&lt;br /&gt;
 - bias resources towards &amp;quot;foreground&amp;quot; tasks in interactive systems&lt;br /&gt;
   - never biased enough&lt;br /&gt;
   - always hacks, heuristics&lt;br /&gt;
&lt;br /&gt;
Memory overcommitment&lt;br /&gt;
 - it is possible to allocate way more memory than can be ever used&lt;br /&gt;
 - goes into &amp;quot;memory debt&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Midterm Review===&lt;br /&gt;
1. Execve and no it does not create a new process&lt;br /&gt;
&lt;br /&gt;
2. Dynamically linked programs map in dynamically linked libraries&lt;br /&gt;
&lt;br /&gt;
3. Hard links maps filenames to inodes&lt;br /&gt;
&lt;br /&gt;
4. Sleep until the consumer wakes it&lt;br /&gt;
&lt;br /&gt;
5. Using type conversion, read returns number of bytes written. We must convert back to the number of unsigned long, minus one because maximum index of array is one less&lt;br /&gt;
&lt;br /&gt;
6. uses of signals:&lt;br /&gt;
* kill process&lt;br /&gt;
* find out when child process is terminated&lt;br /&gt;
* start/stop a process&lt;br /&gt;
* detect when a program has made a ptr error&lt;br /&gt;
&lt;br /&gt;
7. Pointers in C contain virtual memory addresses because the memory of a process is a virtual address space. Each process thinks it has its own stretch of memory.&lt;br /&gt;
&lt;br /&gt;
8. processes make a sys call to allocate memory. execve -&amp;gt; then mmap and/or sbreak to allocate memory&lt;br /&gt;
&lt;br /&gt;
9. shell opens the file output.txt.&lt;br /&gt;
&lt;br /&gt;
10. mmap contents of file can allocate the contents of it into ram.&lt;br /&gt;
* comparing 1 mb of both files at a time will be less expensive&lt;br /&gt;
* only makes sense to mmap if you will access files multiple times&lt;br /&gt;
&lt;br /&gt;
11. producer and consumer now have no way of talking to each other because they do not share the same memory.&lt;br /&gt;
&lt;br /&gt;
12. no. there is a race condition. while loop loops while sem &amp;lt; 0.&lt;br /&gt;
someone else could access and modify the variable between the while and the sem--;.&lt;br /&gt;
* you need special instructions to test and set the variable at the same time.&lt;br /&gt;
* also, int sem parameter isn&#039;t a ptr so it&#039;s a local variable.&lt;br /&gt;
&lt;br /&gt;
===Additional Notes===&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking? Some tips for low level kernel code:&lt;br /&gt;
Be humble; You cannot know how everything works&amp;lt;br&amp;gt;&lt;br /&gt;
Verify your assumptions as you go&amp;lt;br&amp;gt;&lt;br /&gt;
Perform lots of experiments&amp;lt;br&amp;gt;&lt;br /&gt;
Incremental Development, compile and run often&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Check for errors ALWAYS or they will cascade and hurt you later&amp;lt;br&amp;gt;&lt;br /&gt;
*This will save you from later errors&amp;lt;br&amp;gt;&lt;br /&gt;
*Kernel has to live cleanly&amp;lt;br&amp;gt;&lt;br /&gt;
*This principle applies to any large scale coding&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Find another part of the kernel that is close to what you want to do (Search online! This is a good link: http://elixir.free-electrons.com/linux/v4.4.83/source &amp;lt;br&amp;gt;&lt;br /&gt;
You do not understand all abstractions and assumptions, so &amp;quot;pattern match&amp;quot; to minimize trouble &amp;lt;br&amp;gt;&lt;br /&gt;
*Functionality that you want to implement might already exist in the kernel, look at how they do things and follow the pattern.&amp;lt;br&amp;gt;&lt;br /&gt;
*Refine understanding as you go, the other implementation might be for something else. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Realize that the assumptions behind code you don&#039;t necessarily match to your own. Spend the time reading other people&#039;s code. &amp;lt;br&amp;gt;&lt;br /&gt;
Understand the &amp;quot;flow of control&amp;quot; inside the program&amp;lt;br&amp;gt;&lt;br /&gt;
*Architecture&amp;lt;br&amp;gt;&lt;br /&gt;
*Division of responsibilities&amp;lt;br&amp;gt;&lt;br /&gt;
*Purpose of data structures/objects&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the tutorial 6 he gave us a link for a reason. If you click on it you can search getpid and then dig deeper! For example cut and paste the line inside getuid function. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduling&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler decides when what process should run at a high level&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: How does the scheduler work/kernel control when a program runs/how can you make sure one program does not take over CPU from anyone else?&amp;lt;br&amp;gt;&lt;br /&gt;
CPU is given entirely to userspace processes to run most of the time&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel needs to run when it needs to run and no process should be able to stop it&amp;lt;br&amp;gt;&lt;br /&gt;
* The interrupt table: pointers to code that the CPU runs when it receives different hardware or software interrupts. Since the kernel runs first it gets to set the interrupt table. Only supervisor code can change the table not user code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the Ethernet card receives data: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The Ethernet card sends an interrupt to the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
2) The CPU calls the kernel code for handling Ethernet data  &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the clock generates a timer interrupt: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The CPU calls the kernel code for handling timer interrupts &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2) In order to process an interrupt, a CPU core has to be taken over&amp;lt;br&amp;gt;&lt;br /&gt;
3) That core was probably running a userspace process &amp;lt;br&amp;gt;&lt;br /&gt;
4) Scheduling is all about what to do after having kicked a userspace process off of a core&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally on a core:&amp;lt;br&amp;gt;&lt;br /&gt;
* Userspace is happening&amp;lt;br&amp;gt;&lt;br /&gt;
* Interrupt happens &amp;lt;br&amp;gt;&lt;br /&gt;
* core switches to supervisor mode, runs kernel code&amp;lt;br&amp;gt;&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run. Repeat the process&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler needs to be efficient because interrupts are frequent and we do not want to waste resources that could be put towards actual computing&amp;lt;br&amp;gt;&lt;br /&gt;
Entry and exit to kernel has to do low-level tasks like changing CPU modes, manage CPU registers. This is Assembly code. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Go to http://elixir.free-electrons.com/linux/v4.4.83/source&amp;lt;br&amp;gt;&lt;br /&gt;
Go into arch: code specific to CPU architecture. Two most commons are arm and x86&amp;lt;br&amp;gt;&lt;br /&gt;
Go up one level&amp;lt;br&amp;gt;&lt;br /&gt;
Drivers directory have drivers for all kinds of things&amp;lt;br&amp;gt;&lt;br /&gt;
Linux Kernel designed for x86 but it now abstracted to support different architectures. &lt;br /&gt;
Go into architecture -&amp;gt; x86 -&amp;gt; entry &amp;lt;br&amp;gt;&lt;br /&gt;
Open entry.s: Large assembly language file. This is the code that runs before system call specific code.&amp;lt;br&amp;gt;&lt;br /&gt;
shced.h -&amp;gt; Contains definition of task_struct. Data structure that keeps track of a process.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What criteria should the scheduler use in deciding what to run?&amp;lt;br&amp;gt;&lt;br /&gt;
*Fairness: Starvation is when a program does not get the CPU &amp;lt;br&amp;gt;&lt;br /&gt;
**Everyone should get a turn&lt;br /&gt;
**CPU is passed around&lt;br /&gt;
** Nobody should be left that they never get the CPU&lt;br /&gt;
**Prevent Starvation &amp;lt;br&amp;gt;&lt;br /&gt;
**Absent other conditions, equal allocation of resources&lt;br /&gt;
*Bias resources towards &amp;quot;foreground&amp;quot; tasks in interactive systems &lt;br /&gt;
**never Biased enough&lt;br /&gt;
**always hacks, heuristics&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Memory overcommitment&amp;lt;br&amp;gt;&lt;br /&gt;
Memory does not get allocated when you mmap. It is loaded &amp;quot;lazily&amp;quot; in the Linux kernel. It is possible to allocate way more memory than can ever be used. &amp;lt;br&amp;gt;&lt;br /&gt;
Goes into &amp;quot;memory debt&amp;quot; &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21235</id>
		<title>Operating Systems 2017F Lecture 17</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21235"/>
		<updated>2017-11-15T03:14:24Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Midterm Review */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
The video from the lecture given on Nov. 14, 2017 [http://homeostasis.scs.carleton.ca/~soma/os-2017f/lectures/comp3000-2017f-lec17-14Nov2017.mp4 is now available].&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
===In Class===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 17&lt;br /&gt;
----------&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking?&lt;br /&gt;
&lt;br /&gt;
* Be humble&lt;br /&gt;
  - you don&#039;t know how everything works, and nobody else does&lt;br /&gt;
&lt;br /&gt;
* Verify your assumptions as you go&lt;br /&gt;
  - perform lots of experiments&lt;br /&gt;
  - incremental development, compile and run very often&lt;br /&gt;
&lt;br /&gt;
* Check for errors ALWAYS&lt;br /&gt;
  - will save you from later errors&lt;br /&gt;
  - kernel has to &amp;quot;live cleanly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Find another part of the kernel that is close to what you want to do.&lt;br /&gt;
  Read that code, use their approach where possible&lt;br /&gt;
  - You don&#039;t understand all the abstractions and assumptions, so&lt;br /&gt;
    &amp;quot;pattern match&amp;quot; to minimize trouble&lt;br /&gt;
  - Realize that the assumptions behind code you find don&#039;t necessarily match&lt;br /&gt;
    your own.&lt;br /&gt;
&lt;br /&gt;
* Understand the &amp;quot;flow of control&amp;quot; inside the program&lt;br /&gt;
  - architecture&lt;br /&gt;
  - division of responsibilites&lt;br /&gt;
  - purpose of data structures/objects&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scheduling&lt;br /&gt;
----------&lt;br /&gt;
How does the kernel maintain control?&lt;br /&gt;
 - CPU is given entirely to userspace processes to run most of the time&lt;br /&gt;
&lt;br /&gt;
Kernel needs to run when it needs to run&lt;br /&gt;
 - and no process should be able to stop it&lt;br /&gt;
&lt;br /&gt;
*The interrupt table*&lt;br /&gt;
 - pointers to code that the CPU runs when it receives different hardware&lt;br /&gt;
   or software interrupts&lt;br /&gt;
 - since the kernel runs first, it gets to set the interrupt table&lt;br /&gt;
 - only supervisor code can change the table, not user code&lt;br /&gt;
&lt;br /&gt;
So when the ethernet card receives data...&lt;br /&gt;
...the ethernet card sends an interrupt to the kernel&lt;br /&gt;
...the CPU calls the kernel code for handling ethernet data&lt;br /&gt;
&lt;br /&gt;
When the clock generates a timer interrupt...&lt;br /&gt;
...the CPU calls the kernel code for handling timer interrupts&lt;br /&gt;
&lt;br /&gt;
In order to process an interrupt, an CPU core has to be taken over&lt;br /&gt;
 - that core was probably running a userspace process&lt;br /&gt;
&lt;br /&gt;
Scheduling is all about what to do after having kicked a userspace process&lt;br /&gt;
off of a core&lt;br /&gt;
&lt;br /&gt;
Normally on a core&lt;br /&gt;
* userspace process is running&lt;br /&gt;
* interrupt happens&lt;br /&gt;
* core swiches to supervisor mode, runs kernel code&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run&lt;br /&gt;
* goto top :-)&lt;br /&gt;
&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&lt;br /&gt;
&lt;br /&gt;
Entry and exit to the kernel has to do low-level tasks like changing CPU modes,&lt;br /&gt;
manage CPU registers&lt;br /&gt;
 - must be written in assembly&lt;br /&gt;
&lt;br /&gt;
Most OS kernels minimize this low-level code&lt;br /&gt;
&lt;br /&gt;
What criteria should the scheduler use in deciding what to run?&lt;br /&gt;
 - &amp;quot;fairness&amp;quot;&lt;br /&gt;
   - prevent starvation&lt;br /&gt;
   - absent other conditions, equal allocation of resources&lt;br /&gt;
 - bias resources towards &amp;quot;foreground&amp;quot; tasks in interactive systems&lt;br /&gt;
   - never biased enough&lt;br /&gt;
   - always hacks, heuristics&lt;br /&gt;
&lt;br /&gt;
Memory overcommitment&lt;br /&gt;
 - it is possible to allocate way more memory than can be ever used&lt;br /&gt;
 - goes into &amp;quot;memory debt&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Midterm Review===&lt;br /&gt;
1. Execve and no it does not create a new process&lt;br /&gt;
&lt;br /&gt;
2. Dynamically linked programs map in dynamically linked libraries&lt;br /&gt;
&lt;br /&gt;
3. Hard links maps filenames to inodes&lt;br /&gt;
&lt;br /&gt;
4. Sleep until the consumer wakes it&lt;br /&gt;
&lt;br /&gt;
5. Using type conversion, read returns number of bytes written. We must convert back to the number of unsigned long, minus one because maximum index of array is one less&lt;br /&gt;
&lt;br /&gt;
6. uses of signals:&lt;br /&gt;
* kill process&lt;br /&gt;
* find out when child process is terminated&lt;br /&gt;
* start/stop a process&lt;br /&gt;
* detect when a program has made a ptr error&lt;br /&gt;
&lt;br /&gt;
7. Pointers in C contain virtual memory addresses because the memory of a process is a virtual address space. Each process thinks it has its own stretch of memory.&lt;br /&gt;
&lt;br /&gt;
8. processes make a sys call to allocate memory. execve -&amp;gt; then mmap and/or sbreak to allocate memory&lt;br /&gt;
&lt;br /&gt;
9. shell opens the file output.txt.&lt;br /&gt;
&lt;br /&gt;
10. mmap contents of file can allocate the contents of it into ram.&lt;br /&gt;
* comparing 1 mb of both files at a time will be less expensive&lt;br /&gt;
* only makes sense to mmap if you will access files multiple times&lt;br /&gt;
&lt;br /&gt;
11. producer and consumer now have no way of talking to each other because they do not share the same memory.&lt;br /&gt;
&lt;br /&gt;
12. no. there is a race condition. while loop loops while sem &amp;lt; 0.&lt;br /&gt;
someone else could access and modify the variable between the while and the sem--;.&lt;br /&gt;
* you need special instructions to test and set the variable at the same time.&lt;br /&gt;
* also, int sem parameter isn&#039;t a ptr so it&#039;s a local variable.&lt;br /&gt;
&lt;br /&gt;
===Additional Notes===&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking? Some tips for low level kernel code:&lt;br /&gt;
Be humble; You cannot know how everything works&amp;lt;br&amp;gt;&lt;br /&gt;
Verify your assumptions as you go&amp;lt;br&amp;gt;&lt;br /&gt;
Perform lots of experiments&amp;lt;br&amp;gt;&lt;br /&gt;
Incremental Development, compile and run often&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Check for errors ALWAYS or they will cascade and hurt you later&amp;lt;br&amp;gt;&lt;br /&gt;
*This will save you from later errors&amp;lt;br&amp;gt;&lt;br /&gt;
*Kernel has to live cleanly&amp;lt;br&amp;gt;&lt;br /&gt;
*This principle applies to any large scale coding&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Find another part of the kernel that is close to what you want to do (Search online! This is a good link: http://elixir.free-electrons.com/linux/v4.4.83/source &amp;lt;br&amp;gt;&lt;br /&gt;
You do not understand all abstractions and assumptions, so &amp;quot;pattern match&amp;quot; to minimize trouble &amp;lt;br&amp;gt;&lt;br /&gt;
*Functionality that you want to implement might already exist in the kernel, look at how they do things and follow the pattern.&amp;lt;br&amp;gt;&lt;br /&gt;
*Refine understanding as you go, the other implementation might be for something else. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Realize that the assumptions behind code you don&#039;t necessarily match to your own. Spend the time reading other people&#039;s code. &amp;lt;br&amp;gt;&lt;br /&gt;
Understand the &amp;quot;flow of control&amp;quot; inside the program&amp;lt;br&amp;gt;&lt;br /&gt;
*Architecture&amp;lt;br&amp;gt;&lt;br /&gt;
*Division of responsibilities&amp;lt;br&amp;gt;&lt;br /&gt;
*Purpose of data structures/objects&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the tutorial 6 he gave us a link for a reason. If you click on it you can search getpid and then dig deeper! For example cut and paste the line inside getuid function. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduling&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler decides when what process should run at a high level&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: How does the scheduler work/kernel control when a program runs/how can you make sure one program does not take over CPU from anyone else?&amp;lt;br&amp;gt;&lt;br /&gt;
CPU is given entirely to userspace processes to run most of the time&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel needs to run when it needs to run and no process should be able to stop it&amp;lt;br&amp;gt;&lt;br /&gt;
* The interrupt table: pointers to code that the CPU runs when it receives different hardware or software interrupts. Since the kernel runs first it gets to set the interrupt table. Only supervisor code can change the table not user code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the Ethernet card receives data: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The Ethernet card sends an interrupt to the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
2) The CPU calls the kernel code for handling Ethernet data  &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the clock generates a timer interrupt: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The CPU calls the kernel code for handling timer interrupts &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2) In order to process an interrupt, a CPU core has to be taken over&amp;lt;br&amp;gt;&lt;br /&gt;
3) That core was probably running a userspace process &amp;lt;br&amp;gt;&lt;br /&gt;
4) Scheduling is all about what to do after having kicked a userspace process off of a core&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally on a core:&amp;lt;br&amp;gt;&lt;br /&gt;
* Userspace is happening&amp;lt;br&amp;gt;&lt;br /&gt;
* Interrupt happens &amp;lt;br&amp;gt;&lt;br /&gt;
* core switches to supervisor mode, runs kernel code&amp;lt;br&amp;gt;&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run. Repeat the process&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler needs to be efficient because interrupts are frequent and we do not want to waste resources that could be put towards actual computing&amp;lt;br&amp;gt;&lt;br /&gt;
Entry and exit to kernel has to do low-level tasks like changing CPU modes, manage CPU registers. This is Assembly code. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Go to http://elixir.free-electrons.com/linux/v4.4.83/source&amp;lt;br&amp;gt;&lt;br /&gt;
Go into arch: code specific to CPU architecture. Two most commons are arm and x86&amp;lt;br&amp;gt;&lt;br /&gt;
Go up one level&amp;lt;br&amp;gt;&lt;br /&gt;
Drivers directory have drivers for all kinds of things&amp;lt;br&amp;gt;&lt;br /&gt;
Linux Kernel designed for x86 but it now abstracted to support different architectures. &lt;br /&gt;
Go into architecture -&amp;gt; x86 -&amp;gt; entry &amp;lt;br&amp;gt;&lt;br /&gt;
Open entry.s: Large assembly language file. This is the code that runs before system call specific code.&amp;lt;br&amp;gt;&lt;br /&gt;
shced.h -&amp;gt; Contains definition of task_struct. Data structure that keeps track of a process.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What criteria should the scheduler use in deciding what to run?&amp;lt;br&amp;gt;&lt;br /&gt;
*Fairness: Starvation is when a program does not get the CPU &amp;lt;br&amp;gt;&lt;br /&gt;
**Everyone should get a turn&lt;br /&gt;
**CPU is passed around&lt;br /&gt;
** Nobody should be left that they never get the CPU&lt;br /&gt;
**Prevent Starvation &amp;lt;br&amp;gt;&lt;br /&gt;
**Absent other conditions, equal allocation of resources&lt;br /&gt;
*Bias resources towards &amp;quot;foreground&amp;quot; tasks in interactive systems &lt;br /&gt;
**never Biased enough&lt;br /&gt;
**always hacks, heuristics&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Memory overcommitment&amp;lt;br&amp;gt;&lt;br /&gt;
Memory does not get allocated when you mmap. It is loaded &amp;quot;lazily&amp;quot; int he Linux kernel. It is possible to allocate way more memory than can ever be used. &amp;lt;br&amp;gt;&lt;br /&gt;
Goes into &amp;quot;memory debt&amp;quot; &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21229</id>
		<title>Operating Systems 2017F Lecture 17</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21229"/>
		<updated>2017-11-14T19:24:01Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Midterm Review ==&lt;br /&gt;
1. Execve and no it does not create a new process&lt;br /&gt;
&lt;br /&gt;
6. uses of signals:&lt;br /&gt;
* kill process&lt;br /&gt;
* find out when child process is terminated&lt;br /&gt;
* start/stop a process&lt;br /&gt;
* detect when a program has made a ptr error&lt;br /&gt;
&lt;br /&gt;
7. Pointers in C contain virtual memory addresses because the memory of a process is a virtual address space. Each process thinks it has its own stretch of memory.&lt;br /&gt;
&lt;br /&gt;
8. processes make a sys call to allocate memory. execve -&amp;gt; then mmap and/or sbreak to allocate memory&lt;br /&gt;
&lt;br /&gt;
9. shell opens the file output.txt.&lt;br /&gt;
&lt;br /&gt;
10. mmap contents of file can allocate the contents of it into ram.&lt;br /&gt;
* comparing 1 mb of both files at a time will be less expensive&lt;br /&gt;
* only makes sense to mmap if you will access files multiple times&lt;br /&gt;
&lt;br /&gt;
11. producer and consumer now have no way of talking to each other because they do not share the same memory.&lt;br /&gt;
&lt;br /&gt;
12. no. there is a race condition. while loop loops while sem &amp;lt; 0.&lt;br /&gt;
someone else could access and modify the variable between the while and the sem--;.&lt;br /&gt;
* you need special instructions to test and set the variable at the same time.&lt;br /&gt;
* also, int sem parameter isn&#039;t a ptr so it&#039;s a local variable.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking? Some tips for low level kernel code:&lt;br /&gt;
Be humble; You cannot know how everything works&amp;lt;br&amp;gt;&lt;br /&gt;
Verify your assumptions as you go&amp;lt;br&amp;gt;&lt;br /&gt;
Perform lots of experiments&amp;lt;br&amp;gt;&lt;br /&gt;
Incremental Development, compile and run often&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Check for errors ALWAYS or they will cascade and hurt you later&amp;lt;br&amp;gt;&lt;br /&gt;
This will save you from later errors&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel has to live cleanly&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Find another part of the kernel that is close to what you want to do (Search online! This is a good link: http://elixir.free-electrons.com/linux/v4.4.83/source &amp;lt;br&amp;gt;&lt;br /&gt;
You do not understand all abstractions and assumptions, so &amp;quot;pattern match&amp;quot; to minimize trouble &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Realize that the assumptions behind code you don&#039;t necessarily match to your own. Spend the time reading other people&#039;s code. &amp;lt;br&amp;gt;&lt;br /&gt;
Understand the &amp;quot;flow of control&amp;quot; inside the program&amp;lt;br&amp;gt;&lt;br /&gt;
*Architecture&amp;lt;br&amp;gt;&lt;br /&gt;
*Division of responsibilities&amp;lt;br&amp;gt;&lt;br /&gt;
*Purpose of data structures/objects&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the tutorial 6 he gave us a link for a reason. If you click on it you can search getpid and then dig deeper! For example cut and paste the line inside getuid function. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduling&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler decides when what process should run at a high level&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: How does the scheduler work/kernel control when a program runs/how can you make sure one program does not take over CPU from anyone else?&amp;lt;br&amp;gt;&lt;br /&gt;
CPU is given entirely to userspace processes to run most of the time&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel needs to run when it needs to run and no process should be able to stop it&amp;lt;br&amp;gt;&lt;br /&gt;
* The interrupt table: pointers to code that the CPU runs when it receives different hardware or software interrupts. Since the kernel runs first it gets to set the interrupt table. Only supervisor code can change the table not user code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the Ethernet card receives data: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The Ethernet card sends an interrupt to the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
2) The CPU calls the kernel code for handling Ethernet data  &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the clock generates a timer interrupt: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The CPU calls the kernel code for handling timer interrupts &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2) In order to process an interrupt, a CPU core has to be taken over&amp;lt;br&amp;gt;&lt;br /&gt;
3) That core was probably running a userspace process &amp;lt;br&amp;gt;&lt;br /&gt;
4) Scheduling is all about what to do after having kicked a userspace process off of a core&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally on a core:&amp;lt;br&amp;gt;&lt;br /&gt;
* Userspace is happening&amp;lt;br&amp;gt;&lt;br /&gt;
* Interrupt happens &amp;lt;br&amp;gt;&lt;br /&gt;
* core switches to supervisor mode, runs kernel code&amp;lt;br&amp;gt;&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run. Repeat the process&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler needs to be efficient because interrupts are frequent and we do not want to waste resources that could be put towards actual computing&amp;lt;br&amp;gt;&lt;br /&gt;
Entry and exit to kernel has to do low-level tasks like changing CPU modes, manage CPU registers. This is Assembly code. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Go to http://elixir.free-electrons.com/linux/v4.4.83/source&amp;lt;br&amp;gt;&lt;br /&gt;
Go into arch: code specific to CPU architecture. Two most commons are arm and x86&amp;lt;br&amp;gt;&lt;br /&gt;
Go up one level&amp;lt;br&amp;gt;&lt;br /&gt;
Drivers directory have drivers for all kinds of things&amp;lt;br&amp;gt;&lt;br /&gt;
Linux Kernel designed for x86 but it now abstracted to support different architectures. &lt;br /&gt;
Go into architecture -&amp;gt; x86 -&amp;gt; entry &amp;lt;br&amp;gt;&lt;br /&gt;
Open entry.s: Large assembly language file. This is the code that runs before system call specific code.&amp;lt;br&amp;gt;&lt;br /&gt;
shced.h -&amp;gt; Contains definition of task_struct. Data structure that keeps track of a process.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What criteria should the scheduler use in deciding what to run?&amp;lt;br&amp;gt;&lt;br /&gt;
*Fairness: Starvation is when a program does not get the CPU &amp;lt;br&amp;gt;&lt;br /&gt;
**Prevent Starvation &amp;lt;br&amp;gt;&lt;br /&gt;
**Absent other conditions, equal allocation of resources&lt;br /&gt;
*Bias resources towards &amp;quot;foreground&amp;quot; tasks in interactive systems &lt;br /&gt;
**never Biased enough&lt;br /&gt;
**always hacks, heuristics&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Memory overcommitment&amp;lt;br&amp;gt;&lt;br /&gt;
Memory does not get allocated when you mmap. It is loaded &amp;quot;lazily&amp;quot; int he Linux kernel. It is possible to allocate way more memory than can ever be used. &amp;lt;br&amp;gt;&lt;br /&gt;
Goes into &amp;quot;memory debt&amp;quot; &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21228</id>
		<title>Operating Systems 2017F Lecture 17</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21228"/>
		<updated>2017-11-14T19:20:06Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Midterm Review ==&lt;br /&gt;
1. Execve and no it does not create a new process&lt;br /&gt;
&lt;br /&gt;
6. uses of signals:&lt;br /&gt;
* kill process&lt;br /&gt;
* find out when child process is terminated&lt;br /&gt;
* start/stop a process&lt;br /&gt;
* detect when a program has made a ptr error&lt;br /&gt;
&lt;br /&gt;
7. Pointers in C contain virtual memory addresses because the memory of a process is a virtual address space. Each process thinks it has its own stretch of memory.&lt;br /&gt;
&lt;br /&gt;
8. processes make a sys call to allocate memory. execve -&amp;gt; then mmap and/or sbreak to allocate memory&lt;br /&gt;
&lt;br /&gt;
9. shell opens the file output.txt.&lt;br /&gt;
&lt;br /&gt;
10. mmap contents of file can allocate the contents of it into ram.&lt;br /&gt;
* comparing 1 mb of both files at a time will be less expensive&lt;br /&gt;
* only makes sense to mmap if you will access files multiple times&lt;br /&gt;
&lt;br /&gt;
11. producer and consumer now have no way of talking to each other because they do not share the same memory.&lt;br /&gt;
&lt;br /&gt;
12. no. there is a race condition. while loop loops while sem &amp;lt; 0.&lt;br /&gt;
someone else could access and modify the variable between the while and the sem--;.&lt;br /&gt;
* you need special instructions to test and set the variable at the same time.&lt;br /&gt;
* also, int sem parameter isn&#039;t a ptr so it&#039;s a local variable.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking? Some tips for low level kernel code:&lt;br /&gt;
Be humble; You cannot know how everything works&amp;lt;br&amp;gt;&lt;br /&gt;
Verify your assumptions as you go&amp;lt;br&amp;gt;&lt;br /&gt;
Perform lots of experiments&amp;lt;br&amp;gt;&lt;br /&gt;
Incremental Development, compile and run often&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Check for errors ALWAYS or they will cascade and hurt you later&amp;lt;br&amp;gt;&lt;br /&gt;
This will save you from later errors&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel has to live cleanly&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Find another part of the kernel that is close to what you want to do (Search online! This is a good link: http://elixir.free-electrons.com/linux/v4.4.83/source &amp;lt;br&amp;gt;&lt;br /&gt;
You do not understand all abstractions and assumptions, so &amp;quot;pattern match&amp;quot; to minimize trouble &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Realize that the assumptions behind code you don&#039;t necessarily match to your own. Spend the time reading other people&#039;s code. &amp;lt;br&amp;gt;&lt;br /&gt;
Understand the &amp;quot;flow of control&amp;quot; inside the program&amp;lt;br&amp;gt;&lt;br /&gt;
*Architecture&amp;lt;br&amp;gt;&lt;br /&gt;
*Division of responsibilities&amp;lt;br&amp;gt;&lt;br /&gt;
*Purpose of data structures/objects&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the tutorial 6 he gave us a link for a reason. If you click on it you can search getpid and then dig deeper! For example cut and paste the line inside getuid function. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduling&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler decides when what process should run at a high level&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: How does the scheduler work/kernel control when a program runs/how can you make sure one program does not take over CPU from anyone else?&amp;lt;br&amp;gt;&lt;br /&gt;
CPU is given entirely to userspace processes to run most of the time&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel needs to run when it needs to run and no process should be able to stop it&amp;lt;br&amp;gt;&lt;br /&gt;
* The interrupt table: pointers to code that the CPU runs when it receives different hardware or software interrupts. Since the kernel runs first it gets to set the interrupt table. Only supervisor code can change the table not user code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the Ethernet card receives data: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The Ethernet card sends an interrupt to the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
2) The CPU calls the kernel code for handling Ethernet data  &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the clock generates a timer interrupt: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The CPU calls the kernel code for handling timer interrupts &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2) In order to process an interrupt, a CPU core has to be taken over&amp;lt;br&amp;gt;&lt;br /&gt;
3) That core was probably running a userspace process &amp;lt;br&amp;gt;&lt;br /&gt;
4) Scheduling is all about what to do after having kicked a userspace process off of a core&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally on a core:&amp;lt;br&amp;gt;&lt;br /&gt;
* Userspace is happening&amp;lt;br&amp;gt;&lt;br /&gt;
* Interrupt happens &amp;lt;br&amp;gt;&lt;br /&gt;
* core switches to supervisor mode, runs kernel code&amp;lt;br&amp;gt;&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run. Repeat the process&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler needs to be efficient because interrupts are frequent and we do not want to waste resources that could be put towards actual computing&amp;lt;br&amp;gt;&lt;br /&gt;
Entry and exit to kernel has to do low-level tasks like changing CPU modes, manage CPU registers. This is Assembly code. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Go to http://elixir.free-electrons.com/linux/v4.4.83/source&amp;lt;br&amp;gt;&lt;br /&gt;
Go into arch: code specific to CPU architecture. Two most commons are arm and x86&amp;lt;br&amp;gt;&lt;br /&gt;
Go up one level&amp;lt;br&amp;gt;&lt;br /&gt;
Drivers directory have drivers for all kinds of things&amp;lt;br&amp;gt;&lt;br /&gt;
Linux Kernel designed for x86 but it now abstracted to support different architectures. &lt;br /&gt;
Go into architecture -&amp;gt; x86 -&amp;gt; entry &amp;lt;br&amp;gt;&lt;br /&gt;
Open entry.s: Large assembly language file. This is the code that runs before system call specific code.&amp;lt;br&amp;gt;&lt;br /&gt;
shced.h -&amp;gt; Contains definition of task_struct. Data structure that keeps track of a process.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What criteria should the scheduler use in deciding what to run?&amp;lt;br&amp;gt;&lt;br /&gt;
*Fairness: Starvation is when a program does not get the CPU &amp;lt;br&amp;gt;&lt;br /&gt;
**Prevent Starvation &amp;lt;br&amp;gt;&lt;br /&gt;
**Absent other conditions, equal allocation of resources&lt;br /&gt;
*Bias resources towards &amp;quot;foreground&amp;quot; tasks in interactive systems &lt;br /&gt;
**never Biased enough&lt;br /&gt;
**always hacks, heuristics&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21227</id>
		<title>Operating Systems 2017F Lecture 17</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21227"/>
		<updated>2017-11-14T19:19:07Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Midterm Review ==&lt;br /&gt;
1. Execve and no it does not create a new process&lt;br /&gt;
&lt;br /&gt;
6. uses of signals:&lt;br /&gt;
* kill process&lt;br /&gt;
* find out when child process is terminated&lt;br /&gt;
* start/stop a process&lt;br /&gt;
* detect when a program has made a ptr error&lt;br /&gt;
&lt;br /&gt;
7. Pointers in C contain virtual memory addresses because the memory of a process is a virtual address space. Each process thinks it has its own stretch of memory.&lt;br /&gt;
&lt;br /&gt;
8. processes make a sys call to allocate memory. execve -&amp;gt; then mmap and/or sbreak to allocate memory&lt;br /&gt;
&lt;br /&gt;
9. shell opens the file output.txt.&lt;br /&gt;
&lt;br /&gt;
10. mmap contents of file can allocate the contents of it into ram.&lt;br /&gt;
* comparing 1 mb of both files at a time will be less expensive&lt;br /&gt;
* only makes sense to mmap if you will access files multiple times&lt;br /&gt;
&lt;br /&gt;
11. producer and consumer now have no way of talking to each other because they do not share the same memory.&lt;br /&gt;
&lt;br /&gt;
12. no. there is a race condition. while loop loops while sem &amp;lt; 0.&lt;br /&gt;
someone else could access and modify the variable between the while and the sem--;.&lt;br /&gt;
* you need special instructions to test and set the variable at the same time.&lt;br /&gt;
* also, int sem parameter isn&#039;t a ptr so it&#039;s a local variable.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking? Some tips for low level kernel code:&lt;br /&gt;
Be humble; You cannot know how everything works&amp;lt;br&amp;gt;&lt;br /&gt;
Verify your assumptions as you go&amp;lt;br&amp;gt;&lt;br /&gt;
Perform lots of experiments&amp;lt;br&amp;gt;&lt;br /&gt;
Incremental Development, compile and run often&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Check for errors ALWAYS or they will cascade and hurt you later&amp;lt;br&amp;gt;&lt;br /&gt;
This will save you from later errors&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel has to live cleanly&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Find another part of the kernel that is close to what you want to do (Search online! This is a good link: http://elixir.free-electrons.com/linux/v4.4.83/source &amp;lt;br&amp;gt;&lt;br /&gt;
You do not understand all abstractions and assumptions, so &amp;quot;pattern match&amp;quot; to minimize trouble &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Realize that the assumptions behind code you don&#039;t necessarily match to your own. Spend the time reading other people&#039;s code. &amp;lt;br&amp;gt;&lt;br /&gt;
Understand the &amp;quot;flow of control&amp;quot; inside the program&amp;lt;br&amp;gt;&lt;br /&gt;
*Architecture&amp;lt;br&amp;gt;&lt;br /&gt;
*Division of responsibilities&amp;lt;br&amp;gt;&lt;br /&gt;
*Purpose of data structures/objects&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the tutorial 6 he gave us a link for a reason. If you click on it you can search getpid and then dig deeper! For example cut and paste the line inside getuid function. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduling&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler decides when what process should run at a high level&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: How does the scheduler work/kernel control when a program runs/how can you make sure one program does not take over CPU from anyone else?&amp;lt;br&amp;gt;&lt;br /&gt;
CPU is given entirely to userspace processes to run most of the time&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel needs to run when it needs to run and no process should be able to stop it&amp;lt;br&amp;gt;&lt;br /&gt;
* The interrupt table: pointers to code that the CPU runs when it receives different hardware or software interrupts. Since the kernel runs first it gets to set the interrupt table. Only supervisor code can change the table not user code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the Ethernet card receives data: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The Ethernet card sends an interrupt to the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
2) The CPU calls the kernel code for handling Ethernet data  &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the clock generates a timer interrupt: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The CPU calls the kernel code for handling timer interrupts &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2) In order to process an interrupt, a CPU core has to be taken over&amp;lt;br&amp;gt;&lt;br /&gt;
3) That core was probably running a userspace process &amp;lt;br&amp;gt;&lt;br /&gt;
4) Scheduling is all about what to do after having kicked a userspace process off of a core&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally on a core:&amp;lt;br&amp;gt;&lt;br /&gt;
* Userspace is happening&amp;lt;br&amp;gt;&lt;br /&gt;
* Interrupt happens &amp;lt;br&amp;gt;&lt;br /&gt;
* core switches to supervisor mode, runs kernel code&amp;lt;br&amp;gt;&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run. Repeat the process&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler needs to be efficient because interrupts are frequent and we do not want to waste resources that could be put towards actual computing&amp;lt;br&amp;gt;&lt;br /&gt;
Entry and exit to kernel has to do low-level tasks like changing CPU modes, manage CPU registers. This is Assembly code. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Go to http://elixir.free-electrons.com/linux/v4.4.83/source&amp;lt;br&amp;gt;&lt;br /&gt;
Go into arch: code specific to CPU architecture. Two most commons are arm and x86&amp;lt;br&amp;gt;&lt;br /&gt;
Go up one level&amp;lt;br&amp;gt;&lt;br /&gt;
Drivers directory have drivers for all kinds of things&amp;lt;br&amp;gt;&lt;br /&gt;
Linux Kernel designed for x86 but it now abstracted to support different architectures. &lt;br /&gt;
Go into architecture -&amp;gt; x86 -&amp;gt; entry &amp;lt;br&amp;gt;&lt;br /&gt;
Open entry.s: Large assembly language file. This is the code that runs before system call specific code.&amp;lt;br&amp;gt;&lt;br /&gt;
shced.h -&amp;gt; Contains definition of task_struct. Data structure that keeps track of a process.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What criteria should the scheduler use in deciding what to run?&amp;lt;br&amp;gt;&lt;br /&gt;
*Fairness: Starvation is when a program does not get the CPU &amp;lt;br&amp;gt;&lt;br /&gt;
**Prevent Starvation &amp;lt;br&amp;gt;&lt;br /&gt;
**Absent other conditions, equal allocation of resources&lt;br /&gt;
*Bias resources towards &amp;quot;foreground&amp;quot; tasks in interactive systems &lt;br /&gt;
**never Biased enough&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21226</id>
		<title>Operating Systems 2017F Lecture 17</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21226"/>
		<updated>2017-11-14T19:17:14Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Midterm Review ==&lt;br /&gt;
1. Execve and no it does not create a new process&lt;br /&gt;
&lt;br /&gt;
6. uses of signals:&lt;br /&gt;
* kill process&lt;br /&gt;
* find out when child process is terminated&lt;br /&gt;
* start/stop a process&lt;br /&gt;
* detect when a program has made a ptr error&lt;br /&gt;
&lt;br /&gt;
7. Pointers in C contain virtual memory addresses because the memory of a process is a virtual address space. Each process thinks it has its own stretch of memory.&lt;br /&gt;
&lt;br /&gt;
8. processes make a sys call to allocate memory. execve -&amp;gt; then mmap and/or sbreak to allocate memory&lt;br /&gt;
&lt;br /&gt;
9. shell opens the file output.txt.&lt;br /&gt;
&lt;br /&gt;
10. mmap contents of file can allocate the contents of it into ram.&lt;br /&gt;
* comparing 1 mb of both files at a time will be less expensive&lt;br /&gt;
* only makes sense to mmap if you will access files multiple times&lt;br /&gt;
&lt;br /&gt;
11. producer and consumer now have no way of talking to each other because they do not share the same memory.&lt;br /&gt;
&lt;br /&gt;
12. no. there is a race condition. while loop loops while sem &amp;lt; 0.&lt;br /&gt;
someone else could access and modify the variable between the while and the sem--;.&lt;br /&gt;
* you need special instructions to test and set the variable at the same time.&lt;br /&gt;
* also, int sem parameter isn&#039;t a ptr so it&#039;s a local variable.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking? Some tips for low level kernel code:&lt;br /&gt;
Be humble; You cannot know how everything works&amp;lt;br&amp;gt;&lt;br /&gt;
Verify your assumptions as you go&amp;lt;br&amp;gt;&lt;br /&gt;
Perform lots of experiments&amp;lt;br&amp;gt;&lt;br /&gt;
Incremental Development, compile and run often&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Check for errors ALWAYS or they will cascade and hurt you later&amp;lt;br&amp;gt;&lt;br /&gt;
This will save you from later errors&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel has to live cleanly&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Find another part of the kernel that is close to what you want to do (Search online! This is a good link: http://elixir.free-electrons.com/linux/v4.4.83/source &amp;lt;br&amp;gt;&lt;br /&gt;
You do not understand all abstractions and assumptions, so &amp;quot;pattern match&amp;quot; to minimize trouble &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Realize that the assumptions behind code you don&#039;t necessarily match to your own. Spend the time reading other people&#039;s code. &amp;lt;br&amp;gt;&lt;br /&gt;
Understand the &amp;quot;flow of control&amp;quot; inside the program&amp;lt;br&amp;gt;&lt;br /&gt;
*Architecture&amp;lt;br&amp;gt;&lt;br /&gt;
*Division of responsibilities&amp;lt;br&amp;gt;&lt;br /&gt;
*Purpose of data structures/objects&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the tutorial 6 he gave us a link for a reason. If you click on it you can search getpid and then dig deeper! For example cut and paste the line inside getuid function. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduling&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler decides when what process should run at a high level&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: How does the scheduler work/kernel control when a program runs/how can you make sure one program does not take over CPU from anyone else?&amp;lt;br&amp;gt;&lt;br /&gt;
CPU is given entirely to userspace processes to run most of the time&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel needs to run when it needs to run and no process should be able to stop it&amp;lt;br&amp;gt;&lt;br /&gt;
* The interrupt table: pointers to code that the CPU runs when it receives different hardware or software interrupts. Since the kernel runs first it gets to set the interrupt table. Only supervisor code can change the table not user code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the Ethernet card receives data: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The Ethernet card sends an interrupt to the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
2) The CPU calls the kernel code for handling Ethernet data  &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the clock generates a timer interrupt: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The CPU calls the kernel code for handling timer interrupts &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2) In order to process an interrupt, a CPU core has to be taken over&amp;lt;br&amp;gt;&lt;br /&gt;
3) That core was probably running a userspace process &amp;lt;br&amp;gt;&lt;br /&gt;
4) Scheduling is all about what to do after having kicked a userspace process off of a core&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally on a core:&amp;lt;br&amp;gt;&lt;br /&gt;
* Userspace is happening&amp;lt;br&amp;gt;&lt;br /&gt;
* Interrupt happens &amp;lt;br&amp;gt;&lt;br /&gt;
* core switches to supervisor mode, runs kernel code&amp;lt;br&amp;gt;&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run. Repeat the process&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler needs to be efficient because interrupts are frequent and we do not want to waste resources that could be put towards actual computing&amp;lt;br&amp;gt;&lt;br /&gt;
Entry and exit to kernel has to do low-level tasks like changing CPU modes, manage CPU registers. This is Assembly code. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Go to http://elixir.free-electrons.com/linux/v4.4.83/source&amp;lt;br&amp;gt;&lt;br /&gt;
Go into arch: code specific to CPU architecture. Two most commons are arm and x86&amp;lt;br&amp;gt;&lt;br /&gt;
Go up one level&amp;lt;br&amp;gt;&lt;br /&gt;
Drivers directory have drivers for all kinds of things&amp;lt;br&amp;gt;&lt;br /&gt;
Linux Kernel designed for x86 but it now abstracted to support different architectures. &lt;br /&gt;
Go into architecture -&amp;gt; x86 -&amp;gt; entry &amp;lt;br&amp;gt;&lt;br /&gt;
Open entry.s: Large assembly language file. This is the code that runs before system call specific code.&amp;lt;br&amp;gt;&lt;br /&gt;
shced.h -&amp;gt; Contains definition of task_struct. Data structure that keeps track of a process.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What criteria should the scheduler use in deciding what to run?&amp;lt;br&amp;gt;&lt;br /&gt;
*Fairness: Starvation is when a program does not get the CPU &amp;lt;br&amp;gt;&lt;br /&gt;
**Prevent Starvation &amp;lt;br&amp;gt;&lt;br /&gt;
**Absent other conditions, equal allocation of resources&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21225</id>
		<title>Operating Systems 2017F Lecture 17</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21225"/>
		<updated>2017-11-14T19:16:51Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Midterm Review ==&lt;br /&gt;
1. Execve and no it does not create a new process&lt;br /&gt;
&lt;br /&gt;
6. uses of signals:&lt;br /&gt;
* kill process&lt;br /&gt;
* find out when child process is terminated&lt;br /&gt;
* start/stop a process&lt;br /&gt;
* detect when a program has made a ptr error&lt;br /&gt;
&lt;br /&gt;
7. Pointers in C contain virtual memory addresses because the memory of a process is a virtual address space. Each process thinks it has its own stretch of memory.&lt;br /&gt;
&lt;br /&gt;
8. processes make a sys call to allocate memory. execve -&amp;gt; then mmap and/or sbreak to allocate memory&lt;br /&gt;
&lt;br /&gt;
9. shell opens the file output.txt.&lt;br /&gt;
&lt;br /&gt;
10. mmap contents of file can allocate the contents of it into ram.&lt;br /&gt;
* comparing 1 mb of both files at a time will be less expensive&lt;br /&gt;
* only makes sense to mmap if you will access files multiple times&lt;br /&gt;
&lt;br /&gt;
11. producer and consumer now have no way of talking to each other because they do not share the same memory.&lt;br /&gt;
&lt;br /&gt;
12. no. there is a race condition. while loop loops while sem &amp;lt; 0.&lt;br /&gt;
someone else could access and modify the variable between the while and the sem--;.&lt;br /&gt;
* you need special instructions to test and set the variable at the same time.&lt;br /&gt;
* also, int sem parameter isn&#039;t a ptr so it&#039;s a local variable.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking? Some tips for low level kernel code:&lt;br /&gt;
Be humble; You cannot know how everything works&amp;lt;br&amp;gt;&lt;br /&gt;
Verify your assumptions as you go&amp;lt;br&amp;gt;&lt;br /&gt;
Perform lots of experiments&amp;lt;br&amp;gt;&lt;br /&gt;
Incremental Development, compile and run often&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Check for errors ALWAYS or they will cascade and hurt you later&amp;lt;br&amp;gt;&lt;br /&gt;
This will save you from later errors&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel has to live cleanly&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Find another part of the kernel that is close to what you want to do (Search online! This is a good link: http://elixir.free-electrons.com/linux/v4.4.83/source &amp;lt;br&amp;gt;&lt;br /&gt;
You do not understand all abstractions and assumptions, so &amp;quot;pattern match&amp;quot; to minimize trouble &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Realize that the assumptions behind code you don&#039;t necessarily match to your own. Spend the time reading other people&#039;s code. &amp;lt;br&amp;gt;&lt;br /&gt;
Understand the &amp;quot;flow of control&amp;quot; inside the program&amp;lt;br&amp;gt;&lt;br /&gt;
*Architecture&amp;lt;br&amp;gt;&lt;br /&gt;
*Division of responsibilities&amp;lt;br&amp;gt;&lt;br /&gt;
*Purpose of data structures/objects&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the tutorial 6 he gave us a link for a reason. If you click on it you can search getpid and then dig deeper! For example cut and paste the line inside getuid function. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduling&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler decides when what process should run at a high level&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: How does the scheduler work/kernel control when a program runs/how can you make sure one program does not take over CPU from anyone else?&amp;lt;br&amp;gt;&lt;br /&gt;
CPU is given entirely to userspace processes to run most of the time&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel needs to run when it needs to run and no process should be able to stop it&amp;lt;br&amp;gt;&lt;br /&gt;
* The interrupt table: pointers to code that the CPU runs when it receives different hardware or software interrupts. Since the kernel runs first it gets to set the interrupt table. Only supervisor code can change the table not user code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the Ethernet card receives data: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The Ethernet card sends an interrupt to the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
2) The CPU calls the kernel code for handling Ethernet data  &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the clock generates a timer interrupt: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The CPU calls the kernel code for handling timer interrupts &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2) In order to process an interrupt, a CPU core has to be taken over&amp;lt;br&amp;gt;&lt;br /&gt;
3) That core was probably running a userspace process &amp;lt;br&amp;gt;&lt;br /&gt;
4) Scheduling is all about what to do after having kicked a userspace process off of a core&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally on a core:&amp;lt;br&amp;gt;&lt;br /&gt;
* Userspace is happening&amp;lt;br&amp;gt;&lt;br /&gt;
* Interrupt happens &amp;lt;br&amp;gt;&lt;br /&gt;
* core switches to supervisor mode, runs kernel code&amp;lt;br&amp;gt;&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run. Repeat the process&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler needs to be efficient because interrupts are frequent and we do not want to waste resources that could be put towards actual computing&amp;lt;br&amp;gt;&lt;br /&gt;
Entry and exit to kernel has to do low-level tasks like changing CPU modes, manage CPU registers. This is Assembly code. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Go to http://elixir.free-electrons.com/linux/v4.4.83/source&amp;lt;br&amp;gt;&lt;br /&gt;
Go into arch: code specific to CPU architecture. Two most commons are arm and x86&amp;lt;br&amp;gt;&lt;br /&gt;
Go up one level&amp;lt;br&amp;gt;&lt;br /&gt;
Drivers directory have drivers for all kinds of things&amp;lt;br&amp;gt;&lt;br /&gt;
Linux Kernel designed for x86 but it now abstracted to support different architectures. &lt;br /&gt;
Go into architecture -&amp;gt; x86 -&amp;gt; entry &amp;lt;br&amp;gt;&lt;br /&gt;
Open entry.s: Large assembly language file. This is the code that runs before system call specific code.&amp;lt;br&amp;gt;&lt;br /&gt;
shced.h -&amp;gt; Contains definition of task_struct. Data structure that keeps track of a process.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
What criteria should the scheduler use in deciding what to run?&amp;lt;br&amp;gt;&lt;br /&gt;
*Fairness: Starvation is when a program does not get the CPU &amp;lt;br&amp;gt;&lt;br /&gt;
*Prevent Starvation &amp;lt;br&amp;gt;&lt;br /&gt;
*Absent other conditions, equal allocation of resources&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21224</id>
		<title>Operating Systems 2017F Lecture 17</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2017F_Lecture_17&amp;diff=21224"/>
		<updated>2017-11-14T19:15:03Z</updated>

		<summary type="html">&lt;p&gt;Rquaium: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Midterm Review ==&lt;br /&gt;
1. Execve and no it does not create a new process&lt;br /&gt;
&lt;br /&gt;
6. uses of signals:&lt;br /&gt;
* kill process&lt;br /&gt;
* find out when child process is terminated&lt;br /&gt;
* start/stop a process&lt;br /&gt;
* detect when a program has made a ptr error&lt;br /&gt;
&lt;br /&gt;
7. Pointers in C contain virtual memory addresses because the memory of a process is a virtual address space. Each process thinks it has its own stretch of memory.&lt;br /&gt;
&lt;br /&gt;
8. processes make a sys call to allocate memory. execve -&amp;gt; then mmap and/or sbreak to allocate memory&lt;br /&gt;
&lt;br /&gt;
9. shell opens the file output.txt.&lt;br /&gt;
&lt;br /&gt;
10. mmap contents of file can allocate the contents of it into ram.&lt;br /&gt;
* comparing 1 mb of both files at a time will be less expensive&lt;br /&gt;
* only makes sense to mmap if you will access files multiple times&lt;br /&gt;
&lt;br /&gt;
11. producer and consumer now have no way of talking to each other because they do not share the same memory.&lt;br /&gt;
&lt;br /&gt;
12. no. there is a race condition. while loop loops while sem &amp;lt; 0.&lt;br /&gt;
someone else could access and modify the variable between the while and the sem--;.&lt;br /&gt;
* you need special instructions to test and set the variable at the same time.&lt;br /&gt;
* also, int sem parameter isn&#039;t a ptr so it&#039;s a local variable.&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
&lt;br /&gt;
How do you do kernel hacking? Some tips for low level kernel code:&lt;br /&gt;
Be humble; You cannot know how everything works&amp;lt;br&amp;gt;&lt;br /&gt;
Verify your assumptions as you go&amp;lt;br&amp;gt;&lt;br /&gt;
Perform lots of experiments&amp;lt;br&amp;gt;&lt;br /&gt;
Incremental Development, compile and run often&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Check for errors ALWAYS or they will cascade and hurt you later&amp;lt;br&amp;gt;&lt;br /&gt;
This will save you from later errors&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel has to live cleanly&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Find another part of the kernel that is close to what you want to do (Search online! This is a good link: http://elixir.free-electrons.com/linux/v4.4.83/source &amp;lt;br&amp;gt;&lt;br /&gt;
You do not understand all abstractions and assumptions, so &amp;quot;pattern match&amp;quot; to minimize trouble &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
Realize that the assumptions behind code you don&#039;t necessarily match to your own. Spend the time reading other people&#039;s code. &amp;lt;br&amp;gt;&lt;br /&gt;
Understand the &amp;quot;flow of control&amp;quot; inside the program&amp;lt;br&amp;gt;&lt;br /&gt;
*Architecture&amp;lt;br&amp;gt;&lt;br /&gt;
*Division of responsibilities&amp;lt;br&amp;gt;&lt;br /&gt;
*Purpose of data structures/objects&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the tutorial 6 he gave us a link for a reason. If you click on it you can search getpid and then dig deeper! For example cut and paste the line inside getuid function. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduling&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler decides when what process should run at a high level&amp;lt;br&amp;gt;&lt;br /&gt;
Questions: How does the scheduler work/kernel control when a program runs/how can you make sure one program does not take over CPU from anyone else?&amp;lt;br&amp;gt;&lt;br /&gt;
CPU is given entirely to userspace processes to run most of the time&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel needs to run when it needs to run and no process should be able to stop it&amp;lt;br&amp;gt;&lt;br /&gt;
* The interrupt table: pointers to code that the CPU runs when it receives different hardware or software interrupts. Since the kernel runs first it gets to set the interrupt table. Only supervisor code can change the table not user code.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the Ethernet card receives data: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The Ethernet card sends an interrupt to the kernel &amp;lt;br&amp;gt;&lt;br /&gt;
2) The CPU calls the kernel code for handling Ethernet data  &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
When the clock generates a timer interrupt: &amp;lt;br&amp;gt;&lt;br /&gt;
1) The CPU calls the kernel code for handling timer interrupts &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2) In order to process an interrupt, a CPU core has to be taken over&amp;lt;br&amp;gt;&lt;br /&gt;
3) That core was probably running a userspace process &amp;lt;br&amp;gt;&lt;br /&gt;
4) Scheduling is all about what to do after having kicked a userspace process off of a core&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Normally on a core:&amp;lt;br&amp;gt;&lt;br /&gt;
* Userspace is happening&amp;lt;br&amp;gt;&lt;br /&gt;
* Interrupt happens &amp;lt;br&amp;gt;&lt;br /&gt;
* core switches to supervisor mode, runs kernel code&amp;lt;br&amp;gt;&lt;br /&gt;
* last part of kernel code is scheduler, chooses which userspace code to run. Repeat the process&amp;lt;br&amp;gt;&lt;br /&gt;
Kernel is entered via interrupts, exited via the scheduler&amp;lt;br&amp;gt;&lt;br /&gt;
Scheduler needs to be efficient because interrupts are frequent and we do not want to waste resources that could be put towards actual computing&amp;lt;br&amp;gt;&lt;br /&gt;
Entry and exit to kernel has to do low-level tasks like changing CPU modes, manage CPU registers. This is Assembly code. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Go to http://elixir.free-electrons.com/linux/v4.4.83/source&amp;lt;br&amp;gt;&lt;br /&gt;
Go into arch: code specific to CPU architecture. Two most commons are arm and x86&amp;lt;br&amp;gt;&lt;br /&gt;
Go up one level&amp;lt;br&amp;gt;&lt;br /&gt;
Drivers directory have drivers for all kinds of things&amp;lt;br&amp;gt;&lt;br /&gt;
Linux Kernel designed for x86 but it now abstracted to support different architectures. &lt;br /&gt;
Go into architecture -&amp;gt; x86 -&amp;gt; entry &amp;lt;br&amp;gt;&lt;br /&gt;
Open entry.s: Large assembly language file. This is the code that runs before system call specific code.&amp;lt;br&amp;gt;&lt;br /&gt;
shced.h -&amp;gt; Contains definition of task_struct. Data structure that keeps track of a process.&lt;/div&gt;</summary>
		<author><name>Rquaium</name></author>
	</entry>
</feed>