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

PRINTER Printer-Friendly Version
- Notices
- Course Intro
- Consultations
- Survey Results
- Lectures
- Selected Papers
- Project Spec
- Project FAQ
- Exam
- Forums
- Can't Login?
- 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
- 2004
- 2003
- 2002
- 2000
- 1999
- 1998
- 1997
- Gernot Heiser (LiC)
- Kevin Elphinstone
- Guest Lecturers (TBA)
- 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.


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.


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.


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.


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.