Operating system Definition Structures

anair23 307 views 21 slides Jan 25, 2024
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

What is an operating System Structure?
We want a clear structure to let us apply an operating system to our particular needs because operating systems have complex structures. It is easier to create an operating system in pieces, much as we break down larger issues into smaller, more manageable subp...


Slide Content

Operating-System Structures

VIJESH NAIR

SA Operating System Structure

= General-purpose OS is very large program
= Various ways to structure ones

e Simple structure — MS-DOS

+ More complex -- UNIX

e Layered — an abstrcation

e Microkernel -Mach

Vijesh Nair,

SP Simple Structure -- MS-DOS

= MS-DOS - written to provide the
most functionality in the least
space
+ Not divided into modules
e Although MS-DOS has some
structure, its interfaces and
levels of functionality are not
well separated

application program

ROM BIOS device drivers

Vijesh Nair,

SÍ Non Simple Structure -- UNIX

UNIX - limited by hardware functionality, the original UNIX
operating system had limited structuring. The UNIX OS
consists of two separable parts

+ Systems programs

» Systems programs are provided to define the user
interface.

e The kernel

» Consists of everything below the system-call interface
and above the physical hardware

» Provides the file system, CPU scheduling, memory
management, and other operating-system functions; a
large number of functions for one level

+ OS may provide smaller modules for much greater control
of computer resources, incorporating changes in the

separate modules easily to enhance functionality and hide
information in different components

Viesh Nair

4

Traditional UNIX System Structure

Beyond simple but not fully layered

(the users)

shells and commands
compilers and interpreters
system libraries

system-call interface to the kernel

signals terminal file system
handling swapping block 1/0
character /O system

system
terminal drivers disk and tape drivers

Kernel

CPU scheduling
page replacement
demand paging
virtual memory

kernel interface to the hardware

terminal controllers
terminals

device controllers
disks and tapes

memory controllers
physical memory

Vijesh Nair

oS

Layered Approach

The operating system is divided into a number of layers (levels), each
built on top of lower layers. The bottom layer (layer 0), is the
hardware; the highest (layer N) is the user interface.

With modularity, layers are selected such that each uses functions
(operations) and services of only lower-level layers

OS has a greater control over the computer resources and |

applications that make use of it.

Provides more freedom to the implementers to make changes in the |

inner workings of the system.

Provides information hiding by allowing the programmers to
implement the low-level routines using top-down modular
programming approach.

Layered approach is used for modularization of the OS.

Higher-level layers can invoke lower-level layers.

Less number of layers provide more functionality at each level while
reducing the problems.

Vijesh Nair,

