Changes between Version 8 and Version 9 of txt_device_api


Ignore:
Timestamp:
Jan 23, 2020, 12:22:35 AM (4 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • txt_device_api

    v8 v9  
    55== __A) General principles__ ==
    66
    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 channel and per direction (TX/RX).
     7The TXT device allows the kernel to access a text terminal peripheral, seen as two (TX & RX) streams of characters.
     8
     9It is a multi-channel device, and there is one chdev per channel and per direction (TX/RX).
    810
    911The TXT0 (channel 0) is the kernel terminal, and is only used to display debug or log messages.
    1012
    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.
     13The "kernel" API, contains the functions used  by the 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.
    1214
    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 generic ''txt_driver_cmd()'' function for each registered request. 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.
     15The '''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 generic ''txt_driver_cmd()'' function for each registered request. A TXT_WRITE operation (TX direction) moves N characters from a kernel buffer to the TXT terminal. A TXT_READ operation (RX direction) moves one single character from the TXT terminal to a kernel buffer.
    1416
    1517The '''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.
    1618
    17 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).
     19Most 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 accessed by the ''txt_driver_cmd()'' and ''txt_cxd_isr()'' function. 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).
    1820
    19 To access the various drivers, the TXT device defines a lower-level "driver" API, that is detailed in section D below.
     21The lower level "driver" API is detailed in section D below.
    2022
    2123All TXT device structures and access functions are defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/devices/dev_txt.c  dev_txt.c] et [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/devices/dev_txt.h dev_txt.h] files.
     
    3133It must be called by a local thread.
    3234
    33 == __C) The "user" API__ ==
     35== __C) The "kernel" API__ ==
    3436
    3537These three I/O operations are blocking, and return only when the transfer is completed, but the blocking policy depends on the operation type.