aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--comboot.doc35
-rw-r--r--comboot.inc22
-rw-r--r--ldlinux.asm10
3 files changed, 65 insertions, 2 deletions
diff --git a/comboot.doc b/comboot.doc
index 2f5f247c..f427246f 100644
--- a/comboot.doc
+++ b/comboot.doc
@@ -292,6 +292,10 @@ AX=0007h Read file
aligned. SYSLINUX guarantees at least this alignment for the
COMBOOT load segment or the COM32 bounce buffer.
+ Keep in mind that a "file" may be a TFTP connection, and that
+ leaving a file open for an extended period of time may result
+ in a timeout.
+
WARNING: Calling this function with an invalid file handle
will probably crash the system.
@@ -377,3 +381,34 @@ AX=000Bh Get Serial Console Configuration
If no serial port is configured, DX will be set to 0 and the
other registers are undefined.
+
+
+AX=000Ch Perform final cleanup
+ Input: AX 000Ch
+ DX derivative-specific flags (0000h = clean up all)
+ Output: None
+
+ This routine performs any "final cleanup" the boot loader
+ would normally perform before loading a kernel, such as
+ unloading the PXE stack in the case of PXELINUX. AFTER
+ INVOKING THIS CALL, NO OTHER API CALLS MAY BE INVOKED, NOR MAY
+ THE PROGRAM TERMINATE AND RETURN TO THE BOOT LOADER. This
+ call basically tells the boot loader "get out of the way, I'll
+ handle it from here." The boot loader will continue to
+ provide interrupt and BIOS call thunking services as long its
+ memory areas (0x1000-0xffff, 0x100000-0x100fff) are not
+ overwritten. MAKE SURE TO DISABLE INTERRUPTS BEFORE
+ OVERWRITING THESE MEMORY AREAS.
+
+ The permissible values for DX are as follows:
+
+ SYSLINUX: 0000h Normal cleanup
+
+ PXELINUX: 0000h Normal cleanup
+ 0003h Keep UNDI and PXE stacks loaded
+
+ ISOLINUX: 0000h Normal cleanup
+
+ All other values are undefined, and may have different
+ meanings in future versions of SYSLINUX.
+
diff --git a/comboot.inc b/comboot.inc
index d7b03a70..15b25fce 100644
--- a/comboot.inc
+++ b/comboot.inc
@@ -479,6 +479,27 @@ comapi_serialcfg:
ret
;
+; INT 22h AX=000Ch Perform final cleanup
+;
+comapi_cleanup:
+%if IS_PXELINUX
+ ; Unload PXE if requested
+ test dl,3
+ setnz [KeepPXE]
+ call unload_pxe
+%elif IS_SYSLINUX
+ ; Restore original FDC table
+ mov eax,[OrigFDCTabPtr]
+ mov [fdctab],eax
+%endif
+ ; Reset the floppy disk subsystem
+ xor ax,ax
+ xor dx,dx
+ int 13h
+ clc
+ ret
+
+;
; This stuff should really be in the data section...
;
%macro int21 2
@@ -513,6 +534,7 @@ int22_table:
dw comapi_pxecall ; 0009 call PXE stack
dw comapi_derinfo ; 000A derivative-specific info
dw comapi_serialcfg ; 000B get serial port config
+ dw comapi_cleanup ; 000C perform final cleanup
int22_count equ ($-int22_table)/2
APIKeyWait db 0
diff --git a/ldlinux.asm b/ldlinux.asm
index 73803308..6de92f1e 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -294,8 +294,6 @@ start:
mov ds,ax ; Now we can initialize DS...
mov [di+bsDriveNumber-FloppyTable],dl
- and dl,dl ; If floppy disk (00-7F), assume no
- js harddisk ; partition table
;
; Now sautee the BIOS floppy info block to that it will support decent-
; size transfers; the floppy block is 11 bytes and is stored in the
@@ -308,6 +306,14 @@ start:
lfs si,[bx] ; FS:SI -> original fdctab
push fs ; Save on stack in case we need to bail
push si
+
+ ; Save the old fdctab even if hard disk so the stack layout
+ ; is the same. The instructions above do not change the flags
+ and dl,dl ; If floppy disk (00-7F), assume no
+ ; partition table
+ js harddisk
+
+floppy:
mov cl,6 ; 12 bytes (CX == 0)
; es:di -> FloppyTable already
; This should be safe to do now, interrupts are off...