<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2026F_Lecture_10</id>
	<title>Operating Systems 2026F Lecture 10 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2026F_Lecture_10"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_10&amp;action=history"/>
	<updated>2026-10-25T14:32:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_10&amp;diff=25209&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lectures given on October 15th and 16th, 2026 are now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec10a-20261015.mp4 Lecture 10A] * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec10b-20261016.mp4 Lecture 10B]  ==Notes==  ===Lecture 10A===  &lt;pre&gt; Lecture 10A -----------  What&#039;s going to be on the midterm?  - Assignment 1 &amp; 2  - parts of T1-4 related to A1 &amp; A2  Concepts...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2026F_Lecture_10&amp;diff=25209&amp;oldid=prev"/>
		<updated>2026-10-16T15:04:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lectures given on October 15th and 16th, 2026 are now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec10a-20261015.mp4 Lecture 10A] * [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec10b-20261016.mp4 Lecture 10B]  ==Notes==  ===Lecture 10A===  &amp;lt;pre&amp;gt; Lecture 10A -----------  What&amp;#039;s going to be on the midterm?  - Assignment 1 &amp;amp; 2  - parts of T1-4 related to A1 &amp;amp; A2  Concepts...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
Video from the lectures given on October 15th and 16th, 2026 are now available:&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec10a-20261015.mp4 Lecture 10A]&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2026f/lectures/comp3000-2026f-lec10b-20261016.mp4 Lecture 10B]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
===Lecture 10A===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 10A&lt;br /&gt;
-----------&lt;br /&gt;
&lt;br /&gt;
What&amp;#039;s going to be on the midterm?&lt;br /&gt;
 - Assignment 1 &amp;amp; 2&lt;br /&gt;
 - parts of T1-4 related to A1 &amp;amp; A2&lt;br /&gt;
&lt;br /&gt;
Concepts&lt;br /&gt;
 - environment variables&lt;br /&gt;
   - how to set them&lt;br /&gt;
   - how to retrieve values&lt;br /&gt;
   - how they are passed to other processes/programs&lt;br /&gt;
   - getenv()/setenv()&lt;br /&gt;
 - how shells parse commands &amp;amp; arguments&lt;br /&gt;
   - how system() works&lt;br /&gt;
 - assembly language&lt;br /&gt;
   - compiler/assembler directives&lt;br /&gt;
     (metadata about code)&lt;br /&gt;
   - (high level) how functions work in assembly&lt;br /&gt;
     - start with manipulating the stack&lt;br /&gt;
       (save registers/allocate local variables)&lt;br /&gt;
     - end with a ret instruction&lt;br /&gt;
   - how C symbols show up in assembly&lt;br /&gt;
     (function names and variables)&lt;br /&gt;
   - how C constants show up in assembly&lt;br /&gt;
     - especially strings&lt;br /&gt;
   - if/while/for turn into branches (jmp, jne, etc)&lt;br /&gt;
   - how the compiler will replace some library calls&lt;br /&gt;
     with other calls (puts for printf)&lt;br /&gt;
   - system calls vs function calls in assembly&lt;br /&gt;
     (call vs syscall)&lt;br /&gt;
   - you can&amp;#039;t make system calls directly from C,&lt;br /&gt;
     must use assembly/special compiler directives&lt;br /&gt;
 - fork()&lt;br /&gt;
   - duplicates the process&lt;br /&gt;
   - returns &amp;quot;twice&amp;quot;&lt;br /&gt;
   - parent &amp;amp; child return values&lt;br /&gt;
 - execve()&lt;br /&gt;
   - replaces currently running executable&lt;br /&gt;
   - does NOT create a new process&lt;br /&gt;
 - command line arguments&lt;br /&gt;
   - how to make command line arguments&lt;br /&gt;
   - how they are formatted/arranged in memory&lt;br /&gt;
   - where they are in memory&lt;br /&gt;
 - environment variables&lt;br /&gt;
   - how to set/change them&lt;br /&gt;
   - where they are in memory&lt;br /&gt;
   - how they are arranged in memory&lt;br /&gt;
   - how to get them&lt;br /&gt;
     (arguments to main, extern var, getenv() )&lt;br /&gt;
 - background vs foreground processes&lt;br /&gt;
 - how open files can be shared between processes&lt;br /&gt;
   - including open terminals (e.g., /dev/pts/0)&lt;br /&gt;
 - I/O redirection&lt;br /&gt;
   - how to change stdin, stdout, stderr for a process&lt;br /&gt;
     (file descriptors 0, 1, 2)&lt;br /&gt;
 - file descriptors!&lt;br /&gt;
 - system calls, including wait and read, can fail/&lt;br /&gt;
   return with no result&lt;br /&gt;
    - always should check whether system calls&lt;br /&gt;
      succeeded or not&lt;br /&gt;
 - PATH environment variable, how used by shells&lt;br /&gt;
   to map commands onto executables&lt;br /&gt;
 - signals!&lt;br /&gt;
   - how to send them&lt;br /&gt;
   - how to define signal handlers&lt;br /&gt;
   - how to tell the kernel to use a signal handler&lt;br /&gt;
   - interaction with system calls&lt;br /&gt;
     - restarting system calls&lt;br /&gt;
 - /proc&lt;br /&gt;
   - how it stores info about all running processes&lt;br /&gt;
   - how to access values by reading files&lt;br /&gt;
   - kind of info that is in those files&lt;br /&gt;
   - relationship with ps, top&lt;br /&gt;
 - accounts in UNIX&lt;br /&gt;
   - what makes up an account&lt;br /&gt;
     - entries in passwd, group, shadow, gshadow&lt;br /&gt;
     - home directory&lt;br /&gt;
 - accessing account info with getpwnam() and related&lt;br /&gt;
   functions&lt;br /&gt;
 - password hashing, keeping passwords in /etc/shadow&lt;br /&gt;
   - and why&lt;br /&gt;
 - root vs regular users&lt;br /&gt;
 - setuid, dropping privileges&lt;br /&gt;
 - user vs group vs other permissions&lt;br /&gt;
 - users having their own shell&lt;br /&gt;
   - how to find out what that shell is&lt;br /&gt;
   - how to change it&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lecture 10B===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 10B&lt;br /&gt;
