Upload
imogene-oneal
View
306
Download
1
Embed Size (px)
Citation preview
CS 444Introduction to Operating Systems
Lecturer: Dr. Ronald CheungOffice: S/3/073
Phone: 617-287-6483Email: [email protected]
Course Objectives
• This course will teach you details of the operating system
• It will cover topics:– Processes and threads– Deadlocks– Memory management– I/O systems– File systems– Real-time operating systems (if time permits)
Introduction
• Syllabus and Lecture Notes– Web: http://www.cs.umb.edu/~cheungr/cs444
• Required Textbooks– Modern Operating Systems, 4th Ed., A. Tanenbaum
Introduction• HW assignments
– Assignment write-ups will be on my website
– HW will be done on the ulab UNIX machine by student groups (2 students to a group)
– The executable will be downloaded to the SAPC VM and debugged remotely
• Homework is an Individual Group Effort– You can answer questions for each other as long as you
acknowledge any help that you receive from others
– BUT DON’T HAVE OR LET ANYONE ELSE DO YOUR HOMEWORK FOR YOU!
– Exams will definitely have programming questions
– If I discover any cheating, I’ll follow school policy!
Getting Started• UNIX Account
– Apply for a cs444 account – Edit your .cshrc file in your home to add “load module ulab” (set
up environment to compile programs that can run on SAPCs)
• Install VMWare Workstation 10 for PC or VMWare Fusion 8 for MAC – Download the corresponding .exe or .dmg and .txt files from
/nobackup/blade71/cheungr/– Install it on your PC or MAC using the license key provided
• Remote access from your home– login on “users.cs.umb.edu” using ssh2 or putty– Then ssh ulab and cd cs444– You can edit your files and compile a program for the SAPC– Download the executable to the SAPC VM and debug
Getting Started• Putty (Officially Recommended by Systems Staff)
– http://www.chiark.greenend.org.uk/~sgtatham/putty/
– Download, UnZIP and Execute Installer as directed
– Use Putty configured for SSH2 instead of TELNET
– Use PSCP or PSFTP for secure ftp
Getting Started
• Assume students know C programming, make, and tools such as mtip, Tutor, gdb from ulab
• Useful links on ulab:
– http://www.cs.umb.edu/ulab– Professor Wilson’s CS 341 lectures:
www.cs.umb.edu/~bobw/CS341
• Operating system runs in kernel (supervisory) mode– Protected from user tempering by hardware
• Other software runs in user mode– users are free to modify if he/she so chooses
• Boundary between Operating Systems and User mode programs is blurred
Components of a Computer System
Physical Devices
Microarchitecture
Machine Language
Operating System
Compilers Editors CommandInterpreter
Spread sheet
Web Browser
Games
Hardware
System programs
Application programs
What is an Operating System?
• Programming at machine language level primitive and awkward. Operating Systems provide:
– a clean abstract set of services to access hardware resources that is easier to program
– Management of these resources
A Bottom-up View
• OS manages all pieces of a complex system
• Provides an orderly and controlled allocation and access of hardware resources
• Arbitrates which application has access to what resources at what time
Timeline of OS Milestones
UNIX CP/M
BSDUNIX
Apple DOS 3.1
PC-DOS
GNU
AppleMAC
Windows 1.01; Atari ST
OS/2
NeXTStep
Windows 3.0
LINUX
Windows NT
Windows 95
Windows 98
Windows ME, 2000
MAC OS
MAC OS X
Windows XP
Windows Vista
Windows 7
1970 1980 1990 2000 2010
source: http://www.computerworld.com/s/article/9129498/Timeline_40_years_of_OS_milestones
Categories of Operating Systems
• Server OS (UNIX, Windows Server, Linux)– serves multiple users
• PC OS (Mac OS, Windows)– serves a single user
• Real-time OS (VxWorks, pSOS) – completes tasks within a given time budget
• Embedded OS (Blackberry OS, Apple iOS)– fits into small hand held device
System Calls
• What is a System Call?– Interface between user programs and the
operating system– User program transfers control to the operating
system using a trap instruction. Once it completes the work, it returns the program to user space
– System calls vary from one operating system to another
Types of System Calls• UNIX/LINUX- POSIX (International standard
9945-1)– Process Management– File management– Directory Management– Miscellaneous
• Windows Win32 API– Compatible among Windows versions– Many are library calls (user mode to user mode)
About 100 calls
Several1000 calls
User Memory Layout
Important powers of 2: 1G=230, 1M=220, 1K=210
0xFFFFFFFF = 232 -1 = 4G-1
reserved
code
data
stack
0
0x00010000
reserved
code
data
stack
0
0x00020000
0xFFFFFFFF 0x7FFFFFFF
Solaris UNIX Win 32
C lib Dll C lib Dll
Dynamic Link Library(DLL)
• Also known as dynamic library
• code can be called by a program that is not stored in the program’s executable file
• brought to memory at runtime via dynamic linkage to user’s program
• calls to library are direct since it is in user memory
Example of UNIX System Calls
• See debugging session captured in syscalls.html
• C program runs on a Sun Sparc machine with the Solaris OS