Name Date Size #Lines LOC

..Today-

conf/H18-Apr-2024-8267

docs/H09-Aug-2024-183140

subprojects/H24-Jul-2024-

test/H04-Oct-2024-873661

.clang-formatH A D08-Nov-20233.6 KiB119116

.clang-tidyH A D10-Jul-20247.2 KiB218216

.gitignoreH A D10-Jul-20241 KiB6654

.travis.ymlH A D08-Dec-2022528 2217

CHANGELOG.mdH A D04-Oct-20242.2 KiB8754

LICENSEH A D07-Mar-202111.1 KiB203169

OWNERSH A D22-Dec-20231.8 KiB5752

README.mdH A D09-Aug-20243.3 KiB7852

config-internal.hH A D10-Jul-2024731 266

config.cH A D27-Aug-20246.3 KiB317233

config.hH A D24-Jul-20241.4 KiB4017

console-client.cH A D10-Jul-20247.8 KiB390316

console-dbus.cH A D24-Jul-20246.7 KiB268202

console-mux.cH A D24-Jul-20246.5 KiB321254

console-mux.hH A D24-Jul-2024909 278

console-server.cH A D24-Jul-202428.7 KiB1,316974

console-server.hH A D27-Aug-20247.8 KiB288168

console-socket.cH A D17-May-20231.6 KiB7343

log-handler.cH A D04-Oct-20244.9 KiB235174

meson.buildH A D09-Aug-20242.9 KiB9788

meson.optionsH A D27-Oct-2023373 54

ringbuffer.cH A D06-Jun-20245 KiB236158

socket-handler.cH A D24-Jul-202411.2 KiB537396

tty-handler.cH A D10-Jul-20247.2 KiB342252

util.cH A D21-Apr-2023915 3716

util.hH A D12-Jul-2024663 202

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