TTY device driver.
More...
|
| devcall | ttyClose (device *devptr) |
| |
| devcall | ttyControl (device *devptr, int func, long arg1, long arg2) |
| |
| devcall | ttyGetc (device *devptr) |
| |
| devcall | ttyInit (device *devptr) |
| |
| devcall | ttyOpen (device *devptr, va_list ap) |
| |
| devcall | ttyPutc (device *devptr, char ch) |
| |
| devcall | ttyRead (device *devptr, void *buf, uint len) |
| |
| devcall | ttyWrite (device *devptr, void *buf, uint len) |
| |
TTY device driver.
This is the TTY device driver. It is responsible for wrapping around a raw character input/output device to provide line-editing and other useful features.
| devcall ttyClose |
( |
device * |
devptr | ) |
|
Close a TTY device.
- Parameters
-
| devptr | TTY device table entry |
- Returns
- OK if TTY is closed properly, otherwise SYSERR
| devcall ttyControl |
( |
device * |
devptr, |
|
|
int |
func, |
|
|
long |
arg1, |
|
|
long |
arg2 |
|
) |
| |
Control function for TTY pseudo devices.
- Parameters
-
| devptr | TTY device table entry |
| func | control function to execute |
| arg1 | first argument for the control function |
| arg2 | second argument for the control function |
- Returns
- the result of the control function
| devcall ttyGetc |
( |
device * |
devptr | ) |
|
Read a single character from a TTY.
- Parameters
-
| devptr | TTY device table entry |
- Returns
- character read from TTY, or EOF
| devcall ttyInit |
( |
device * |
devptr | ) |
|
Initialize TTY structures.
- Parameters
-
| devptr | TTY device table entry |
- Returns
- OK if device is initialized
| devcall ttyOpen |
( |
device * |
devptr, |
|
|
va_list |
ap |
|
) |
| |
Associate a TTY with a hardware device.
- Parameters
-
| devptr | TTY device table entry |
| ap | 2nd argument is the device number for the hardware device |
- Returns
- OK if TTY is opened properly, otherwise SYSERR
| devcall ttyPutc |
( |
device * |
devptr, |
|
|
char |
ch |
|
) |
| |
Write a single character to a TTY.
- Parameters
-
| devptr | TTY device table entry |
| ch | character to output |
- Returns
- OK if character was written successfully, otherwise SYSERR
| devcall ttyRead |
( |
device * |
devptr, |
|
|
void * |
buf, |
|
|
uint |
len |
|
) |
| |
Read characters from a tty.
- Parameters
-
| devptr | pointer to tty device |
| buf | buffer for read characters |
| len | size of the buffer |
- Returns
- number of characters read, EOF if end of file was reached
| devcall ttyWrite |
( |
device * |
devptr, |
|
|
void * |
buf, |
|
|
uint |
len |
|
) |
| |
Write a buffer to a tty
- Parameters
-
| devptr | TTY device table entry |
| buf | buffer of characters to output |
| len | size of the buffer |
- Returns
- count of characters output