Changes between Version 1 and Version 2 of txt_device_api
- Timestamp:
- Jan 22, 2020, 12:08:46 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
txt_device_api
v1 v2 5 5 == __A) General principles__ == 6 6 7 The TXT device allows the kernel to access a text terminal peripheral. It is a multi-channel device, and there is one chdev per terminal, and per direction (TX/RX). The TXT0 (channel 0) is the kernel terminal.7 The TXT device allows the kernel to access a text terminal peripheral. It is a multi-channel device, and there is one chdev per terminal, and per direction (TX/RX). 8 8 9 The "user" API, contains the functions used the user-level system calls, and by the kernel itself for debug. It defines three operation types : '''TXT_READ''', '''TXT_WRITE''', and '''TXT_SYNC_WRITE'''. This API is detailed in section C below.9 The TXT0 (channel 0) is the kernel terminal, and is only used to display debug or log messages. 10 10 11 * The '''asynchronous''' READ and WRITE operations are not directly executed by the client thread. The READ and WRITE requests are registered in the waiting queue rooted in the TXT chdev descriptor. These requests are actually handled by a dedicated server thread running in the cluster containing the chdev descriptor, that call the ''txt_driver_cmd()'' function. 12 A WRITE operation (TX direction) moves N characters from a kernel buffer to the TXT terminal. A READ operation moves one single character from the TXT terminal to a kernel buffer. 11 The "user" API, contains the functions used the user-level system calls, and by the kernel itself. It defines three operation types : '''TXT_READ''', '''TXT_WRITE''', and '''TXT_SYNC_WRITE'''. This API is detailed in section C below. 12 13 * The '''asynchronous''' TXT_READ and TXT_WRITE operations are not directly executed by the client thread. The requests are registered in the waiting queue rooted in the TXT chdev descriptor. These requests are actually handled by a dedicated server thread running in the cluster containing the chdev descriptor, that call the ''txt_driver_cmd()'' function. 14 A TXT_WRITE operation (TX direction) moves N characters from a kernel buffer to the TXT terminal. A TXT_READ operation moves one single character from the TXT terminal to a kernel buffer. 13 15 14 16 * The '''synchronous''' SYNC_WRITE operation is used by the kernel to display debug messages on the TXT0. It does not use the waiting queue, and it does not use the server thread. The client thread calls directly the ''txt_driver_aux()'' function, without using the the txt_command_t structure to communicate with the driver. 15 17 16 Most TXT device implementation use two (hardware or software) FIFOs for asynchronous READ and WRITE operations. These FIFOs are not controlled by the kernel, but are controlled by the ''txt_driver_cmd()'' and ''txt_cxd_isr()''. When they are used by the driver, the TXT_TX_IRQ and TXT_RX_IRQ are routed to the core executing the corresponding TXT server thread. (ISR stand for Interrupt Service Routine).18 Most TXT device implementations use two (hardware or software) FIFOs for asynchronous READ and WRITE operations. These FIFOs are not controlled by the kernel, but are controlled by the ''txt_driver_cmd()'' and ''txt_cxd_isr()''. When they are used by the driver, the TXT_TX_IRQ and TXT_RX_IRQ are routed to the core executing the corresponding TXT server thread. (ISR stand for Interrupt Service Routine). 17 19 18 20 To access the various drivers, the TXT device defines a lower-level "driver" API, that is detailed in section D below.