Unit 6 O.S
Unit 6 O.S
Unit 6 O.S
1. Boot Device
2. Character Device
3. Network Device
Boot Device
It stores data in fixed-size blocks, each with its unique address. For example-
Disks.
Character Device
It transmits or accepts a stream of characters, none of which can be
addressed individually. For instance, keyboards, printers, etc.
Network Device
It is used for transmitting the data packets
Types of devices
There are three types of Operating system peripheral devices: dedicated,
shared, and virtual. These are as follows:
1. Dedicated Device
In device management, some devices are allocated or assigned to only one
task at a time until that job releases them. Devices such as plotters, printers,
tape drivers, and other similar devices necessitate such an allocation
mechanism because it will be inconvenient if multiple people share them
simultaneously. The disadvantage of such devices is the inefficiency caused
by allocating the device to a single user for the whole duration of task
execution, even if the device is not used 100% of the time.
2. Shared Devices
These devices could be assigned to a variety of processes. By interleaving
their requests, disk-DASD could be shared by multiple processes
simultaneously. The Device Manager carefully controls the interleaving, and
pre-determined policies must resolve all difficulties.
3. Virtual Devices
Virtual devices are a hybrid of the two devices, and they are dedicated
devices that have been transformed into shared devices. For example, a
printer can be transformed into a shareable device by using a spooling
program that redirects all print requests to a disk. A print job is not sent
directly to the printer; however, it is routed to the disk until it is fully
prepared with all of the required sequences and formatting, at which point it
is transmitted to the printers. The approach can transform a single printer
into numerous virtual printers, improving performance and ease of use
1. The OS interacts with the device controllers via the device drivers while
allocating the device to the multiple processes executing on the system.
2. Device drivers can also be thought of as system software programs that
bridge processes and device controllers.
3. The device management function's other key job is to implement the API.
4. Device drivers are software programs that allow an operating system to
control the operation of numerous devices effectively.
5. The device controller used in device management operations mainly contains
three registers: command, status, and data.
Virtual Devices:- These devices are the combination of the first two types and
they are dedicated devices which are transformed into shared devices. For
example, a printer converted into a shareable device via spooling program
which re-routes all the print requests to a disk. A print job is not sent straight
to the printer, instead, it goes to the disk(spool)until it is fully prepared with
all the necessary sequences and formatting, then it goes to the printers. This
technique can transform one printer into several virtual printers which leads
to better performance and use.
SCAN algorithm
What is Spooling
Spooling is a process in which data is temporarily held to be used and
executed by a device, program, or system. Data is sent to and stored in
memory or other volatile storage until the program or computer requests it
for execution.
1. Spooling involves creating a buffer called SPOOL, which is used to hold off
jobs and data till the device in which the SPOOL is created is ready to make
use and execute that job or operate on the data.
2. When a faster device sends data to a slower device to perform some
operation, it uses any secondary memory attached as a SPOOL buffer. This
data is kept in the SPOOL until the slower device is ready to operate on this
data. When the slower device is ready, then the data in the SPOOL is loaded
onto the main memory for the required operations.
3. Spooling considers the entire secondary memory as a huge buffer that can
store many jobs and data for many operations. The advantage of Spooling is
that it can create a queue of jobs that execute in FIFO order to execute the
jobs one by one.
What is Interrupt in OS?
An interrupt is a signal emitted by hardware or software when a process or
an event needs immediate attention. It alerts the processor to a high-priority
process requiring interruption of the current working process. In I/O devices,
one of the bus control lines is dedicated for this purpose and is called
the Interrupt Service Routine (ISR).
Types of Interrupt
Interrupt signals may be issued in response to hardware or software events.
These are classified as hardware interrupts or software interrupts,
respectively
Sequential Access
In sequential access, the OS read the file word by word. A pointer is maintained
which initially points to the base address of the file. If the user wants to read first
word of the file then the pointer provides that word to the user and increases its
value by 1 word. This process continues till the end of the file.
Direct Access
The Direct Access is mostly required in the case of database systems. In
most of the cases, we need filtered information from the database. The
sequential access can be very slow and inefficient in such cases.
Suppose every block of the storage stores 4 records and we know that the
record we needed is stored in 10th block. In that case, the sequential access
will not be implemented because it will traverse all the blocks in order to
access the needed record.
Indexed Access
If a file can be sorted on any of the filed then an index can be assigned to a
group of certain records. However, A particular record can be accessed by its
index. The index is nothing but the address of a record in the file.