0% found this document useful (0 votes)
23 views

1 Introduction p3

The document discusses operating system concepts including deadlocks, files, file systems, directories, path names, file management system calls, security permissions, shells, and different approaches to structuring operating systems such as monolithic, layered, virtual machines, and client-server models.

Uploaded by

Mohi Gpt4
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

1 Introduction p3

The document discusses operating system concepts including deadlocks, files, file systems, directories, path names, file management system calls, security permissions, shells, and different approaches to structuring operating systems such as monolithic, layered, virtual machines, and client-server models.

Uploaded by

Mohi Gpt4
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

2/6/24

Operating System Concepts (Deadlock)

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.

(a) A potential deadlock. (b) an actual deadlock.


Operating Systems 29

29

Operating Systems Concepts

• 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 System Concepts

File system for a university department

Operating Systems 31

31

Operating System Concepts

Each process has a working directory

Relative vs. absolute path names

What is the absolute path name for CS101?

/Faculty/Prof.Brown/Courses/CS101

Operating Systems 32

32

2
2/6/24

Some System Calls For File Management

Operating Systems 33

33

Some System Calls For Directory Management

Operating Systems 34

34

3
2/6/24

Operating System Concepts


(Mounted file system)

• 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 System Concepts


(Security)
• Security is BIG issue!
• Files in UNIX are protected by assigning each one a 9-bit binary
protection code.
• Three 3-bit fields: owner, other members of owner’s group, and
one for everyone else.
• Each field has a bit for read access, a bit for write access, and a
bit for execute access (rwx bits).
• E.g: rwxr-x--x

Operating Systems 36

36

4
2/6/24

System Calls

Some Win32 API calls


Operating Systems 37

37

Operating Systems Concepts

• 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

A stripped down shell:

while (TRUE) { /* repeat forever */


type_prompt( ); /* display prompt */
read_command (command, parameters) /* input from terminal */

if (fork() != 0) { /* fork off child process */


/* Parent code */
waitpid( -1, &status, 0); /* wait for child to exit */
} else {
/* Child code */
execve (command, parameters, 0); /* execute command */
}
}

Operating Systems 39

39

Operating System Structure

• 4 ways of structuring OS
• Monolithic systems
• Layered systems
• Virtual machines
• Client-server models

Monolithic systems - ex: DOS, Unix


• No specific structure
• OS is collection of procedures
• all procedures can call any of the other ones whenever it needs to.
• Consist of
• main program - invokes requested service procedure
• set of service procedures - carry out system calls
• set of utility procedures - help service procedures

Operating Systems 40

40

6
2/6/24

Operating System Structure

Simple structuring model for a monolithic system

Operating Systems 41

41

Operating System Structure

Structure of a layered operating system

Operating Systems 42

42

7
2/6/24

Operating System Structure

Virtual Machines - ex: IBM VM


timesharing system with 2 layers of distinct functions
• layer 1: virtual machine monitor
• does multiprogramming by providing several virtual machines to next
layer
• runs on bare hardware
• not extended machines but exact copies of hardware
• layer 2: conversational monitor system (CMS)
• provides multiple extended machines
• each virtual machine can run different OS

Operating Systems 43

43

Operating System Structure

Structure of VM/370 with CMS

Operating Systems 44

44

8
2/6/24

Operating System Structure

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

Operating System Structure

Client-server model

Operating Systems 46

46

9
2/6/24

Operating System Structure (5)

The client-server model in a distributed system

Operating Systems 47

47

10

You might also like