Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
conf/ | H | - | - | 82 | 67 | |
docs/ | H | - | - | 183 | 140 | |
subprojects/ | H | - | - | 52 | 40 | |
test/ | H | - | - | 1,494 | 1,101 | |
.clang-format | H A D | 20-Oct-2023 | 3.6 KiB | 119 | 116 | |
.clang-tidy | H A D | 12-Jun-2024 | 7.2 KiB | 218 | 216 | |
.gitignore | H A D | 12-Jun-2024 | 1 KiB | 66 | 54 | |
.travis.yml | H A D | 08-Dec-2022 | 528 | 22 | 17 | |
CHANGELOG.md | H A D | 03-Feb-2025 | 2.3 KiB | 88 | 55 | |
LICENSE | H A D | 17-Mar-2016 | 11.1 KiB | 203 | 169 | |
OWNERS | H A D | 21-Dec-2023 | 1.8 KiB | 57 | 52 | |
README.md | H A D | 30-Jul-2024 | 3.3 KiB | 78 | 52 | |
config-internal.h | H A D | 12-Jun-2024 | 731 | 26 | 6 | |
config.c | H A D | 29-Aug-2024 | 6.3 KiB | 317 | 233 | |
config.h | H A D | 03-Feb-2025 | 1.4 KiB | 41 | 18 | |
console-client.c | H A D | 12-Jun-2024 | 7.8 KiB | 390 | 316 | |
console-dbus.c | H A D | 10-Jul-2024 | 6.7 KiB | 268 | 202 | |
console-mux.c | H A D | 10-Jul-2024 | 6.5 KiB | 321 | 254 | |
console-mux.h | H A D | 10-Jul-2024 | 909 | 27 | 8 | |
console-server.c | H A D | 10-Jul-2024 | 28.7 KiB | 1,316 | 974 | |
console-server.h | H A D | 16-Aug-2024 | 7.8 KiB | 288 | 168 | |
console-socket.c | H A D | 12-May-2023 | 1.6 KiB | 73 | 43 | |
log-handler.c | H A D | 22-Aug-2024 | 4.9 KiB | 235 | 174 | |
meson.build | H A D | 01-Feb-2025 | 2.6 KiB | 104 | 95 | |
meson.options | H A D | 01-Feb-2025 | 407 | 14 | 13 | |
ringbuffer.c | H A D | 04-Jun-2024 | 5 KiB | 236 | 158 | |
socket-handler.c | H A D | 09-Feb-2025 | 11.2 KiB | 537 | 396 | |
tty-handler.c | H A D | 12-Jun-2024 | 7.2 KiB | 342 | 252 | |
util.c | H A D | 18-Apr-2023 | 915 | 37 | 16 | |
util.h | H A D | 10-Jul-2024 | 663 | 20 | 2 |
README.md
1# obmc-console 2 3## To Build 4 5To build this project, run the following shell commands: 6 7 meson setup build 8 meson compile -C build 9 10To test: 11 12 dbus-run-session meson test -C build 13 14## To Run Server 15 16Running the server requires a serial port (e.g. /dev/ttyS0): 17 18 touch obmc-console.conf 19 ./obmc-console-server --config obmc-console.conf ttyS0 20 21## To Connect Client 22 23To connect to the server, simply run the client: 24 25 ./obmc-console-client 26 27To disconnect the client, use the standard `~.` combination. 28 29## Underlying design 30 31This shows how the host UART connection is abstracted within the BMC as a Unix 32domain socket. 33 34 +---------------------------------------------------------------------------------------------+ 35 | | 36 | obmc-console-client unix domain socket obmc-console-server | 37 | | 38 | +----------------------+ +------------------------+ | 39 | | client.2200.conf | +---------------------+ | server.ttyVUART0.conf | | 40 +---+--+ +----------------------+ | | +------------------------+ +--------+-------+ 41 Network | 2200 +--> +->+ @obmc-console.host0 +<-+ <--+ /dev/ttyVUART0 | UARTs 42 +---+--+ | console-id = "host0" | | | | console-id = "host0" | +--------+-------+ 43 | | | +---------------------+ | | | 44 | +----------------------+ +------------------------+ | 45 | | 46 | | 47 | | 48 +---------------------------------------------------------------------------------------------+ 49 50This supports multiple independent consoles. The `console-id` is a unique 51portion for the unix domain socket created by the obmc-console-server instance. 52The server needs to know this because it needs to know what to name the pipe; 53the client needs to know it as it needs to form the abstract socket name to 54which to connect. 55 56## Mux Support 57 58In some hardware designs, multiple UARTS may be available behind a Mux. Please 59reference 60[docs/mux-support.md](https://github.com/openbmc/obmc-console/blob/master/docs/mux-support.md) 61in that case. 62 63## Sample Development Setup 64 65For developing obmc-console, we can use pseudo terminals (pty's) in Linux. 66 67The socat command will output names of 2 pty's, one of which is the master and 68the other one is the slave. The master pty can be used to emulate a UART. 69 70 $ socat -d -d pty,raw,echo=0,link=pty1 pty,raw,echo=0,link=pty2 71 72 $ obmc-console-server --console-id dev $(realpath pty2) 73 74 $ obmc-console-client -i dev 75 76 # this message should appear for the client 77 $ echo "hi" > pty1 78