From: H. Peter Anvin Date: Sat, 19 Apr 2008 15:40:10 +0000 (-0400) Subject: Support LOCALBOOT (ISOLINUX-style) in SYSLINUX/EXTLINUX X-Git-Tag: syslinux-3.64-pre1~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75f156f68da694eae5f12cfe995903f91ad23e8b;p=profile%2Fivi%2Fsyslinux.git Support LOCALBOOT (ISOLINUX-style) in SYSLINUX/EXTLINUX Add support for ISOLINUX-style LOCALBOOT in SYSLINUX/EXTLINUX. No way to do the same for PXELINUX, due to the keyword collision. Suck. --- diff --git a/NEWS b/NEWS index 84a8b6a..7df0b1c 100644 --- 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). diff --git a/comboot.inc b/comboot.inc index 3a9b433..b7b3147 100644 --- a/comboot.inc +++ b/comboot.inc @@ -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 diff --git a/config.inc b/config.inc index d6a981e..f0f59ce 100644 --- a/config.inc +++ b/config.inc @@ -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 diff --git a/extlinux.asm b/extlinux.asm index c96e110..352e7e1 100644 --- a/extlinux.asm +++ b/extlinux.asm @@ -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 diff --git a/isolinux.asm b/isolinux.asm index c245769..57ca1d4 100644 --- a/isolinux.asm +++ b/isolinux.asm @@ -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 diff --git a/keywords.inc b/keywords.inc index e98f879..b6a701b 100644 --- a/keywords.inc +++ b/keywords.inc @@ -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 diff --git a/ldlinux.asm b/ldlinux.asm index 0f06315..5593f71 100644 --- a/ldlinux.asm +++ b/ldlinux.asm @@ -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 diff --git a/parseconfig.inc b/parseconfig.inc index 90c1f3c..2ef9c3a 100644 --- a/parseconfig.inc +++ b/parseconfig.inc @@ -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 diff --git a/pxelinux.asm b/pxelinux.asm index 2f08bac..7cc8d74 100644 --- a/pxelinux.asm +++ b/pxelinux.asm @@ -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 --- 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