[810860a] | 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;
|
---|
[82cf692] | 53 | sys_console sys_console;
|
---|
[6d4c549] | 54 | initialization:
|
---|
| 55 | !ns.ipc_m_connect_me_to /* kbd */ ;
|
---|
| 56 | !kbd.ipc_m_connect_to_me ;
|
---|
| 57 | !ns.ipc_m_connect_me_to /* fb */ ;
|
---|
| 58 | [/uspace/lib/libc/fnc.devmap_driver_register] ;
|
---|
| 59 | !fb.get_resolution ;
|
---|
| 60 | (
|
---|
| 61 | [fnc.vp_create] +
|
---|
| 62 | [fnc.vp_switch]
|
---|
| 63 | )* ;
|
---|
| 64 | [fnc.make_pixmap]* ;
|
---|
| 65 | [fnc.make_anim] ;
|
---|
| 66 | [fnc.vp_switch] ;
|
---|
| 67 | !fb.flush ;
|
---|
| 68 | !fb.get_csize ;
|
---|
| 69 | !fb.get_color_cap ;
|
---|
| 70 | !fb.ipc_m_share_out ;
|
---|
| 71 | [/uspace/lib/libc/fnc.devmap_device_register]* ;
|
---|
| 72 | !sys_console.sys_disable_console ;
|
---|
| 73 | [fnc.gcons_redraw_console] ;
|
---|
| 74 | [fnc.set_rgb_color] ;
|
---|
| 75 | [fnc.screen_clear] ;
|
---|
| 76 | [fnc.curs_goto] ;
|
---|
| 77 | [fnc.curs_visibility]
|
---|
[810860a] | 78 | protocol:
|
---|
[6d4c549] | 79 | [/uspace/lib/libc/protocol]
|
---|
[810860a] | 80 | };
|
---|
| 81 |
|
---|
| 82 | architecture console {
|
---|
| 83 | inst ui_dispatcher ui_dispatcher;
|
---|
| 84 | inst kbd kbd;
|
---|
| 85 | inst fb fb;
|
---|
| 86 |
|
---|
| 87 | bind ui_dispatcher:kbd to kbd:kbd;
|
---|
| 88 | bind ui_dispatcher:fb to fb:fb;
|
---|
| 89 |
|
---|
| 90 | bind kbd:event to ui_dispatcher:event;
|
---|
| 91 |
|
---|
| 92 | delegate console to ui_dispatcher:console;
|
---|
| 93 |
|
---|
| 94 | [/uspace/lib/libc/subsume%ui_dispatcher]
|
---|
| 95 | [/uspace/lib/libc/subsume%kbd]
|
---|
| 96 | [/uspace/lib/libc/subsume%fb]
|
---|
| 97 |
|
---|
| 98 | subsume ui_dispatcher:ns to ns;
|
---|
[82cf692] | 99 | subsume ui_dispatcher:sys_console to sys_console;
|
---|
| 100 |
|
---|
[810860a] | 101 | subsume kbd:ns to ns;
|
---|
| 102 | subsume fb:ns to ns;
|
---|
| 103 | };
|
---|