Go to the previous, next section.
A device driver is a module used to control all accesses that the system makes to a specific hardware resource. This chapter explains how to use some of the system's device drivers, the drivers not documented here are either invisible to the user or totally trivial.
Some of the modules documented here are not really device drivers, this part of the manual seemed the best place for them though.
The hard disk device driver allows the system (and especially, the filing system, see section The Filing System) to talk to any IDE hard disks connected to the host computer.
When the hard disk driver is initialised it probes for IDE disks (only on the first controller at present), and recognised disks are added to the system's list of hard-disk-like devices. Each device is then scanned for partitions, each partition is given a unique name and added to the list of hard disk partitions that the system maintains.n
The name of each partition is made from the name of the disk (either `hda' or `hdb') and a number defining which partition it is. The primary partitions are given numbers one to four, any extended partitions are given numbers starting at five. For example `hda1' refers to the first primary partition of the first IDE hard disk, while `hdb6' refers to the second extended partition of the second IDE disk.
A special partition is created which spans the whole of the hard disk, it has the same name as the device it spans (i.e. `hda').
The hard disk defines the following shell commands.
List the currently recognised hard disk devices, and the partitions which they contain.
Command: hdperf partition blocks [blocks-per-request]
This command times the performance of hard disk reads from the hard disk partition partition. It reads blocks number of 512-byte blocks from the partition calculating the amount of time it takes.
If the blocks-per-request parameter is defined it specifies the number of blocks to read in each request made to the device driver. Normally the data throughput should increase as this value is raised.
The time period is measured in ticks, each tick is 1/1024 of a second.
This command actually makes two timings: the first by requesting the device driver to read the blocks, the second by reading the blocks from the filing system's buffer cache. The second timing will not work if the partition is not mounted in the filing system (see section The Filing System). Also, the blocks-per-request argument is not used when reading from the buffer-cache, a standard value of 2 is used.
For details on how to mount a hard disk partition in the filing system see section Devices.
The floppy driver provides support for up to two floppy drives, numbered `fd0' and {fd1}. The geometry of these drives is obtained from the CMOS information of the machine.
Lists the floppy devices that floppy driver is supporting. This is the information obtained from the kernel, and if mounted, the information of the physical disks.
To mount a floppy drive for use by the filing system, see section Devices.
The ramdisk is a simple means of utilising memory in a way accessible through the filing system.
Once a suitable region of memory has been allocated for the purpose, a device becomes available for file storage, and any accesses to that device are reflected into the allocated memory. The devices are numbered `rd0' onwards, the numeric part representing the number of the device.
Once the ramdisk device driver is loaded, management of the ramdisks is achieved with the commands listed below.
This command lists information on the allocated ramdisks present in the system, including their device name, the address of their memory regions and the size of the region.
This enables the user to add a ramdisk to the system of blocks blocks in size. A block is 512 bytes in size (unlike the file system, where a block is in fact 1024 bytes in size) and memory will be allocated for it, if possible. Once allocated, the area is initialised and mounted ready for use. Numbering of the ramdisk is incremental from the last created ramdisk, starting at zero.
Removes the device device from the system, making it unavailable for use. Any information stored on it is lost. In removing it from the driver, the device is unmounted and the memory it was using is returned returned to the system.
A tty is a virtual console. Multiple tty's may be open at any one time, the tty actually being displayed is known as the foreground tty. Any characters typed at the keyboard are always transmitted to the foreground tty.
TTY's are put to two main purposes by the system
All tty's respond to the following hot keys (a key sequence that can be typed at any time)
When a line of input is being read from a tty (i.e. in a shell) that is not in a virtual machine, the following commands are available to edit the line being entered. In general these will be bound to the same keys as the equivalent functions in the Emacs editor. The following table lists the available commands, where the variable arg is mentioned it refers to the prefix argument entered by the metafied numeric keys.
The notation C-x and M-x means the x key with the Control modifier and the Meta qualifier respectively. To generate a M-x event either type Alt-x or ESC x.
The printer spooler allows sharing of a single printer device by more than one process. The user can submit files to be printed along with files printed by other processes and access to the printer by virtual machines.
The spooler defines the following commands.
This command adds the listed files to the printer spooler queue.
It makes a copy of the file in the spooler directory and adds it to the spooler queue. It then reports the result of each file it attempts to spool.
This command lists all the files currently in the spool queue with a job number
for each file spooled. This number can be used in conjunction with the
lprm
command.
This command removes the files from the printer spooler queue with the job numbers listed in the commands parameters before they are printed. It reports if the job was successfully dequeued or not.
The job numbers can be obtained from the lpq
command.
The system log daemon allows processes to send status and debugging output to a common file. The operation of the log daemon process can be controlled by the user to set how much information goes to the file or can completely stop all output to the logfile.
This command controls operation of the system log daemon. The command parameter defines the operation performed, it can be one of the following:
-stop
-start
-level new-level
-status
Go to the previous, next section.