1 | interface console extends service {
|
---|
2 | /* Read characters from console */
|
---|
3 | ipcarg_t read(out_copy stream data);
|
---|
4 |
|
---|
5 | /* Write characters to console */
|
---|
6 | ipcarg_t write(in_copy stream data);
|
---|
7 |
|
---|
8 | /* Get last event from event queue */
|
---|
9 | ipcarg_t get_event(out ipcarg_t type, out ipcarg_t key, out ipcarg_t mods, out ipcarg_t char);
|
---|
10 |
|
---|
11 | /* Flush output buffer */
|
---|
12 | ipcarg_t sync(void);
|
---|
13 |
|
---|
14 | /* Clear console */
|
---|
15 | ipcarg_t clear(void);
|
---|
16 |
|
---|
17 | /* Move cursor to given position */
|
---|
18 | ipcarg_t goto(in ipcarg_t col, in ipcarg_t row);
|
---|
19 |
|
---|
20 | /* Get console dimensions (in character cells) */
|
---|
21 | ipcarg_t get_size(out ipcarg_t cols, in ipcarg_t rows);
|
---|
22 |
|
---|
23 | /* Get color capabilities */
|
---|
24 | ipcarg_t get_color_cap(void);
|
---|
25 |
|
---|
26 | /* Set abstract text style */
|
---|
27 | ipcarg_t set_style(in ipcarg_t style);
|
---|
28 |
|
---|
29 | /* Set EGA-based text color */
|
---|
30 | ipcarg_t set_color(in ipcarg_t fb_color, in ipcarg_t bg_color, in ipcarg_t attr);
|
---|
31 |
|
---|
32 | /* Set RGB-based text color */
|
---|
33 | ipcarg_t set_rgb_color(in ipcarg_t fb_color, in ipcarg_t bg_color);
|
---|
34 |
|
---|
35 | /* Set cursor visibility */
|
---|
36 | ipcarg_t cursor_visibility(in ipcarg_t visible);
|
---|
37 |
|
---|
38 | /* Switch to kernel debugging console (if available) */
|
---|
39 | ipcarg_t kcon_enable(void);
|
---|
40 | protocol:
|
---|
41 | [console.bp]
|
---|
42 | };
|
---|
43 |
|
---|
44 | frame ui_dispatcher {
|
---|
45 | provides:
|
---|
46 | console console;
|
---|
47 | event event;
|
---|
48 | requires:
|
---|
49 | [/uspace/lib/libc/requires]
|
---|
50 | kbd kbd;
|
---|
51 | fb fb;
|
---|
52 | ns ns;
|
---|
53 | sys_console sys_console;
|
---|
54 | protocol:
|
---|
55 | [/uspace/lib/libc/protocol] |
|
---|
56 | [console_server.bp]
|
---|
57 | };
|
---|
58 |
|
---|
59 | architecture console {
|
---|
60 | inst ui_dispatcher ui_dispatcher;
|
---|
61 | inst kbd kbd;
|
---|
62 | inst fb fb;
|
---|
63 |
|
---|
64 | bind ui_dispatcher:kbd to kbd:kbd;
|
---|
65 | bind ui_dispatcher:fb to fb:fb;
|
---|
66 |
|
---|
67 | bind kbd:event to ui_dispatcher:event;
|
---|
68 |
|
---|
69 | delegate console to ui_dispatcher:console;
|
---|
70 |
|
---|
71 | [/uspace/lib/libc/subsume%ui_dispatcher]
|
---|
72 | [/uspace/lib/libc/subsume%kbd]
|
---|
73 | [/uspace/lib/libc/subsume%fb]
|
---|
74 |
|
---|
75 | subsume ui_dispatcher:ns to ns;
|
---|
76 | subsume ui_dispatcher:sys_console to sys_console;
|
---|
77 |
|
---|
78 | subsume kbd:ns to ns;
|
---|
79 | subsume fb:ns to ns;
|
---|
80 | };
|
---|