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

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lecture given on January 15, 2020 [https://homeostasis.scs.carleton.ca/~soma/os-2020w/lectures/comp3000-2020w-lec03-20200115.m4v is now available]. =...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
Video from the lecture given on January 15, 2020 [https://homeostasis.scs.carleton.ca/~soma/os-2020w/lectures/comp3000-2020w-lec03-20200115.m4v is now available].&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 3&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
Structure of a UNIX system&lt;br /&gt;
&lt;br /&gt;
ls&lt;br /&gt;
emacs     &amp;lt;--- regular programs, running in user mode&lt;br /&gt;
firefox&lt;br /&gt;
vi /etc/hostname&lt;br /&gt;
-------------  user/supervisor mode boundary&lt;br /&gt;
&lt;br /&gt;
linux kernel  &amp;lt;--- in between the hardware and regular programs&lt;br /&gt;
                   runs in supervisor mode&lt;br /&gt;
hardware&lt;br /&gt;
&lt;br /&gt;
user and supervisor mode are CPU modes&lt;br /&gt;
 - on x86 chips, they are actually ring 3 and ring 0, but ring 0 and 1 aren&amp;#039;t&lt;br /&gt;
   used so much&lt;br /&gt;
&lt;br /&gt;
ring 0 = supervisor mode&lt;br /&gt;
ring 3 = user mode&lt;br /&gt;
&lt;br /&gt;
in supervisor mode, programs have access to all hardware features&lt;br /&gt;
in user mode, programs have limited access to hardware&lt;br /&gt;
&lt;br /&gt;
it is much safer to run in user mode&lt;br /&gt;
 - can&amp;#039;t crash the system&lt;br /&gt;
&lt;br /&gt;
drivers: code added to the kernel to help it understand specific hardware&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
on UNIX, the root user can do &amp;quot;anything&amp;quot;, while regular users have limited privileges&lt;br /&gt;
 - root on UNIX is the same as Administrator on Windows&lt;br /&gt;
&lt;br /&gt;
a root user has to ask the kernel to do things.  The kernel will generally&lt;br /&gt;
say yes, but it can say no to anything&lt;br /&gt;
 - and there are ways to configure systems where root is very limited&lt;br /&gt;
&lt;br /&gt;
programs running as root are still running in user mode on the CPU&lt;br /&gt;
only the kernel runs in supervisor mode&lt;br /&gt;
&lt;br /&gt;
Focus in first half of class is on the userspace/kernel space boundary and user programs.  Second half, we talk about the kernel.&lt;br /&gt;
&lt;br /&gt;
please don&amp;#039;t stream the lecture over the Carleton VPN.&lt;br /&gt;
 - I&amp;#039;ll show you ways to access the class VMs without the VPN&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
programs running in userspace can&amp;#039;t do I/O on their own, or access much hardware&lt;br /&gt;
 - they get their CPU allotment and some RAM, that&amp;#039;s it&lt;br /&gt;
 - if they want want more RAM or want to talk to the disk, keyboard, screen, etc&lt;br /&gt;
   they have to ask the kernel for access&lt;br /&gt;
&lt;br /&gt;
running programs ask the kernel for things via system calls&lt;br /&gt;
&lt;br /&gt;
you can run many copies of the same program&lt;br /&gt;
each copy of a running program is referred to as a process&lt;br /&gt;
&lt;br /&gt;
processes run in user mode&lt;br /&gt;
the kernel runs in supervisor mode&lt;br /&gt;
&lt;br /&gt;
a &amp;quot;user&amp;quot; is just a label for one or more process&lt;br /&gt;
 - really a number (uid)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
different processes can use the same memory addresses&lt;br /&gt;
  - address 2000 means different things for different processes&lt;br /&gt;
  - each process has its own addresses&lt;br /&gt;
&lt;br /&gt;
a system call has to&lt;br /&gt;
 - switch the CPU mode to supervisor mode&lt;br /&gt;
 - jump to a standard entry point, so the kernel can decide what to do&lt;br /&gt;
&lt;br /&gt;
CPU mode: can be user mode or supervisor mode&lt;br /&gt;
&lt;br /&gt;
a function call can&amp;#039;t on its own invoke kernel code&lt;br /&gt;
 - (the kernel of course is divided into functions like any C program)&lt;br /&gt;
&lt;br /&gt;
a kernel is just a program...but with special privileges and special responsibilities&lt;br /&gt;
&lt;br /&gt;
what is a system call, actually?&lt;br /&gt;
 - a special CPU instruction&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
what is a CPU?&lt;br /&gt;
what is an instruction?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>