The devices starting by sata
represent several ATA IDE block devices.
These ATA drives have internal caching at the driver level, so they must be
sync
’d for data integrity when wanting to ensure data coherency.
No special ioctl
calls are supported.
The fb0
device exposes the framebuffer passed as part of the boot
protocol, when present. The device uses Linux’s fbdev interface.
i6300esb
is a hardware watchdog featured in a lot of intel hardware, it
can be reset by using write
and can be configured using
ioctl
like:
WDOG_START = 1 // Start the count. WDOG_STOP = 2 // Stop the count. WDOG_HEARTBEAT = 3 // Reset and set a new heartbeat period in seconds. ioctl(wdog, WDOG_START, ignored); // Enable 2:1 scaling. ioctl(wdog, WDOG_STOP, ignored); // Enable 1:1 scaling. ioctl(wdog, WDOG_HEARTBEAT, pointer_to_uint32_t);
There is no default heartbeat count, so be sure to configure it if you do not want mayhem. Access to reset and configuration can be restricted by using MAC.
While this piece of hardware allows for hooking up interrupts and reboot separately when the timer expires, Ironclad right now will only reboot when the timer expires.
The devices starting by lpt
represent the several character devices
representing the system’s parallel ports. They support write operations, but no
TTY interface is exposed, they are raw byte streams.
pcspeaker
represents the IBM PC speaker, it is interfaced with using
ioctl
, as such:
ioctl(fd, ignored, pointer_to_uint32_t_frequency_in_hz);
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 sata
represent several SATA AHCI block devices.
For now only SATA drives are supported, support for ATAPI is not present.
These SATA drives have internal caching at the driver level, so they must be
sync
’d for data integrity when wanting to ensure data coherency.
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
.