Software Organization Structure:


Definitions and Explanation:

Operating system implements supervisor calls for processes to request device input and output services. The same set primitive may be available for all devices.


Some characteristics of devices affect the supervisor call that are as follows:


1. Device Speed:


The speed of device I/O can be slow. Some operating systems provide the facility to issue nonblocking I/O operations that can be handled as follows:


Using data received and buffered before the system call, the return can be immediate using the data in the input buffer. The return value indicates the amount of supplied data.
The process can be notified at the completion of input operation. It can be done by sending a signal to process. Signal is sent by setting the value of a process variable or by providing a special system call.


Notification can be ignored in nonblocking outputs. The reason is that it is not relevant to the application when the data is output by the device.


2. Mutual Exclusion:


Operating system provides the following protection for non-sharable devices:


It may allow only one process to open the device at one time.

It may assign the ownership of the device to the user who opened it and may deny access to other users.

A spooling scheme may be used to handle the problem at application level.

It may do nothing and leave the problem to the user.


3. Unidirectional Devices:


Some devices are unidirectional i.e. input-only or output-only. The devices can only be used for specific purpose. The devices must be opened before I/O can be performed on them. The open call can include a parameter that indicates the type of access. An attempt to open a device for wrong kind of I/O should not be allowed.


Network I/O:


Some operating systems provide separate mechanism for network devices. These operating systems provide the support for network protocols for complex network communication. A popular network I/O abstraction is sockets.


Socket is connected to your computer on one side and to a remote computer on the other side. Applications create sockets, establish connections to sockets on remote machines, and send and receive messages on established connections.


Logical I/O:


Logical I/O level uses semi-device-independent kernel I/O objects. The Objects are not always totally device-independent. I/O requests from other modules of operating system access the capabilities of this level.


Two commonly device types are block devices and character devices. A disk is a block device. I/O operations transfer the number of disk blocks i.e. sectors. Character devices like printer and modem transfer single character or byte at a time.


Buffering:


Logical I/O provides buffering for I/O data for the following reasons:


I/O operation can occur at any time. If no process requests input from keyboard/ the
buffers are used to store data typed by the user.

Block devices perform I/O in blocks. Buffers package the requests in block-size units.

In DMA transfers, buffers are used as destination or source of transfer.

In asynchronous write operation, data is copied in buffer and application continues to execute.
Caching:


Cache is a fast storage device to hold a copy the data stored on a slower device. If the information to be read from a slower device is present in cache, the request en be executed faster. I/O caches store device data in main memory. Systems that implement caches create a buffer to be used as cache.


Device Drivers:


I/O objects generated in the logical I/O software are passed to device drivers that are built for the needs of different devices. They operate on one or more related devices.


Operating system may require a set of functions implemented for that device as follows:


open: Perform startup function before the use of device.


close: Perform any function to shut down the device.


schedule: Perform scheduling on I/O request.


interrupt: The routine executed when device send an interrupt to CPU.


ioctl: Implements any special functions that can be applied to this device.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Blog Archive

Powered by Blogger.

- Copyright © 2013 Taqi Shah Blogspot -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -