The fb0
device exposes the framebuffer passed as part of the boot
protocol, when present. The device uses Linux’s fbdev interface.
The devices ps2keyboard
and ps2mouse
exposes x86’s native PS2
interfaces, ps2keyboard
is a normal character device that returns
scancodes as they are received. ps2mouse
is a character device that
returns mouse packets following the structure:
struct mouse_data { int x_variation; int y_variation; int z_variation; bool is_left_click; bool is_right_click; bool is_middle_clock; bool is_4th_click; bool is_5th_click; };
ps2mouse
supports a series of ioctl
calls for setting different
modes and talking directly with the PS2 controller:
PS2MOUSE_2_1_SCALING = 1 PS2MOUSE_1_1_SCALING = 2 PS2MOUSE_SET_RES = 3 PS2MOUSE_SET_SAMPLE_RATE = 4 ioctl(mouse, PS2MOUSE_2_1_SCALING, ignored); // Enable 2:1 scaling. ioctl(mouse, PS2MOUSE_1_1_SCALING, ignored); // Enable 1:1 scaling. ioctl(mouse, PS2MOUSE_SET_RES, resolution); // (0 - 3). ioctl(mouse, PS2MOUSE_SET_SAMPLE_RATE, rate); // (0 - 200).
Valid resolutions and sample rates are values for the PS2 controller, else the call is ignored. For valid values and their meaning refer to this website.
The devices starting by serial
represent the several character devices
used for each present serial port, they support read/write operations, but no
TTY interface is exposed, they are raw byte streams.
Baud and other settings can be set by using the termios
, note that
most of the fields are not implemented as the serial devices are not ttys but
just byte streams.
The default baud for all ports is set to be 115200
.