|
PatchworkOS
dbbdc99
A non-POSIX operating system.
|
#include "ps2.h"#include "ps2_kbd.h"#include "ps2_mouse.h"#include <kernel/cpu/irq.h>#include <kernel/log/log.h>#include <kernel/log/panic.h>#include <kernel/module/module.h>#include <kernel/sched/clock.h>#include <kernel/sched/timer.h>#include <kernel/sync/lock.h>#include <kernel/acpi/aml/object.h>#include <kernel/acpi/devices.h>#include <kernel/acpi/resources.h>#include <kernel/acpi/tables.h>#include <errno.h>#include <string.h>#include <time.h>Go to the source code of this file.
Functions | |
| static const char * | ps2_self_test_response_to_string (ps2_self_test_response_t response) |
| static const char * | ps2_device_test_response_to_string (ps2_device_test_response_t response) |
| static const char * | ps2_device_to_string (ps2_device_t device) |
| static uint64_t | ps2_controller_init (void) |
| static void | ps2_controller_deinit (void) |
| static uint64_t | ps2_self_test (void) |
| static uint64_t | ps2_check_if_dual_channel (void) |
| static uint64_t | ps2_devices_test (void) |
| void | ps2_drain (void) |
| Drain the PS/2 output buffer. | |
| uint64_t | ps2_wait_until_set (ps2_status_bits_t status) |
| Wait until status bit(s) are set. | |
| uint64_t | ps2_wait_until_clear (ps2_status_bits_t status) |
| Wait until status bit(s) are clear. | |
| uint64_t | ps2_read (void) |
| Read from the PS/2 controllers data port. | |
| uint64_t | ps2_read_no_wait (void) |
| Read from the PS/2 controllers data port without waiting. | |
| uint64_t | ps2_write (uint8_t data) |
| Write to the PS/2 controllers data port. | |
| uint64_t | ps2_cmd (ps2_cmd_t command) |
| Send a command to the PS/2 controller without reading response. | |
| uint64_t | ps2_cmd_and_read (ps2_cmd_t command) |
| Send a command to the PS/2 controller and read response. | |
| uint64_t | ps2_cmd_and_write (ps2_cmd_t command, uint8_t data) |
| Send a command to the PS/2 controller and write data. | |
| static uint64_t | ps2_device_init (ps2_device_t device) |
| uint64_t | ps2_device_cmd (ps2_device_t device, ps2_device_cmd_t command) |
| Send a command to a PS/2 device without reading response. | |
| uint64_t | ps2_device_cmd_and_read (ps2_device_t device, ps2_device_cmd_t command) |
| Send a command to a PS/2 device and read response. | |
| uint64_t | ps2_device_sub_cmd (ps2_device_t device, ps2_device_cmd_t command, uint8_t subCommand) |
| Send a command and a subcommand to a PS/2 device. | |
| static uint64_t | ps2_attach_device (const char *type, const char *name) |
| uint64_t | _module_procedure (const module_event_t *event) |
| MODULE_INFO ("PS2 Driver", "Kai Norberg", "A PS/2 keyboard and mouse driver", OS_VERSION, "MIT", PS2_KEYBOARD_PNP_IDS ";" PS2_MOUSE_PNP_IDS) | |
Variables | |
| static port_t | dataPort = 0 |
| static port_t | statusPort = 0 |
| static port_t | commandPort = 0 |
| static uint64_t | currentConfig = 0 |
| static bool | isDualChannel = false |
| static bool | controllerInitialized = false |
| static ps2_known_device_t | knownKeyboards [] |
| static ps2_known_device_t | knownMice [] |
| static ps2_device_info_t | devices [PS2_DEV_COUNT] |
| static lock_t | attachLock = LOCK_CREATE() |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| uint64_t _module_procedure | ( | const module_event_t * | event | ) |
| MODULE_INFO | ( | "PS2 Driver" | , |
| "Kai Norberg" | , | ||
| "A PS/2 keyboard and mouse driver" | , | ||
| OS_VERSION | , | ||
| "MIT" | , | ||
| PS2_KEYBOARD_PNP_IDS ";" | PS2_MOUSE_PNP_IDS | ||
| ) |
|
static |
|
static |
|
static |
|
static |