summaryrefslogtreecommitdiff
path: root/core/font.c
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 /core/font.c
parent43499c9dc347ee858e9e395eba0954ec52a410ef (diff)
downloadsyslinux-51529126e71d1a2b451c6e809567e1ebd3788aa6.tar.gz
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>
Diffstat (limited to 'core/font.c')
-rw-r--r--core/font.c20
1 files changed, 11 insertions, 9 deletions
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);
+}