1 Introduction p3
1 Introduction p3
When two or more processes are interacting, they can sometimes get themselves into a
stalemate situation they cannot get out of. Such a situation is called a deadlock.
29
• Files
• OS presents programmer with nice, clean abstract model of device-
independent files
• system calls needed to create, remove, read, and write files
• file system - hierarchy of directories and files
• directory - way of grouping files together
• file within hierarchy is specified by path name from root directory
• opening file returns integer called file descriptor or handle
• OS allows some I/O devices to be handled like files
• standard input file (keyboard) and standard output file (monitor)
Operating Systems 30
30
1
2/6/24
Operating Systems 31
31
/Faculty/Prof.Brown/Courses/CS101
Operating Systems 32
32
2
2/6/24
Operating Systems 33
33
Operating Systems 34
34
3
2/6/24
• Before mounting,
• files on floppy are inaccessible
• After mounting floppy on b,
• files on floppy are part of file hierarchy
Operating Systems 35
35
Operating Systems 36
36
4
2/6/24
System Calls
37
• Shell
• Command interpreter
• acts as a user-interface program for operating system
• not part of OS but uses many OS features
• when user logs in, shell is started up automatically
• uses terminal as standard input and output
• starts by typing prompt and waits for user commands
• extracts first word from command line & assumes it is name of
program
• creates child process and runs program
• suspends itself until child process terminates
• waits to read next command
Operating Systems 38
38
5
2/6/24
System Calls
Operating Systems 39
39
• 4 ways of structuring OS
• Monolithic systems
• Layered systems
• Virtual machines
• Client-server models
Operating Systems 40
40
6
2/6/24
Operating Systems 41
41
Operating Systems 42
42
7
2/6/24
Operating Systems 43
43
Operating Systems 44
44
8
2/6/24
Client-Server Model
• OS is divided into two parts: kernel and servers
• kernel handles communication between user processes (called clients) and
servers
• each server only handles one facet of system
• runs in user mode (no direct access to hardware)
• file service, process service, memory service, terminal service etc.
• each part is small and manageable
• if an error occurs - server crash and not entire system
• facilitates distributed systems
Operating Systems 45
45
Client-server model
Operating Systems 46
46
9
2/6/24
Operating Systems 47
47
10