CSE 325 Operating Systems Lecture Notes
- Intro
- Overview, part 1
- Overview, part 2
- PC x86 Architecture
- Processes
- Processes, part 2
- Processes, part 3
- Scheduling
- Scheduling, part 2
- Scheduling, part 3
- Scheduling, part 4
- Scheduling, part 5
- Scheduling, part 6
- Deadlocks, part 1
- Deadlocks, part 2
- Deadlocks, part 4
- Memory Management, part 1
- Memory Management, part 2
- Memory Management, part 3
- Memory Management, part 4
- Memory Management, part 5
- Virtual Memory, part 1
- Virtual Memory, part 2
- Virtual Memory, part 3
- Virtual Memory, part 4
- Virtual Memory, part 5
- File Systems, part 1
- File Systems, part 2
- File Systems, part 3
- IO Systems
- Storage Systems, part 1
- Storage Systems, part 2
- Final Exam Review
Thoughts on Appendix A and B
- Modern OS may have to run on dozens of flavors of x86 with
minute differences. Options include: (a) lowest common denominator,
(b) autodetect on startup, or (c) customize on install
- How well do you think (a-c) above can deal with a motherboard swap
or a CPU upgrade?
- xv6 apparently using semi-old-fashioned (32-bit) x86. Probably need
to know the general purpose register names. I have never explicitly
used the control, debug or segment registers, or the pseudo-registers,
but if any code ever would, it would be the OS.
- Estimate of difference between registers and main memory speed may be
low (it has grown over time).
- in and out instructions vs. memory-mapped I/O. Either way, I/O behavior
across
different peripheral types varies enormously and device drivers
must go to great lengths to provide higher level abstractions.
- we'll no doubt look at the boot process in some more detail, but in
the meantime, I wonder why it loads at 0x7c00.
- processor starts up in 8088 compatibility mode, cute!
Thoughts on System Call Parameters
The actual hardware instruction takes an immediate integer code for
which system call it is. Many syscalls may take 3 or more parameters.
In the lecture notes, it was noted that there are many ways that
operating systems have employed to pass parameter information into
system calls: registers, stack, "tables"...
- Yeah sure, all of these may have been used in some OS at some point
- ...But in a modern OS with virtual memory, switching to the kernel
implies changing address space.
- a chunk of shared memory could be pre-arranged between kernel and
each user process, but: ick.
- Many OS'es (such as
AIX)
will just tell you that all parameters
must be passed in registers, and the OS must live with this size
restriction.
- Check out Bart Miller's notes
Mailbox Question 8/31/22
-
Me and my partner have been trying to figure out the lab and have no idea
what we are supposed to be looking for. So far we have figured out a total
of two things that are on the stack but have no clue about anything else.
-
Thank you for the question; I love questions.
Questions like this should be posed earlier than <24 hours
before the lab is due, in order for there to be time to generate a
response and still allow you to have time to utilize any help you receive.
To have a clue about what you are looking at, you will have to pretty
aggressively read all available documentation regarding the boot process.
What addresses are printed out? What address does the boot start at?
What instructions are in the boot assembler code? What opcodes are they,
in binary? How does the x86 define/establish a "stack"? Does the boot
assembler define/establish such a stack? At what address?
Mailbox Questions 9/2/22
-
Can I have a "mulligan"?
-
No, sorry. This proposal is unfair to others. But maybe Lab 1 will not be
weighted as heavily as later labs.
-
Can I have a lab team of size 3 ?
-
This is unfair to others unless you get a supermajority to agree that all teams
should be size 3, in which case assignments will be resized.
-
Can I have a lab team of size 1?
-
No. Per the syllabus, the learning outcomes for this course include management
of a substantial group project.
- After noticing the instruction portion was over at ~6:05pm, I was
wondering if we could use lab time to go over the previous week's lab? It
would be tremendously helpful to have a walk-through of the lab and the
solutions to solidify understanding.
- My understanding is that the last lab should have included a walk
through of the previous lab, but a student requested that that not happen
so that they could turn in the lab late, and the TA agreed. But in fact,
class policy is that we don't take late turnins of labs. I will seek to
clarify with the TA how they are spending the lab time.
Mailbox Questions 9/7/22
- Where in the book are we?
- I am following Dr. Zheng's notes, which may not correspond very closely to
our book. I will try to tie them together via appropriate reading assignments.
- I added my system calls for Lab 2, but my test program won't compile/link,
what do I do?
- User-level code must have two things to compile/link: the prototype and
the actual function body. The prototype goes in: ___________.
The body is generated by: ______________. Note that the user-level code
links to system call functions without a sys_ prefix; the sys_ prefix is
for the in-kernel implementations of those system calls. The connection
between the two is a table mapping system call integers to function pointers.
The table is named _________.
Midterm 1 Distribution
95
90 90 91 91
86 87 88 88 89
82 83 83 84 84 85
80 80
79 79 79
77
73 73 74 75
72 72 72
67 67 68 68
62 63
58
54
Midterm Grades Discussion
- Canvas points do not reflect the syllabus weights
- On Canvas everything is out of 100 but not all assignments are
equal in length and difficulty.
- Syllabus weights have additional warts, like In-Class Work
- Weights preserve ratio of Exams vs. Homeworks/Labs in syllabus
Mailbag
-
I'm struggling a bit with mutex locks. I'm trying to replicate the
spinlock but to work with the lock_t. I can't seem to figure out how
to declare it as an actual struct. I can only declare it as an
alternate definition of uint. The issue I'm running into is how the
sleep is supposed to work. I'm just not seeing how to call the sleep
function, as when I do I don't know how to get reference back to the
process to wake it back up, as I cannot put a reference in the lock
itself due to the lock only able to be an integer. Even so it seems
like it always runs into a "panic: sched locks" when I'm basically
reusing the spinlock code.
-
Great question. Before I try, how would you-all assist this colleague?
Midterm 2 Distribution
Extra credit has not yet been applied to your score as recorded, since it
was entered in a separate place on Canvas.
86 87
82 83
75 76 76 77
-------------------- A line
67 67 67
63
60 60 61
-------------------- B line
56 56 56 57 57 57
52 53 54 54 54
49 50
-------------------- C line
46
42 43
40
37
-------------------- D line
31