Consider an industrial computer (say "embedded system"),
- equipped with a linux server OS (no desktop)
- running just a SINGLE application process (a single non-root user)
- attached to an high resolution screen
- attached with a keyboard
The computer fully dedicated to a SINGLE application process/user,
- running in background (to be defined) and started at boot
- run some I/O logics
- get some user inputs (keystrokes/digits) from the keyboard
- has to display some text/images on a screen attached to the computer
BTW, for text display details see also the related question: display big texts (on a graphic mode?) without a desktop environment).
linux server host (no desktop env)
+-------------------------------------------+
| |
| +--------> Digital inputs
| +--------------+ <--------- Digital outputs
| | graphic card | |
+---+------+-------+--------------------^---+
| |
| HDMI / VGA | USB
+--------------v---------------+ +-------+--------+
| Please contact the operator. | | |
+------------------------------+ +----------------+
screen (TTY console?) keyboard
How can the (background) process print text (in text-terminal mode or in graphic mode) on the attached (dedicated) screen, and get keystrokes from the keyboard?
OUTPUT
For output, I presume that one solution is that the process prints output texts as images, directly writing on the framebuffer (by example using program fbi
.
But how if I would use the screen as a stdout
of the (background) process? In this case I guess I need to "uncouple" the root TTY from the attached screen (that's possible?), allowing the user process to get the full control of the screen. It make sense?
INPUT
How can I take keystrokes from the keyboard? Using the stdin? Reading the keyboard device directly?
BTW, I presume to access the computer for any (root) need, over SSH.
Any suggestion?
getty
with the program you want to run (or something that relays the input to your program)? https://raymii.org/s/tutorials/Run_software_on_tty1_console_instead_of_login_getty.html – rudib Nov 22 '20 at 12:24cat /dev/tty1
(but this will block whatever is running in it frim getting the input). https://stackoverflow.com/questions/31440833/how-to-redirect-input-from-another-tty – rudib Nov 22 '20 at 12:41