Professional Documents
Culture Documents
Concepts
CS204 Operating Systems
By:
Dilum Bandara
Outline
p
OS concepts
n
n
n
n
n
n
n
Processes
Deadlocks
Memory management
Input/Output
Files
Security
Shell
Kernel
p User & kernel mode
p System calls
p
CSE-DB
Process
Process is a program in execution
p Includes:
p
n
n
n
n
executable program
program data
stack
various register status
CSE-DB
Process cont
p
A process tree
n
n
Deadlock
CSE-DB
Deadlocks in OSs
p
Example:
Process
Holds
Request
A
CD-ROM Tape drive
B
Tape drive CD-ROM
CSE-DB
Memory management
p
We need to run:
n
n
n
n
n
Input/Output
Many I/O devices used in modern
computers
p OS should manage them
p
I/O software
n
n
CSE-DB
Files
p
lp in Unix - /dev/lp
CSE-DB
10
Hierarchy of files
CSE-DB
11
Before mounting,
n
12
Security
p
Example:
n
CSE-DB
13
The shell
Its another program that executes on top
of the OS
p Act as a command line interpreter
p It reads a command from standard input
& execute
p Commands can be classified as:
p
n
n
Examples
n
14
External commands
Commands which are implement as
individual programs
p Example:
n $ date
p
15
Internal commands
p
CSE-DB
16
More on shell
p
Login shell
n
to re-login
CSE-DB
17
Kernel
p
CSE-DB
U
t
i
l
i
t
i
e
s
Operating System
Machine language
Physical
devices
m
a
n
a
g
e
m
e
n
t
18
CSE-DB
19
System calls
p
20
Opening a file
n n = read(fd, buffer, nbytes)
n
n
n
n
CSE-DB
21
Trap to Kernel
Put the code to read in register
User program
.
number=read(fd,buffer,nbytes);
.
Kernel
Space
22
POSIX
n
n
Win32 API
n
n
n
n
n
n
23
Win32 API
Description
fork
CreateProcess
execve
open
CreateFile
read
ReadFile
write
WriteFile
mkdir
CreateDirectory
rmdir
RemoveDirectory
time
GetLocalTime
24