The main file of the console driver framework is c/src/lib/libbsp/shared/console.c, and the driver's entry is console_initialize() The primary function is to initialize the global variables provided by the BSP Console_configuration_ports[Console_configuration_count], initializes the Termios schema, registers the file node of the Console device.
C/SRC/LIB/LIBBSP/ARM/BEAGLE/CONSOLE/CONSOLE-CONFIG.C is the only file provided by the Beagle BSP regarding the console driver, as the serial device provided by AM335X is compatible with the NS16550 register , things become very simple, because ns16550 's various operating functions are implemented in Libchip, the specific file is c/src/libchip/serial/ NS16550.C, it should be said that a lot of CPU provided by the serial port are ns16550 compatible, this is the de facto standard, even if unfortunately incompatible, we are just to implement a few operating functions ~
C Library Support
To support printf and scanf for C libraries, you must provide input and output functions, initialize Bsp_output_char and Bsp_poll_char two function pointers, Beagle BSP provides functions that use the same serial port as the console, and fixed for round robin to get or write characters, the sensation may go wrong and later be studied.
Console_initialize Call
The console_driver_table_entry is defined in cpukit/include/rtems/console.h, and if the console is required for the final application, it can be configured by cpukit/sapi/include/ Confdefs.h included in the _io_driver_address_table.
Rtems 4.11 Console Drive (ARM, beagle)