Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
serial console wants queue key events and needs to map ascii chars to
the keycode, so make enqueue_key public and also exports a helper
function so sercon can use the scan_to_keycode mapping table.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Move checking for extended scancodes and key release to the top of
__process_key().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Generate the appropriate interrupt events for the given keys.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
AT keyboards can produce "fake" shift keys on some extended events.
It's not necessary to process these artificial events as the actual
extended keys are detected directly.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Merge the two consecutive u8 fields into a single u16 field.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't warn if a key without a mapping is pressed - it's known that
some keys aren't mapped to keycodes. Suppress these keys instead of
sending 0x0000 to the keyboard buffer - as 0x0000 can confuse some
programs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
On a 101-key keyboard the keypad enter and keypad '/' keys have unique
BIOS keycodes that are distinct from the main keyboard enter and '/'
keys.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The current keyboard code only supports the keycode mappings for
83-key keyboards (plus handling for alt-esc and f11/f12). Add a more
complete mapping of keycodes for 101-key keyboards. This adds more
alt key and ctrl key mappings.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Simplify the scan_to_keycode[] table by implementing numlock and
capslock checking in the code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The scancode/asciicode pair can be more easily handled as a single
16bit value.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
It's not valid to pass a pointer to a stack variable through the
stack_hop() call (because the call changes the stack segment). This
bug was probably not noticed before because by default
(CONFIG_ENTRY_EXTRASTACK) SeaBIOS uses the extra stack on all 16bit
entry points, and the internal stack_hop() with that config option is
effectively a no-op.
This reverts commit d488a7683d90bf8fae7ceb8c3ad9e95fbbd92079.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, sort the order of include files in the c files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move many C files from the src/ directory to the new src/hw/ directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The POST phase has to invoke many initialization functions, and these
functions can have complex inter-dependencies. Try to categorize the
functions into 4 classes:
preinit - functions called very early in POST where function ordering
is very important and the code has limited access to other
interfaces.
init - functions that initialize internal interfaces and standard
external interfaces. This code is generally not dependent on
particular hardware and typically does not communicate directly
with any hardware devices.
setup - functions which access hardware or are dependent on particular
hardware or platform devices.
prepboot - functions that finalize internal interfaces and that
prepare for the boot phase.
This patch attempts to normalize the suffixes - functions that used
_init(), _setup(), _finalize(), or similar that did not follow the
above pattern were renamed. Other than function name changes, there
should be no code impact to this patch.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Some versions of gcc have been found to inline these funcions and then
cause the calling functions to use very large stack usage. Since
these functions are called from 16bit mode, their stack space usage is
very sensitive.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Now that the extra stack is used for keyboard and mouse driver code,
there is no reason to set noinline (which was done to try and conserve
stack space).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Jump into the extra stack for all hardware irq handlers. This reduces
the overall stack requirements of SeaBIOS.
Replace all users of call16_simpint with call16_int. Only the
hardware irq handlers used the old call, and they need to use the new
call to ensure the extra stack is properly re-entrant.
Also, pass in a 'struct bregs' to the hardware irq handlers now. It
was not done previously to save stack space. Now that the extra stack
is used, that is no longer an issue.
Note that should an old OS invoke a hardware irq in 16bit protected
mode, then this patch could break that OS. However, the chances of
this causing a regression seem small as several existing hardware irq
handlers already do not work in 16bit protected mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Route keyboard commands to a USB handler when USB keyboard is active.
Add a GETID handler for USB keyboards.
|
|
Some old programs will spin on a clock/keyboard call with irqs
disabled. They assume the BIOS will enable irqs and allow key events
and clock events to occur.
So, enable irqs in those functions that a caller might "spin" on.
|
|
This reverts commit 6f702dd6987b22e9bce472fe61910392af17416a.
That patch introduced a regression by enabling mouse interrupts by
default. It also appears that disabling interrupts by software alone
will not work well with some old DOS programs that hook the keyboard
irq.
|
|
Disable the ps2 port irqs in software instead of hardware. This
prevents a race where an irq could get queued and later called when
not desired.
|
|
Omitting "void" leads to a K&R style declaration which was not intended.
|
|
Don't use "fail" in the debug output - as this confuses users.
When reporting on an invalid parameter - use the word "invalid".
When reporting on an unimplemented call - state it is unimplemented.
Add separate debug levels for unimplemented vs invalid calls.
Also, increase the debug level of several entry points.
|
|
|
|
Enable system for running hardware initialization in parallel.
The yield() call can now round-robin between "threads".
Rework ata controller init to use a thread per controller.
Make sure internal drives are registered in a defined order.
Run keyboard initialization in a thread.
Rework usb init to use a thread per controller.
|
|
Add new function yield() which will permit irqs to trigger.
The yield() call enables irqs to occur in 32bit mode.
Add [num]sleep calls that yield instead of just spinning.
Rename existing int 1586 usleep call to biosusleep.
Convert many calls to mdelay to msleep.
|
|
This adds preliminary support for USB controllers and keyboards.
Add support for UHCI controllers.
Add support for "HID" USB keyboards.
Also, fix bug in hexdump() - len need not be power of 4.
|
|
Add wait_irq() - it's more efficient than looping with cpu_relax().
Also, move kbd irq enables down - only kbd_command needs it.
Also, make some minor code layout improvements to kbd.c.
|
|
|
|
Also, move setting of bit flags to the end of process_key().
|
|
|
|
Use custom timeouts when issuing a reset.
Handle 1-byte returns from reset in ps2 code.
Do full keyboard reset even in coreboot mode.
Send set scan mode command during reset.
|
|
Change license of contributions from Kevin O'Connor from GPLv3 to
LGPLv3 (or later). Since the work as a whole is based on Kevin's
contributions and the "bochs bios" which has a license of LGPL (v2 or
later), this effectively makes the work as a whole available under
LGPLv3 (or later).
|
|
Discard reads from real-time events or from a different device.
Also, improve the kbd/mouse diagnostic messages.
|
|
The interrupt vector table is technically at 0x0000.
|
|
Avoid using call16_int() -- it consumes too much stack space.
Instead, use a new function (call16_simpint). This assumes that
the handler wont corrupt regs - which should be a safe assumption,
because if they did corrupt regs they wouldn't work on any bios.
Avoid enabling irqs in the hw irq handlers - there are no loops in the
handlers that could cause any notable latency.
|
|
Rename VAR16 to VAR16_32 -- that macro supports accesses from both
16bit and 32bit mode.
Introduce a new macro VAR16 that must be present on all global
variables accessed from 16bit mode.
|
|
Clearing of Z_FL occurs on the !incr path.
|
|
All 4 callers of dequeue_key are very similar - move the redundant
logic into dequeue_key() itself.
|
|
|
|
Detect a non-standard CMOS shutdown code during post and run a
separate resume handler.
Set aside space in the EBDA for the resume handler stack.
Add support for several of the code supported in bochs bios.
|
|
|