Master the fundamental concepts of device drivers & interrupts through this focused micro-challenge.
COM1 at I/O base 0x3F8 uses a 16550 UART with FIFOs and line status register (LSR). Poll LSR bit 5 (THRE) before writing transmit holding register, or enable receive interrupts via IER. For example, sending 'H' means waiting for THRE then out 0x3F8, al.
nasmLoading…
-serial stdio-serial stdio merges COM1 with the terminal so polled output appears instantly. Divisor 1 with 115200 baud is the common lab default when the input clock is 1.8432 MHz. Enable FIFOs via FCR bit 0 to reduce overrun during bursts. Line status bit 0 indicates received data ready for blocking reads without interrupts.
You will initialize COM1 and poll (or interrupt-drive) character output. This exercise requires baud divisor setup and LSR polling before each transmitted byte.
Implement serial port driver in C.
Requirements:
Test:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github