[CSE]  Advanced Operating Systems 
 COMP9242 2005/S2 
UNSW
CRICOS Provider
Number: 00098G

PRINTER Printer-Friendly Version
Administration               
- Notices
- Course Intro
- Consultations
- Survey Results
 
Work
- Lectures
- Selected Papers
- Project Spec
- Project FAQ
- Exam
 
Forums
- Forums
- Can't Login?
 
Documentation
- Project Resources
- ASysT Lab
- Using Sulima
- L4 Debugging Guide
- L4Ka::Pistachio FAQ
- L4 source browser
- SOS source browser
- L4 reference manual
- L4 user manual
- Sulima ISA Simulator
R4x00 ISA Summary 
MIPS R4700 ReferenceMIPS R4000 User Manual 
- GT64111

 
Related Info
- Aurema OS Prize
- OS Hall of Fame
 
History
- 2004
- 2003
- 2002
- 2000
- 1999
- 1998
- 1997
 
Staff
- Gernot Heiser (LiC)
- Kevin Elphinstone
- Guest Lecturers (TBA)
 
Stureps
- Student Reps

 
Valid HTML 4.0!

Serial Library

The serial library provides a very simple device driver for the serial port chipset found in the U4600 machine.

serial_init

struct serial * serial_init(bs_seq spaces)

serial_init initalises the state of the serial driver and returns a handle that must be passed to other serial functions. The spaces parameter defines where in physical memory the serial chips have been mapped. The provided code in hardware.c provides an example of how this is used.

serial_interrupt_handler

int serial_interrupt_handler(struct serial *serial);

serial_interrupt_handler should be called when ever and interrupt for the serial device occurs. The serial parameter should be a variable previously returned by serial_init. Again, hardware.c provides an example of how this function is used.

serial_send

int serial_send(struct serial *serial, char *data, int len);

serial_send will write len bytes of data to the serial line. This function returns the number of bytes written, which may be less than len. This occurs if the serial driver's internal buffer fills faster than it can actually output data. In this case it is up to the calling code to handle the situation, either by retrying or returning an error to the user.

It should be noted that the serial driver performs conversion of \n to \r\n.

serial_register_handler

int serial_register_handler(struct serial *serial, void (*handler) (char c));

To receive input from the serial line you must register a handler function, which will be called by the serial driver when input is available. The provided function simply takes the inputted character as it's only argument. This function will be called during the interrupt context so it should be reasonably light-weight.


Last modified: 23 Aug 2004.