Lecture 03
Lecture 03
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 1 / 36
Outline
1 Learning Outcome
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 2 / 36
Learning Outcome
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 3 / 36
Operating System Components
Process
A program in execution
An instance of a program running on a computer
The entity that can be assigned to and executed on a processor
A unit of resource ownership
A unit of activity characterized by a single sequential thread of
execution, a current state, and an associated set of system
resources
Nowadays the execution abstraction is separated out: Thread
Single process can contain many threads
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 4 / 36
Process
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 6 / 36
Multiprocess Creates Concurrency issues
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 7 / 36
Memory Management
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 8 / 36
Virtual Memory
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 9 / 36
Virtual Memory Addressing
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 10 / 36
Paging
Allows process to be comprised of a number of fixed-size blocks,
called pages
Virtual address is a page number and an offset within the page
Each page may be located any where in main memory
A page may actually exist only on disk
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 11 / 36
Virtual Memory
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 13 / 36
Information Protection & Security
Access control
regulate user access to the system
Involves authentication
Information flow control
regulate flow of data within the system and its delivery to users
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 14 / 36
Scheduling & Resource Management
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 15 / 36
Operating System Structure
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 16 / 36
Operating System Structure
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 17 / 36
The Monolithic Operating System Structure
Monolithic Kernel
Also called the “spaghetti
nest” approach
Everything is tangled up
with everything else.
Implement user services
and kernel services
separately
How use same address
space
Make operating system
faster
Switching between
user mode to kernel Figure 7: Spaghetti
mode
Linux, Windows, . . . .
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 18 / 36
The Monolithic Operating System Structure
The Monolithic Operating System Structure
However, some reasonable structure usually prevails
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 19 / 36
Monolithic Kernel Example: UNIX
Monolithic Kernel Example: UNIX
Provides a good
hardware abstraction
Everything is a file
(mostly)
Runs on most hardware
Comes with a number
of user services and
interfaces
Shell
C compiler
Note: Unix is the OS that
creates or motivates all
modern OS (including
Mobile OS, Android, and
Linux)
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 20 / 36
Traditional Unix Structure
Traditional Unix Structure
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 21 / 36
Traditional Unix Structure
Traditional Unix Structure
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 22 / 36
Microkernel-Based System
Microkernel-Based System
Assigns only a few essential functions to the kernel
Address space
Interprocess Communication (IPC)
Basic scheduling
Minimal hardware abstraction
Other services implemented by user-level servers
Traditional “system calls” become IPC requests to servers
Extreme view of a micro-kernel
A feature is only allowed in the kernel if required for security
expensive and poor in performance
Example: Minix – Andrew S. Tanenbaum and Linus Torvald – debate
(Linux kernel structure???)
L4 Micro kernel – Unix like OS – L4Ka::Hazelnut, L4/Fiasco,
L4Ka::Pistachio
Hyper-vision – Nano-Kernel
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 23 / 36
Monolithic OS structure
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 24 / 36
Microkernel OS structure
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 27 / 36
System Calls
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 28 / 36
A Brief Overview of classes of System Calls
From the user’s perspective
Process Management
File I/O
Directories management
Some other selected Calls
There are many more
On Linux, see man syscalls for a list
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 29 / 36
Some System Calls For Process Management
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 30 / 36
Some System Calls For File Management
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 31 / 36
Some System Calls For Directory Management
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 32 / 36
Some System Calls For Miscellaneous Tasks
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 33 / 36
System Calls
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 34 / 36
System Calls
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 35 / 36
RTOS and Bare-metal System call
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 36 / 36
IOS Syscalls
Dr. MHK Tushar (CSE, DU) CSE3201 Operating Systems August 02, 2022 37 / 36