robert-w-gries / rxinu

Rust implementation of Xinu educational operating system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UART does not utilize buffers

robert-w-gries opened this issue · comments

Xinu Behavior

  • uartWrite
    • write method sends all bytes from given buffer
    • Checks for non-blocking mode then sends bytes to output buffer if available
  • uartRead
    • reads a requested number of bytes
    • reads from UART buffer

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

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.