Support LOCALBOOT (ISOLINUX-style) in SYSLINUX/EXTLINUX
authorH. Peter Anvin <hpa@zytor.com>
Sat, 19 Apr 2008 15:40:10 +0000 (11:40 -0400)
committerH. Peter Anvin <hpa@zytor.com>
Sat, 19 Apr 2008 15:40:10 +0000 (11:40 -0400)
Add support for ISOLINUX-style LOCALBOOT in SYSLINUX/EXTLINUX.  No way
to do the same for PXELINUX, due to the keyword collision.  Suck.

NEWS
comboot.inc
config.inc
extlinux.asm
isolinux.asm
keywords.inc
ldlinux.asm
parseconfig.inc
pxelinux.asm
ui.inc

diff --git a/NEWS b/NEWS
index 84a8b6a..7df0b1c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ Starting with 1.47, changes marked with SYSLINUX/PXELINUX/ISOLINUX
 apply to that specific program only; other changes apply to all of
 them.
 
+Changes in 3.64:
+       * SYSLINUX/EXTLINUX: support "localboot" with the same feature
+         set as ISOLINUX.
+
 Changes in 3.63:
        * Fix errors in the PCI and DMI detection modules (Erwan Velu,
          Sebastian Herbszt).
index 3a9b433..b7b3147 100644 (file)
@@ -661,13 +661,13 @@ comapi_idle       equ comapi_err
 ;
 ; INT 22h AX=0014h     Local boot
 ;
-%if IS_PXELINUX || IS_ISOLINUX
+%if HAS_LOCALBOOT
 comapi_localboot:
                mov ax,P_DX
                jmp local_boot
 %else
 comapi_localboot equ comapi_err
-%endif
+%endif ; HAS_LOCALBOOT
 
 ;
 ; INT 22h AX=0015h     Feature flags
index d6a981e..f0f59ce 100644 (file)
@@ -28,6 +28,11 @@ MAX_FKEYS    equ 12                  ; Number of F-key help files
 %assign        DO_WBINVD 0                     ; Should we use WBINVD or not?
 
 ;
+; Local boot supported
+;
+%assign        HAS_LOCALBOOT 1
+
+;
 ; Set this to return the A20 gate to its previous state, instead of
 ; leaving it open.  This has caused problems, because there appear
 ; to be a race condition between disabling the A20 gate and trying to
index c96e110..352e7e1 100644 (file)
@@ -1528,6 +1528,7 @@ getfssec:
 %include "strecpy.inc"          ; strcpy with end pointer check
 %include "cache.inc"           ; Metadata disk cache
 %include "adv.inc"             ; Auxillary Data Vector
+%include "localboot.inc"       ; Disk-based local boot
 
 ; -----------------------------------------------------------------------------
 ;  Begin data section
index c245769..57ca1d4 100644 (file)
@@ -1092,46 +1092,6 @@ is_disk_image:
 .done_sector:  ret
 
 ;
-; Boot a specified local disk.  AX specifies the BIOS disk number; or
-; 0xFFFF in case we should execute INT 18h ("next device.")
-;
-local_boot:
-               call vgaclearmode
-               lss sp,[cs:Stack]               ; Restore stack pointer
-               xor dx,dx
-               mov ds,dx
-               mov es,dx
-               mov fs,dx
-               mov gs,dx
-               mov si,localboot_msg
-               call writestr
-               cmp ax,-1
-               je .int18
-
-               ; Load boot sector from the specified BIOS device and jump to it.
-               mov dl,al
-               xor dh,dh
-               push dx
-               xor ax,ax                       ; Reset drive
-               call xint13
-               mov ax,0201h                    ; Read one sector
-               mov cx,0001h                    ; C/H/S = 0/0/1 (first sector)
-               mov bx,trackbuf
-               call xint13
-               pop dx
-               cli                             ; Abandon hope, ye who enter here
-               mov si,trackbuf
-               mov di,07C00h
-               mov cx,512                      ; Probably overkill, but should be safe
-               rep movsd
-               lss sp,[cs:InitStack]
-               jmp 0:07C00h                    ; Jump to new boot sector
-
-.int18:
-               int 18h                         ; Hope this does the right thing...
-               jmp kaboom                      ; If we returned, oh boy...
-
-;
 ; close_file:
 ;           Deallocates a file structure (pointer in SI)
 ;           Assumes CS == DS.
@@ -1487,6 +1447,7 @@ getfssec:
 %include "strcpy.inc"          ; strcpy()
 %include "rawcon.inc"          ; Console I/O w/o using the console functions
 %include "adv.inc"             ; Auxillary Data Vector
+%include "localboot.inc"       ; Disk-based local boot
 
 ; -----------------------------------------------------------------------------
 ;  Begin data section
@@ -1494,7 +1455,6 @@ getfssec:
 
                section .data
 
-localboot_msg  db 'Booting from local disk...', CR, LF, 0
 default_str    db 'default', 0
 default_len    equ ($-default_str)
 boot_dir       db '/boot'                      ; /boot/isolinux
index e98f879..b6a701b 100644 (file)
@@ -90,7 +90,7 @@ keywd_table:
 %if IS_PXELINUX
                keyword ipappend,       pc_ipappend
 %endif
-%if IS_PXELINUX || IS_ISOLINUX
+%if HAS_LOCALBOOT
                keyword localboot,      pc_localboot
 %endif
 
index 0f06315..5593f71 100644 (file)
@@ -1529,6 +1529,7 @@ getfatsector:
 %include "strcpy.inc"           ; strcpy()
 %include "cache.inc"           ; Metadata disk cache
 %include "adv.inc"             ; Auxillary Data Vector
+%include "localboot.inc"       ; Disk-based local boot
 
 ; -----------------------------------------------------------------------------
 ;  Begin data section
index 90c1f3c..2ef9c3a 100644 (file)
@@ -81,7 +81,8 @@ pc_ipappend:  call getint
 ;
 ; "localboot" command (PXELINUX, ISOLINUX)
 ;
-%if IS_PXELINUX || IS_ISOLINUX
+%if HAS_LOCALBOOT
+
 pc_localboot:  call getint
                cmp byte [VKernel],0            ; ("label" section only)
                je .err
@@ -97,7 +98,8 @@ pc_localboot: call getint
                mov [VKernelBuf+vk_rname+1], bx ; Return type
 %endif
 .err:          ret
-%endif
+
+%endif ; HAS_LOCALBOOT
 
 ;
 ; "kernel", "config", ... command
index 2f08bac..7cc8d74 100644 (file)
@@ -845,6 +845,8 @@ config_scan:
 ; Boot to the local disk by returning the appropriate PXE magic.
 ; AX contains the appropriate return code.
 ;
+%if HAS_LOCALBOOT
+
 local_boot:
                push cs
                pop ds
@@ -863,6 +865,8 @@ local_boot:
                popfd
                retf                            ; Return to PXE
 
+%endif
+
 ;
 ; kaboom: write a message and bail out.  Wait for quite a while,
 ;        or a user keypress, then do a hard reboot.
diff --git a/ui.inc b/ui.inc
index 69ba7dc..b26c395 100644 (file)
--- a/ui.inc
+++ b/ui.inc
@@ -343,7 +343,7 @@ vk_check:
                mov al, [VKernelBuf+vk_type]
                mov [KernelType], al
 
-%if IS_PXELINUX || IS_ISOLINUX
+%if HAS_LOCALBOOT
                ; Is this a "localboot" pseudo-kernel?
 %if IS_PXELINUX
                cmp byte [VKernelBuf+vk_rname+4], 0