Chapter 2 B13
Chapter 2 B13
Operating-System Structures
Saminda Premaratne
Chapter 2: Operating-System
Structures
interface (UI)
Varies between Command-Line (CLI), Graphics User
errors
May occur in the CPU and memory hardware, in I/O devices,
in user program
For each type of error, OS should take the appropriate action
controlled
Security of the system from outsiders requires user authentication,
executes it
Sometimes commands built-in,
KDE)
Shell Command Interpreter
The Mac OS X GUI
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 Interface (API) rather than
direct system call use
Three most common APIs are Win32 API for
Windows, POSIX API for POSIX-based systems
(including virtually all versions of UNIX, Linux, and
Mac OS X), and Java API for the Java virtual machine
(JVM)
Why use APIs rather than system calls?
Example of System Calls
System call sequence to copy the
contents of one file to another file
Example of Standard API
Consider the ReadFile() function in the
Win32 API—a function for reading from a file
these numbers
The system call interface invokes intended system call in OS
kernel and returns status of the system call and any return
values
The caller need know nothing about how the system call is
implemented
Just needs to obey API and understand what OS will do as a
result call
Most details of OS interface hidden from programmer by
API
Managed by run-time support library (set of functions
Status information
File modification
Communications
Application programs
sh local etc
/usr/local/bin/bash
bin
bash
UNIX
The kernel
More secure
Detriments:
Performance overhead of user space to kernel space
communication
Mac OS X Structure
Modules
Most modern operating systems implement kernel
modules
Uses object-oriented approach