Commit Graph

28 Commits

Author SHA1 Message Date
Kevin O'Connor ca34ce5aaa Move most of the VAR16FIXED() defs to misc.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-04 11:06:58 -04:00
Kevin O'Connor cf85418f78 debug: Add runtime option to not report the debug serial port to the OS.
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>
2014-01-22 17:30:30 -05:00
Kevin O'Connor 4ade523a9d Remove ioport.h; disperse its contents to other header files.
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>
2013-09-28 22:10:31 -04:00
Kevin O'Connor 2d2fa31b37 Move function definitions for output.c from util.h to new file output.h.
Also, sort the order of include files in the c files.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18 20:48:34 -04:00
Kevin O'Connor 3df600bbdf Move stacks.c definitions from util.h to new file stacks.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18 20:48:34 -04:00
Kevin O'Connor 95ee382b65 Rename check_timer() function (and similar) to irqtimer_check().
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>
2013-07-21 14:09:29 -04:00
Kevin O'Connor e51316d0cc Minor - remove CLEARBITS_BDA and SETBITS_BDA macros.
Remove these infrequently used macros and replace with explicit
GET_BDA/SET_BDA calls.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-06-10 09:09:22 -04:00
Kevin O'Connor b5cc2ca5d0 Generalize timer based delay code.
Move the timer based counting code in serial.c to clock.c.

Rework the interface to make it similar to the tsc based timers.
2010-05-23 11:38:53 -04:00
Kevin O'Connor 1ca05b0f39 Be sure to add "void" to all function prototypes that take no args.
Omitting "void" leads to a K&R style declaration which was not intended.
2010-01-03 17:43:37 -05:00
Kevin O'Connor dfefeb5438 Distinguish between debug reports for unimplemented vs invalid calls.
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.
2009-12-13 13:04:17 -05:00
Kevin O'Connor 10ad799ff4 Replace irq_enable() regions with explicit calls to check for irqs.
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.
2009-10-24 11:06:08 -04:00
Kevin O'Connor 0c5893d761 Cleanup serial and lpt timers.
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.
2009-07-13 20:29:07 -04:00
Kevin O'Connor c151b3bf75 Improve serial port detection.
Add port names for serial port registers.
When detecting serial port, ignore top two bits of IIR register.
2009-05-12 22:59:41 -04:00
Kevin O'Connor 4edb275979 Minor - report found serial and lpt ports. 2009-05-06 23:25:40 -04:00
Kevin O'Connor 308537650f Move variables from assembler to C code.
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.
2009-01-17 18:49:20 -05:00
Kevin O'Connor 9e91c7bf42 Misc fixes.
The pnp bios string can't be const and VAR16_32.
Show ps2 port status when discarding data.
2009-01-17 02:30:21 -05:00
Kevin O'Connor b1b7c2a1c3 Change license from GPLv3 to LGPLv3.
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).
2009-01-15 20:52:58 -05:00
Kevin O'Connor 409670204b Add additional config options to remove parts of code.
Added options CONFIG_BOOT, CONFIG_SERIAL, CONFIG_LPT, CONFIG_KEYBOARD,
    CONFIG_BOOTMENU.
Also extended coverage of existing options to ensure full code got
    removed.
2008-07-21 22:23:05 -04:00
Kevin O'Connor 9521e26a16 Extract 'struct bregs' out of biosvar.h; clean up header includes. 2008-07-04 13:04:29 -04:00
Kevin O'Connor 15c1f2207f Support config driven debugging of each irq handler.
This allows one to easily enable verbose output from handlers.
2008-06-12 22:59:43 -04:00
Kevin O'Connor 35192dda4c Move debugging messages to appropriate functions.
Move dprintf calls from post() to the function calls that perform the work.
2008-06-08 19:18:33 -04:00
Kevin O'Connor 5c73240407 Serial debugging code must not access BDA.
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.
2008-06-07 10:43:07 -04:00
Kevin O'Connor 1812e20b4b Add support for sending debug messages to a serial port.
Enable by turning on CONFIG_DEBUG_SERIAL option.
2008-05-07 21:29:50 -04:00
Kevin O'Connor 913cc2e089 Move serial/lpt setup from post.c to serial.c 2008-04-13 17:31:45 -04:00
Kevin O'Connor 6c78122091 Replace debug_exit calls with debug info while setting a failure.
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.
2008-03-09 12:19:23 -04:00
Kevin O'Connor 19786767cf Rename VISIBLE macro for better control.
VISIBLE16 is used to mark functions externally available in 16bit code.
VISIBLE32 is for 32bit functions.
2008-03-05 21:09:59 -05:00
Kevin O'Connor 38fcbfeebc Version 0.1.2 2008-02-25 22:30:47 -05:00
Kevin O'Connor f076a3eeb9 Initial checkin. 2008-02-25 22:25:15 -05:00