summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2014-03-03 10:18:09 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2014-03-03 10:18:09 -0800
commit908c3fa1c3ea57e2bba148a590ebb788b453af09 (patch)
treec1980e79f4c3d63524fcb282bd6ad4df89121de9
parenta562f1c87424a58daea16dc0bd8801211817c116 (diff)
parent4c8fbb20ad6f612a9fe8022c3a14b402a07b8f33 (diff)
downloadsyslinux-908c3fa1c3ea57e2bba148a590ebb788b453af09.tar.gz
Merge branch 'nocomapi'syslinux-6.03-pre7
-rw-r--r--com32/include/syslinux/boot.h3
-rw-r--r--com32/lib/syslinux/biosboot.c39
-rw-r--r--com32/lib/syslinux/shuffle.c11
-rw-r--r--core/adv.inc9
-rw-r--r--core/bcopyxx.inc8
-rw-r--r--core/bios.c39
-rw-r--r--core/cleanup.c22
-rw-r--r--core/com32.inc8
-rw-r--r--core/comboot.inc447
-rw-r--r--core/diskboot.inc1
-rw-r--r--core/diskfs.inc14
-rw-r--r--core/extern.inc3
-rw-r--r--core/include/bios.h1
-rw-r--r--core/include/core.h4
-rw-r--r--core/init.inc6
-rw-r--r--core/isolinux.asm18
-rw-r--r--core/pxelinux.asm19
-rw-r--r--efi/main.c4
-rw-r--r--mk/lib.mk2
19 files changed, 117 insertions, 541 deletions
diff --git a/com32/include/syslinux/boot.h b/com32/include/syslinux/boot.h
index 74a311df..6079e7c1 100644
--- a/com32/include/syslinux/boot.h
+++ b/com32/include/syslinux/boot.h
@@ -48,6 +48,9 @@ void syslinux_chain_bootstrap(uint16_t flags, const void *bootstrap,
uint32_t bootstrap_len, uint32_t edx,
uint32_t esi, uint16_t ds);
+void bios_do_shuffle_and_boot(uint16_t bootflags, uint32_t descaddr,
+ const void *descbuf, uint32_t dsize);
+
struct image_types {
const char *name;
uint32_t type;
diff --git a/com32/lib/syslinux/biosboot.c b/com32/lib/syslinux/biosboot.c
new file mode 100644
index 00000000..9bdf84fb
--- /dev/null
+++ b/com32/lib/syslinux/biosboot.c
@@ -0,0 +1,39 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2014 Intel Corporation; author: H. Peter Anvin
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include <syslinux/boot.h>
+#include <syslinux/movebits.h>
+
+void bios_do_shuffle_and_boot(uint16_t bootflags, uint32_t descaddr,
+ const void *descbuf, uint32_t dsize)
+{
+ extern void do_raw_shuffle_and_boot(addr_t, const void *, addr_t);
+
+ syslinux_final_cleanup(bootflags);
+ do_raw_shuffle_and_boot(descaddr, descbuf, dsize);
+ /* Should not return */
+}
diff --git a/com32/lib/syslinux/shuffle.c b/com32/lib/syslinux/shuffle.c
index dcc4afa4..4f9c22b7 100644
--- a/com32/lib/syslinux/shuffle.c
+++ b/com32/lib/syslinux/shuffle.c
@@ -43,6 +43,7 @@
#include <dprintf.h>
#include <syslinux/movebits.h>
#include <klibc/compiler.h>
+#include <syslinux/boot.h>
struct shuffle_descriptor {
uint32_t dst, src, len;
@@ -68,7 +69,6 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist,
int need_ptrs;
addr_t desczone, descfree, descaddr;
int nmoves, nzero;
- com32sys_t ireg;
#ifndef __FIRMWARE_BIOS__
errno = ENOSYS;
@@ -219,13 +219,8 @@ bail:
return rv;
/* Actually do it... */
- memset(&ireg, 0, sizeof ireg);
- ireg.edi.l = descaddr;
- ireg.esi.l = (addr_t) dbuf;
- ireg.ecx.l = (addr_t) dp - (addr_t) dbuf;
- ireg.edx.w[0] = bootflags;
- ireg.eax.w[0] = 0x0024;
- __intcall(0x22, &ireg, NULL);
+ bios_do_shuffle_and_boot(bootflags, descaddr, dbuf,
+ (size_t)dp - (size_t)dbuf);
return -1; /* Shouldn't have returned! */
}
diff --git a/core/adv.inc b/core/adv.inc
index 0b45a6c7..288bf03c 100644
--- a/core/adv.inc
+++ b/core/adv.inc
@@ -43,6 +43,13 @@ ADV_LEN equ 500 ; Data bytes
adv_retries equ 6 ; Disk retries
+ section .data
+ global __syslinux_adv_ptr, __syslinux_adv_size
+__syslinux_adv_ptr:
+ dd adv0.data
+__syslinux_adv_size:
+ dd ADV_LEN
+
section .adv
; Introduce the ADVs to valid but blank
adv0:
@@ -63,6 +70,7 @@ adv1:
; This is called after config file parsing, so we know
; the intended location of the ADV
;
+ global adv_init
adv_init:
cmp byte [ADVDrive],-1
jne adv_read
@@ -293,6 +301,7 @@ adv_cleanup:
;
; Returns CF=1 if the ADV cannot be written.
;
+ global adv_write
adv_write:
push eax
mov eax,[ADVSec0]
diff --git a/core/bcopyxx.inc b/core/bcopyxx.inc
index 2bdc053d..3658f097 100644
--- a/core/bcopyxx.inc
+++ b/core/bcopyxx.inc
@@ -207,6 +207,14 @@ pm_bcopy:
;
; (*) dst, src, and len are four bytes each
;
+; do_raw_shuffle_and_boot is the same entry point, but with a C ABI:
+; do_raw_shuffle_and_boot(safearea, descriptors, bytecount)
+;
+ global do_raw_shuffle_and_boot
+do_raw_shuffle_and_boot:
+ mov edi,eax
+ mov esi,edx
+
pm_shuffle:
cli ; End interrupt service (for good)
mov ebx,edi ; EBX <- descriptor list
diff --git a/core/bios.c b/core/bios.c
index 6de4f2d6..328c729a 100644
--- a/core/bios.c
+++ b/core/bios.c
@@ -12,6 +12,7 @@
#include <sys/vesa/video.h>
#include <sys/vesa/debug.h>
#include <minmax.h>
+#include "core.h"
__export struct firmware *firmware = NULL;
@@ -165,22 +166,12 @@ static void bios_get_serial_console_info(uint16_t *iobase, uint16_t *divisor,
*flowctl |= (0x80 << 8);
}
-void *__syslinux_adv_ptr;
-size_t __syslinux_adv_size;
-
void bios_adv_init(void)
{
static com32sys_t reg;
memset(&reg, 0, sizeof(reg));
- reg.eax.w[0] = 0x0025;
- __intcall(0x22, &reg, &reg);
-
- memset(&reg, 0, sizeof(reg));
- reg.eax.w[0] = 0x001c;
- __intcall(0x22, &reg, &reg);
- __syslinux_adv_ptr = MK_PTR(reg.es, reg.ebx.w[0]);
- __syslinux_adv_size = reg.ecx.w[0];
+ call16(adv_init, &reg, NULL);
}
int bios_adv_write(void)
@@ -188,8 +179,7 @@ int bios_adv_write(void)
static com32sys_t reg;
memset(&reg, 0, sizeof(reg));
- reg.eax.w[0] = 0x001d;
- __intcall(0x22, &reg, &reg);
+ call16(adv_write, &reg, &reg);
return (reg.eflags.l & EFLAGS_CF) ? -1 : 0;
}
@@ -675,6 +665,29 @@ void bios_init(void)
dmi_init();
}
+extern void bios_timer_cleanup(void);
+
+extern uint32_t OrigFDCTabPtr;
+
+static void bios_cleanup_hardware(void)
+{
+ /* Restore the original pointer to the floppy descriptor table */
+ if (OrigFDCTabPtr)
+ *((uint32_t *)(4 * 0x1e)) = OrigFDCTabPtr;
+
+ /*
+ * Linux wants the floppy motor shut off before starting the
+ * kernel, at least bootsect.S seems to imply so. If we don't
+ * load the floppy driver, this is *definitely* so!
+ */
+ __intcall(0x13, &zero_regs, NULL);
+
+ call16(bios_timer_cleanup, &zero_regs, NULL);
+
+ /* If we enabled serial port interrupts, clean them up now */
+ sirq_cleanup();
+}
+
extern void *bios_malloc(size_t, enum heap, size_t);
extern void *bios_realloc(void *, size_t);
extern void bios_free(void *);
diff --git a/core/cleanup.c b/core/cleanup.c
index de318d98..eceb8e94 100644
--- a/core/cleanup.c
+++ b/core/cleanup.c
@@ -15,38 +15,18 @@
#include <syslinux/memscan.h>
#include <syslinux/firmware.h>
-extern void comboot_cleanup_api(void);
-extern void bios_timer_cleanup(void);
-
/*
* cleanup.c
*
* Some final tidying before jumping to a kernel or bootsector
*/
-void bios_cleanup_hardware(void)
-{
- /*
- * TODO
- *
- * Linux wants the floppy motor shut off before starting the
- * kernel, at least bootsect.S seems to imply so. If we don't
- * load the floppy driver, this is *definitely* so!
- */
- __intcall(0x13, &zero_regs, NULL);
-
- call16(comboot_cleanup_api, &zero_regs, NULL);
- call16(bios_timer_cleanup, &zero_regs, NULL);
-
- /* If we enabled serial port interrupts, clean them up now */
- sirq_cleanup();
-}
-
/*
* cleanup_hardware:
*
* Shut down anything transient.
*/
+
__export void cleanup_hardware(void)
{
firmware->cleanup();
diff --git a/core/com32.inc b/core/com32.inc
index 9c565f1d..5561c720 100644
--- a/core/com32.inc
+++ b/core/com32.inc
@@ -29,8 +29,6 @@
; "mov ax,0x4cff; int 0x21" in 16-bit mode. This will abort the
; program with an error if run in 16-bit mode.
;
-com32_entry equ free_high_memory
-
bits 16
section .data16
@@ -59,4 +57,10 @@ HighMemSize dd 0 ; End of memory pointer (bytes)
section .uibss
Com32Name resb FILENAME_MAX
+ section .bss16
+%ifndef HAVE_CURRENTDIRNAME
+ global CurrentDirName:data hidden
+CurrentDirName resb FILENAME_MAX
+%endif
+
section .text16
diff --git a/core/comboot.inc b/core/comboot.inc
deleted file mode 100644
index 63394350..00000000
--- a/core/comboot.inc
+++ /dev/null
@@ -1,447 +0,0 @@
-;; -----------------------------------------------------------------------
-;;
-;; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
-;; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
-;;
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
-;; Boston MA 02111-1307, USA; either version 2 of the License, or
-;; (at your option) any later version; incorporated herein by reference.
-;;
-;; -----------------------------------------------------------------------
-
-;;
-;; comboot.inc
-;;
-;; Common code for running a COMBOOT image
-;;
- section .text16
-
-; Parameter registers definition; this is the definition
-; of the stack frame used by INT 21h and INT 22h.
-%define P_FLAGS word [bp+44]
-%define P_FLAGSL byte [bp+44]
-%define P_FLAGSH byte [bp+45]
-%define P_CS word [bp+42]
-%define P_IP word [bp+40]
-%define P_CSIP dword [bp+40]
-%define P_DS word [bp+38]
-%define P_ES word [bp+36]
-%define P_FS word [bp+34]
-%define P_GS word [bp+32]
-%define P_EAX dword [bp+28]
-%define P_AX word [bp+28]
-%define P_HAX word [bp+30]
-%define P_AL byte [bp+28]
-%define P_AH byte [bp+29]
-%define P_ECX dword [bp+24]
-%define P_CX word [bp+24]
-%define P_HCX word [bp+26]
-%define P_CL byte [bp+24]
-%define P_CH byte [bp+25]
-%define P_EDX dword [bp+20]
-%define P_DX word [bp+20]
-%define P_HDX word [bp+22]
-%define P_DL byte [bp+20]
-%define P_DH byte [bp+21]
-%define P_EBX dword [bp+16]
-%define P_BX word [bp+16]
-%define P_HBX word [bp+18]
-%define P_BL byte [bp+16]
-%define P_BH byte [bp+17]
-%define P_EBP dword [bp+8]
-%define P_BP word [bp+8]
-%define P_HBP word [bp+10]
-%define P_ESI dword [bp+4]
-%define P_SI word [bp+4]
-%define P_HSI word [bp+6]
-%define P_EDI dword [bp]
-%define P_DI word [bp]
-%define P_HDI word [bp+2]
-
-;
-; Set up the COMBOOT API interrupt vectors. This is now done at
-; initialization time.
-;
-comboot_setup_api:
- mov di,DOSErrTramp ; Error trampolines
- mov cx,32
- push cx
- mov eax,02EB206Ah ; push 20h; jmp $+4
-.loop1: stosd
- inc ah
- loop .loop1
- dec di
- mov byte [di-1],0E9h
- mov ax,comboot_bogus-2
- sub ax,di
- stosw
-
- pop cx ; CX <- 32
- mov si,4*20h ; DOS interrupt vectors
- mov bx,comboot_vectors
- mov di,DOSSaveVectors
-.loop2:
- movsd
- movzx eax,word [bx]
- inc bx
- inc bx
- mov [si-4],eax
- loop .loop2
- ret
-
-;
-; Restore the original state of the COMBOOT API vectors, and free
-; any low memory allocated by the comboot module.
-;
- global comboot_cleanup_api:function hidden
-comboot_cleanup_api:
- pusha
- mov si,DOSSaveVectors
- mov di,4*20h
- mov cx,20h
- rep movsd ; Restore DOS-range vectors
- popa
- ret
-
- section .bss16
- alignb 4
-DOSSaveVectors resd 32
-
- section .data16
-%define comboot_err(x) (DOSErrTramp+4*((x)-20h))
-
-comboot_vectors:
- dw comboot_return ; INT 20 = exit
- dw comboot_err(21h) ; INT 21 = DOS-compatible system calls
- dw comboot_int22 ; INT 22 = native system calls
- dw comboot_err(23h) ; INT 23 = DOS Ctrl-C handler
- dw comboot_err(24h) ; INT 24 = DOS critical error handler
- dw comboot_err(25h) ; INT 25 = DOS absolute disk read
- dw comboot_err(26h) ; INT 26 = DOS absolute disk write
- dw comboot_err(27h) ; INT 27 = DOS TSR
- dw comboot_int28 ; INT 28 = DOS idle interrupt
- dw comboot_int29 ; INT 29 = DOS fast console output
- dw comboot_err(2Ah) ; INT 2A = DOS network API (NetBIOS)
- dw comboot_err(2Bh) ; INT 2B = DOS reserved
- dw comboot_err(2Ch) ; INT 2C = DOS reserved
- dw comboot_iret ; INT 2D = DOS reserved, AMIS
- dw comboot_err(2Eh) ; INT 2E = DOS run command
- dw comboot_iret ; INT 2F = DOS multiplex interrupt
- dw comboot_err(30h) ; INT 30 = DOS CP/M system calls
- dw comboot_err(31h) ; INT 31 = DPMI
- dw comboot_err(32h) ; INT 32 = DOS reserved
- dw comboot_iret ; INT 33 = DOS mouse API
- dw comboot_err(34h) ; INT 34 = DOS FPU emulation
- dw comboot_err(35h) ; INT 35 = DOS FPU emulation
- dw comboot_err(36h) ; INT 36 = DOS FPU emulation
- dw comboot_err(37h) ; INT 37 = DOS FPU emulation
- dw comboot_err(38h) ; INT 38 = DOS FPU emulation
- dw comboot_err(39h) ; INT 39 = DOS FPU emulation
- dw comboot_err(3Ah) ; INT 3A = DOS FPU emulation
- dw comboot_err(3Bh) ; INT 3B = DOS FPU emulation
- dw comboot_err(3Ch) ; INT 3C = DOS FPU emulation
- dw comboot_err(3Dh) ; INT 3D = DOS FPU emulation
- dw comboot_err(3Eh) ; INT 3E = DOS FPU emulation
- dw comboot_err(3Fh) ; INT 3F = DOS overlay manager
-
- section .text16
-
-comboot_resume:
- mov bp,sp ; In case the function clobbers BP
- setc P_FLAGSL ; Propagate CF->error
- popad
- pop gs
- pop fs
- pop es
- pop ds
-comboot_iret:
- iret
-
-comboot_bad_int21:
- mov ax,P_AX
- push P_CSIP
- push 21h
- ; Fall through
-
-; Attempted to execute invalid DOS system call
-; The interrupt number is on the stack.
-comboot_bogus: pop dx ; Interrupt number
- pop edi ; CS:IP
- mov cx,err_notdos
- push comboot_bogus_tail
- jmp comboot_exit_msg
-comboot_bogus_tail:
- xchg ax,dx
- pm_call pm_writehex2 ; Interrupt number
- mov al,' '
- pm_call pm_writechr
- xchg ax,dx
- pm_call pm_writehex4 ; Function number (AX)
- mov al,' '
- pm_call pm_writechr
- mov eax,edi
- pm_call pm_writehex8 ; CS:IP of the origin
- pm_call crlf
- jmp kaboom
-
-; Proper return vector
-; Note: this gets invoked directly via INT 20h.
-; We don't need to cld explicitly here, because comboot_exit does that
-; when invoking RESET_STACK_AND_SEGS.
-comboot_return:
- cli ; May not have a safe stack
- push enter_command ; Normal return to command prompt
- ; jmp comboot_exit
-
-;
-; Generic COMBOOT return to command line code
-; stack -> where to go next
-; CX -> message (for _msg version)
-;
- extern comboot_cleanup_lowmem
-comboot_exit:
- xor cx,cx
-comboot_exit_msg:
- pop bx ; Return address
- RESET_STACK_AND_SEGS si ; Contains sti, cld
- pm_call comboot_cleanup_lowmem
- pm_call pm_adjust_screen; The COMBOOT program might have change the screen
- jcxz .nomsg
- mov si,KernelName
- pm_call pm_writestr
- mov si,cx
- pm_call pm_writestr
-.nomsg:
- jmp bx
-
-;
-; INT 21h system calls
-;
-comboot_getkey: ; 01 = get key with echo
- pm_call vgashowcursor
- call comboot_getchar
- pm_call vgahidecursor
- pm_call pm_writechr
- clc
- ret
-
-comboot_writechr: ; 02 = writechr
- mov al,P_DL
- pm_call pm_writechr
- clc
- ret
-
-comboot_writeserial: ; 04 = write serial port
- mov al,P_DL
- pm_call pm_write_serial
- clc
- ret
-
-comboot_getkeynoecho: ; 08 = get key w/o echo
- call comboot_getchar
- clc
- ret
-
-comboot_writestr: ; 09 = write DOS string
- mov es,P_DS
- mov si,P_DX
-.loop: es lodsb
- cmp al,'$' ; End string with $ - bizarre
- je .done
- pm_call pm_writechr
- jmp short .loop
-.done: clc
- ret
-
-comboot_checkkey: ; 0B = check keyboard status
- cmp byte [APIKeyFlag],00h
- jnz .waiting
- pm_call pm_pollchar
-.waiting: setz al
- dec al ; AL = 0FFh if present, 0 if not
- mov P_AL,al
- clc
- ret
-
-comboot_checkver: ; 30 = check DOS version
- ; We return 0 in all DOS-compatible version registers,
- ; but the high part of eax-ebx-ecx-edx spell "SYSLINUX"
- mov P_EAX,'SY' << 16
- mov P_EBX,'SL' << 16
- mov P_ECX,'IN' << 16
- mov P_EDX,'UX' << 16
- ret
-
-comboot_getchar:
- cmp byte [APIKeyFlag],00h
- jne .queued
- pm_call pm_getchar ; If not queued get input
- and al,al ; Function key? (CF <- 0)
- jnz .done
- mov [APIKeyWait],ah ; High part of key
- inc byte [APIKeyFlag] ; Set flag
-.done: mov P_AL,al
- ret
-.queued: mov al,[APIKeyWait]
- dec byte [APIKeyFlag]
- jmp .done
-
-;
-; INT 28h - DOS idle
-;
-comboot_int28:
- sti
- cld
- extern __idle
- pm_call __idle
- iret
-
-;
-; INT 29h - DOS fast write character
-;
-comboot_int29:
- sti
- cld
- pm_call pm_writechr
- iret
-
-;
-; INT 22h - SYSLINUX-specific system calls
-; System call number in ax
-;
-comboot_int22:
- sti
- push ds
- push es
- push fs
- push gs
- pushad
- cld
- mov bp,cs
- mov ds,bp
- mov es,bp
- mov bp,sp ; Set up stack frame
-
- pm_call pm_adjust_screen ; The COMBOOT program might hav changed the screen
-
- cmp ax,int22_count
- jb .ok
- xor ax,ax ; Function 0 -> unimplemented
-.ok:
- xchg ax,bx
- add bx,bx ; CF <- 0
- call [bx+int22_table]
- jmp comboot_resume ; On return
-
-;
-; INT 22h AX=0000h Unimplemented call
-;
-comapi_err:
- stc
- ret
-
-;
-; INT 22h AX=001Ch Get pointer to auxillary data vector
-;
-comapi_getadv:
- mov P_ES,ds
- mov P_BX,adv0.data
- mov P_CX,ADV_LEN
- ret
-
-;
-; INT 22h AX=001Dh Write auxillary data vector
-;
-comapi_writeadv equ adv_write
-
-;
-; INT 22h AX=0024h Cleanup, shuffle and boot raw
-;
-comapi_shufraw:
-%if IS_PXELINUX
- ; Unload PXE if requested
- test dl,3
- setnz [KeepPXE]
- sub bp,sp ; unload_pxe may move the stack around
- pm_call unload_pxe
- add bp,sp ; restore frame pointer...
-%elif IS_SYSLINUX || IS_EXTLINUX
- ; Restore original FDC table
- mov eax,[OrigFDCTabPtr]
- mov [fdctab],eax
-%endif
- pm_call cleanup_hardware
- mov edi,P_EDI
- mov esi,P_ESI
- mov ecx,P_ECX
- jmp shuffle_and_boot_raw
-
-;
-; INT 22h AX=0025h Initialize the ADV structure
-;
-comapi_initadv:
- call adv_init
- ret
-
- section .data16
-
- alignz 2
-int22_table:
- dw comapi_err ; 0000 unimplemented syscall
- dw comapi_err ; 0001 get SYSLINUX version
- dw comapi_err ; 0002 write string
- dw comapi_err ; 0003 run specified command
- dw comapi_err ; 0004 run default command
- dw comapi_err ; 0005 force text mode
- dw comapi_err ; 0006 open file
- dw comapi_err ; 0007 read file
- dw comapi_err ; 0008 close file
- dw comapi_err ; 0009 call PXE stack
- dw comapi_err ; 000A derivative-specific info
- dw comapi_err ; 000B get serial port config
- dw comapi_err ; 000C perform final cleanup
- dw comapi_err ; 000D clean up then bootstrap
- dw comapi_err ; 000E get name of config file
- dw comapi_err ; 000F get ipappend strings
- dw comapi_err ; 0010 resolve hostname
- dw comapi_err ; 0011 maximum shuffle descriptors
- dw comapi_err ; 0012 cleanup, shuffle and boot
- dw comapi_err ; 0013 idle call
- dw comapi_err ; 0014 local boot
- dw comapi_err ; 0015 feature flags
- dw comapi_err ; 0016 run kernel image
- dw comapi_err ; 0017 report video mode change
- dw comapi_err ; 0018 query custom font
- dw comapi_err ; 0019 read disk
- dw comapi_err ; 001A cleanup, shuffle and boot to pm
- dw comapi_err ; 001B cleanup, shuffle and boot to rm
- dw comapi_getadv ; 001C get pointer to ADV
- dw comapi_writeadv ; 001D write ADV to disk
- dw comapi_err ; 001E keyboard remapping table
- dw comapi_err ; 001F get current working directory
- dw comapi_err ; 0020 open directory
- dw comapi_err ; 0021 read directory
- dw comapi_err ; 0022 close directory
- dw comapi_err ; 0023 query shuffler size
- dw comapi_shufraw ; 0024 cleanup, shuffle and boot raw
- dw comapi_initadv ; 0025 initialize adv structure
-int22_count equ ($-int22_table)/2
-
-APIKeyWait db 0
-APIKeyFlag db 0
-
-zero_string db 0 ; Empty, null-terminated string
-
-err_notdos db ': attempted DOS system call INT ',0
-err_comlarge db 'COMBOOT image too large.', CR, LF, 0
-
- section .bss16
- alignb 4
-DOSErrTramp resd 33 ; Error trampolines
-
-%ifndef HAVE_CURRENTDIRNAME
- global CurrentDirName:data hidden
-CurrentDirName resb FILENAME_MAX
-%endif
diff --git a/core/diskboot.inc b/core/diskboot.inc
index ce75b8c9..9dea6f9a 100644
--- a/core/diskboot.inc
+++ b/core/diskboot.inc
@@ -29,6 +29,7 @@
;
global StackBuf, PartInfo, Hidden, OrigESDI, DriveNumber
+ global OrigFDCTabPtr
StackBuf equ STACK_TOP-44-92 ; Start the stack here (grow down - 4K)
PartInfo equ StackBuf
.mbr equ PartInfo
diff --git a/core/diskfs.inc b/core/diskfs.inc
index d0f2804c..93016649 100644
--- a/core/diskfs.inc
+++ b/core/diskfs.inc
@@ -83,23 +83,13 @@ KernelName resb FILENAME_MAX ; Mangled name for kernel
section .text16
;
-; COMBOOT-loading code
+; COM32 vestigial data structure
;
-%include "comboot.inc"
%include "com32.inc"
;
-; Boot sector loading code
+; Common local boot code
;
-
-;
-; Abort loading code
-;
-
-;
-; Hardware cleanup common code
-;
-
%include "localboot.inc"
;
diff --git a/core/extern.inc b/core/extern.inc
index 673191cf..af8eb04c 100644
--- a/core/extern.inc
+++ b/core/extern.inc
@@ -44,6 +44,9 @@
; newconfig.c
extern pm_is_config_file
+ ; idle.c
+ extern __idle
+
%ifdef DEBUG
; debug.c
extern pm_debug_msg
diff --git a/core/include/bios.h b/core/include/bios.h
index 0a68f5d3..a9f4ef17 100644
--- a/core/include/bios.h
+++ b/core/include/bios.h
@@ -88,7 +88,6 @@ extern char *SerialHead;
extern char *SerialTail;
extern void bios_init(void);
-extern void bios_cleanup_hardware(void);
static inline uint16_t get_serial_port(uint16_t port)
{
diff --git a/core/include/core.h b/core/include/core.h
index f45c024d..6bcdda0f 100644
--- a/core/include/core.h
+++ b/core/include/core.h
@@ -67,6 +67,10 @@ extern void (*core_pm_hook)(void);
/* getc.inc */
extern void core_open(void);
+/* adv.inc */
+extern void adv_init(void);
+extern void adv_write(void);
+
/* hello.c */
extern void myputs(const char*);
diff --git a/core/init.inc b/core/init.inc
index b74cf30b..8ecbdbd8 100644
--- a/core/init.inc
+++ b/core/init.inc
@@ -39,12 +39,6 @@ common_init:
pm_call init
;
-; Set up the COMBOOT APIs
-;
- call comboot_setup_api
-
- section .text16
-;
; The code to decompress the PM code and initialize other segments.
;
extern _lzo1x_decompress_asm_fast_safe
diff --git a/core/isolinux.asm b/core/isolinux.asm
index f1512611..50d9fe1c 100644
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -1205,23 +1205,13 @@ KernelName resb FILENAME_MAX ; Mangled name for kernel
section .text16
;
-; COMBOOT-loading code
+; COM32 vestigial data structure
;
-%include "comboot.inc"
%include "com32.inc"
;
-; Boot sector loading code
+; Common local boot code
;
-
-;
-; Abort loading code
-;
-
-;
-; Hardware cleanup common code
-;
-
%include "localboot.inc"
; -----------------------------------------------------------------------------
@@ -1236,3 +1226,7 @@ KernelName resb FILENAME_MAX ; Mangled name for kernel
section .data16
err_disk_image db 'Cannot load disk image (invalid file)?', CR, LF, 0
+
+ section .bss16
+ global OrigFDCTabPtr
+OrigFDCTabPtr resd 1 ; Keep bios_cleanup_hardware() honest
diff --git a/core/pxelinux.asm b/core/pxelinux.asm
index f4c52c2b..953a906f 100644
--- a/core/pxelinux.asm
+++ b/core/pxelinux.asm
@@ -272,23 +272,10 @@ KernelName resb FILENAME_MAX ; Mangled name for kernel
section .text16
;
-; COMBOOT-loading code
+; COM32 vestigial data structure
;
-%include "comboot.inc"
%include "com32.inc"
-;
-; Boot sector loading code
-;
-
-;
-; Abort loading code
-;
-
-;
-; Hardware cleanup common code
-;
-
section .text16
global local_boot16:function hidden
local_boot16:
@@ -575,3 +562,7 @@ syslinux_banner db CR, LF, MY_NAME, ' ', VERSION_STR, ' ', MY_TYPE, ' '
section .data16
global KeepPXE
KeepPXE db 0 ; Should PXE be kept around?
+
+ section .bss16
+ global OrigFDCTabPtr
+OrigFDCTabPtr resd 1 ; Keep bios_cleanup_hardware() honest
diff --git a/efi/main.c b/efi/main.c
index 7c3b86b4..1cc2456a 100644
--- a/efi/main.c
+++ b/efi/main.c
@@ -117,10 +117,6 @@ void kaboom(void)
{
}
-void comboot_cleanup_api(void)
-{
-}
-
void printf_init(void)
{
}
diff --git a/mk/lib.mk b/mk/lib.mk
index a12a0595..ceb95bd0 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -151,7 +151,7 @@ LIBCONSOLE_OBJS = \
LIBLOAD_OBJS = \
syslinux/addlist.o syslinux/freelist.o syslinux/memmap.o \
syslinux/movebits.o syslinux/shuffle.o syslinux/shuffle_pm.o \
- syslinux/shuffle_rm.o syslinux/zonelist.o \
+ syslinux/shuffle_rm.o syslinux/biosboot.o syslinux/zonelist.o \
syslinux/dump_mmap.o syslinux/dump_movelist.o \
\
syslinux/run_default.o syslinux/run_command.o \