<?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=COMP_3000_2011_Week_9_Notes</id>
	<title>COMP 3000 2011 Week 9 Notes - 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=COMP_3000_2011_Week_9_Notes"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_2011_Week_9_Notes&amp;action=history"/>
	<updated>2026-05-02T04:43:30Z</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=COMP_3000_2011_Week_9_Notes&amp;diff=13058&amp;oldid=prev</id>
		<title>Sbrett: Created page with &quot;Test Review (with Ann Fry)  will go over Q5 before test  30 mins test Anil will have Q&amp;A before the test  Go over lab notes, and study questions  1) 	Q:Without errors, what does …&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_2011_Week_9_Notes&amp;diff=13058&amp;oldid=prev"/>
		<updated>2011-11-08T01:32:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Test Review (with Ann Fry)  will go over Q5 before test  30 mins test Anil will have Q&amp;amp;A before the test  Go over lab notes, and study questions  1) 	Q:Without errors, what does …&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Test Review (with Ann Fry)&lt;br /&gt;
&lt;br /&gt;
will go over Q5 before test&lt;br /&gt;
&lt;br /&gt;
30 mins test&lt;br /&gt;
Anil will have Q&amp;amp;A before the test&lt;br /&gt;
&lt;br /&gt;
Go over lab notes, and study questions&lt;br /&gt;
&lt;br /&gt;
1) 	Q:Without errors, what does the execve system call return? &lt;br /&gt;
	A:execve doesn&amp;#039;t return on success because process is replaced. (Found in man page of execve)&lt;br /&gt;
&lt;br /&gt;
2)	Q:Can a process modify its argument variables? Environment variables? &lt;br /&gt;
	A:Yes, Yes.  Regular variables defined in process address space by the kernel &amp;amp; made accessible by libc&lt;br /&gt;
	Kernel copies the args of execve into the top of memory of the new program image (running in the old process)&lt;br /&gt;
&lt;br /&gt;
3)	Q:Who calls a signal handler?&lt;br /&gt;
	A:The kernel.  Kernel emits the signal which is caught by the processes handler, so essentially the kernel calls the handler&lt;br /&gt;
	&amp;quot;machine generated error messages handled by the kerenl are sent via signals eg.(divide by zero &amp;amp; seg fault)&lt;br /&gt;
	Kernel calls the signal dispatcher in the process that calls the actual handler&amp;quot;&lt;br /&gt;
&lt;br /&gt;
4)	Q:If a parent and child process start printing &amp;quot;Parent\n&amp;quot; and &amp;quot;Child\n&amp;quot; to standard out, what will be the order of the output? &lt;br /&gt;
	A:Order is indeterminate (printing 2 words continuously).  The scheduler determines how they are interleaved, either could go first.&lt;br /&gt;
&lt;br /&gt;
5)	Q:In race-demo, why does the consumer sometimes finish before the producer has done hardly anything? &lt;br /&gt;
	A:*dont worry for test*  We will get it before next class&lt;br /&gt;
&lt;br /&gt;
6)	Q:What does pthread_join() do? &lt;br /&gt;
	A:Blocks calling thread until the specified thread id terminates&lt;br /&gt;
	(Ann posted a link in the answer key of Lab4 with mutex tutorial)&lt;br /&gt;
&lt;br /&gt;
7)	Q:How is argc calculated? Note that argc is not specified by execve! &lt;br /&gt;
	A:Calculated by libc in a process before main starts.  # of args are counted by walking argv&lt;br /&gt;
&lt;br /&gt;
8)	Q:What parts of the kernel would you need to re-implement in userspace in order to simulate a loopback mount? &lt;br /&gt;
	A:Re-implemeting the file system (ext4) in userspace - then you can parse the file system image.&lt;br /&gt;
	WHY? It&amp;#039;s a weird data structure, you can parse the file system image just like any file, you just can&amp;#039;t use &amp;quot;file&amp;quot; operations because those are implemented in the kernel, but you could simulate them even by copying the kernel code into userspace.&lt;br /&gt;
&lt;br /&gt;
9)	Q:Why are sparse files tricky to copy? &lt;br /&gt;
	A:When you read them they do not look sparse.&lt;br /&gt;
	Scenario 1: trasferrring between file systems types, must allocate memory for entire file.&lt;br /&gt;
&lt;br /&gt;
10)	Q:What is the relationship between lost+found and fsck?&lt;br /&gt;
	A:If an improper shutdown, Linux throws all potentially corrupt files into lost+found directory for that partition&lt;br /&gt;
	fsck is used for disk recovery.  &lt;br /&gt;
	fsck will go into lost+found directory and try to recover files&lt;/div&gt;</summary>
		<author><name>Sbrett</name></author>
	</entry>
</feed>