<?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_Lab_7_2012</id>
	<title>COMP 3000 Lab 7 2012 - 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_Lab_7_2012"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Lab_7_2012&amp;action=history"/>
	<updated>2026-04-22T11:18:54Z</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_Lab_7_2012&amp;diff=17608&amp;oldid=prev</id>
		<title>Afry: /* /proc//syscall */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Lab_7_2012&amp;diff=17608&amp;oldid=prev"/>
		<updated>2012-11-20T18:50:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;/proc//syscall&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:50, 20 November 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot;&gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;4. What type is &amp;lt;tt&amp;gt;tgid_base_stuff&amp;lt;/tt&amp;gt;?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;4. What type is &amp;lt;tt&amp;gt;tgid_base_stuff&amp;lt;/tt&amp;gt;?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;5. The directory &amp;lt;tt&amp;gt;fd&amp;lt;/tt&amp;gt; is associated with two &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;functions&lt;/del&gt;.  What are &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;those two functions&lt;/del&gt;?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;5. The directory &amp;lt;tt&amp;gt;fd&amp;lt;/tt&amp;gt; is associated with two &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pointers to structs&lt;/ins&gt;.  What are &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;they&lt;/ins&gt;?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;LEARN: Why are there two functions associated with every directory? What do they each do?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;LEARN: Why are there two functions associated with every directory? What do they each do?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l48&quot;&gt;Line 48:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;8. What function is used to output the system call number and other information into the file &amp;lt;tt&amp;gt;/proc/&amp;lt;PID&amp;gt;/syscall&amp;lt;/tt&amp;gt;?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;8. What function is used to output the system call number and other information into the file &amp;lt;tt&amp;gt;/proc/&amp;lt;PID&amp;gt;/syscall&amp;lt;/tt&amp;gt;?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==syscall numbers==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==syscall numbers==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Afry</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Lab_7_2012&amp;diff=17604&amp;oldid=prev</id>
		<title>Soma: /* syscall numbers */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Lab_7_2012&amp;diff=17604&amp;oldid=prev"/>
		<updated>2012-11-19T05:28:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;syscall numbers&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:28, 19 November 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l63&quot;&gt;Line 63:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 63:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;10. What is the system call number of &amp;lt;tt&amp;gt;getpid&amp;lt;/tt&amp;gt;?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;10. What is the system call number of &amp;lt;tt&amp;gt;getpid&amp;lt;/tt&amp;gt;?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;LEARN: Why is this file in assembly language rather than C?  Specifically, what tasks must this code do that is difficult, if not impossible to do in standard C?&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;11. [2] (EXTRA CREDIT) What is this generated file, and how is it generated?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;11. [2] (EXTRA CREDIT) What is this generated file, and how is it generated?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Lab_7_2012&amp;diff=17603&amp;oldid=prev</id>
		<title>Soma at 05:26, 19 November 2012</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Lab_7_2012&amp;diff=17603&amp;oldid=prev"/>
		<updated>2012-11-19T05:26:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:26, 19 November 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this lab you will be taking a tour of parts of the Linux kernel source code in the course of answering a few specific questions.  Along the tour you&amp;#039;ll be required to answer some simple questions.  Note that these questions are generally meant to be straightforward and should require very short answers.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this lab you will be taking a tour of parts of the Linux kernel source code in the course of answering a few specific questions.  Along the tour you&amp;#039;ll be required to answer some simple questions.  Note that these questions are generally meant to be straightforward and should require very short answers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are 10 points in 10 questions, with one extra credit question worth 2 points.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are 10 points in 10 questions, with one extra credit question worth 2 points&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. The lab is due on Wednesday, November 28th, by 11:55 PM&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you just look up the answers to this lab you will miss the point of this lab.  Try to tie the material covered in lecture to what you see in the code.  There are a few &amp;quot;LEARN:&amp;quot; notes.  These are things you should figure out if you don&amp;#039;t know them already.  You won&amp;#039;t be graded on them in this lab; however, expect them to show up on the final in some form.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you just look up the answers to this lab you will miss the point of this lab.  Try to tie the material covered in lecture to what you see in the code.  There are a few &amp;quot;LEARN:&amp;quot; notes.  These are things you should figure out if you don&amp;#039;t know them already.  You won&amp;#039;t be graded on them in this lab; however, expect them to show up on the final in some form.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Lab_7_2012&amp;diff=17602&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;In this lab you will be taking a tour of parts of the Linux kernel source code in the course of answering a few specific questions.  Along the tour you&#039;ll be required to answe...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP_3000_Lab_7_2012&amp;diff=17602&amp;oldid=prev"/>
		<updated>2012-11-19T05:25:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;In this lab you will be taking a tour of parts of the Linux kernel source code in the course of answering a few specific questions.  Along the tour you&amp;#039;ll be required to answe...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In this lab you will be taking a tour of parts of the Linux kernel source code in the course of answering a few specific questions.  Along the tour you&amp;#039;ll be required to answer some simple questions.  Note that these questions are generally meant to be straightforward and should require very short answers.&lt;br /&gt;
