CS40 Operating Systems

David Morgan
Santa Monica College
see syllabus for email address


Administrativa

Syllabus

Grade information

Course outline

Information

Stallings book's site
 7th edition
 6th edition
 5th edition

Remote Unix access with telnet

Remote Unix access with ssh

Using ftp

Caching

Linux links
Linux man pages

Fundamental Unix Commands

System calls

Linux syscall cheat sheet

Disks & booting:
 - Partitioning primer
 - Linux loader doc
 - Comparative MBRs
 -Interpreting Partition Records
 - Future of BIOS

Sys. architecture
(disk organization)

Punched cards

Memory mgmt:
 - Segmentation
 - Page replacement
 - Intel architecture (pdf)
 - Management types

Code relocation

Overlays
 - code composition
 - memory organization 

Threads

Deadlock example

Filesystem analysis

Files vs devices

Foundation concepts:

ASCII chart

Sys. architecture (interrupts)

Sys. architecture
(disk organization)

Number bases:
  -Hex tutorial
  -Hex advocacy
  -Binary numbers
  -Number systems
conversion tools:
  Table, or
  Calculator
   - binary
   - hexadecimal

 Instruction sets
   -Intel instruction set
   -Intel chip architecture

  -Others
  -CPU registers
  -a CPU instruction

An assembler program
  -source code
  -explanation 

Symbol management

Data structures
  - Datastructures
  - Linked list of states

Compile/link/load

Slide presentations

Stallings TEXTBOOK's:

Background
Ch 1 Computer Overview
Ch 2 OS Overview

Processes
Ch 3 Process
Ch 4 Threads
Ch 5 Concurrency
Ch 6 Concurrency

Memory
Ch 7 Mem Mgmt
Ch 8 Virtual Mem

Scheduling
Ch 9 Scheduling
Ch 10 Scheduling

I/O & Files
Ch 11 I/O Mgmt
Ch 12 File Mgmt


PROFESSOR's:

OS Installation

Memory Mgmt

Process Mgmt

Datastructures

Linux landscape

linux process scheduling

 

SPRING 2014
Section 4104 6:30p - 9:35p Fri Bus 259

This Website (http://homepage.smc.edu/morgan_david/)  will be used extensively to communicate with you. Announcements, grade reports, and assignments will be posted here. Please access the website from any SMC computer lab. Alternatively, it can be viewed from an internet-connected browser anywhere. You are responsible for awareness of the information posted here.

No class meeting April 18. Have a good spring break. See you April 25. (4/11)

Birth of the internet - at UCLA's Boelter Hall room 3420. Here, of optional and casual interest (but hey! it's interesting!) is a BBC radio interview about it (first 9 minutes). (4/9)

A survey - whose purpose is to help us improve the computer science department.
The survey is available through Friday, April 11 at midnight. Please take the survey if you care to. (4/5)

Spring break - coming up. There will be no class meeting April 18. (4/4)

Upcoming topic - will be processes
read - textbook chapters we will cover on the topic of processes. Those are chapters 3 and 9 (process scheduling).
anticipate - assgt 9, to be done later, after I have demonstrated how to do it in class. (4/4)

Time sharing - a way to allow multiple interactive processes to share a computer's CPU pioneered by Fernando Corbato at MIT. (4/4)

Grades - updated, at the link entitled "Grade information," at left, including the "disassembly" and "figure 1.4, prob 1.1" assignments. (4/4)

Hacker volunteers sought by L.A. Hacks, for big confab at UCLA in 2 weeks. (4/2)

Waste time in class - see in-class exercise link, lower right, entitled "waste time" (3/28)

