Next: Implementation of Interface Procedures
Up: No Title
Previous: Monolithic processes
- Devices are considered to be part of the file system - mapped as special
files : /dev/tty1 or /dev/lpr (the special case : /dev/null)
- Device independence :
cat file.txt > /dev/tty
cat file.txt > /dev/lpr
cat file.au > /dev/audio
- I/O Classes :
Characters (unstructured) : files and devices
Block (structured) : files
Socket (message) : network interface
- I/O Calls are synchronous
fd = open(filename, mode)
close(fd)
nbytesread = read(fd,buffer,nbytes)
nbyteswritten = write(fd, buffer, nbytes)
pos = lseek(fd,offset,offsettype)
- where : fd : index to a file descriptor and mode : 0,1 or 2 (for read, write
or read/write)
- offsettype : relative or absolute (bytes or 512 byte blocks)
- How are requests made to perform activities on devices ? How are these requests
managed ?
- Answer: Need a File Manager process which performs these activities
Requests are made to the file manager via a request queue
Figure 3: Filemanager
Each descriptor within the request queue is as follows :
Figure 4: FileMan request queue
What additional information is needed for an open request ?
Omer F Rana
Fri Feb 14 18:33:29 GMT 1997