Change Note 2024-01-17
Text IO infrastructure, Kernel, new example program.
Module TextIO
- Simplified
Writer: noputCharprocedure variable anymore, all output to be done usingputString. - Output via strings in lieu of repeatedly using single character output allows to make better use of buffers, such as the UART’s FIFO, and is friendlier for DMA.
Texts.Writewas the only procedure anyway that used single the charputCharprocedure.
Module UART
- Renamed to UARTstr: uses the UART for string output, via device module
UARTd. - Removed procedure
PutChar, since it’s not needed anymore forTextIO.Writer. - Removed procedure
GetChar, since it’s not needed anymore forTextIO.Reader. - Note: procedure
GetStringneeds implementation.
Module Terminals
Terminals.Opendoes not directly use moduleUART(nowUARTstr) anymore, but takes theputStringandgetStringas parameters.- This allows to “plug” other procedures from other modules, such as the new ones for the kernel, which avoid busy waiting (see
UARTkstrbelow).
Module Texts
- Adjusted
Texts.Writeto simplifiedTextIO.Writer.
Module Main
- Implemented changes to module
Terminals.
Module Kernel (v1)
- Added procedure
Kernel.AwaitDeviceSet. - Extended scheduler for
Kernel.AwaitDeviceSet. - Threads can enquire their last scheduler trigger: period, delay, or device.
- See new example
NoBusyWaiting.
Module UARTkstr (for Kernel v1)
- New module.
- Equivalent to
UARTstr, but without busy-waiting. - The thread gets suspended until the transmit buffer is empty again.
Example program NoBusyWaiting
- New example program.
- Demo the new
Kernel.AwaitDeviceSetandUARTkstr.