<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2020W_Lecture_12</id>
	<title>Operating Systems 2020W Lecture 12 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2020W_Lecture_12"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2020W_Lecture_12&amp;action=history"/>
	<updated>2026-06-02T22:26:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2020W_Lecture_12&amp;diff=22577&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lecture given on February 14, 2020 [https://homeostasis.scs.carleton.ca/~soma/os-2020w/lectures/comp3000-2020w-lec12-20200214.m4v is now available]....&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2020W_Lecture_12&amp;diff=22577&amp;oldid=prev"/>
		<updated>2020-03-20T02:34:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lecture given on February 14, 2020 [https://homeostasis.scs.carleton.ca/~soma/os-2020w/lectures/comp3000-2020w-lec12-20200214.m4v is now available]....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
Video from the lecture given on February 14, 2020 [https://homeostasis.scs.carleton.ca/~soma/os-2020w/lectures/comp3000-2020w-lec12-20200214.m4v is now available].&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 12&lt;br /&gt;
----------&lt;br /&gt;
&lt;br /&gt;
* Assignment 2 hints&lt;br /&gt;
  - Q3&lt;br /&gt;
  - Q1&lt;br /&gt;
  - Q2&lt;br /&gt;
  - Q4&lt;br /&gt;
  - Q6&lt;br /&gt;
  - Q14&lt;br /&gt;
  - Q17 walkthrough&lt;br /&gt;
* Assignment 1 solutions&lt;br /&gt;
&lt;br /&gt;
You cannot decide between physical and logical sizes based on which is bigger.&lt;br /&gt;
 - because of coarse allocation (can only allocate in blocks), physical size can be bigger than logical size&lt;br /&gt;
 - but files can have holes, which means logical size is bigger than physical size&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RAM means addreses (pointers), code + data (variables, etc) in a process&lt;br /&gt;
 - they go away when a process terminates&lt;br /&gt;
&lt;br /&gt;
logical/physical size refers to properties of files (data stored persistently&lt;br /&gt;
on disk, referred to by a filename)&lt;br /&gt;
 - can figure out both based on info in the inode of a file&lt;br /&gt;
 - fstat/lstat tells you about inodes&lt;br /&gt;
&lt;br /&gt;
a hole in a file is a range of null bytes (zeros) that aren&amp;#039;t explicitly stored&lt;br /&gt;
in blocks on disk&lt;br /&gt;
 - instead, there is just a note that &amp;quot;byte range X-Y is all zeros&amp;quot;&lt;br /&gt;
 - why bother allocating blocks for zeros?&lt;br /&gt;
 - if you write to this part of the file, blocks will be allocated&lt;br /&gt;
   (allocation is thus lazy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RAM is allocated with sbrk, anonymous mmaps, and malloc&lt;br /&gt;
disk space is allocated with file operations (open, read, write, close, seek)&lt;br /&gt;
 - mmap can be used to map disk files into ram, but the size of the file&lt;br /&gt;
   is then fixed&lt;br /&gt;
&lt;br /&gt;
Midterm is on Assignment 1 and 2&lt;br /&gt;
&lt;br /&gt;
du reports physical size of files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;one trillion zeros&amp;quot;  &amp;lt;--- how many bytes does this consume?&lt;br /&gt;
&lt;br /&gt;
note all files have to take up some space&lt;br /&gt;
 - for their inode&lt;br /&gt;
 - so &amp;quot;holes&amp;quot; can be stored in an inode sometimes, depending&lt;br /&gt;
   on the design of the filesystem, or maybe just using one data block&lt;br /&gt;
&lt;br /&gt;
How do you get files to show up in lost+found?&lt;br /&gt;
 - you lose a directory&lt;br /&gt;
   - no directory means no names for files&lt;br /&gt;
   - but if those inodes are still allocated, fsck will find them and say&lt;br /&gt;
     &amp;quot;hey, I have these allocated inodes but no filenames for them.&lt;br /&gt;
      I don&amp;#039;t know where they belong so I should put them in lost+found&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 - ideally, make lots of directories and files&lt;br /&gt;
 - I suggest rsync -a /etc &amp;lt;your mountpoint&amp;gt;&lt;br /&gt;
    - will get you lots of files&lt;br /&gt;
    - make sure your mountpoint is writable (after mounting)&lt;br /&gt;
      (do it as root or change the ownership of the directory in the top of&lt;br /&gt;
       the filesystem to be your current user)&lt;br /&gt;
 - then study the structure of the filesystem using dumpe2fs&lt;br /&gt;
   - find out the group number based on inode&lt;br /&gt;
   - find inode table blocks for that group&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>