<?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=COMP3000_Operating_Systems_F23%3A_Tutorial_2</id>
	<title>COMP3000 Operating Systems F23: Tutorial 2 - 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=COMP3000_Operating_Systems_F23%3A_Tutorial_2"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;action=history"/>
	<updated>2026-05-12T18:06:35Z</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=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24516&amp;oldid=prev</id>
		<title>Abdou: /* Part A */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24516&amp;oldid=prev"/>
		<updated>2023-09-27T15:49:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Part A&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:49, 27 September 2023&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-l30&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&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;Here you may need some basic knowledge of the assembly language. For now, you do not need to read and understand each line (and it will not be the focus of this course).&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;Here you may need some basic knowledge of the assembly language. For now, you do not need to read and understand each line (and it will not be the focus of this course).&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;div&gt;In general, such assembly code is divided into three colums: starting at position/character 1 will be labels/symbols (which you can refer to), followed by mnemonics (instruction opcodes) and last corresponding arguments (operands).&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 general, such assembly code is divided into three colums: starting at position/character 1 will be labels/symbols (which you can refer to), followed by mnemonics (instruction opcodes) and last corresponding arguments (operands).&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;You can &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;turn to &lt;/del&gt;related documentation&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/manuals &lt;/del&gt;like: [https://en.wikibooks.org/wiki/X86_Assembly/GNU_assembly_syntax x86 Assembly/GNU assembly syntax]&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;You can &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;check out &lt;/ins&gt;related documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;like: [https://en.wikibooks.org/wiki/X86_Assembly/GNU_assembly_syntax x86 Assembly/GNU assembly syntax]&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;div&gt;# Looking at the &amp;lt;tt&amp;gt;.s&amp;lt;/tt&amp;gt; file produced from &amp;lt;tt&amp;gt;gcc -S -O2 hello.c&amp;lt;/tt&amp;gt;, do you see anything familiar and discussed in the lectures of our first weeks?&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;# Looking at the &amp;lt;tt&amp;gt;.s&amp;lt;/tt&amp;gt; file produced from &amp;lt;tt&amp;gt;gcc -S -O2 hello.c&amp;lt;/tt&amp;gt;, do you see anything familiar and discussed in the lectures of our first weeks?&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;div&gt;# Where (e.g., at which line) is it supposed to call that &amp;lt;tt&amp;gt;printf()&amp;lt;/tt&amp;gt;? If it is not doing that, &amp;lt;tt&amp;gt;why?&amp;lt;/tt&amp;gt; (you can just mention what you think/believe)&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;# Where (e.g., at which line) is it supposed to call that &amp;lt;tt&amp;gt;printf()&amp;lt;/tt&amp;gt;? If it is not doing that, &amp;lt;tt&amp;gt;why?&amp;lt;/tt&amp;gt; (you can just mention what you think/believe)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Abdou</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24515&amp;oldid=prev</id>
		<title>Abdou: /* Part A */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24515&amp;oldid=prev"/>
		<updated>2023-09-27T14:09:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Part A&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 14:09, 27 September 2023&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-l31&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&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 general, such assembly code is divided into three colums: starting at position/character 1 will be labels/symbols (which you can refer to), followed by mnemonics (instruction opcodes) and last corresponding arguments (operands).&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 general, such assembly code is divided into three colums: starting at position/character 1 will be labels/symbols (which you can refer to), followed by mnemonics (instruction opcodes) and last corresponding arguments (operands).&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;div&gt;You can turn to related documentation/manuals like: [https://en.wikibooks.org/wiki/X86_Assembly/GNU_assembly_syntax x86 Assembly/GNU assembly syntax]&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;You can turn to related documentation/manuals like: [https://en.wikibooks.org/wiki/X86_Assembly/GNU_assembly_syntax x86 Assembly/GNU assembly syntax]&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;# Looking at the &amp;lt;tt&amp;gt;.s&amp;lt;/tt&amp;gt; file produced from &amp;lt;tt&amp;gt;gcc -S -O2 hello.c&amp;lt;/tt&amp;gt;, do you see anything familiar and discussed in the lectures of our first &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;week&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;# Looking at the &amp;lt;tt&amp;gt;.s&amp;lt;/tt&amp;gt; file produced from &amp;lt;tt&amp;gt;gcc -S -O2 hello.c&amp;lt;/tt&amp;gt;, do you see anything familiar and discussed in the lectures of our first &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;weeks&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;div&gt;# Where (e.g., at which line) is it supposed to call that &amp;lt;tt&amp;gt;printf()&amp;lt;/tt&amp;gt;? If it is not doing that, &amp;lt;tt&amp;gt;why?&amp;lt;/tt&amp;gt; (you can just mention what you think/believe)&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;# Where (e.g., at which line) is it supposed to call that &amp;lt;tt&amp;gt;printf()&amp;lt;/tt&amp;gt;? If it is not doing that, &amp;lt;tt&amp;gt;why?&amp;lt;/tt&amp;gt; (you can just mention what you think/believe)&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;div&gt;# Generate the .s file for [https://people.scs.carleton.ca/~abdou/comp3000/f23/tut2/syscall-hello.c syscall-hello.c] as well. Observing the two .s files, what do you think is the key difference?&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;# Generate the .s file for [https://people.scs.carleton.ca/~abdou/comp3000/f23/tut2/syscall-hello.c syscall-hello.c] as well. Observing the two .s files, what do you think is the key difference?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Abdou</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24514&amp;oldid=prev</id>
		<title>Abdou at 02:01, 27 September 2023</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24514&amp;oldid=prev"/>
		<updated>2023-09-27T02:01:18Z</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 02:01, 27 September 2023&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 tutorial, you will revisit the lifecyle of a program, from source code, to an executable (binary image), and further to being loaded into the address space. Then from a different angle, you can see when in execution, how the program (now a process) makes different types of calls to function, and how its memory is laid out.&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 tutorial, you will revisit the lifecyle of a program, from source code, to an executable (binary image), and further to being loaded into the address space. Then from a different angle, you can see when in execution, how the program (now a process) makes different types of calls to function, and how its memory is laid out.&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; 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;==General Instructions (same for all tutorials)==&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; 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; 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;&amp;lt;div class=&quot;mw-collapsible mw-collapsed&quot;&amp;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; 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;Click on Expand to view.&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; 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;&amp;lt;div class=&quot;mw-collapsible-content&quot;&amp;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; 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;Tutorials are graded based on participation and effort (&#039;&#039;&#039;so no need to struggle to have the “correct” answers — what matters is the attempts and sufficient thinking reflected in your answers&#039;&#039;&#039;), but you should still turn in your work. Submit your answers on Brightspace as a single text file named &quot;&amp;lt;username&amp;gt;-comp3000-t&amp;lt;n&amp;gt;.txt&quot; (where username is your MyCarletonOne username and n is the tutorial number). The first four lines of this file should be &quot;COMP 3000 Tutorial &amp;lt;n&amp;gt;&quot;, your name, student number, and the date of submission. Your submitted answers must at least respond to all the items in the &#039;&#039;&#039;Tasks/Questions&#039;&#039;&#039; section.&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; 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; 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;The deadline is usually four days after the tutorial date (see the actual deadline on the submission entry). Note that the submission entry is enforced by the system, so you may fail to get the effort marks even if it is one minute past the deadline.&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; 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; 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;You should also check in with your assigned TA (in person or by responding to a poll if online). Your TA will be your first point of contact when you have questions or encounter any issues during the tutorial session. &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; 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; 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;You get 1.5 marks for submitting answers that shows your effort and 0.5 for checking in, making this tutorial worth 2 points total.&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; 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; 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;Read through the instructions before starting your work to get an overall picture. When source files are needed, you can download them by clicking on the hyperlink.&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; 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;&amp;lt;/div&amp;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; 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;&amp;lt;/div&amp;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;==Building Your Program==&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;==Building Your Program==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Abdou</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24513&amp;oldid=prev</id>
		<title>Abdou: /* Part C */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24513&amp;oldid=prev"/>
		<updated>2023-09-27T02:00:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Part C&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 02:00, 27 September 2023&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-l67&quot;&gt;Line 67:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 67:&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;===Part C===&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;===Part C===&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;Compile and run [https://people.scs.carleton.ca/~&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lianyingzhao&lt;/del&gt;/comp3000/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;w23&lt;/del&gt;/tut2/3000memview.c 3000memview.c], then consider the following questions (if they turn out to be difficult, document your exploration and get some thinking).&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;Compile and run [https://people.scs.carleton.ca/~&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abdou&lt;/ins&gt;/comp3000/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;f23&lt;/ins&gt;/tut2/3000memview.c 3000memview.c], then consider the following questions (if they turn out to be difficult, document your exploration and get some thinking).&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;# Why are the addresses inconsistent between runs?&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;# Why are the addresses inconsistent between runs?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Abdou</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24512&amp;oldid=prev</id>
		<title>Abdou: /* Part B */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24512&amp;oldid=prev"/>
		<updated>2023-09-27T02:00:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Part B&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 02:00, 27 September 2023&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-l59&quot;&gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#: &amp;lt;tt&amp;gt;gcc -O2 -z lazy hello.c -o hello.dynamic&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;#: &amp;lt;tt&amp;gt;gcc -O2 -z lazy hello.c -o hello.dynamic&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;div&gt;#:How does the size of hello.dynamic compare with that of hello.static? &amp;lt;u&amp;gt;Why?&amp;lt;/u&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;#:How does the size of hello.dynamic compare with that of hello.static? &amp;lt;u&amp;gt;Why?&amp;lt;/u&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;# Compile the other flavor of hello.c: [https://people.scs.carleton.ca/~&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lianyingzhao&lt;/del&gt;/comp3000/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;w23&lt;/del&gt;/tut2/syscall-hello.c syscall-hello.c]. Build one static version and one dynamic version as well.  &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;# Compile the other flavor of hello.c: [https://people.scs.carleton.ca/~&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abdou&lt;/ins&gt;/comp3000/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;f23&lt;/ins&gt;/tut2/syscall-hello.c syscall-hello.c]. Build one static version and one dynamic version as well.  &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;div&gt;#: Now considering hello.dynamic, hello.static, syscall-hello.dynamic and syscall-hello.static, see what system calls each program produces by running &amp;lt;tt&amp;gt;strace -o sys-somename.log ./somename.static&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;./somename.dynamic&amp;lt;/tt&amp;gt;). Which version generates more system calls? &amp;lt;u&amp;gt;Why?&amp;lt;/u&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;#: Now considering hello.dynamic, hello.static, syscall-hello.dynamic and syscall-hello.static, see what system calls each program produces by running &amp;lt;tt&amp;gt;strace -o sys-somename.log ./somename.static&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;./somename.dynamic&amp;lt;/tt&amp;gt;). Which version generates more system calls? &amp;lt;u&amp;gt;Why?&amp;lt;/u&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;div&gt;#: Note: system calls are saved in the log file &amp;lt;tt&amp;gt;sys-somename.log&amp;lt;/tt&amp;gt;. Feel free to save them in a different file for each version.&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;#: Note: system calls are saved in the log file &amp;lt;tt&amp;gt;sys-somename.log&amp;lt;/tt&amp;gt;. Feel free to save them in a different file for each version.&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;div&gt;# See what library calls each program produces by running &amp;lt;tt&amp;gt;ltrace -o lib-somename.log ./somename.dynamic&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;./somename.static&amp;lt;/tt&amp;gt;). Which version generates more library calls? &amp;lt;u&amp;gt;Why?&amp;lt;/u&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;# See what library calls each program produces by running &amp;lt;tt&amp;gt;ltrace -o lib-somename.log ./somename.dynamic&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;./somename.static&amp;lt;/tt&amp;gt;). Which version generates more library calls? &amp;lt;u&amp;gt;Why?&amp;lt;/u&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;div&gt;# Remember when building hello in Tutorial 1 you did not use &amp;lt;tt&amp;gt;-z lazy&amp;lt;/tt&amp;gt;. Comparing &amp;lt;tt&amp;gt;hello&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;hello.dynamic&amp;lt;/tt&amp;gt;, any difference? &amp;lt;u&amp;gt;Why this difference?&amp;lt;/u&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;# Remember when building hello in Tutorial 1 you did not use &amp;lt;tt&amp;gt;-z lazy&amp;lt;/tt&amp;gt;. Comparing &amp;lt;tt&amp;gt;hello&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;hello.dynamic&amp;lt;/tt&amp;gt;, any difference? &amp;lt;u&amp;gt;Why this difference?&amp;lt;/u&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;# Use &amp;lt;tt&amp;gt;ldd&amp;lt;/tt&amp;gt; to find out what dynamic library dependencies dynamic versions have. What about static versions?  &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;# Use &amp;lt;tt&amp;gt;ldd&amp;lt;/tt&amp;gt; to find out what dynamic library dependencies dynamic versions have. What about static versions?&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;===Part C===&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;===Part C===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Abdou</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24511&amp;oldid=prev</id>
		<title>Abdou: /* Part A */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24511&amp;oldid=prev"/>
		<updated>2023-09-27T01:59:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Part A&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 01:59, 27 September 2023&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-l50&quot;&gt;Line 50:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 50:&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;# Looking at the &amp;lt;tt&amp;gt;.s&amp;lt;/tt&amp;gt; file produced from &amp;lt;tt&amp;gt;gcc -S -O2 hello.c&amp;lt;/tt&amp;gt;, do you see anything familiar and discussed in the lectures of our first week?&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;# Looking at the &amp;lt;tt&amp;gt;.s&amp;lt;/tt&amp;gt; file produced from &amp;lt;tt&amp;gt;gcc -S -O2 hello.c&amp;lt;/tt&amp;gt;, do you see anything familiar and discussed in the lectures of our first week?&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;div&gt;# Where (e.g., at which line) is it supposed to call that &amp;lt;tt&amp;gt;printf()&amp;lt;/tt&amp;gt;? If it is not doing that, &amp;lt;tt&amp;gt;why?&amp;lt;/tt&amp;gt; (you can just mention what you think/believe)&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;# Where (e.g., at which line) is it supposed to call that &amp;lt;tt&amp;gt;printf()&amp;lt;/tt&amp;gt;? If it is not doing that, &amp;lt;tt&amp;gt;why?&amp;lt;/tt&amp;gt; (you can just mention what you think/believe)&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;# Generate the .s file for [https://people.scs.carleton.ca/~&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lianyingzhao&lt;/del&gt;/comp3000/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;w23&lt;/del&gt;/tut2/syscall-hello.c syscall-hello.c] as well. Observing the two .s files, what do you think is the key difference?&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;# Generate the .s file for [https://people.scs.carleton.ca/~&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abdou&lt;/ins&gt;/comp3000/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;f23&lt;/ins&gt;/tut2/syscall-hello.c syscall-hello.c] as well. Observing the two .s files, what do you think is the key difference?&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;div&gt;# You can play around by trying to see: how a function in C is reflected in assembly; how to return from a function; how variables/literals are represented; what are &amp;#039;&amp;#039;&amp;#039;symbols&amp;#039;&amp;#039;&amp;#039; (refer to commands like &amp;lt;tt&amp;gt;nm&amp;lt;/tt&amp;gt;); etc.&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;# You can play around by trying to see: how a function in C is reflected in assembly; how to return from a function; how variables/literals are represented; what are &amp;#039;&amp;#039;&amp;#039;symbols&amp;#039;&amp;#039;&amp;#039; (refer to commands like &amp;lt;tt&amp;gt;nm&amp;lt;/tt&amp;gt;); etc.&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;/table&gt;</summary>
		<author><name>Abdou</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24510&amp;oldid=prev</id>
		<title>Abdou at 01:58, 27 September 2023</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24510&amp;oldid=prev"/>
		<updated>2023-09-27T01:58:54Z</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 01:58, 27 September 2023&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-l21&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&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;Assuming you use a compiled programming language like C, you will involve the following steps (implicitly) to build your program:&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;Assuming you use a compiled programming language like C, you will involve the following steps (implicitly) to build your program:&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;div&gt;* Compile source (C) code into assembly code (.s files).&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;* Compile source (C) code into assembly code (.s files).&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;*:You can see it using &amp;lt;tt&amp;gt;gcc -S -O2 [https://people.scs.carleton.ca/~&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lianyingzhao&lt;/del&gt;/comp3000/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;w23&lt;/del&gt;/tut1/hello.c hello.c]&amp;lt;/tt&amp;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;*:You can see it using &amp;lt;tt&amp;gt;gcc -S -O2 [https://people.scs.carleton.ca/~&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abdou&lt;/ins&gt;/comp3000/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;f23&lt;/ins&gt;/tut1/hello.c hello.c]&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;div&gt;* Assemble assembly code into machine code placed in object code files (.o files).&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;* Assemble assembly code into machine code placed in object code files (.o files).&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;div&gt;*:To avoid the .o file being deleted automatically, you can do the compilation alone without linking by: &amp;lt;tt&amp;gt;gcc -c -O2 hello.c&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;*:To avoid the .o file being deleted automatically, you can do the compilation alone without linking by: &amp;lt;tt&amp;gt;gcc -c -O2 hello.c&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Abdou</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24509&amp;oldid=prev</id>
		<title>Abdou: Created page with &quot;In this tutorial, you will revisit the lifecyle of a program, from source code, to an executable (binary image), and further to being loaded into the address space. Then from a different angle, you can see when in execution, how the program (now a process) makes different types of calls to function, and how its memory is laid out.  ==General Instructions (same for all tutorials)==  &lt;div class=&quot;mw-collapsible mw-collapsed&quot;&gt; Click on Expand to view. &lt;div class=&quot;mw-collapsi...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=COMP3000_Operating_Systems_F23:_Tutorial_2&amp;diff=24509&amp;oldid=prev"/>
		<updated>2023-09-27T01:57:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;In this tutorial, you will revisit the lifecyle of a program, from source code, to an executable (binary image), and further to being loaded into the address space. Then from a different angle, you can see when in execution, how the program (now a process) makes different types of calls to function, and how its memory is laid out.  ==General Instructions (same for all tutorials)==  &amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt; Click on Expand to view. &amp;lt;div class=&amp;quot;mw-collapsi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In this tutorial, you will revisit the lifecyle of a program, from source code, to an executable (binary image), and further to being loaded into the address space. Then from a different angle, you can see when in execution, how the program (now a process) makes different types of calls to function, and how its memory is laid out.&lt;br /&gt;
&lt;br /&gt;
==General Instructions (same for all tutorials)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
Click on Expand to view.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Tutorials are graded based on participation and effort (&amp;#039;&amp;#039;&amp;#039;so no need to struggle to have the “correct” answers — what matters is the attempts and sufficient thinking reflected in your answers&amp;#039;&amp;#039;&amp;#039;), but you should still turn in your work. Submit your answers on Brightspace as a single text file named &amp;quot;&amp;lt;username&amp;gt;-comp3000-t&amp;lt;n&amp;gt;.txt&amp;quot; (where username is your MyCarletonOne username and n is the tutorial number). The first four lines of this file should be &amp;quot;COMP 3000 Tutorial &amp;lt;n&amp;gt;&amp;quot;, your name, student number, and the date of submission. Your submitted answers must at least respond to all the items in the &amp;#039;&amp;#039;&amp;#039;Tasks/Questions&amp;#039;&amp;#039;&amp;#039; section.&lt;br /&gt;
&lt;br /&gt;
The deadline is usually four days after the tutorial date (see the actual deadline on the submission entry). Note that the submission entry is enforced by the system, so you may fail to get the effort marks even if it is one minute past the deadline.&lt;br /&gt;
&lt;br /&gt;
You should also check in with your assigned TA (in person or by responding to a poll if online). Your TA will be your first point of contact when you have questions or encounter any issues during the tutorial session. &lt;br /&gt;
&lt;br /&gt;
You get 1.5 marks for submitting answers that shows your effort and 0.5 for checking in, making this tutorial worth 2 points total.&lt;br /&gt;
&lt;br /&gt;
Read through the instructions before starting your work to get an overall picture. When source files are needed, you can download them by clicking on the hyperlink.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Building Your Program==&lt;br /&gt;
Assuming you use a compiled programming language like C, you will involve the following steps (implicitly) to build your program:&lt;br /&gt;
* Compile source (C) code into assembly code (.s files).&lt;br /&gt;
*:You can see it using &amp;lt;tt&amp;gt;gcc -S -O2 [https://people.scs.carleton.ca/~lianyingzhao/comp3000/w23/tut1/hello.c hello.c]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Assemble assembly code into machine code placed in object code files (.o files).&lt;br /&gt;
*:To avoid the .o file being deleted automatically, you can do the compilation alone without linking by: &amp;lt;tt&amp;gt;gcc -c -O2 hello.c&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Link object code files together to create a runnable binary image (ELF files, no extension name).&lt;br /&gt;
*:This is the way you did it in Tutorial 1.&lt;br /&gt;
&lt;br /&gt;
==Talking to the OS Kernel via System Calls==&lt;br /&gt;
A process on its own has limited access to the system. It cannot directly access any external devices or data sources (e.g., files, keyboard, the screen, networks) on its own. To access these external resources, to allocate memory, or otherwise change its runtime environment, it must make &amp;#039;&amp;#039;&amp;#039;system calls&amp;#039;&amp;#039;&amp;#039;. So we can say system calls are one way for the contained process to request OS services. Note that system calls run code outside of a process and thus cannot be called like regular function calls. The standard C library provides function wrappers for most commonly-used system calls so they can be accessed like regular C functions. Under the hood, however, these functions make use of special compiler directives in order to generate the machine code necessary to invoke system calls. We will take a closer look later this term.&lt;br /&gt;
&lt;br /&gt;
You can see the system calls produced by a process using the &amp;lt;tt&amp;gt;strace&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that this can be a good example to show the orthogonal relationship between root/non-root users and kernel/user modes. System calls are requesting the kernel to do something in the kernel mode on behalf of the calling process. Therefore, any user (even non-root) process making a system call will at certain point run in the kernel mode.&lt;br /&gt;
&lt;br /&gt;
==Static &amp;amp; Dynamic Libraries==&lt;br /&gt;
Because of abstraction (e.g., for portability or ease of development), most applications are not self-contained. For instance, you call just a simple &amp;lt;tt&amp;gt;printf()&amp;lt;/tt&amp;gt; to output a message instead of drawing pixels on a display using a lot of low-level code. Hence, your program relies on lots of external code.&lt;br /&gt;
In compiled languages such as C, external code can be brought into the process through linking. There are two basic types of linking, static and dynamic linking:&lt;br /&gt;
&lt;br /&gt;
* With static linking, code is brought in at compile time (specifically, in the link stage above) and added to the executable. The code is now the same as other application code. (Static libraries are more &amp;lt;tt&amp;gt;.o&amp;lt;/tt&amp;gt; files like &amp;lt;tt&amp;gt;hello.o&amp;lt;/tt&amp;gt;; in practice, you may see more often &amp;lt;tt&amp;gt;.a&amp;lt;/tt&amp;gt; files, which are &amp;quot;archives&amp;quot; of multiple &amp;lt;tt&amp;gt;.o&amp;lt;/tt&amp;gt; files.)&lt;br /&gt;
* With dynamic linking, a reference to the library code is added to the binary. The actual library code has to later be loaded when the program is executed. This loading will happen before &amp;lt;tt&amp;gt;main()&amp;lt;/tt&amp;gt; is called (you will notice a lot of noisy system calls at the beginning to achieve this). Then, at runtime, calling functions in such dynamic libraries will take the form of &amp;lt;b&amp;gt;library calls&amp;lt;/b&amp;gt; (which only happens within this process in user space, as opposed to system calls in kernel space).&lt;br /&gt;
&lt;br /&gt;
The dynamic libraries associated with a program binary can be found using the &amp;lt;tt&amp;gt;ldd&amp;lt;/tt&amp;gt; command. You can use &amp;lt;tt&amp;gt;ltrace&amp;lt;/tt&amp;gt; to see calls to functions that are dynamically linked.&lt;br /&gt;
&lt;br /&gt;
==Tasks/Questions==&lt;br /&gt;
===Part A===&lt;br /&gt;
Here you may need some basic knowledge of the assembly language. For now, you do not need to read and understand each line (and it will not be the focus of this course).&lt;br /&gt;
In general, such assembly code is divided into three colums: starting at position/character 1 will be labels/symbols (which you can refer to), followed by mnemonics (instruction opcodes) and last corresponding arguments (operands).&lt;br /&gt;
You can turn to related documentation/manuals like: [https://en.wikibooks.org/wiki/X86_Assembly/GNU_assembly_syntax x86 Assembly/GNU assembly syntax]&lt;br /&gt;
# Looking at the &amp;lt;tt&amp;gt;.s&amp;lt;/tt&amp;gt; file produced from &amp;lt;tt&amp;gt;gcc -S -O2 hello.c&amp;lt;/tt&amp;gt;, do you see anything familiar and discussed in the lectures of our first week?&lt;br /&gt;
# Where (e.g., at which line) is it supposed to call that &amp;lt;tt&amp;gt;printf()&amp;lt;/tt&amp;gt;? If it is not doing that, &amp;lt;tt&amp;gt;why?&amp;lt;/tt&amp;gt; (you can just mention what you think/believe)&lt;br /&gt;
# Generate the .s file for [https://people.scs.carleton.ca/~lianyingzhao/comp3000/w23/tut2/syscall-hello.c syscall-hello.c] as well. Observing the two .s files, what do you think is the key difference?&lt;br /&gt;
# You can play around by trying to see: how a function in C is reflected in assembly; how to return from a function; how variables/literals are represented; what are &amp;#039;&amp;#039;&amp;#039;symbols&amp;#039;&amp;#039;&amp;#039; (refer to commands like &amp;lt;tt&amp;gt;nm&amp;lt;/tt&amp;gt;); etc.&lt;br /&gt;
&lt;br /&gt;
===Part B===&lt;br /&gt;
# By default, gcc-produced binaries are dynamically linked (so at runtime they will require dynamic libraries to be present on the system). To compile a binary that is statically linked (so it has no external runtime library dependencies), instead do this:&lt;br /&gt;
#: &amp;lt;tt&amp;gt;gcc -O2 -static hello.c -o hello.static&amp;lt;/tt&amp;gt;&lt;br /&gt;
#: Then compile a dynamically linked version:&lt;br /&gt;
#: &amp;lt;tt&amp;gt;gcc -O2 -z lazy hello.c -o hello.dynamic&amp;lt;/tt&amp;gt;&lt;br /&gt;
#:How does the size of hello.dynamic compare with that of hello.static? &amp;lt;u&amp;gt;Why?&amp;lt;/u&amp;gt;&lt;br /&gt;
# Compile the other flavor of hello.c: [https://people.scs.carleton.ca/~lianyingzhao/comp3000/w23/tut2/syscall-hello.c syscall-hello.c]. Build one static version and one dynamic version as well. &lt;br /&gt;
#: Now considering hello.dynamic, hello.static, syscall-hello.dynamic and syscall-hello.static, see what system calls each program produces by running &amp;lt;tt&amp;gt;strace -o sys-somename.log ./somename.static&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;./somename.dynamic&amp;lt;/tt&amp;gt;). Which version generates more system calls? &amp;lt;u&amp;gt;Why?&amp;lt;/u&amp;gt; &lt;br /&gt;
#: Note: system calls are saved in the log file &amp;lt;tt&amp;gt;sys-somename.log&amp;lt;/tt&amp;gt;. Feel free to save them in a different file for each version.&lt;br /&gt;
# See what library calls each program produces by running &amp;lt;tt&amp;gt;ltrace -o lib-somename.log ./somename.dynamic&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;./somename.static&amp;lt;/tt&amp;gt;). Which version generates more library calls? &amp;lt;u&amp;gt;Why?&amp;lt;/u&amp;gt;&lt;br /&gt;
# Remember when building hello in Tutorial 1 you did not use &amp;lt;tt&amp;gt;-z lazy&amp;lt;/tt&amp;gt;. Comparing &amp;lt;tt&amp;gt;hello&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;hello.dynamic&amp;lt;/tt&amp;gt;, any difference? &amp;lt;u&amp;gt;Why this difference?&amp;lt;/u&amp;gt;&lt;br /&gt;
# Use &amp;lt;tt&amp;gt;ldd&amp;lt;/tt&amp;gt; to find out what dynamic library dependencies dynamic versions have. What about static versions? &lt;br /&gt;
&lt;br /&gt;
===Part C===&lt;br /&gt;
Compile and run [https://people.scs.carleton.ca/~lianyingzhao/comp3000/w23/tut2/3000memview.c 3000memview.c], then consider the following questions (if they turn out to be difficult, document your exploration and get some thinking).&lt;br /&gt;
&lt;br /&gt;
# Why are the addresses inconsistent between runs?&lt;br /&gt;
# Roughly where does the stack seem to be? The heap? Code? Global variables? (hints: recall the memory image layout of a process discussed in the lecture and you can search for a more detailed one somewhere; local variables go to the stack; initialized &amp;#039;&amp;#039;&amp;#039;data&amp;#039;&amp;#039;&amp;#039; and global variables go to the data segment, data allocated at runtime go to the heap.)&lt;br /&gt;
# Change each &amp;lt;tt&amp;gt;malloc()&amp;lt;/tt&amp;gt; call to allocate more than 128K. What happens to the values of &amp;lt;tt&amp;gt;sbrk&amp;lt;/tt&amp;gt;? Why? (Hint: use &amp;lt;tt&amp;gt;strace&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&amp;lt;!-- # Add more code and data to the program, and add more printf&amp;#039;s to see where things are. Are things where you expect them to be? --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Abdou</name></author>
	</entry>
</feed>