How interrupts save time - my in-class example put some numbers on the textbook's figure 1.5, "Program Flow of Control without and with Interrupts." I assigned time units to the various portions of the program shown in the Figure, both the 5 numbered ones and the I/O Command. Then I calculated the elapsed time from the start of the program till the time it finishes. I did that twice, once where interrupts are not used (Figure's left panel (a) ) and once where they are used (Figure's center panel (b) ). I assigned/posited the following amounts of time:
 1 - takes 6 units
 2 - takes 20 units
 3 - takes 18 units
 4 - takes 4 units
 5 - takes 4 units
 I/O command - takes 8 units

If that were the case, I reached the conclusion that the program as a whole would take 76 time units to complete if all phases ran consecutively (i.e., without interrupts) in the order shown in the Figure, versus only 60 time units if some phases ran concurrently (i.e., with interrupts). A similar question appears on an upcoming test. The question is to perform the identical analysis/calculation, but with different input numbers supplied. Be sure you can do this problem, and you'll be able to do its companion problem on the test. (3/28)

Operation of a stack - to keep track of where to return after a function call. Shown in the gdb debugger (same one used by ddd debugger you used). (3/28)

System calls - here's a cheat sheet listing the approximately 200 system functions that user programs can call, for various services. Here is some further information. (3/21)

Homework - 
 do the reading in the Reading column of section 4  of the course outline.
 do the assignments found in the "Homework" column of sections 4 and 5. Caching assignment due on paper in class April 4.

----------------
Some helpful explanation - here is how to correspond or reconcile the vocabulary in the textbook problem, and that at the end of my related writeup. There are 3 terms involved. What he calls T
m, I call Tslow. What he calls Tc, I call Tfast. What he calls "effective access time, I call Tave. There is no difference between what he and I are talking about, it's the same situation. The first term is talking about the native access time of one type of manufactured physical memory, and the second term about that of another. The second one is superior, does its job (moving data in and out) faster, costs more no doubt. Engineers buy that to make their caches. They buy the first, slower kind to make their RAM memory modules (regular memory) that you stick into the slots on your motherboard. The third term, on the other hand, is a little different in that it isn't talking about the native access time of anything. Rather, it's talking about the access time that would be experienced in actually using the computer. That doesn't match the native access time of either of the 2 memory types that the computer contains, since the computer uses a blend of both so that the experienced access time will fall somewhere in between their native times. Better than the slow one, not as good as the fast one. But in doing the problem just recognize that

 Tm = = Tslow

 Tc = = Tfast

 effective access time = = Tave

----------------

Grades - published, at the link entitled "Grade information," at left, including the in-class 3+2 exercise. (3/21)

Students dropped - Fotso, Huang Jie, Joseph Lee, Mathes, Smith, Toll
This is reversible. If you remain in the class and wish to stay enrolled please see me and I can give you a code to reinstate yourself. (3/16)

Grades - published at link entitled "Grade information" (3/14)

Homework - 
 do the reading in the Reading column of section 3  of the course outline.
 do the assignment found in the "Homework" column of section 3.
----------------
Some helpful explanation about textbook's problem 1.1 at the end of the chapter. It is very similar to the one in the book in Figure 1.4 (and the matching assembly language in-class exercise we did). The difference is, he wants to get/put numbers from/to some devices, instead of memory. So, he gives you 2 new instructions (to go with the 3 you already know) in his hypothetical machine language, for the purpose of shuttling data back and forth to devices.  The instructions require id's of some kind for devices (just as memory locations require addresses, which serve as their id's). The author doesn't provide id's for the devices, but you can do so. You can make up your own id format and system. A good choice for this academic exercise might be 3-digit numbers such as 001 for device 1, 002 for device 2, and so on. Then, putting together the drawing I ask for is a matter of showing the devices and their contained values, and constructing a drawing pretty much the same as the one in Figure 1.4.)
----------------

 (3/14)

No class meeting this Friday 3/7 - see you next Friday 3/14. For your general information here's the official SMC calendar. (3/5)

Homework - please
 do the assignment found in the "Homework" column of section 2 of the course outline.
(2/28)

Textbook - I unexpectedly received from the publisher a new (eighth) edition. It shows up on the author's website (link at left for "7th edition" now takes us to the 8th) but not  yet on amazon apparently, so it must be very new. We will stick officially with the 7th edition for this class. (2/26)

Course outline (under active construction) - with approximate weekly topic coverage corresponded to related readings, homework assignments, and in-class slides I will use. Please follow this outline week to week for assignments and reading I want you to do (2/26)

First personal computer - Altair by Ed Roberts

(click photo to enlarge, note switches and lights on front panel)
(3/9)

PCBSD installation - time permitting I hope to demonstrate the installation of an operating system on a laptop in class. I'll use PCBSD. See this related YouTube video and PCBSD's website. (2/22)

Virtual machines - on class laptops (screenshot).

Homework - please
 read chapter 1 of the textbook
 read the 7 links about binary and other number systems, below left, under the heading "Number bases" in the "Foundation Concepts" section.

read - write-up at link entitled "Remote Unix access with ssh" at left, and then:
log in - to your remote unix account. Please see section here entitled "Remote Unix system account for you". I will see your login history and record a minor grade credit for your having logged in. Log in by next week. After logging in, get out by running the "exit" command.

listen - to this podcast about operating systems (skip the part from the 6:00 minute mark to the 39:00 minute mark). It spans a lot of topics that we'll encounter in coming weeks, in a broad summary touching on all the items on the OS's job description list (the ones in paragraph titiled "Jobs" below). You won't understand some of it, and I considered not asking you to listen to it on the grounds that it bites off more than you can chew. But that's what the coming weeks are for. Listen to it now. Then, it would be interesting if you did so again after the course to see if I taught you anything.

anticipate, from assignment 1.5, the book's problem 1.1 at the end of Chapter 1, by reviewing the instruction execution example in Figure 1-4 of the textbook and associated discussion. (2/22)

Jobs for which operating systems have responsibility:
 Internal
  memory management
  process management
  device management
  file management
 External
  user interface
 (2/22)

Slides we're viewing
 "Ch1 Computer Overview" - about interrupts, caching, etc
 "OS Installation" - about partitions, MBR, boot process, filesystems etc  (2/22)

Listed homework assignments at right - will not necessarily all be assigned. So don't go off and try to do them all on that erroneous assumption. They will be assigned selectively and explicitly. (2/22)

Textbook - Operating Systems: Internals and Design Principles, sixth edition, William Stallings, Pearson Prentice Hall. It appears to be offered in an online format. (2/22)

Foundation concepts you should be(come) familiar with as background/prerequisite for this class:
 Data structures (lists, stacks)
 Binary and hexadecimal number representation
 Compiling/linking/loading (symbols, address fixups)
 ASCII code
 Processor instruction sets
 System architectures (bus, data lines, interrupt lines)
 Use of ssh
 Use of ftp/sftp

Procedures for using class laptops

A Remote Unix system is available for your use. (There are 2 students with the last name Lee. To avoid duplication your account names are therefore leejacky and leejoseph.)

Using ssh (secure shell). ssh is an important tool you will use for interacting with remote computers. For that you will need an ssh client. There are a number of ssh client alternatives.

Running linux at home.

 

Eniac - 1946

Milestone in the history of computation

Assignments/due

Assgt. 1 telnet

Assgt 1.5a textbook

Assgt 1.5b textbook

Assgt. 2  ftp

Assgt 2.5 add

Assgt. 3 cmds

Assgt 3.5 assembly

Assgt. 4
session capture

Assgt 5 linux mem

Assgt 6 memseg

Assgt 7 pageaddr

Assgt 8 pagerepl

Assgt 9 scheduling

Assgt 10 filesystem


In-class exercises

line termination

3+2=5

waste time

process scheduling

MBR dump

Virtual memory swap

Operation of threads