Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions

TTY device driver. More...

Functions

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)
 

Detailed Description

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.

Function Documentation

devcall ttyClose ( device *  devptr)

Close a TTY device.

Parameters
devptrTTY 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
devptrTTY device table entry
funccontrol function to execute
arg1first argument for the control function
arg2second argument for the control function
Returns
the result of the control function
devcall ttyGetc ( device *  devptr)

Read a single character from a TTY.

Parameters
devptrTTY device table entry
Returns
character read from TTY, or EOF
devcall ttyInit ( device *  devptr)

Initialize TTY structures.

Parameters
devptrTTY device table entry
Returns
OK if device is initialized
devcall ttyOpen ( device *  devptr,
va_list  ap 
)

Associate a TTY with a hardware device.

Parameters
devptrTTY device table entry
ap2nd 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
devptrTTY device table entry
chcharacter 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
devptrpointer to tty device
bufbuffer for read characters
lensize 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
devptrTTY device table entry
bufbuffer of characters to output
lensize of the buffer
Returns
count of characters output