&lt;br /&gt;
There are 10 points in 10 questions, with one extra credit question worth 2 points.&lt;br /&gt;
&lt;br /&gt;
If you just look up the answers to this lab you will miss the point of this lab.  Try to tie the material covered in lecture to what you see in the code.  There are a few &amp;quot;LEARN:&amp;quot; notes.  These are things you should figure out if you don&amp;#039;t know them already.  You won&amp;#039;t be graded on them in this lab; however, expect them to show up on the final in some form.&lt;br /&gt;
&lt;br /&gt;
You can go through this lab by looking at a local copy of the linux source code (downloadable from [http://www.kernel.org the Linux Kernel archives] or by looking at the [http://lxr.linux.no/ Linux Cross Reference] (using the 2.6.11 and later branch).&lt;br /&gt;
&lt;br /&gt;
==The Linux Banner==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;QUESTION:&amp;#039;&amp;#039;&amp;#039; What code prints the &amp;quot;Linux version&amp;quot; banner when the kernel first starts up?&lt;br /&gt;
&lt;br /&gt;
The Linux kernel&amp;#039;s architecture-independent start-up code is in the &amp;lt;tt&amp;gt;init&amp;lt;/tt&amp;gt; directory.  As you might guess, the main startup code is in &amp;lt;tt&amp;gt;init/main.c&amp;lt;/tt&amp;gt;, with the necessary routines being called by the function &amp;lt;tt&amp;gt;start_kernel()&amp;lt;/tt&amp;gt;.  In this function there is a printk that references &amp;lt;tt&amp;gt;linux_banner&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
1. What is the log level of the banner printing printk?&lt;br /&gt;
&lt;br /&gt;
LEARN: What are kernel log levels?  What are they used for?&lt;br /&gt;
&lt;br /&gt;
Now, the definition of &amp;lt;tt&amp;gt;linux_banner&amp;lt;/tt&amp;gt; is not this file, but is instead in &amp;lt;tt&amp;gt;init/version.c&amp;lt;/tt&amp;gt;.  This file is not referenced, however, by &amp;lt;tt&amp;gt;init/main.c&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2. What file declares &amp;lt;tt&amp;gt;linux_banner&amp;lt;/tt&amp;gt; for &amp;lt;tt&amp;gt;init/main.c&amp;lt;/tt&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
==/proc/&amp;lt;PID&amp;gt;/syscall==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;QUESTION:&amp;#039;&amp;#039;&amp;#039; If you look in /proc/&amp;lt;PID&amp;gt;/ (the process-specific directories) you&amp;#039;ll notice a file called &amp;quot;syscall&amp;quot;.  It requires privileges to read this file.  But what is it for?&lt;br /&gt;
&lt;br /&gt;
First, let us find where the code is that produces this file.  First, run &amp;lt;tt&amp;gt;df /proc&amp;lt;/tt&amp;gt;.  You&amp;#039;ll note the filesystem is of type &amp;quot;proc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. How much space is used in /proc?&lt;br /&gt;
&lt;br /&gt;
LEARN: What does it mean to mount a filesystem?  What file specifies static mounts like /proc?&lt;br /&gt;
&lt;br /&gt;
LEARN: What storage is associated with /proc?&lt;br /&gt;
&lt;br /&gt;
The code for the proc filesystem is in &amp;lt;tt&amp;gt;fs/proc&amp;lt;/tt&amp;gt;.  But where is the code for this particular file?  Well, if you look in &amp;lt;tt&amp;gt;fs/proc/base.c&amp;lt;/tt&amp;gt;, you&amp;#039;ll find a struct call &amp;lt;tt&amp;gt;tgid_base_stuff&amp;lt;/tt&amp;gt;.  In this, you&amp;#039;ll see the string &amp;quot;syscall&amp;quot; is associated with the function &amp;lt;tt&amp;gt;proc_pid_syscall()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
4. What type is &amp;lt;tt&amp;gt;tgid_base_stuff&amp;lt;/tt&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
5. The directory &amp;lt;tt&amp;gt;fd&amp;lt;/tt&amp;gt; is associated with two functions.  What are those two functions?&lt;br /&gt;
&lt;br /&gt;
LEARN: Why are there two functions associated with every directory? What do they each do?&lt;br /&gt;
&lt;br /&gt;
Look at the code of &amp;lt;tt&amp;gt;proc_pid_syscall()&amp;lt;/tt&amp;gt;.  In this function, there is a call to &amp;lt;tt&amp;gt;task_current_syscall()&amp;lt;/tt&amp;gt; (in lib/syscall.c), which does the real work.  The comments for that function indicates that it is used to &amp;quot;Discover what a blocked task is doing.&amp;quot;  Thus, /proc/&amp;lt;PID&amp;gt;/syscall gives information on the current system call being executed by a process, if any.&lt;br /&gt;
&lt;br /&gt;
6. What variable holds the current system call number in &amp;lt;tt&amp;gt;proc_pid_syscall()&amp;lt;/tt&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
7. What variable holds the current system call number in &amp;lt;tt&amp;gt;task_current_syscall()&amp;lt;/tt&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
8. What function is used to output the system call number and other information into the file &amp;lt;tt&amp;gt;/proc/&amp;lt;PID&amp;gt;/syscall&amp;lt;/tt&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==syscall numbers==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;QUESTION:&amp;#039;&amp;#039;&amp;#039; What code converts system call numbers to internal kernel functions?&lt;br /&gt;
&lt;br /&gt;
The system call entry into the kernel for x86-64 is defined in &amp;lt;tt&amp;gt;arch/x86/kernel/entry_64.S&amp;lt;/tt&amp;gt;.  This is an assembly language file.  The main entry point is defined at &amp;lt;tt&amp;gt;ENTRY(system_call)&amp;lt;/tt&amp;gt;.  The actual system call function invocation is done with the line:&lt;br /&gt;
 call *sys_call_table(,%rax,8)&lt;br /&gt;
Note there are two calls to this, one for the regular path and one for the &amp;quot;fast path&amp;quot;.  Also, notice the &amp;lt;tt&amp;gt;call schedule&amp;lt;/tt&amp;gt; lines in this file.  These are where the scheduler gets invoked.&lt;br /&gt;
&lt;br /&gt;
9. What nearby lines check whether the system call number requested doesn&amp;#039;t exist (is a number bigger than any defined system call)?  Note there are two of them, depending upon a compile time config option.&lt;br /&gt;
&lt;br /&gt;
Now the system call table is defined in another file (of course), &amp;lt;tt&amp;gt;arch/x86/kernel/syscall_64.c&amp;lt;/tt&amp;gt;, with the actual calls coming from a compile-time generated file.  The system call numbers, however, are defined in &amp;lt;tt&amp;gt;x86_64-linux-gnu/asm/unistd_64.h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. What is the system call number of &amp;lt;tt&amp;gt;getpid&amp;lt;/tt&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
11. [2] (EXTRA CREDIT) What is this generated file, and how is it generated?&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>