Management of the I/O devices is one of the basic component of an operating system and it is the messiest aspect of an operating system design. The subsystems of the I/O are dedicated in operating its process. This incorporates the keyboard, monitor, hard disk drive, mouse, speaker, network adapter, webcam, etc… All of these I/O devices are overseen by the kernel which should have the capacity to stack up the drivers that are utilized in the operating system so that there will be an acknowledgment and usage of these devices. It deals with the transfer of information in and out of the devices. The buffers that are controlled by the I/O utilities are the primary aspect of the I/O because it smoothes out the differences between the computer system’s internal speed to the I/O devices’ speed. The kernel handles all the intercommunication among devices and it additionally make use of the most effective strategy for transferring information in the system.
There is a need to effectively manage these devices despite the unique characteristics that each of the devices have. These devices have different variations in speed and level of shareability. Some devices can deal direct access and others can only handle sequential access. The task in balancing the demand for each devices is complex and it is important to have communication that link these parts in order for the I/O subsystem to be successful. The I/O architecture maintains the OS in managing the activity of the I/O efficiently with the information that it needs and it gives an efficient way to control the communication with the outside world. The I/O management of the OS also has protocols which helps in interfacing the device I/O, it has a dedicated handler which are the interrupt handlers and device drivers, and the details of the I/O from core processing are decoupled which allows flexibility in its performance. The disk I/O has the greatest impact on the overall performance of the system and approaches such as disk scheduling and disk cache are widely used for the improvement of its performance.
Unix is designed to give the independence of the device on the applications running over it by considering each I/O device as a special type of file which are handled by the file system and are treated the same way as the user data files. The devices installed in a UNIX system is given a name which is related to the given name of any other file, these descriptors are called iodes which identifies the devices that contains the information about them and saved in the device directory. The transmission of data between the peripheral units and the main memory are called device drivers. During the configuration of the system, incorporation of a device driver into the kernel is performed. And it has a program called config which contains the specification that control resources such as the swap space sizes and the number of internal buffers for the kernel. The file contains two tables, bdevsw (block device switch) and cdevsw (character device switch), that gives the system kernel of UNIX the capacity to adapt easily to the different hardware configurations through installing different driver modules. There are two types of I/O in a UNIX system, the buffered and unbuffered. The buffered cache is actually a disk cache that is managed through the buffer cache. Transmission of data between buffer cache and user process space happens when it utilizes a direct memory access. It is utilized to be able to execute a memory-to-memory copy. Buffered I/O uses two types of buffers which is the character queues and system buffer caches in which it maintains a list such as free list, device list and the driver I/O queue. Unbuffered I/O is the direct memory access between the process and the device. This method is fast and swapping out can’t be performed since the process is already locked in the main memory. In addition, the device is fixed to the process and it is unavailable to other processes. The I/O system of UNIX is divided into two parts, which is the block I/O system and the character I/O system. Each of the device is classified by a major and minor device number and a class which is either block or character. Each of the class owns a configuration table that has an array of access points to the driver of the device and it serves as a connection between the code of the system and device drivers. Block I/O system is used for devices that addresses blocks of a fixed size that are in disk memories. It allows the device manager in using buffering to lessen the physical disk I/O and it emphasizes the use of buffer cache. For the character class, these devices are managed by the device drivers which implements list of characters. Examples of devices that are included in a character class are terminals and printers which does not utilize the block buffer cache. The procedure of the I/O is organized through the completion interrupts of a hardware where if the interrupt is complete then the device driver brings the next character which is from the queue and it is sent to the hardware. Each of the device has a special area in the kernel which is called device drivers. These drivers are stored in a set of files that can be utilized. When peripherals are upgraded, there are small modifications that are applied to the device driver file which can be connected to the kernel in order to notify the operating system on the new features and capabilities. These files are stored in the /dev directory which makes them one of the device files. The operating system Mac OS X supports the RAID 0, RAID 1, RAID 01, and RAID 10.
The I/O system in Windows executes functions that are required by the driver. Its responsibility is to be able to make I/O request packet (IRP) and to guide the packets through different drivers. Windows I/O system supports different installable file systems which includes CD-ROM file system, FAT and NTFS. Easier services in making the development of the device-driver, the system administrators’ ability to be able to delete drivers from the system, device drivers can be loaded and unloaded dynamically, it provides services that grants the drivers to be made in a high-level language to minimize the time to be developed and enhance its portability, it can also support plug and play, supports power management for the system to be able to go into low power states, systematic naming and security over devices so that shareable resources will be protected. The caller receives the results when an I/O is done. The I/O manager figures out different drivers and devices utilizing the objects of the I/O system which includes device objects and driver. It is the responsibility of the I/O manager to manage all I/O in the operating system and it gives a systematic interface for all the drivers.To attain high performance, the I/O system of Windows works asynchronously. During this operation, it continues to execute another task while there is a data transfer that is taking place and processes must not be able to enter to any data from the operation until the transfer of data is done. It also gives I/O capabilities which are both synchronous and asynchronous to the applications of user-mode. Network, file system, and layered filter drivers are also included in the device drivers. They all have a standard structure and communicates with the I/O manager. Because of the common structure that the drivers have, they can be arranged in one layer on the top of each other to manage modularity and minimize duplication between the drivers. Device drivers should be made to operate correctly on systems that has multiprocessor. The function of the PnP manager is to operate together with the device drivers to detect hardware devices dynamically and to be able to create an internal device tree that leads hardware device enumeration and installation of drivers. Power manager also operates with the device drivers to conserve energy and extend battery life. Windows also applies RAID functionality and it supports RAID 0, 1 and 5. Lastly, it implements shadow copies on the volume which is a way to efficiently make copies of data before it will be overwritten. It also encrypts the whole volumes using BitLocker which offers reliable security of the data.
Management of the files is a system that gives services to the users and applications in the usage of files, which includes access to the files, maintenance of the directory, and access control. It has a system service programs that is running as a privileged applications and it is related with the secondary storage. This system is used to organize and monitor the files. The file system allows the user to be able to make collections of data which is called as files and it manages a group of attributes related with the file that includes the owner, time created, modification time, and access privileges. The file organization indicates that the logical management of the records is through the way that they are accessed. The file’s physical organization on the secondary storage also relies on strategies that uses blocking and file allocation. The file directories are related with each file management system and the set of files is called file directory which contains attributes, location and ownership. Management of the secondary storage is where a file contains a group of block and the file management system’s responsibility is for it to perform allocation of blocks to the files.
In UNIX file management, it has six different group of files: regular files, directory files, special files, pipe files, existing files, and symbolic links. Regular files are those which users store the information. The basis of its protection is on the requests of the user and performance of write, read, delete, and execute functions on a file. Directory files are utilized by the system to manage the order structure of the system. It has a file names and pointers to related index nodes. Special files has no data but it gives the interface to the hardware of the I/O. These files shows as an entries in the directories. The name of every special file specifies the device type that it is associated with. Allocation of files in UNIX is accomplished through block basis and it is dynamically allocated.The indexed method is utilized to monitor each file and inode have a several direct pointers. This method is used to allocate disk space that has a 4KB size of a disk block. The organization of its directories are in a hierarchical tree and it contains the record of file names. For the access control in UNIX, each of the user is selected a unique identification number for the user and it is also part of a group which can be classified by a group ID. Each file is related to a set of twelve bits which gives protection to the files. The process of storing files in UNIX is by a sequence of bytes and does not establish structure on them. The file management system manages the disk into 512 bytes each and separates the disk into four areas or regions. First region is for booting, second region is called a superblock that contains the disk information, third region involves the i-list that is a list of file descriptors and these descriptors are referred to as i-nodes. Last region has the available free blocks for the storage of files. The filenames in UNIX can have a length of up to 255 characters. For directory listing, it displays eight bit of information for each of the file: access control, number of links, owner and group name, file’s byte size, time and date of last revision, and the filename. UNIX has a root for the file system which is called superblock and it has the free list and the size of the list of inode and file system. The Mac OS X utilizes an access control list to restrict the access of files to specific users and groups.
The file system that the Windows have is the New Technology File System or NTFS which is designed to satisfy the high-end demands for servers and workstations. The features that NTFS provides are its recoverability, security, large disks and files, various streams of data, stores all changes that are made to files, and the capacity for the files to be compressed or encrypted. NTFS utilizes concepts on disk storage such as sector, cluster and volume. Each of the elements that are on a volume is considered as a file and each of these file contains a set of attributes. The first few parts on a volume are being used by the sector of a partition boot. The partition boot holds the information of the volume layout and it creates a volume that is bootable. Next is master file table (MFT) that have all the information on the files and folders that are in the volume of NTFS. The system files which are about 1 megabyte in size and it includes MFT2, a series of transaction steps that are used, cluster bitmap and a definition table for the attributes. The I/O manager in windows consists of the NTFS driver that handles different functions of the NTFS. Its components have a service for log files, management of cache to increase its performance and it manages the virtual memory in which the NTFS enters the cached files. The Windows OS helps in the accessibility of the file system formats to the local system and remote clients. The filter driver of the file system gives a clean way in extending and augmenting the access to the file system. Reliability, security and scalability of the file system format for the system storage of the local file have been provided by the NTFS. In Windows, programs execute I/O on virtual files and they are manipulated through file handles. File objects have names that are in hierarchy, protection by the object-based security, it provides synchronization and are managed by object services. When object files are created, it helps in bridging the gap between the features or attributes of the physical devices and structures of the directory, structures of the file system, and formats of the data. It gives a representation of the shared physical resources which is based on the memory. A handle is returned by the I/O manager to a file object when there is a file that is opened and the one that manages the object will consider the file objects as one of the other objects until it is used. The object manager will then call the manager of the I/O devices to receive some assistance in accessing one of the devices. The file management system of Windows supports filenames that are long which can have spaces and special characters. The NTFS provides techniques in saving disk space, it does not perform disk allocation to that part of the file when the file is partially empty or has no data. It also compresses data for file that are non-sparse by utilizing clusters that are in virtual in a file. It gives robustness to the system by making sure that metadata will be consistent even if a crash will happen. It also performs recovery when the metadata is changed by the redo entries. Data in the files may be deleted if the disk blocks are being damaged due to a crash. To tolerate this faults, RAID technology is utilized by the driver. There are new ways in recovery for Windows such as the transaction manager of the kernel and the backup and recovery center.