-----------&lt;br /&gt;
&lt;br /&gt;
To review for the midterm, we&amp;#039;re going to make up questions for the midterm.&lt;br /&gt;
&lt;br /&gt;
A1Q1&lt;br /&gt;
Environment variables&lt;br /&gt;
 - What is an environment variable?&lt;br /&gt;
 - What environment variable was used in 3000menu to create a custom command?&lt;br /&gt;
   - either need to include 3000menu code&lt;br /&gt;
   - or this is a test of memorization&lt;br /&gt;
 - what&amp;#039;s the difference between envp and environ?&lt;br /&gt;
 - Another student was trying to set a custom command in 3000menu, but it wasn&amp;#039;t working for them. This is the command they used:&lt;br /&gt;
    MENUCMD=&amp;quot;nano&amp;quot;&lt;br /&gt;
Another student says &amp;quot;Dummy you defined a shell variable!&amp;quot; What did the second student mean, and what did the first do wrong? Why wouldn&amp;#039;t a shell variable work?&lt;br /&gt;
&lt;br /&gt;
A1Q2 &amp;amp; A1Q8&lt;br /&gt;
 - calling system(), which calls /bin/sh -c to execute the command&lt;br /&gt;
 - there&amp;#039;s a fork/execve in there, but it isn&amp;#039;t of the&lt;br /&gt;
   command directly&lt;br /&gt;
&lt;br /&gt;
Possible questions&lt;br /&gt;
 - What does system() do?&lt;br /&gt;
 - What system calls does system() make?&lt;br /&gt;
   - this is a bit tricky because it makes more than&lt;br /&gt;
     fork/execve/wait&lt;br /&gt;
 - 3000menu and 3000menu2 use different ways of handling commands with arguments. Which method do you think is more efficient? Why?&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
I/O redirection&lt;br /&gt;
 - what is file descriptor 1 normally referred to in C?&lt;br /&gt;
 - when a program first opens a file (using open() or other function that calls open()), it normally gets file descriptor 3 first. Why?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>