Professional Documents
Culture Documents
2.2
Objectives
To describe the services an operating system provides to users,
2.3
One set of operating-system services provides functions that are helpful to the
user:
User interface - Almost all operating systems have a user interface (UI).
4
I/O operations - A running program may require I/O, which may involve a
file or an I/O device
2.4
4 For
4 Debugging
2.5
Another set of OS functions exists for ensuring the efficient operation of the
system itself via resource sharing
Resource allocation - When multiple users or multiple jobs running
concurrently, resources must be allocated to each of them
4 Many types of resources - Some (such as CPU cycles, main memory,
and file storage) may have special allocation code, others (such as I/O
devices) may have general request and release code
Accounting - To keep track of which users use how much and what kinds
of computer resources
Protection and security - The owners of information stored in a multiuser
or networked computer system may want to control use of that information,
concurrent processes should not interfere with each other
4 Protection involves ensuring that all access to system resources is
controlled
4 Security of the system from outsiders requires user authentication,
extends to defending external I/O devices from invalid access attempts
4
2.6
2.7
program
4 Sometimes
4 Primarily
2.8
2.9
Unix and Linux have CLI with optional GUI interfaces (CDE, KDE,
GNOME)
2.10
Touchscreen Interfaces
Touchscreen devices require new
interfaces
2.11
2.12
System Calls
Programming interface to the services provided by the OS
Typically written in a high-level language (C or C++)
Mostly accessed by programs via a high-level Application Program
(Note that the system-call names used throughout this text are
generic)
2.13
2.14
2.15
and returns status of the system call and any return values
The caller need know nothing about how the system call is
implemented
2.16
2.17
system call
Exact type and amount of information vary according to OS and
call
Three general methods used to pass parameters to the OS
2.18
2.19
end, abort
load, execute
2.20
Device management
2.21
Communications
client to server
2.22
2.23
2.24
2.25
Example: MS-DOS
Single-tasking
Shell invoked when system
booted
Simple method to run
program
No process created
reloaded
(a) At system startup (b) running a program
2.26
Example: FreeBSD
Unix variant
Multitasking
User login -> invoke users choice of
shell
Shell executes fork() system call to create
process
2.27
System Programs
System programs provide a convenient environment for program
File manipulation
Communications
Background services
Application programs
2.28
System Programs
Provide a convenient environment for program development and
execution
Some of them are simply user interfaces to system calls; others
are considerably more complex
File management - Create, delete, copy, rename, print, dump, list,
Some ask the system for info - date, time, amount of available
memory, disk space, number of users
Others provide detailed performance, logging, and debugging
information
Typically, these programs format and print the output to the
terminal or other output devices
Some systems implement a registry - used to store and retrieve
configuration information
2.29
2.30
Application programs
2.31
2.32
be done
engineering
2.33
Implementation
Much variation
Now C, C++
Main body in C
But slower
2.34
2.35
Simple Structure
I.e. MS-DOS written to provide
2.36
UNIX
UNIX limited by hardware functionality, the original UNIX operating
Systems programs
The kernel
4 Consists
4 Provides
2.37
2.38
Layered Approach
The operating system is
2.39
passing
Benefits:
More secure
Detriments:
2.40
Application
Program
File
System
messages
Interprocess
Communication
Device
Driver
user
mode
messages
memory
managment
CPU
scheduling
kernel
mode
microkernel
hardware
2.41
Modules
Most modern operating systems implement loadable kernel modules
2.42
2.43
Hybrid Systems
Most modern operating systems actually not one pure model
environment
2.44
Mac OS X Structure
graphical user interface
Aqua
Cocoa
Quicktime
BSD
kernel environment
BSD
Mach
I/O kit
kernel extensions
2.45
iOS
Apple mobile OS for iPhone, iPad
2.46
Cocoa Touch
Media Services
Core Services
Core OS
Android
Developed by Open Handset Alliance (mostly Google)
Open Source
machine
2.47
Applications
Android
Architecture
Application Framework
Libraries
Android runtime
SQLite
openGL
surface
manager
media
framework
webkit
Core Libraries
Dalvik
virtual machine
libc
Linux kernel
Operating System Concepts 9 th Edition
2.48
Operating-System Debugging
Debugging is finding and fixing errors, or bugs
OSes generate log files containing error information
Failure of an application can generate core dump file capturing
kernel memory
Beyond crashes, performance tuning can optimize system performance
2.49
Performance Tuning
Improve performance by
removing bottlenecks
OS must provide means of
2.50
DTrace
DTrace tool in Solaris,
Example of following
2.51
DTrace
DTrace code to record
2.52
2.53
System Boot
When power initialized on system, execution starts at a fixed memory
location
can start it
2.54