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>
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
;
#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;
/* 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++;
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) {
{
adjust_screen();
}
+
+void pm_userfont(com32sys_t *regs)
+{
+ regs->es = SEG(fontbuf);
+ regs->ebx.w[0] = OFFS(fontbuf);
+}
extern char syslinux_banner[];
extern char copyright_str[];
-extern char aux_seg[];
extern uint8_t KbdMap[256];
/* diskstart.inc isolinux.asm*/
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
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
;
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) : {