Operating Systems Test 3 Dr. Howell

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/54

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

55 Terms

1
New cards

Device Independent I/O Software (The File System)

- Has no clue how the device works, just reads and writes blocks

- Performs I/O functions common to ALL devices

- Provides a uniform interface to the user processes

2
New cards

What is Uniform Interfacing?

It is a data structure which contains the attributes and disk addresses of the filed data blocks (Includes major and minor device numbers)

3
New cards

Block Device Buffering:

The hardware reads or writes entire blocks at a time while the user only reads or writes one record at a time so a buffer is needed

4
New cards

Character Device Buffering:

Users Process read or writes faster than the device is able to, so a buffer is needed to keep up

5
New cards

Error Reporting

- Errors are handled at the lowest level possible

- The driver first tries to resolve the error

- Next up is the Device Independent Software (File System) which reports the error back to the user process and then crashes the OS using the panic() function (UNIX)

6
New cards

Dedicated Devices

- Some devices can be used only by one process at a time

- The OS accepts or rejects device user requests

How is this done?

- Requires an OPEN() system call, if the device is unavailable, return "open failed" code

7
New cards

Block Sizes:

- Not all disks have the same sector size

- Disks devices read/write data in terms of sector size

- User processes read/write records

- The Device Independent Software (File System) hides differences

8
New cards

How data is viewed at various levels of the I/O Software:

Users = Records

File System = Blocks or Records

Driver = Sectors/Tracks/Cylinders

Device = Bytes

9
New cards

-User Space I/O Software-

10
New cards

What are Library Procedures?

1. Open

2. Read

3. Write

4. Close

11
New cards

What is User Code?

1. Printf

2. Scanf

3. anything that calls the library procedures ()

12
New cards

What are Functions?

1. Printf

2. Scanf

3. Anything that are in

13
New cards

Spooling deals with Dedicated I/O Devices (like a printer):

- Users place data in the printer spooling directory

- Only 1 program has access to the printer device, (printer Daemon)

14
New cards

Other situations a Spooler is used?

An email spooling directory and an email daemon, etc.

15
New cards

What makes Deadlocks possible?

When an OS can temporarily gran a process exclusive access to a certain resource/resources (i.e. hardware and software)

16
New cards

What is a Resource?

Anything that can be used by only 1 process at a time

Examples:

- Tape Drive

- Printer

- Database Records

17
New cards

What are the two types of resources we talked about?

1. Preemptable

2. Non-preemptable

18
New cards

What is a Preemptable Resource?

It can taken away with no ill or negative effects

19
New cards

What is a non-preemptable Resource?

1. Can not be taken away without causing a computation to fail

2. Note: Deadlocks involve non-preemptable resources

20
New cards

What is a Deadlock?

A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause

21
New cards

What are the Deadlock Conditions we talked about in class?

1. Mutual Exclusion Condition

2. Hold and Wait Condition

3. No Preemption Condition

4. Circular Wait Condition

22
New cards

What is a Mutual Exclusion Condition?

When each resource is either currently assigned to exactly one process or is available

23
New cards

What is a Hold and Wait Condition?

Processes currently holding resources that were granted earlier can request new resources

24
New cards

What is a No Preemption Condition?

Resources previously granted cannot be forcibly taken away from a process. They must be explicitly released by the process holding them

25
New cards

What is a Circular Wait Condition?

There must be a circular chain of two or more processes, each of which is waiting for a resource help by the next member of the chain

26
New cards

Deadlock Avoidance page 241-242

27
New cards

What is a Device Controller (Adapter)?

I/O units typically consist of a mechanical component and an electronic component. It is often possible to separate the two portions to provide a more modular and general design. The electronic component is called the Device Controller or Adapter.

28
New cards

What is a System Bus?

A system bus works by sharing data and other information between various aspects of the computer's hardware. Example would be USB

29
New cards

What is Direct Memory Access?

Instead of using the CPU to address device controllers DMA is used so no CPU time is wasted. The DMA controller has access to the system bus independent of the CPU

30
New cards