(A

hardware

“ger à Layered Approach (Cont.,)

m= Advantages: modularization makes debugging and Level5:Userprograms

verification much easier; design and implementation is [-<vel4: buffering for input and output devices
sole devicedriver

simplified; each layer hides certain data structures, Level3:operalor:

Figure : THE layer structure
operations and hardware details from higher-level Level2: memory management Y mer

layers. Level 1: CPU scheduling
= Disadvantages: level definition and implementation is LevelO:hardware
very difficult, order of levels for the design of layered
structure is problematical; interaction between layers Level6:Userprograms
device drivers and schedulers

and passing of parameters / data is very complex; less
efficient as a system call takes longer time for execution T.evel4: virtual memory
than a non-layered system.

Figure; Venus layer structur
m= Examples: Technische Hogeschool Eindhoven (THE) 1

OS and Venus layer structure.

Level 0shardware

Vijesh Nair,

Layered Approach (Cont.,)

= OS/2 provides multitasking and dual mode operation on
more powerful hardware.

= OS/2 does not provide direct user access to low- level
facilities like DOS, OS has more control over the
hardware, and has more information about usage of
resources.

m Windows NT 4.0 has increased its performance by
moving layers from user space to kernel space and
closely integrating them.

Vijesh Nair à

application application application
as
subsystem subsystem
system
kemel memory management
“task dspaching
+ device management

(85)

Microkernel System Structure

Microkernel approach moves all non-essential components
from the kernel and implements them as system-level
programs and user- level programs.Moves as much from
the kernel into user space

Mach example of microkernel
e Mac OS X kernel (Darwin) partly based on Mach

Communication takes place between user modules using
message passing

Benefits:
e Easier to extend a microkernel

e Easier to port the operating system to new architectures
e More reliable (less code is running in kernel mode)
e More secure

Windows NT Client-Server Structure

Detriments:

e Performance overhead of user space to kernel space
communication

Vijesh Nair,

Virtual Machines

m The layered approach is taken to its logical conclusion in the concept of a virtual machine

m Avirtual machine provides an interface identical to the underlying bare hardware.

= The operating system creates the illusion of multiple processes, each executing on its own processor with its
own (virtual) memory.

m A virtual machine has virtual memory, virtual disks, virtual printer, virtual console, virtual processor and virtual
communication network.

m Auser can run any type of software package on his/her virtual machine.

m= Advantages

= The virtual-machine concept provides complete protection of system resources since each virtual machine is
isolated from all other virtual machines.

= A virtual-machine system is a perfect vehicle for operating- systems research and development. System
development is done on the virtual machine, instead of on a physical machine and so does not disrupt normal
system operation.

+ Virtual machines are useful for solving system compatibility problems.

m Disadvantages

No direct sharing of resources as each virtual machine is isolated from all other virtual machines.

The virtual machine concept is difficult to implement due to the effort required to provide an exact duplicate to
the underlying machine.

= The privileged instructions (needed mainly for I/O) must be simulated and hence execute more slowly.

_ Vijesh Nair y

SA Virtual Machines (Cont.,)

processes

ll a

kernel

hardware

Non-virtual Machine

programming —"
interface

Viesh Nair

processes

44h

processes

processes

kernel kernel kernel
VM1 VM2 VM3
virtual machine
implementation
hardware

"

Virtual Machine

mi

ar Java Virtual Machines

m In addition to a language specification and a large API library, Java
also provides a specification for a Java Virtual Machine (JVM).

m For each Java class, the Java compiler produces an architecture-
neutral bytecode output (.class) file that will run on any
implementation of the JVM.

= JVM consists of:

- class loader

- class verifier

- runtime interpreter

The Java interpreter may be a software module that interprets the
byte-codes one at a time, or it may be a Just-In-Time (JIT) compiler
that turns the architecture-neutral bytecodes into native machine
language for the host computer.

Most implementations of the JVM use a JIT compiler for enhanced
performance.

JVM design provides a secure, efficient, object-oriented, portable,

and architecture-neutral platform ‚on, which to run Java programs.
Vies

Jair

java .class files

class loader

y

verifier

y

java interpreter

host system

all Modules

m Many modern operating systems implement loadable kernel
modules

e Uses object-oriented approach

e Each core component is separate

e Each talks to the others over known interfaces

e Each is loadable as needed within the kernel
m Overall, similar to layers but with more flexible

e Linux, Solaris, etc

Vijesh Nair à

Solaris Modular Approach

scheduling
classes

core Solaris
kernel

device and
bus drivers

loadable

miscellaneous
system calls

modules

executable
formats

STREAMS
modules

Vijesh Nair 44

Hybrid Systems

= Most modern operating systems are actually not one pure model
e Hybrid combines multiple approaches to address
performance, security, usability needs
e Linux and Solaris kernels in kernel address space, so
monolithic, plus modular for dynamic loading of functionality
e Windows mostly monolithic, plus microkernel for different
subsystem personalities
m Apple Mac OS X hybrid, layered, Aqua UI plus Cocoa
programming environment

e Below is kernel consisting of Mach microkernel and BSD Unix
parts, plus I/O kit and dynamically loadable modules (called
kernel extensions)

Vijesh Nair,

Mac OS X Structure

graphical user interface a

application environments and services

kernel environment H

Mach

VO kit kernel extensions

Vijesh Nair

16

iOS

m= Apple mobile OS for iPhone, iPad

e Structured on Mac OS X, added functionality

Does not run OS X applications natively

» Also runs on different CPU architecture
(ARM vs. Intel)

Cocoa Touch Objective-C API for
developing apps

Media services layer for graphics, audio,
video

Core services provides cloud computing,
databases

Core operating system, based on Mac OS X
kernel

Vijesh Nair

Cocoa Touch

Media Services

Core Services

Core OS

Android

m Developed by Open Handset Alliance (mostly Google)
e Open Source

m Similar stack to IOS

m Based on Linux kernel but modified
e Provides process, memory, device-driver management
e Adds power management

m Runtime environment includes core set of libraries and Dalvik
virtual machine

e Apps developed in Java plus Android API

» Java class files compiled to Java bytecode then translated
to executable than runs in Dalvik VM

m Libraries include frameworks for web browser (webkit), database
(SQLite), multimedia, smaller libc

Vijesh Nair 4g

ur a Android Architecture

Application Framework

Libraries
SQLite openGL
surface media
manager framework
webkit libe

Android runtime

Core Libraries

Dalvik
virtual machine

Vijesh Nair 4g

System Boot

When power initialized on system, execution starts at a fixed
memory location

e Firmware ROM used to hold initial boot code

Operating system must be made available to hardware so hardware
can start it

e Small piece of code — bootstrap loader, stored in ROM or
EEPROM locates the kernel, loads it into memory, and starts it

e Sometimes two-step process where boot block at fixed
location loaded by ROM code, which loads bootstrap loader
from disk

Common bootstrap loader, GRUB, allows selection of kernel from
multiple disks, versions, kernel options

Kernel loads and system is then running

Vijesh Nair op

End of Chapter 2

VIJESH NAIR