Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ filesys(4spp) — UMIPS/BSD System Programmer's Package 2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

intro(4spp)

FILESYS(4spp)

NAME

filesys − general description of file system interface

SYNOPSIS

{
init_routine,open_routine,read_routine,
write_routine,ioctl_routine,close_routine
}

DESCRIPTION

New file systems and protocol support is added to the standalone i/o system by write the file system or protocol implementation routines and making a new entry to the file system configuration structure _fs_table in the file saio/conf.c.  The format of a file system configuration entry is shown above.  The fields in a file system configuration entry have the following usage:

init_routine(iop)
The initialization routine is called during the startup initialization of the standalone i/o library when a program is run. The main function of the initialization routine is to initialize global data of the file system routines.  The initialization routine usually does not reference a hardware device.

open_routine(iop, path, flags)
The open routine is called in response to a read(3spp) request.  It is called after the standalone i/o system has called the device driver open routine.  It is passed a pointer to a struct iob associated with the descriptor being opened, the path component of the file to be opened, and flags indicating if the open is read-only, write-only, or read-write.  The main function of the file system open routine is to establish enough context regarding file named in path so that future read and write requests may be accomplished.  For UNIX file systems, this is accomplished by locating and reading the appropriate struct inode from the device.  Protocol implementations locate an appropriate file server during the open. 

read_routine(iop, buffer, count)
The read routine is passed a pointer to a struct iob associated with the descriptor being read, the address of a user’s buffer, and a byte count indicating the amount of data to transfer.  The read routine accomplishes the data transfer by referring to data established during the open and making calls to the lower level device driver.  The lower level device driver is called indirectly through the struct iob, allowing a file system implementation to serve multiple devices. 

write_routine(iop,  buffer, count)
The write routine functions similarly to the read routine to accomplish writes to a file system or via a protocol.

ioctl_routine(iop, command, argument)
The ioctl routine implements any special functions possible on the file system or protocol.  It is passed a struct iob pointer associated with the descriptor being operated on, a command indicating the operation to perform, and an argument that is specific to the command. 

close_routine(iop)
The close routine is passed a pointer to a struct iob associated with the descriptor being closed.  The close routine performs any clean-up activities necessary with terminating access to the descriptor. 

SEE ALSO

intro(4spp)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026