#include <libc.h>
#include <ipc/kbd.h>
#include <io/keycode.h>
#include <ipc/mouse.h>
#include <ipc/fb.h>
#include <ipc/services.h>
#include <ipc/ns.h>
#include <errno.h>
#include <str_error.h>
#include <ipc/console.h>
#include <unistd.h>
#include <async.h>
#include <adt/fifo.h>
#include <sys/mman.h>
#include <stdio.h>
#include <str.h>
#include <sysinfo.h>
#include <event.h>
#include <devmap.h>
#include <fcntl.h>
#include <vfs/vfs.h>
#include <fibril_synch.h>
#include <io/style.h>
#include <io/screenbuffer.h>
#include <inttypes.h>
#include "console.h"
#include "gcons.h"
#include "keybuffer.h"
Go to the source code of this file.
Data Structures | |
struct | console_t |
struct | hid_class_info |
Defines | |
#define | HOTPLUG_WATCH_INTERVAL (1000 * 250) |
Interval for checking for new keyboard (1/4s). | |
#define | MAX_IPC_OUTGOING_PHONES 128 |
#define | NAME "console" |
#define | NAMESPACE "term" |
Functions | |
static int | async_connect_to_me_hack (int phone, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, async_client_conn_t client_receiver, ipc_callid_t *hash) |
static int | ccap_fb_to_con (sysarg_t ccap_fb, sysarg_t *ccap_con) |
static void | cell_mark_changed (sysarg_t col, sysarg_t row) |
Mark a character cell as changed. | |
static void | change_console (console_t *cons) |
Switch to new console. | |
static int | check_new_device_fibril (void *arg) |
Periodically check for new keyboards in /dev/class/. | |
static void | check_new_devices_in_background (int(*connection_func)(const char *), const char *classname) |
Start a fibril monitoring hot-plugged keyboards. | |
static void | client_connection (ipc_callid_t iid, ipc_call_t *icall) |
Default thread for new connections. | |
static void | close_driver_phone (ipc_callid_t hash) |
static int | connect_keyboard (const char *path) |
static int | connect_keyboard_or_mouse (const char *devname, async_client_conn_t handler, const char *path) |
static int | connect_mouse (const char *path) |
static void | cons_get_event (console_t *cons, ipc_callid_t rid, ipc_call_t *request) |
static void | cons_read (console_t *cons, ipc_callid_t rid, ipc_call_t *request) |
static void | cons_write (console_t *cons, ipc_callid_t rid, ipc_call_t *request) |
static bool | console_init (char *input) |
static void | curs_goto (sysarg_t x, sysarg_t y) |
static void | curs_hide_sync (void) |
static void | curs_visibility (bool visible) |
static void | fb_pending_flush (void) |
Flush pending cells to FB. | |
static void | fb_putchar (wchar_t c, sysarg_t col, sysarg_t row) |
Print a character to the active VC with buffering. | |
static void | fb_update_area (console_t *cons, sysarg_t x0, sysarg_t y0, sysarg_t width, sysarg_t height) |
Send an area of screenbuffer to the FB driver. | |
static void | interrupt_received (ipc_callid_t callid, ipc_call_t *call) |
static void | kbd_reclaim (void) |
static void | kbd_yield (void) |
static void | keyboard_events (ipc_callid_t iid, ipc_call_t *icall) |
Handler for keyboard. | |
int | main (int argc, char *argv[]) |
Main entry point. | |
static void | mouse_events (ipc_callid_t iid, ipc_call_t *icall) |
Handler for mouse events. | |
static void | screen_clear (void) |
static void | screen_reclaim (void) |
static void | screen_yield (void) |
static void | set_attrs (attrs_t *attrs) |
static void | set_color (uint8_t fgcolor, uint8_t bgcolor, uint8_t flags) |
static void | set_rgb_color (uint32_t fgcolor, uint32_t bgcolor) |
static void | set_style (uint8_t style) |
static void | usage (void) |
static void | write_char (console_t *cons, wchar_t ch) |
Process a character from the client (TTY emulation). | |
Variables | |
static console_t * | active_console = &consoles[0] |
static console_t | consoles [CONSOLE_COUNT] |
Array of data for virtual consoles. | |
static ipc_callid_t | driver_phones [MAX_IPC_OUTGOING_PHONES] = { 0 } |
To allow proper phone closing. | |
struct { | |
sysarg_t color_cap | |
Color capabilities (FB_CCAP_xxx). | |
sysarg_t cols | |
Framebuffer columns. | |
int phone | |
Framebuffer phone. | |
sysarg_t rows | |
Framebuffer rows. | |
} | fb_info |
Information about framebuffer. | |
struct { | |
sysarg_t cnt | |
Width of the span. | |
sysarg_t col | |
Leftmost column of the span. | |
sysarg_t row | |
Row where the span lies. | |
} | fb_pending |
Information on row-span yet unsent to FB driver. | |
static keyfield_t * | interbuffer = NULL |
Pointer to memory shared with framebufer used for faster virtual console switching. | |
static int | kbd_phone |
Phone to the keyboard driver. | |
static console_t * | kernel_console = &consoles[KERNEL_CONSOLE] |
static int | mouse_phone |
Phone to the mouse driver. | |
static console_t * | prev_console = &consoles[0] |
Definition in file console.c.