diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-02-26 12:56:07 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-02-26 12:56:07 +0000 |
commit | 93178adb981ba0068826ab223f40a78c4098e7bb (patch) | |
tree | a5faab6e58ffc451820c6d701bbccfe02118fd70 | |
parent | 9cdf68a2190a050a0b60d4ad6f51ec88c1b1b296 (diff) | |
download | ipxe-93178adb981ba0068826ab223f40a78c4098e7bb.tar.gz |
[prefix] Call decompressor in flat real mode when DEBUG=libprefix is enabled
Allow the decompressor the option of generating debugging output via
the BIOS console by calling it in flat real mode (rather than 16-bit
protected mode) when libprefix.S is built with debugging enabled.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/arch/i386/prefix/libprefix.S | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/arch/i386/prefix/libprefix.S b/src/arch/i386/prefix/libprefix.S index 0be96798..5a2dff57 100644 --- a/src/arch/i386/prefix/libprefix.S +++ b/src/arch/i386/prefix/libprefix.S @@ -394,8 +394,10 @@ process_bytes: movw %ax, %fs movw %ax, %gs +#ifdef NDEBUG /* Call memcpy()-like function */ call *%bx +#endif /* Return to (flat) real mode */ movl %cr0, %eax @@ -409,6 +411,20 @@ process_bytes: popw %fs popw %gs +#ifndef NDEBUG + /* Call memcpy()-like function in flat real mode (to allow for + * debug output via INT 10). + */ + pushw %ds + pushw %es + xorw %ax, %ax + movw %ax, %ds + movw %ax, %es + call *%bx + popw %es + popw %ds +#endif + /* Restore GDT */ data32 lgdt -8(%bp) addw $( 8 /* saved GDT */ + ( PM_DS + 8 ) /* GDT on stack */ ), %sp |