diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2014-02-13 16:09:13 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-02-13 16:09:13 -0800 |
commit | a5727651bb78e7cd1bd90046e24fbcedf4f7dfb9 (patch) | |
tree | 6cf28a5896cd1c71841b7bb3e713c257ed86af69 /core | |
parent | 636504f7bb6f9e86cc65addbfb36aed14dc1ecb4 (diff) | |
download | syslinux-a5727651bb78e7cd1bd90046e24fbcedf4f7dfb9.tar.gz |
bios: Remove shuffle and boot comapi call
Remove the shuffle and boot comapi call. This is the last of the
comapi calls left; we should now be able to completely remove the
comapi support.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/bcopyxx.inc | 8 | ||||
-rw-r--r-- | core/bios.c | 25 | ||||
-rw-r--r-- | core/cleanup.c | 22 | ||||
-rw-r--r-- | core/comboot.inc | 24 | ||||
-rw-r--r-- | core/diskboot.inc | 1 | ||||
-rw-r--r-- | core/include/bios.h | 1 | ||||
-rw-r--r-- | core/isolinux.asm | 4 | ||||
-rw-r--r-- | core/pxelinux.asm | 4 |
8 files changed, 44 insertions, 45 deletions
diff --git a/core/bcopyxx.inc b/core/bcopyxx.inc index cfdda0bc..7a8c6496 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 ac1f48bc..9cfb94be 100644 --- a/core/bios.c +++ b/core/bios.c @@ -665,6 +665,31 @@ void bios_init(void) dmi_init(); } +extern void comboot_cleanup_api(void); +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(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(); +} + 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/comboot.inc b/core/comboot.inc index c6514837..4b64d086 100644 --- a/core/comboot.inc +++ b/core/comboot.inc @@ -342,28 +342,6 @@ comapi_err: stc ret -; -; 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 - section .data16 alignz 2 @@ -404,7 +382,7 @@ int22_table: 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_err ; 0024 cleanup, shuffle and boot raw dw comapi_err ; 0025 initialize adv structure int22_count equ ($-int22_table)/2 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/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/isolinux.asm b/core/isolinux.asm index f1512611..94a5b0b4 100644 --- a/core/isolinux.asm +++ b/core/isolinux.asm @@ -1236,3 +1236,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 dd 0 ; Keep bios_cleanup_hardware() honest diff --git a/core/pxelinux.asm b/core/pxelinux.asm index f4c52c2b..029e4004 100644 --- a/core/pxelinux.asm +++ b/core/pxelinux.asm @@ -575,3 +575,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 dd 0 ; Keep bios_cleanup_hardware() honest |