aboutsummaryrefslogtreecommitdiffstats
path: root/src/output.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove drive->desc field.Kevin O'Connor2010-12-291-0/+26
| | | | | | | | | | | | | | The description field is only available during the POST phase - it is confusing to have it live in a structure available through all phases. The description was only used by the boot menu code - pass each drive description directly to the bootlist code. Add a helper (znprintf) to automatically malloc_tmp the required space. Also, fixup ramdisk handling - it was using an incorrect floppy priority.
* Fix bvprintf() to respect padding for hex printing.Kevin O'Connor2010-06-191-15/+23
| | | | | | | | Fix bvprintf to respect space padding when printing hex numbers and the caller specifies alignment without zero padding, eg. %2x as opposed to %02x Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
* Add a generic "internal error" warning function.Kevin O'Connor2010-02-281-0/+8
|
* Introduce standard warnings for allocation failures and timeouts.Kevin O'Connor2010-02-141-0/+15
| | | | | There is no need for custom warnings for many common failures. Introduce a common warning which is consistent and more visible.
* Be sure to add "void" to all function prototypes that take no args.Kevin O'Connor2010-01-031-2/+2
| | | | Omitting "void" leads to a K&R style declaration which was not intended.
* Add support for 32bit PCI BIOS entry.Kevin O'Connor2009-12-301-1/+3
| | | | | | | | | Create a new code blob (code32seg) with support for 32bit functions that need to utilize explicit segment accesses. This code blob uses global variables relative to %gs and with a dynamic code offset (determined by get_global_offset()). Add BIOS32 structure and code. Add code for 32bit PCI BIOS code.
* Introduce MODESEGMENT define; rename VISIBLE32 to VISIBLE32FLAT.Kevin O'Connor2009-12-261-9/+9
| | | | | Prepare for support of segmented 32bit code. Add new MODESEGMENT definition, and clarify existing 32bit mode defs.
* Distinguish between debug reports for unimplemented vs invalid calls.Kevin O'Connor2009-12-131-13/+49
| | | | | | | | 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.
* Update snprintf to return the number of bytes used.Kevin O'Connor2009-11-241-3/+7
|
* Improve debugging output from threads.Kevin O'Connor2009-10-241-1/+13
| | | | | Show the "thread id" on each debug message sent from a thread. Also, cleanup translation dprintf() so it looks nicer withe thread output.
* Cleanup 'debuginfo' variable in output; add comment.Kevin O'Connor2009-10-121-2/+5
|
* Really fix linker issue with "debuginfo" variable.Kevin O'Connor2009-10-081-1/+5
| | | | | | The 16bit and 32bit code can't share debuginfo because it points to code and must point to 16bit code in 16bit mode. Introduce two separate variables - one for 32bit mode and one for 16bit mode.
* Add VAR16VISIBLE to debuginfo - older gcc doesn't optimize out.Kevin O'Connor2009-10-081-1/+1
|
* Add snprintf support.Kevin O'Connor2009-10-071-37/+120
| | | | | | Extend bvprintf() code to support building a string. Don't flush the serial port from printf if CONFIG_SCREEN_AND_DEBUG not set.
* Silence gcc asm deprectation warning in output.c.Kevin O'Connor2009-10-071-2/+3
| | | | gcc prefers asm parameters not be casts.
* Initial support for USB, UHCI, and USB Keyboards.Kevin O'Connor2009-09-281-2/+2
| | | | | | | 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.
* Interrupts should be enabled when calling 16bit code.Kevin O'Connor2009-09-241-0/+1
| | | | | Set most code paths to have interrupts on when calling 16bit code. This fixes at least one optionrom that needed irqs on.
* Replace common segment/offset pairs with struct segoff_s.Kevin O'Connor2009-09-091-1/+1
| | | | Introduce 'struct segoff_s' to more places.
* Add option CONFIG_SCREEN_AND_DEBUG to control printf and debugging.Kevin O'Connor2009-08-021-2/+2
| | | | | New option controls whether or not printf content is also written to the debug ports.
* In register dump, show %esp - not address of regs.Kevin O'Connor2009-05-271-2/+2
| | | | | The address of the callers stack can be inferred from the address of 'regs' - do the math in the dump function.
* Support %ebp register in 'struct bregs'.Kevin O'Connor2009-05-161-4/+5
| | | | | | Save/restore %ebp on irq entry. Support saving and restoring %ebp on call16. Enable display of %ebp in register dumps.
* Flush debugging serial output after every line.Kevin O'Connor2009-05-151-6/+22
| | | | | Wait for the serial port to be ready after every debug function. This fixes an issue with serial port detection.
* Improve serial port detection.Kevin O'Connor2009-05-121-7/+7
| | | | | Add port names for serial port registers. When detecting serial port, ignore top two bits of IIR register.
* Add support for field width argument to %x (eg, %08x).Kevin O'Connor2009-05-051-15/+38
| | | | Patch from Stefan Reinauer; modified by Kevin O'Connor.
* Add hexdump() output helper function.Kevin O'Connor2009-02-171-0/+20
|
* Minor - rename BX_PANIC to panic.Kevin O'Connor2009-02-081-1/+1
|
* Change license from GPLv3 to LGPLv3.Kevin O'Connor2009-01-151-1/+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).
* Improve set_code_fail/floppy_ret/disk_ret code generation.Kevin O'Connor2009-01-021-4/+13
| | | | | | | Encode lineno and return code into one u32 parameter. This reduces the number of functions arguments to 3 - which gcc does a better job of scheduling. Also, consistently place *regs parameter in the first arg.
* Implement GET/SET_GLOBAL(...) instead of using GET/SET_VAR(CS, ...)Kevin O'Connor2008-12-131-5/+6
|
* Fix bug in dprintf - isdigit had sign overflow problem.Kevin O'Connor2008-08-291-1/+1
|
* Shrink size of bx_panic when CONFIG_DEBUG_LEVEL is off.Kevin O'Connor2008-07-211-4/+6
| | | | | When CONFIG_DEBUG_LEVEL the debug message wont be shown, so don't bother calling bvprintf.
* Misc fixes and updates.Kevin O'Connor2008-07-191-7/+12
| | | | | | | | Minor code cleanups. Fix parenthesis imbalance in keyboard led test. The printf() call is only used in 32bit mode - make this explicit to the compiler - it improves the code generation. Clear the screen after initializing the vga option rom.
* Improve debugging output.Kevin O'Connor2008-07-071-10/+21
| | | | | | | Return the line number of the debug_fail() / debug_stub() call site on each call. Show the return status on set_code_fail() calls. Also, the floppy_1305() code should not clear AL.
* Extract 'struct bregs' out of biosvar.h; clean up header includes.Kevin O'Connor2008-07-041-1/+2
|
* Convert '\n' to '\r\n' on debug serial output.Kevin O'Connor2008-06-211-1/+4
|
* Init serial port before using it for debug - also reinit after option rom.Kevin O'Connor2008-06-211-0/+19
| | | | | | Apparently, some VGA option roms will enable serial irqs - this could cause problems with spurious irqs from debug messages. Also, improve debugging of option roms that fail the checksum check.
* Serial debugging code must not access BDA.Kevin O'Connor2008-06-071-3/+17
| | | | | | | | | | 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.
* Improve control of debug messages.Kevin O'Connor2008-05-241-10/+12
| | | | | | Rename BX_INFO() to dprintf() and add a "severity level" parameter. Add CONFIG_DEBUG_LEVEL compile option to control debug verbosity. Add more debug info to init steps of post.c.
* Add support for sending debug messages to a serial port.Kevin O'Connor2008-05-071-1/+8
| | | | Enable by turning on CONFIG_DEBUG_SERIAL option.
* Minor cleanups.Kevin O'Connor2008-05-061-4/+1
| | | | | Several minor comment improvements. Rearrange some definitions to make them more clear.
* Forward port new boot menu features from bochs bios.Kevin O'Connor2008-04-051-0/+8
| | | | | | | Support boot menu during last stage of post. Improve description of option roms. Support printf of "%.s" to force printing strings on stack. Enhance memcpy so that it also works in real-mode.
* Make several functions non-inline.Kevin O'Connor2008-04-051-8/+37
|
* Minor cleanup of GET_VAR usage in output.c.Kevin O'Connor2008-03-301-4/+4
| | | | Don't cast to a u8 - instead, cast the pointer to a u8*.
* Minor debugging improvements.Kevin O'Connor2008-03-291-3/+3
| | | | | | Support '%p' format in bprintf. Display pointer of register in debug output (useful for calculating start stack).
* Minor cleanups.Kevin O'Connor2008-03-151-1/+1
| | | | | Remove some redundant code from Makefile. Improve a couple of comments.
* Don't pass in ebp/esp to irq handlers.Kevin O'Connor2008-03-111-2/+2
| | | | | The C code won't clobber these registers, so backing them up isn't needed. Removing them saves a few bytes on the stack.
* Reduce stack usage for ISRs; minor fixes.Kevin O'Connor2008-03-111-1/+1
| | | | | | | | | | | | Don't back up all registers on isr handlers - they don't read/modify them. This saves stack space. extended_bios_data_area_s must be packed to match ebda spec. Enable irqs on int 08 - follows old bochs bios code. Fix bug in int 76 -- should clear disk_interrupt_flag not floppy_harddisk_info. Make sure we alert in disk_ret on failure case. int 18/19 entry points need to setup cld/%ds too. asm in handle_1587 clobbers flags - note that in clobber list.
* Replace debug_exit calls with debug info while setting a failure.Kevin O'Connor2008-03-091-4/+2
| | | | | | 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.
* Minor hack - allow formats with 'l' to be shown in printf.Kevin O'Connor2008-03-081-0/+5
|
* Ignore precision specifiers in printf code.Kevin O'Connor2008-03-041-1/+12
| | | | This at least allows the variable to be printed.