DOS resets the serial ports reported by the BIOS. This can mess up
debugging and timing when the serial baud rate changes on the debug
port. The new "etc/advertise-serial-debug-port" option allows one to
suppress the debug serial port from the normal list of serial ports
the BIOS reports to DOS.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the inb(), insb(), etc. code from ioport.h to x86.h. Move the
PORT_* definitions to their appropriate hardware files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename functions to be more consistent and so they are not confused
with the normal timer functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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.
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.
Separate out the 18.2Hz timer check into its own code.
Cleanup serial return codes.
Use a real timers for lpt port.
Replace lpt "nop" call with udelay(5).
Move irq_enable() into calls that need it.
Define macro VAR16FIXED for declaring a variable at a fixed location.
Introduce new file src/misc.c, and move non int15 calls from system.c
to it.
Implement all fixed location variables in C code.
Move IDT/GDT defs to misc.c. Remove unused gdt entry 1.
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).
Added options CONFIG_BOOT, CONFIG_SERIAL, CONFIG_LPT, CONFIG_KEYBOARD,
CONFIG_BOOTMENU.
Also extended coverage of existing options to ensure full code got
removed.
Regular serial writing code uses the system timer to timeout failed
writes - however, serial debugging can't rely on access to the BDA
segment or the hardware timer.
Therefore, implement a simple debug only serial writing function and
separate it from the regular serial output code.
Also include change to dump_regs - don't call __dprintf if debugging
not on.
Calling debug_exit at the end of a call doesn't help much - several of
the registers are already clobbered at this point. It also increases
stack usage because it prevents call tail optimization in many places.