Operating System Structure
Operating System Structure
Structures
Chapter #2
Course Instructor: Nausheen Shoaib
Operating System Services
Touchscreen devices
require new
interfaces
Mouse not possible or not
desired
Actions and selection based on
gestures
Virtual keyboard for text entry
Voice commands.
System Calls
Programming interface to the services provided by the OS
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)
Example of System Calls
1. Process Control
2. File management
3. Device Management
4. Information Maintenance
5. Communication
Types of System Calls
1.Process Control
load
execute
create process (for example, fork on Unix-like
open, close
3.Device Management
request device, release device
5.Communication
create, delete communication connection
Single-tasking
Shell invoked when
system booted
Simple method to
run program
◦ No process created
Single memory space
Loads program into
memory, overwriting
all but the kernel
Program exit ->
shell reloaded At system startup running a program
Example: FreeBSD
Unix variant
Multitasking
User login -> invoke user’s
choice of shell
Shell executes fork() system
◦ Relocation assigns final addresses to program parts and adjusts code and
data in program to match those addresses
Modern general purpose systems don’t link libraries into
executables
◦ Rather, dynamically linked libraries (in Windows, DLLs) are loaded as
needed, shared by all that use the same version of that same library
(loaded once)
Object, executable files have standard formats, so operating
system knows how to load and start them
The Role of the Linker and Loader
Why Applications are Operating System Specific
Much variation
◦ Early OSes in assembly language
◦ Then system programming languages like Algol, PL/1
◦ Now C, C++
Actually usually a mix of languages
◦ Lowest levels in assembly
◦ Main body in C
◦ Systems programs in C, C++, scripting languages like PERL,
Python, shell scripts
More high-level language easier to port to other
hardware
◦ But slower
Emulation can allow an OS to run on non-native
hardware
Operating System Design and Implementation (Cont.)
1. Simple Structure
2. Layered Systems
3. Microkernels
4. Modules
5. Hybrid Machines
Operating System Structure
1.Monolithic Structure:
DOS has no modern software engineering techniques,
Does not break the system into subsystems, and has
no distinction between user and kernel modes.
Allow all programs direct access to hardware.
Layered approaches can also be less efficient, as a request for service from a
higher layer has to filter through all lower layers before it reaches the HW,
possibly with significant processing at each step.
Operating System Structure
3.Microkernels:
micro kernels is to remove all non-essential services from the kernel, and
implement them as system applications
System expansion can also be easier, because it only involves adding more system
applications, not rebuilding a new kernel.
and a JVM
apps are developed using
Java
Operating-System Debugging
information
Failure of an application can generate core