What is Memory-Mapped I/O?

A Scheme that involves the I/O registers being a part of the regular memory address space (Usually on top of the address space)

31
New cards

What is a Device Driver?

Software that acts as a translator which enhances the capabilities of the operating system by enabling it to communicate with hardware. It accepts abstract requests from the device independent software above it and see to it that the request is executed

32
New cards

What is an Interrupt Handler?

It is run to discover what has happened, that is, which device want attention right now. It then extracts the status from the device and wakes up the sleeping process to finish off the I/O request and let the user process continue.

33
New cards

What are the Deadlock Handling Strategies we talked about in class?

1. Ignore the problem altogether and maybe it will ignore you

2. Detection and recovery - Detect when a deadlock occurs and take action

3. Dynamic Avoidance - by careful resource allocation

4. Prevention - Structurally negate one of the four conditions necessary to cause a deadlock

34
New cards

Goals of I/O Software:

1. Device Independence

2. Uniform Naming

3. Error handling

4. Synchronous(blocking) vs asynchronous(interrupt-drive) transfers

5. Buffering

6. Shareable vs Dedicated Devices

35
New cards

Major Device Number:

Used to locate the appropriate driver

36
New cards

Minor Device Number

Used to locate the unit to be read from or written to

37
New cards

Layers of I/O System:

1. User Processes - Make I/O call; format I/O; Spooling

2. Device-independent Software - Naming, protection, blocking, buffering, allocation

3. Device Drivers - Set up device registers; check status

4. Interrupt Handlers - Wake up driver when I/O completed

5. Hardware - Perform I/O operation

38
New cards

Error handling

- Handled as close to the hardware are possible

- if the controller cannot correct an error, the device driver is next

- many errors are transient and can be fixed with repetition

- ONLY if the lower layers are not able to deal with the problem should the upper layers be told about it

39
New cards

Two Phase Locking:

Phase 1:

- Process tries to lock all the records it needs, one at a time

- if it succedds, it moves to phase 2

- if it fails to lock every record, it releases all locks and starts over

Phase 2:

- Updated locked DB records

- Release all locked records

40
New cards

How does Unix handle deadlocks?

They ignore deadlocks, only place they can occur is in shared resources

41
New cards

What is a terminal?

A free standing device which has a keyboard for input, a display for output, and is often connected to the computer by a wire or more typically by using a modem

42
New cards

What is a terminal driver?

Software which hides all the many terminal type differences from the user, so the device independent software sees only one type

43
New cards

What are the 3 terminal types we talked about in class?

1. memory mapped interface

2. RS232 Interface

3. Network Interface

44
New cards

What are the 2 types of clocks used?

1. Simple Clocks

2. Programmable Clocks

45
New cards

Simple Clocks

Interrupt on every voltage cycle, Hz = Cycles per second

46
New cards

Programmable Clocks

Use a crystal oscilator (5 to 20 million cycles per second)

47
New cards

Duties of the Clock driver:

1. maintaining time of day

2. Preventing processes from running longer than they are allowed to

3. Accounting for CPU usage

4. Handling the alarm system call made by user processes

5. Providing watchdog timers for parts of the system itself

6. Doing profiling, monitoring, and statistics gathering

48
New cards

Detection and Recovery:

Monitors the requests and releases the resources.

- Often used on large main frame computers, especially batch systems in which killing a process and restarting is acceptable.

49
New cards

Summary of approaches to deadlock prevention:

1. Mutual Exclusion - Spool everything

2. Hold and Wait - Request all resources initially

3. No Preemption - Take resources away

4. Circular Wait - Order resources numerically

50
New cards

- Disk Arm Scheduling -

51
New cards

FCFS

simple but poor performance

52
New cards

SSF

Best performance but with heave requests the disk arm will stay in the middle most of the time

53
New cards

Elevator Alg

Moves in one direction, stops at the last request and moves back to the first request

54
New cards

Block Devices

Make it possible to read or write each block independently of all other ones. (Disks are the most common block devices)

55
New cards

Video RAM

Data buffer that programs or the OS write into