class16_hw_os
Download
Report
Transcript class16_hw_os
HW & Systems:
Operating Systems
COMP101
Computational Thinking and Design
Tuesday, October 21, 2014
Carolyn Seaman
Susan Martin
University of Maryland, Baltimore County
Wherefore OS?
A “naked machine” has no tools or programs to help
the user
Write instructions in binary
Write data in binary
Load instructions into memory one cell at a time
Initiate program run
Too difficult for humans to do
We must build an interface to hide the details and make
the computer easier to build
The OS is an abstraction of the machine that keeps
users and programmers from having to think about the
low-level hardware details
Virtual Machine (abstraction!)
Naked machine:
Virtual machine (OS):
1. Write program in binary
1. Write program using text
2. Load instructions oneby-one into memory
3. Insert start into memory
address 0 and push “go”
button
4. Read results from
memory one-by-one, in
binary
editor in high-level
language
2. Save program to folder
3. Use translator to convert
to binary
4. Use scheduler to load
and run
5. Use I/O system to print
results
Operating Systems
Schedule processes and pieces of processes
Manage resources (data, I/O devices)
Give users and programmers easier ways to make the
computer work
Deadlock
Safe use of resources: ensure that computer doesn’t get
stuck in deadlock
Multiple programs requesting access to resources
Deadlock occurs when all programs have some resources,
and are waiting for resources held by others
Deadlock prevention: if you can’t get all resources, release
all you have and try again later
Deadlock recovery: if no acknowledgement, send message
again
It’s time for…
OS
Jeopardy!!!!!
Rules
All questions and answers come from the assigned reading
or the first part of this lecture
I’ll show you an answer, you have to come up with the
question
If your team knows the question, one person needs to stand
up
If I call on your team, someone DIFFERENT from the person
who stood up has to give the question
If I call on your team, you must answer within 5 seconds
No team can respond twice in a row
Answer: Operating system.
Question: What does OS stand for?
Answer: A core component of the
operating system that coordinates all
other programs
Question: What is the kernel?
Answer: One is static and written down,
the other is dynamic and running.
Question: What is the difference between
a process and a program?
Answer: One has its own address space
and the other shares an address space
with other entities of the same type.
Question: What is the different between a
process and a thread?
Answer: It lets processes act as if there
is more memory available than there
actually is.
Question: What is virtual memory?
Answer: When the kernel switches back
and forth between programs, giving each
its turn with the CPU.
Question: What is multitasking?
Answer: Because it keeps users and
programmers from having to think
about the low-level hardware details of
the computer they’re working with.
Question: How is an OS an abstraction?
Answer: Process management, memory
management, file system management,
network and device management
Question: What are the main functions of
the kernel?
Answer: This occurs when all running
processes have some resources (e.g.
I/O devices), and are waiting for
resources held by others.
Question: What is deadlock?
Answer: If a process can’t get all the
resources it needs, it must release all
the resources it has and try again later.
Question: How can you prevent
deadlocks?
Answer: What the kernel does when a
process’s time slice expires.
Question: What is interrupt?
Answer: When a process is stuck waiting
either for data or for a device to be
available.
Question: What is I/O bound?
Answer: When the kernel swaps out the
context of one process for the context of
another.
Question: What is context switching?
Answer: round-robin, FIFO, priority-based,
shortest-time-remaining
Question: What are some scheduling
policies that could be implemented by a
kernel?
Answer: CPU utilization, average
latency, throughput, fairness
Question: What are some ways to
measure the efficiency of the CPU?
Answer: A computer without an
operating system.
Question: What is a naked machine?