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).
;
; 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
%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
%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
.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.
%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
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
%if IS_PXELINUX
keyword ipappend, pc_ipappend
%endif
-%if IS_PXELINUX || IS_ISOLINUX
+%if HAS_LOCALBOOT
keyword localboot, pc_localboot
%endif
%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
;
; "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
mov [VKernelBuf+vk_rname+1], bx ; Return type
%endif
.err: ret
-%endif
+
+%endif ; HAS_LOCALBOOT
;
; "kernel", "config", ... command
; 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
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.
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