robert-w-gries / rxinu

Rust implementation of Xinu educational operating system
Apache License 2.0
34 stars 4 forks source link

UART does not utilize buffers #21

Closed robert-w-gries closed 6 years ago

robert-w-gries commented 6 years ago

Xinu Behavior

Current rXinu behavior

read(nbytes) and write(data_buffer_to_write) functions do not exist in the current API.

Change Needed

Need to add these functions

robert-w-gries commented 6 years ago

Edit: The following information is incorrect. I misunderstood the purpose of the FIFO register. We do not read from the FIFO, it is used internally in the UART driver to prevent loss of data during com1 interrupts.

xinu uses 8250 UART while rxinu uses 16550 UART.

The Interrupt Identifaction Register is used in 8250 to manually implement buffers. The FIFO Control Register is used in 16550 to trigger interrupts when a certain number of bytes are filled.

Currently, we are losing data because we do not read all data from the FIFO buffer in the SerialPort.receive() method. This needs to be fixed.

In the future, we'll add a uart_8250 driver. We'll need one if we plan to run rxinu on the MIPS routers in Marquette's Systems Lab.