aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-02-16 12:12:50 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-03-23 16:34:41 +0000
commit51529126e71d1a2b451c6e809567e1ebd3788aa6 (patch)
tree319e50d828ff053e7e769787516544573149474b
parent43499c9dc347ee858e9e395eba0954ec52a410ef (diff)
downloadsyslinux-51529126e71d1a2b451c6e809567e1ebd3788aa6.tar.gz
syslinux-51529126e71d1a2b451c6e809567e1ebd3788aa6.tar.xz
syslinux-51529126e71d1a2b451c6e809567e1ebd3788aa6.zip
core: Delete the aux segment
We don't need to use a special aux segment because we can represent 'fontbuf' with OFFS() and SEG(). We're guaranteed to be able to break the 32-bit pointer up with these macros because we control where in the address space the core is loaded. (Not all 32-bit pointers can be represented with OFFS() and SEG(), only addresses in the range 0..0xFFFFF.) This fixes the breakage that was introduced in commit 14531c47bc95 ("core: Delete code that is duplicated in ldlinux"). This allows the default font to be displayed. Previously junk was being returned in the COMBOOT API call to query the userfont, leading the caller to believe that a user font was installed even when it wasn't. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--core/comboot.inc6
-rw-r--r--core/font.c20
-rw-r--r--core/include/core.h1
-rw-r--r--core/init.inc2
-rw-r--r--core/layout.inc15
-rw-r--r--core/syslinux.ld15
6 files changed, 16 insertions, 43 deletions
diff --git a/core/comboot.inc b/core/comboot.inc
index e0ad0681..38d65dd9 100644
--- a/core/comboot.inc
+++ b/core/comboot.inc
@@ -669,10 +669,12 @@ comapi_userfont:
and al,al
jz .done
mov al,[VGAFontSize]
- mov P_ES,aux_seg
- mov P_BX,aux.fontbuf
+ pm_call pm_userfont
+ mov P_ES,es
+ mov P_BX,bx
.done: ; CF=0 here
+ mov P_AL,al
ret
;
diff --git a/core/font.c b/core/font.c
index b14d3d2a..0eeb90fa 100644
--- a/core/font.c
+++ b/core/font.c
@@ -24,12 +24,8 @@
#include "bios.h"
#include "core.h"
-struct aux {
- char fontbuf[8192];
- char serial[serial_buf_size];
-};
-
-#define fontbuf offsetof(struct aux, fontbuf)
+char fontbuf[8192];
+char serial[serial_buf_size];
extern uint16_t VGAFontSize;
extern uint8_t UserFont;
@@ -91,7 +87,7 @@ void loadfont(char *filename)
/* Copy to font buffer */
VGAFontSize = height;
- di = (uint32_t *)MK_PTR(aux_seg, fontbuf);
+ di = (uint32_t *)fontbuf;
si = (uint32_t *)trackbuf;
for (i = 0; i < (height << 6); i++)
*di++ = *si++;
@@ -118,8 +114,8 @@ void use_font(void)
memset(&ireg, 0, sizeof(ireg));
- ireg.es = aux_seg;
- ireg.ebp.w[0] = fontbuf; /* ES:BP -> font */
+ ireg.es = SEG(fontbuf);
+ ireg.ebp.w[0] = OFFS(fontbuf); /* ES:BP -> font */
/* Are we using a user-specified font? */
if (UserFont & 0x1) {
@@ -193,3 +189,9 @@ void pm_adjust_screen(com32sys_t *regs)
{
adjust_screen();
}
+
+void pm_userfont(com32sys_t *regs)
+{
+ regs->es = SEG(fontbuf);
+ regs->ebx.w[0] = OFFS(fontbuf);
+}
diff --git a/core/include/core.h b/core/include/core.h
index 69c16d65..a247d49f 100644
--- a/core/include/core.h
+++ b/core/include/core.h
@@ -24,7 +24,6 @@ extern char ConfigFile[];
extern char syslinux_banner[];
extern char copyright_str[];
-extern char aux_seg[];
extern uint8_t KbdMap[256];
/* diskstart.inc isolinux.asm*/
diff --git a/core/init.inc b/core/init.inc
index 286b3803..e0ffd23e 100644
--- a/core/init.inc
+++ b/core/init.inc
@@ -63,7 +63,7 @@ pm_decompress:
mov edi,__bss16_start
mov ecx,__bss16_dwords
rep stosd
- mov edi,__high_clear_start ; .uibss, .auxseg, .lowmem
+ mov edi,__high_clear_start ; .uibss, .lowmem
mov ecx,__high_clear_dwords
rep stosd
diff --git a/core/layout.inc b/core/layout.inc
index dab27dde..c58c0fd7 100644
--- a/core/layout.inc
+++ b/core/layout.inc
@@ -128,21 +128,6 @@ RBFG_brainfuck: resb 2048 ; Bigger than an Ethernet packet...
serial_buf_size equ 4096 ; Should be a power of 2
;
-; Contents of aux_seg
-;
- extern aux_seg ; Actual segment assigned by linker
-
- struc aux
-.fontbuf resb 8192
-.serial resb serial_buf_size
-
- alignb 4096 ; Align the next segment to 4K
- endstruc
-
- section .auxseg write nobits align=16
-auxseg resb aux_size
-
-;
; Transfer buffer segment: guaranteed to be aligned 64K, used for disk I/O
; One symbol for the segment number, one for the absolute address
;
diff --git a/core/syslinux.ld b/core/syslinux.ld
index 43fc1531..81d6b119 100644
--- a/core/syslinux.ld
+++ b/core/syslinux.ld
@@ -212,21 +212,6 @@ SECTIONS
xfer_buf_seg = core_xfer_buf >> 4;
/*
- * The auxilliary data segment is used by the 16-bit code
- * for items that don't need to live in the bottom 64K.
- */
-
- . = ALIGN(16);
- .auxseg (NOLOAD) : {
- __auxseg_start = .;
- *(.auxseg)
- __auxseg_end = .;
- }
- __auxseg_len = ABSOLUTE(__auxseg_end) - ABSOLUTE(__auxseg_start);
- __auxseg_dwords = (__auxseg_len + 3) >> 2;
- aux_seg = __auxseg_start >> 4;
-
- /*
* Used to allocate lowmem buffers from 32-bit code
*/
.lowmem (NOLOAD) : {