Professional Documents
Culture Documents
Operating Systems
Week 1
Introduction to OS – Interrupts
(a)
(i)
(d) (j)
(g)
(c)
(e)
Operating System Benefits
●
Simplifies hardware control for applications and
developers
●
Enforcer of sharing resources, fairness among
process/users, and security with the goal of better
overall performance
User vs Kernel mode
●
Dual-mode operation allows OS to protect itself and other
system components
– User mode and kernel mode
– Mode bit provided by hardware
●
Provides ability to distinguish when system is running user code or kernel
code
●
Some instructions designated as privileged, only executable in kernel mode
Some history of OS
●
60s – 70s
●
Multiprogramming:
Modern OS features
●
Multiprogramming
– Multiprogramming organizes jobs (code and data) so CPU always has one
to execute
– A subset of total jobs in system is kept in memory
– One job is selected and run
●
Timesharing (multitasking)
– Minimal response time
– Impression that everything runs in parallel
Closed-source vs open-source OS
●
Operating systems made available in source-code format rather than just binary
closed-source
●
Counter to the copy protection and Digital Rights Management (DRM) movement
●
Started by Free Software Foundation (FSF), which has “copyleft” GNU Public License
(GPL)
●
Examples include GNU/Linux and BSD UNIX (including core of Mac OS X), and many
more
●
Can use VMM like VMware Player (Free on Windows), Virtualbox (open source and free
on many platforms - http://www.virtualbox.com)
●
Use to run guest operating systems for exploration
The Linux OS
●
An operating system (kernel) developed by a
student, Linus Torvalds, in 1991 (version 0.02)
●
Currently at version 6.2
●
Dominant OS in servers, embedded devices, and
mobile devices
GNU/Linux architecture
Computer architecture (PC)
●
One or more CPUs, device controllers connect through common bus
providing access to shared memory
– Each device controller is in charge of a particular device type
– Each device controller has a local buffer
– CPU moves data from/to main memory to/from local buffers
– I/O is from the device to local buffer of controller
von Neumann Architecture
Interrupts
●
Interrupts are usually electrical signals sent to the CPU by external devices, typically I/O devices
(controllers). They tell the CPU to stop its current activities and execute the appropriate part of
the operating system.
●
There are three types of interrupts:
– Hardware Interrupts are generated by hardware devices to signal that they need some attention from the
OS. They may have just received some data (e.g., keystrokes on the keyboard or an data on the Ethernet
card); or they have just completed a task which the operating system previous requested, such as
transferring data between the hard drive and memory.
– Software Interrupts are generated by programs when they want to request a system call to be performed
by the operating system.
– Traps are generated by the CPU itself to indicate that some error or condition occurred for which assistance
from the operating system is needed.
Any questions?
What to read
●
Chapter 1 from either book (not in detail)
Next class:
●
Week 1: OS Overview – Introduction
– Interrupts
– System calls