Showing changes from revision #3 to #4:
Added | Removed | Changed
System Device | Input | Output | Provide by Module Name | Description | Notes |
---|---|---|---|---|---|
kbd: |
Y | Y | SystemDevices | The keyboard | Reading a line at a time using OS_ReadLine |
rawkbd: |
Y | Y | SystemDevices | The keyboard | Reading a character at a time using OS_ReadC |
null: |
Y | Y | SystemDevices | The ‘null’ device | Gives no input/output |
printer: |
N | Y | SystemDevices | The printer | Currently configured printer |
vdu: |
N | Y | SystemDevices | The screen | Using GSRead format passed to OS_WriteC |
rawvdu: |
N | Y | SystemDevices | The screen | Via the VDU drivers and OS_WriteC |
netprint: |
N | Y | NetPrint | The printer | Currently configured printer |
device: |
Y | Y | DeviceFS | Device filing system | - |
parallel: |
N | Y | DeviceFS | Parallel port | - |
serial: |
N | Y | DeviceFS | Serial port | - |
pipe: |
Y | Y | PipeFS | The pipe filing system | |
resource: |
Y | Y | ResourceFS | The resource filing system |
System Devices can be useful with commands such as *Copy, and the redirection operators (> and <):
Example | Description |
---|---|
*Copy myfile printer: |
Send myfile to the printer |
*Cat { > |
List the files in the current directory to the printer |
By using the System Device named null:
it is possible to suppress unwanted output from a command script or program:
Example | Description |
---|---|
*myprogram { > null: } |
Run myprogram with no output |
You can only open one file for input on kbd: at once as it has buffered input; normal line editing facilities are available. If you try to open kbd:
a second time whilst the first file is open, you will get returned a handle of 0, or an error if the appropriate bit is set in the open mode passed to FileSwitch. Ctrl-D in the input line will yield EOF when it is read from the buffer.
You can open rawkbd:
as many times as you like, even if a file is open on kbd:. It uses XOS_ReadC (without echoing to the screen) to read characters. No EOF condition exists on rawkbd:; the program reading it must detect an input value/pattern and stop on that.
No files exist on any of these devices. If you call OS_File 5 on the devices it will always return object type 0, so you cannot use them for input to programs that need to load an entire file at once for processing.
The netprint:
system device, as well as using it in place of file names, you can also be used with certain commands that normally use the name of a filing system.
This device allows various special fields to specify different types of printers. They are:
Special Field | Printer Type |
---|---|
printer#null: |
Null Printer |
printer#sink: |
|
printer#parallel: |
Parallel Printer |
printer#centronics: |
|
printer#serial: |
Serial Printer |
printer#rs423: |
|
printer#user: |
Printer Type 3 |
printer# n : |
Printer Type n (where n is in the range 0 – 255) |
It is possible to open multiple files on printer:
, provided they are on different devices and using different buffers.
You can open as many files as you wish on the ‘other output devices’, which are:
null:
vdu:
rawvdu:
H% = OPENOUT "rawvdu:" SYS"OS_Byte",199,H%,0 type here… *Spool
When you type everything is sent to the vdu, which outputs it and then uses XOS_BPut to send it to the spool file handle. This in turn sends it (through another mechanism, OS_PrintChar) to the screen again! The *Spool at the end clears up.
In addition to byte-oriented operations, you are allowed to perform file save operations on the output devices.
The difference between vdu: and rawvdu: is that the former is filtered using the configured DumpFormat, whereas the latter sends its characters straight to the VDU drivers.