suse_gfxboot
## 11-suse_gfxboot.diff by Colin Watson <cjwatson@ubuntu.com> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Add gfxboot hooks. The original patch was from openSUSE: ## DP: http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/suse/src/syslinux-3.63-13.src.rpm Gbp-Pq: Name 11-suse_gfxboot.diff
This commit is contained in:
parent
9f65a910db
commit
a996ae09a3
5
Makefile
5
Makefile
|
@ -147,15 +147,16 @@ kwdhash.gen: keywords genhash.pl
|
|||
$(PERL) genhash.pl < keywords > kwdhash.gen
|
||||
|
||||
# Standard rule for {isolinux,isolinux-debug}.bin
|
||||
iso%.bin: iso%.asm kwdhash.gen version.gen
|
||||
iso%.bin: iso%.asm kwdhash.gen version.gen gfxboot.inc
|
||||
$(NASM) $(NASMOPT) -f bin -DDATE_STR="'$(DATE)'" -DHEXDATE="$(HEXDATE)" \
|
||||
-DMAP=$(@:.bin=.map) -l $(@:.bin=.lsr) -o $@ $<
|
||||
$(PERL) lstadjust.pl $(@:.bin=.lsr) $(@:.bin=.map) $(@:.bin=.lst)
|
||||
$(PERL) checksumiso.pl $@
|
||||
$(PERL) checkov.pl $(@:.bin=.map) $@
|
||||
-./add_crc $@
|
||||
|
||||
# Standard rule for {ldlinux,pxelinux,extlinux}.bin
|
||||
%.bin: %.asm kwdhash.gen version.gen
|
||||
%.bin: %.asm kwdhash.gen version.gen gfxboot.inc
|
||||
$(NASM) $(NASMOPT) -f bin -DDATE_STR="'$(DATE)'" -DHEXDATE="$(HEXDATE)" \
|
||||
-DMAP=$(@:.bin=.map) -l $(@:.bin=.lsr) -o $@ $<
|
||||
$(PERL) lstadjust.pl $(@:.bin=.lsr) $(@:.bin=.map) $(@:.bin=.lst)
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
Graphical boot screen
|
||||
=====================
|
||||
|
||||
syslinux/isolinux support a graphical boot screen using VESA BIOS
|
||||
extensions. (Note that this is different from the graphics support that
|
||||
syslinux comes with).
|
||||
|
||||
To use it you have to prepare a special boot logo file and put a line like
|
||||
this into syslinux.cfg/isolinux.cfg:
|
||||
|
||||
gfxboot foo
|
||||
|
||||
The tools to create 'foo' from the above example are in the gfxboot
|
||||
package. Please _do_ have a look at its documentation before you begin.
|
||||
|
||||
Note that you cannot use comboot images and graphics at the same time as
|
||||
the memory used overlaps the comboot loading area.
|
||||
|
||||
If you encouter problems with the graphics code, hold down SHIFT while
|
||||
syslinux starts. This will put it into 'failsafe' mode that lets you
|
||||
interactively skip critical parts (like monitor detection).
|
||||
|
||||
|
||||
|
||||
Spread boot images over several floppy disks (syslinux)
|
||||
=======================================================
|
||||
|
||||
You can prepare boot disks with a file system that spans several disks.
|
||||
The 'mkbootdisk' script from the openSUSE project can create a suitable
|
||||
file system.
|
||||
|
||||
syslinux will ask you for disk changes if necessary. To enable this
|
||||
feature, use
|
||||
|
||||
disksize <size_of_single_disk_in_sectors>
|
||||
|
||||
Note that every individual disk must have at least a valid FAT boot
|
||||
sector. syslinux will use the serial number stored there to verify that
|
||||
the correct disk has been inserted (its last hex digit is the zero based
|
||||
disk number).
|
||||
|
|
@ -21,6 +21,11 @@
|
|||
; abort_check: let the user abort with <ESC> or <Ctrl-C>
|
||||
;
|
||||
abort_check:
|
||||
%ifdef WITH_GFX
|
||||
; don't
|
||||
cmp byte [gfx_ok],0
|
||||
jnz .ret1
|
||||
%endif
|
||||
call pollchar
|
||||
jz .ret1
|
||||
pusha
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
#! /usr/bin/perl
|
||||
|
||||
use integer;
|
||||
|
||||
# for isolinux
|
||||
#
|
||||
# Ensure checksum over (first sector - 64 bytes) [internally: FirstSecSum]
|
||||
# is 0 by adjusting the variable csum_value.
|
||||
#
|
||||
# Though isolinux checks the integrity with a separate checksum after all
|
||||
# data has been loaded this does not help with BIOSes that don't get even
|
||||
# the first 2k right. Hence this additional check. :-(
|
||||
#
|
||||
|
||||
$file = shift;
|
||||
$list = "$file";
|
||||
$list =~ s/\.bin$/.lsr/;
|
||||
|
||||
open F, $list;
|
||||
|
||||
while(<F>) {
|
||||
if(/^\s*\d+\s*(\S+)\s*0+\s*(\<\d+\>\s*)?csum_value\s*dd\s*0/) {
|
||||
$ofs = hex $1;
|
||||
}
|
||||
}
|
||||
close F;
|
||||
|
||||
die "oops 1\n" unless $ofs && !($ofs & 3);
|
||||
|
||||
# print "$ofs\n";
|
||||
|
||||
open F, $file or die "$file: $!\n";
|
||||
|
||||
$file_size = -s $file;
|
||||
|
||||
sysread F, $buf, $file_size;
|
||||
|
||||
close F;
|
||||
|
||||
die "oops 1\n" if $file_size != length($buf);
|
||||
|
||||
@x = unpack "V512", $buf;
|
||||
|
||||
for ($sum = 0, $i = 16; $i < 512; $i++) {
|
||||
$sum += $x[$i];
|
||||
}
|
||||
|
||||
# printf "0x%08x\n", $sum;
|
||||
|
||||
$ns = pack "V", -$sum;
|
||||
|
||||
substr($buf, $ofs, 4) = $ns;
|
||||
|
||||
open F, ">$file" or die "$file: $!\n";
|
||||
|
||||
syswrite F, $buf;
|
||||
|
|
@ -42,6 +42,10 @@
|
|||
#include <getkey.h>
|
||||
#include <libutil.h>
|
||||
|
||||
#ifndef CLK_TCK
|
||||
# define CLK_TCK __sysconf(2)
|
||||
#endif
|
||||
|
||||
struct keycode {
|
||||
int code;
|
||||
int seqlen;
|
||||
|
|
|
@ -254,7 +254,7 @@ static int mpf_checksum(unsigned char *mp, int len)
|
|||
|
||||
static int smp_scan_config (unsigned long base, unsigned long length)
|
||||
{
|
||||
unsigned long *bp = base;
|
||||
unsigned long *bp = (unsigned long *) base;
|
||||
struct intel_mp_floating *mpf;
|
||||
|
||||
// printf("Scan SMP from %p for %ld bytes.\n", bp,length);
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#include <consoles.h> /* Provided by libutil */
|
||||
#include <getkey.h>
|
||||
|
||||
#ifndef CLK_TCK
|
||||
# define CLK_TCK __sysconf(2)
|
||||
#endif
|
||||
|
||||
static void cooked_keys(void)
|
||||
{
|
||||
int key;
|
||||
|
|
|
@ -49,6 +49,14 @@ loadkeys_ret: ret
|
|||
; Assumes CS == DS == ES.
|
||||
;
|
||||
get_msg_file:
|
||||
%ifdef WITH_GFX
|
||||
; don't load if graphics code is active
|
||||
cmp byte [gfx_ok],0
|
||||
jz .nogfx
|
||||
jmp close
|
||||
.nogfx:
|
||||
%endif
|
||||
|
||||
mov byte [TextAttribute],07h ; Default grey on white
|
||||
mov byte [DisplayMask],07h ; Display text in all modes
|
||||
call msg_initvars
|
||||
|
|
|
@ -230,7 +230,7 @@ LABEL label
|
|||
Append nothing. APPEND with a single hyphen as argument in a
|
||||
LABEL section can be used to override a global APPEND.
|
||||
|
||||
LOCALBOOT type [ISOLINUX, PXELINUX]
|
||||
LOCALBOOT type [ISOLINUX, SYSLINUX, PXELINUX]
|
||||
On PXELINUX, specifying "LOCALBOOT 0" instead of a "KERNEL"
|
||||
option means invoking this particular label will cause a local
|
||||
disk boot instead of booting a kernel.
|
||||
|
@ -244,12 +244,11 @@ LABEL label
|
|||
UNDI or PXE stacks are, don't worry -- you don't want them,
|
||||
just specify 0.
|
||||
|
||||
On ISOLINUX, the "type" specifies the local drive number to
|
||||
boot from; 0x00 is the primary floppy drive and 0x80 is the
|
||||
primary hard drive. The special value -1 causes ISOLINUX to
|
||||
report failure to the BIOS, which, on recent BIOSes, should
|
||||
mean that the next boot device in the boot sequence should be
|
||||
activated.
|
||||
On ISOLINUX and SYSLINUX, the "type" specifies the local drive
|
||||
number to boot from; 0x00 is the primary floppy drive and 0x80 is
|
||||
the primary hard drive. The special value -1 causes them to report
|
||||
failure to the BIOS, which, on recent BIOSes, should mean that the
|
||||
next boot device in the boot sequence should be activated.
|
||||
|
||||
IMPLICIT flag_val
|
||||
If flag_val is 0, do not load a kernel image unless it has been
|
||||
|
|
File diff suppressed because it is too large
Load Diff
142
isolinux.asm
142
isolinux.asm
|
@ -19,6 +19,10 @@
|
|||
; ****************************************************************************
|
||||
|
||||
%define IS_ISOLINUX 1
|
||||
|
||||
%define WITH_GFX 1
|
||||
; %define DEBUG_DISKIO
|
||||
|
||||
%include "head.inc"
|
||||
|
||||
;
|
||||
|
@ -70,6 +74,8 @@ vk_end: equ $ ; Should be <= vk_size
|
|||
real_mode_seg equ 2000h
|
||||
xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem
|
||||
comboot_seg equ real_mode_seg ; COMBOOT image loading zone
|
||||
gfx_menu_seg equ 3000h ; temporary storage to setup menu
|
||||
first_free_seg equ 4000h ; end of isolinux used memory
|
||||
|
||||
;
|
||||
; File structure. This holds the information for each currently open file.
|
||||
|
@ -259,6 +265,21 @@ initial_csum: xor edi,edi
|
|||
mov [FirstSecSum],edi
|
||||
|
||||
mov [DriveNumber],dl
|
||||
|
||||
; check whether the BIOS did load us correctly
|
||||
cmp dl,80h ; some BIOSes try to do floppy emulation...
|
||||
jb bios_err
|
||||
cmp dword [FirstSecSum], byte 0
|
||||
jz bios_ok
|
||||
bios_err:
|
||||
mov si,broken_bios_msg
|
||||
call writemsg
|
||||
jmp short $
|
||||
broken_bios_msg db 13, 10, 'Cannot boot from this CD. Please try a BIOS update.', 13, 10, 0
|
||||
align 4
|
||||
csum_value dd 0
|
||||
bios_ok:
|
||||
|
||||
%ifdef DEBUG_MESSAGES
|
||||
mov si,startup_msg
|
||||
call writemsg
|
||||
|
@ -283,6 +304,9 @@ initial_csum: xor edi,edi
|
|||
; Other nonzero fields
|
||||
inc word [dsp_sectors]
|
||||
|
||||
%if 0
|
||||
; Some BIOSes don't like that call.
|
||||
|
||||
; Now figure out what we're actually doing
|
||||
; Note: use passed-in DL value rather than 7Fh because
|
||||
; at least some BIOSes will get the wrong value otherwise
|
||||
|
@ -303,6 +327,8 @@ initial_csum: xor edi,edi
|
|||
call crlf
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
found_drive:
|
||||
; Alright, we have found the drive. Now, try to find the
|
||||
; boot file itself. If we have a boot info table, life is
|
||||
|
@ -427,6 +453,9 @@ integrity_ok:
|
|||
%endif
|
||||
jmp all_read ; Jump to main code
|
||||
|
||||
%if 0
|
||||
; doesn't work anyway, see above
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Start of BrokenAwardHack --- 10-nov-2002 Knut_Petersen@t-online.de
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -618,6 +647,7 @@ spec_query_failed:
|
|||
mov si,trysbm_msg
|
||||
call writemsg
|
||||
jmp .found_drive ; Pray that this works...
|
||||
%endif
|
||||
|
||||
fatal_error:
|
||||
mov si,nothing_msg
|
||||
|
@ -694,10 +724,17 @@ getonesec:
|
|||
;
|
||||
getlinsec:
|
||||
mov si,dapa ; Load up the DAPA
|
||||
mov [si+4],bx
|
||||
mov bx,es
|
||||
mov [si+6],bx
|
||||
mov [si+8],eax
|
||||
; seems that some BIOSes have problems if the target
|
||||
; segment is 0 (don't ask); to avoid this, we normalize
|
||||
; the buffer address here
|
||||
; -> seen on Acer TravelMate C102Ti
|
||||
mov [si+4],bx
|
||||
and word [si+4],0fh
|
||||
mov ax,es
|
||||
shr bx,4
|
||||
add ax,bx
|
||||
mov [si+6],ax
|
||||
.loop:
|
||||
push bp ; Sectors left
|
||||
cmp bp,[MaxTransfer]
|
||||
|
@ -724,15 +761,78 @@ getlinsec:
|
|||
; INT 13h with retry
|
||||
xint13: mov byte [RetryCount],retry_count
|
||||
.try: pushad
|
||||
%ifdef DEBUG_DISKIO
|
||||
pushad
|
||||
mov cx,16
|
||||
.zap:
|
||||
lodsb
|
||||
call writehex2
|
||||
mov al,' '
|
||||
call writechr
|
||||
loop .zap
|
||||
mov ah,0
|
||||
int 16h
|
||||
popad
|
||||
%endif
|
||||
; seen buggy bios that overwrites buffer address on error...
|
||||
push dword [dapa + 4]
|
||||
call int13
|
||||
pop dword [dapa + 4]
|
||||
%ifdef DEBUG_DISKIO
|
||||
pushad
|
||||
pushf
|
||||
push ax
|
||||
mov al,':'
|
||||
call writechr
|
||||
mov al,' '
|
||||
call writechr
|
||||
pop ax
|
||||
sbb al,al
|
||||
call writehex4
|
||||
call crlf
|
||||
mov ah,0
|
||||
int 16h
|
||||
popf
|
||||
popad
|
||||
%endif
|
||||
jc .error
|
||||
.noerror:
|
||||
add sp,byte 8*4 ; Clean up stack
|
||||
ret
|
||||
.error:
|
||||
or ah,ah
|
||||
jz .noerror
|
||||
mov [DiskError],ah ; Save error code
|
||||
popad
|
||||
mov [DiskSys],ax ; Save system call number
|
||||
dec byte [RetryCount]
|
||||
|
||||
%if 0
|
||||
; eject currently not supported - doesn't work anyway with
|
||||
; most BIOSes
|
||||
|
||||
test byte [gfx_user_note],1
|
||||
jz .noeject
|
||||
cmp byte [RetryCount],4
|
||||
ja .noeject
|
||||
cmp byte [DiskError],0aah ; drive not ready
|
||||
jnz .noeject
|
||||
; might have been cdrom eject, wait a bit
|
||||
cmp byte [gfx_ok],0
|
||||
jz .noeject
|
||||
push si
|
||||
push di
|
||||
push ax
|
||||
mov si,err_not_ready
|
||||
xor di,di
|
||||
mov al,0
|
||||
call gfx_infobox
|
||||
pop ax
|
||||
pop di
|
||||
pop si
|
||||
%endif
|
||||
.noeject:
|
||||
|
||||
dec byte [RetryCount]
|
||||
jz .real_error
|
||||
push ax
|
||||
mov al,[RetryCount]
|
||||
|
@ -774,6 +874,17 @@ xint13: mov byte [RetryCount],retry_count
|
|||
;
|
||||
kaboom:
|
||||
RESET_STACK_AND_SEGS AX
|
||||
|
||||
cmp byte [gfx_ok],0
|
||||
jz .nogfx
|
||||
mov si,err_failed_gfx
|
||||
xor di,di
|
||||
mov al,1
|
||||
call gfx_infobox
|
||||
call gfx_done
|
||||
call do_reboot
|
||||
.nogfx:
|
||||
|
||||
mov si,err_bootfailed
|
||||
call cwritestr
|
||||
call getchar
|
||||
|
@ -825,6 +936,9 @@ bailmsg equ err_bootfailed
|
|||
crlf_msg db CR, LF
|
||||
null_msg db 0
|
||||
|
||||
err_failed_gfx db 'Error reading boot CD.', 0
|
||||
err_not_ready db 'CDROM drive not ready.', 0
|
||||
|
||||
alignb 4, db 0
|
||||
MaxTransfer dw 32 ; Max sectors per transfer
|
||||
|
||||
|
@ -882,6 +996,9 @@ all_read:
|
|||
; (which will be at 16 only for a single-session disk!); from the PVD
|
||||
; we should be able to find the rest of what we need to know.
|
||||
;
|
||||
call get_fs_structures
|
||||
jmp get_fs_struct_done
|
||||
|
||||
get_fs_structures:
|
||||
mov eax,[bi_pvd]
|
||||
mov bx,trackbuf
|
||||
|
@ -907,10 +1024,15 @@ get_fs_structures:
|
|||
; Look for an isolinux directory, and if found,
|
||||
; make it the current directory instead of the root
|
||||
; directory.
|
||||
|
||||
cmp byte [gfx_ok],0 ; don't look at both
|
||||
jnz .gfx
|
||||
|
||||
mov di,boot_dir ; Search for /boot/isolinux
|
||||
mov al,02h
|
||||
call searchdir_iso
|
||||
jnz .found_dir
|
||||
.gfx:
|
||||
mov di,isolinux_dir
|
||||
mov al,02h ; Search for /isolinux
|
||||
call searchdir_iso
|
||||
|
@ -931,6 +1053,9 @@ get_fs_structures:
|
|||
call crlf
|
||||
%endif
|
||||
.no_isolinux_dir:
|
||||
ret
|
||||
|
||||
get_fs_struct_done:
|
||||
|
||||
;
|
||||
; Locate the configuration file
|
||||
|
@ -1096,6 +1221,9 @@ is_disk_image:
|
|||
; 0xFFFF in case we should execute INT 18h ("next device.")
|
||||
;
|
||||
local_boot:
|
||||
%ifdef WITH_GFX
|
||||
call gfx_done
|
||||
%endif
|
||||
call vgaclearmode
|
||||
lss sp,[cs:Stack] ; Restore stack pointer
|
||||
xor dx,dx
|
||||
|
@ -1113,7 +1241,7 @@ local_boot:
|
|||
xor dh,dh
|
||||
push dx
|
||||
xor ax,ax ; Reset drive
|
||||
call xint13
|
||||
int 13h ; we don't care about errors here...
|
||||
mov ax,0201h ; Read one sector
|
||||
mov cx,0001h ; C/H/S = 0/0/1 (first sector)
|
||||
mov bx,trackbuf
|
||||
|
@ -1488,6 +1616,9 @@ getfssec:
|
|||
%include "rawcon.inc" ; Console I/O w/o using the console functions
|
||||
%include "adv.inc" ; Auxillary Data Vector
|
||||
|
||||
%include "gfxboot.inc" ; add gfx things
|
||||
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; Begin data section
|
||||
; -----------------------------------------------------------------------------
|
||||
|
@ -1499,6 +1630,7 @@ default_str db 'default', 0
|
|||
default_len equ ($-default_str)
|
||||
boot_dir db '/boot' ; /boot/isolinux
|
||||
isolinux_dir db '/isolinux', 0
|
||||
zb 64
|
||||
config_name db 'isolinux.cfg', 0
|
||||
err_disk_image db 'Cannot load disk image (invalid file)?', CR, LF, 0
|
||||
|
||||
|
|
|
@ -91,8 +91,15 @@ keywd_table:
|
|||
%if IS_PXELINUX
|
||||
keyword ipappend, pc_ipappend
|
||||
%endif
|
||||
%if IS_PXELINUX || IS_ISOLINUX
|
||||
%if IS_PXELINUX || IS_ISOLINUX || IS_SYSLINUX
|
||||
keyword localboot, pc_localboot
|
||||
%endif
|
||||
|
||||
%ifdef WITH_GFX
|
||||
keyword gfxboot, pc_filecmd, get_gfx_file
|
||||
%if IS_SYSLINUX
|
||||
keyword disksize, pc_disksize, DiskSize
|
||||
%endif
|
||||
%endif
|
||||
|
||||
keywd_count equ ($-keywd_table)/keywd_size
|
||||
|
|
|
@ -88,7 +88,11 @@ RBFG_brainfuck: resb 2048 ; Bigger than an Ethernet packet...
|
|||
section .uibss nobits align=16 follows=.adv
|
||||
|
||||
; Normal bss...
|
||||
%if IS_ISOLINUX
|
||||
section .bss1 nobits align=16 follows=.bss2
|
||||
%else
|
||||
section .bss1 nobits align=16 follows=.uibss
|
||||
%endif
|
||||
|
||||
; Reserve space for stack
|
||||
section .stack nobits align=16 start=STACK_START
|
||||
|
|
62
ldlinux.asm
62
ldlinux.asm
|
@ -24,6 +24,9 @@
|
|||
%ifndef IS_MDSLINUX
|
||||
%define IS_SYSLINUX 1
|
||||
%endif
|
||||
|
||||
%define WITH_GFX 1
|
||||
|
||||
%include "head.inc"
|
||||
|
||||
;
|
||||
|
@ -82,6 +85,8 @@ real_mode_seg equ 3000h
|
|||
cache_seg equ 2000h ; 64K area for metadata cache
|
||||
xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem
|
||||
comboot_seg equ real_mode_seg ; COMBOOT image loading zone
|
||||
gfx_menu_seg equ 4000h ; temporary storage to setup menu
|
||||
first_free_seg equ 5000h ; end of syslinux used memory
|
||||
|
||||
;
|
||||
; File structure. This holds the information for each currently open file.
|
||||
|
@ -357,6 +362,8 @@ getlinsec:
|
|||
add eax,[bsHidden] ; Add partition offset
|
||||
xor edx,edx ; Zero-extend LBA (eventually allow 64 bits)
|
||||
|
||||
.patch: jmp strict near .jmp
|
||||
|
||||
.jmp: jmp strict short getlinsec_cbios
|
||||
|
||||
;
|
||||
|
@ -906,6 +913,48 @@ getfattype:
|
|||
;
|
||||
%include "ui.inc"
|
||||
|
||||
; Boot a specified local disk. AX specifies the BIOS disk number; or
|
||||
; 0xFFFF in case we should execute INT 18h ("next device.")
|
||||
;
|
||||
local_boot:
|
||||
%ifdef WITH_GFX
|
||||
call gfx_done
|
||||
%endif
|
||||
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 cwritestr
|
||||
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
|
||||
int 13h
|
||||
mov ax,0201h ; Read one sector
|
||||
mov cx,0001h ; C/H/S = 0/0/1 (first sector)
|
||||
mov bx,trackbuf
|
||||
int 13h
|
||||
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
|
||||
mov ss,cx
|
||||
mov sp,7c00h
|
||||
jmp 0:07C00h ; Jump to new boot sector
|
||||
.int18:
|
||||
int 18h ; Hope this does the right thing...
|
||||
jmp kaboom ; If we returned, oh boy...
|
||||
|
||||
;
|
||||
; allocate_file: Allocate a file structure
|
||||
;
|
||||
|
@ -1126,6 +1175,15 @@ PrevDir resd 1 ; Last scanned directory
|
|||
; starting with "kaboom.patch" with this part
|
||||
|
||||
kaboom2:
|
||||
cmp byte [gfx_ok],0
|
||||
jz .nogfx
|
||||
mov si,err_failed_gfx
|
||||
xor di,di
|
||||
mov al,1
|
||||
call gfx_infobox
|
||||
call gfx_done
|
||||
call do_reboot
|
||||
.nogfx:
|
||||
mov si,err_bootfailed
|
||||
call cwritestr
|
||||
cmp byte [kaboom.again+1],18h ; INT 18h version?
|
||||
|
@ -1530,6 +1588,8 @@ getfatsector:
|
|||
%include "cache.inc" ; Metadata disk cache
|
||||
%include "adv.inc" ; Auxillary Data Vector
|
||||
|
||||
%include "gfxboot.inc" ; add gfx things
|
||||
|
||||
; -----------------------------------------------------------------------------
|
||||
; Begin data section
|
||||
; -----------------------------------------------------------------------------
|
||||
|
@ -1539,6 +1599,8 @@ copyright_str db ' Copyright (C) 1994-', year, ' H. Peter Anvin'
|
|||
db CR, LF, 0
|
||||
err_bootfailed db CR, LF, 'Boot failed: please change disks and press '
|
||||
db 'a key to continue.', CR, LF, 0
|
||||
err_failed_gfx db 'Error reading from disk.', 0
|
||||
localboot_msg db 'Booting from local disk...', CR, LF, 0
|
||||
syslinux_cfg1 db '/boot' ; /boot/syslinux/syslinux.cfg
|
||||
syslinux_cfg2 db '/syslinux' ; /syslinux/syslinux.cfg
|
||||
syslinux_cfg3 db '/' ; /syslinux.cfg
|
||||
|
|
13
loadhigh.inc
13
loadhigh.inc
|
@ -47,7 +47,12 @@ load_high:
|
|||
.read_loop:
|
||||
and si,si ; If SI == 0 then we have end of file
|
||||
jz .eof
|
||||
%ifdef WITH_GFX
|
||||
cmp byte [gfx_ok],0
|
||||
jnz .no_message
|
||||
%endif
|
||||
call bx
|
||||
.no_message:
|
||||
push bx ; <AA> Pausebird function
|
||||
|
||||
push eax ; <A> Total bytes to transfer
|
||||
|
@ -63,7 +68,15 @@ load_high:
|
|||
push edi ; <C> Target buffer
|
||||
mov cx,ax
|
||||
xor bx,bx ; ES:0
|
||||
|
||||
%ifdef WITH_GFX
|
||||
call gfx_progress_update
|
||||
%endif
|
||||
|
||||
push dx
|
||||
call getfssec ; Load the data into xfer_buf_seg
|
||||
; getfssec destroys dx!
|
||||
pop dx
|
||||
pop edi ; <C> Target buffer
|
||||
pop ecx ; <B> Byte count this round
|
||||
push ecx ; <B> Byte count this round
|
||||
|
|
|
@ -107,6 +107,14 @@ KbdMap resb 256 ; Keyboard map
|
|||
FKeyName resb MAX_FKEYS*FILENAME_MAX ; File names for F-key help
|
||||
KernelCNameLen resw 1 ; Length of unmangled kernel name
|
||||
InitRDCNameLen resw 1 ; Length of unmangled initrd name
|
||||
|
||||
%if IS_ISOLINUX
|
||||
%ifdef DEBUG_MESSAGES
|
||||
; we need to rearrange memory a bit to make isolinux-debug.bin fit
|
||||
section .bss
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if IS_SYSLINUX
|
||||
KernelName resb FILENAME_MAX+1 ; Mangled name for kernel
|
||||
KernelCName resb FILENAME_MAX+2 ; Unmangled kernel name
|
||||
|
|
|
@ -94,7 +94,7 @@ pc_ipappend: call getint
|
|||
;
|
||||
; "localboot" command (PXELINUX, ISOLINUX)
|
||||
;
|
||||
%if IS_PXELINUX || IS_ISOLINUX
|
||||
%if IS_PXELINUX || IS_ISOLINUX || IS_SYSLINUX
|
||||
pc_localboot: call getint
|
||||
cmp byte [VKernel],0 ; ("label" section only)
|
||||
je .err
|
||||
|
@ -299,6 +299,25 @@ pc_serial: call getint
|
|||
mov [SerialPort], word 0
|
||||
ret
|
||||
|
||||
%ifdef WITH_GFX
|
||||
%if IS_SYSLINUX
|
||||
;
|
||||
; like pc_setint16, but patch sector read funtion, too
|
||||
;
|
||||
pc_disksize:
|
||||
push ax
|
||||
call getint
|
||||
pop si
|
||||
jc .err
|
||||
mov [si],bx
|
||||
mov word [getlinsec.patch+1], getlinsec3 - getlinsec.patch - 3
|
||||
or bx,bx
|
||||
jz .err
|
||||
call cache_metadata
|
||||
.err: ret
|
||||
%endif
|
||||
%endif
|
||||
|
||||
;
|
||||
; "F"-key command
|
||||
;
|
||||
|
|
|
@ -846,6 +846,9 @@ config_scan:
|
|||
; AX contains the appropriate return code.
|
||||
;
|
||||
local_boot:
|
||||
%ifdef WITH_GFX
|
||||
call gfx_done
|
||||
%endif
|
||||
push cs
|
||||
pop ds
|
||||
mov [LocalBootType],ax
|
||||
|
|
|
@ -206,6 +206,15 @@ cmdline_end:
|
|||
pop ds
|
||||
sub si,cmd_line_here
|
||||
mov [CmdLineLen],si ; Length including final null
|
||||
|
||||
%ifdef WITH_GFX
|
||||
mov eax,[KernelSects]
|
||||
mov esi,ds
|
||||
shl esi,4
|
||||
add esi,KernelCName
|
||||
call gfx_progress_init
|
||||
%endif
|
||||
|
||||
;
|
||||
; Now check if we have a large kernel, which needs to be loaded high
|
||||
;
|
||||
|
@ -312,6 +321,19 @@ load_initrd:
|
|||
jz nk_noinitrd
|
||||
call parse_load_initrd
|
||||
nk_noinitrd:
|
||||
|
||||
%ifdef WITH_GFX
|
||||
call gfx_progress_done
|
||||
|
||||
cmp byte [gfx_cd_changed],0
|
||||
jz .no_cd_change
|
||||
mov al,6
|
||||
xor si,si
|
||||
xor di,di
|
||||
call gfx_infobox
|
||||
.no_cd_change:
|
||||
%endif
|
||||
|
||||
;
|
||||
; Abandon hope, ye that enter here! We do no longer permit aborts.
|
||||
;
|
||||
|
@ -320,6 +342,10 @@ nk_noinitrd:
|
|||
mov si,ready_msg
|
||||
call cwritestr
|
||||
|
||||
%ifdef WITH_GFX
|
||||
call gfx_done
|
||||
%endif
|
||||
|
||||
call vgaclearmode ; We can't trust ourselves after this
|
||||
|
||||
UNLOAD_PREP ; Module-specific hook
|
||||
|
@ -552,6 +578,34 @@ parse_load_initrd:
|
|||
|
||||
.got_start:
|
||||
push si
|
||||
|
||||
%ifdef WITH_GFX
|
||||
cmp byte [si],'+'
|
||||
jnz .got_start_10
|
||||
mov byte [cs:gfx_cd_changed],1
|
||||
inc si
|
||||
push es
|
||||
push ds
|
||||
push si
|
||||
push cs
|
||||
pop es
|
||||
mov cx,100h
|
||||
mov di,trackbuf
|
||||
push di
|
||||
rep movsb
|
||||
mov byte [es:di],0
|
||||
pop si
|
||||
xor di,di
|
||||
mov al,5 ; ask for cd change
|
||||
push cs
|
||||
pop ds
|
||||
call gfx_infobox
|
||||
pop si
|
||||
pop ds
|
||||
pop es
|
||||
.got_start_10:
|
||||
%endif
|
||||
|
||||
mov di,InitRD ; Target buffer for mangled name
|
||||
call mangle_name
|
||||
call loadinitrd
|
||||
|
@ -645,6 +699,20 @@ loadinitrd:
|
|||
ret
|
||||
|
||||
.notthere:
|
||||
|
||||
%ifdef WITH_GFX
|
||||
cmp byte [gfx_ok],0
|
||||
jz .nogfx
|
||||
mov si,InitRDCName
|
||||
xor di,di
|
||||
mov al,2
|
||||
call gfx_infobox
|
||||
call gfx_progress_done
|
||||
mov si,no_msg
|
||||
jmp abort_load
|
||||
.nogfx:
|
||||
%endif
|
||||
|
||||
mov si,err_noinitrd
|
||||
call cwritestr
|
||||
mov si,InitRDCName
|
||||
|
@ -653,7 +721,21 @@ loadinitrd:
|
|||
jmp abort_load
|
||||
|
||||
no_high_mem: ; Error routine
|
||||
|
||||
%ifdef WITH_GFX
|
||||
cmp byte [gfx_ok],0
|
||||
jz .nogfx
|
||||
mov si,err_nohighmem
|
||||
xor di,di
|
||||
mov al,0
|
||||
call gfx_infobox
|
||||
call gfx_progress_done
|
||||
mov si,no_msg
|
||||
jmp abort_load
|
||||
.nogfx:
|
||||
%endif
|
||||
|
||||
mov si,err_nohighmem
|
||||
jmp abort_load
|
||||
|
||||
ret
|
||||
|
@ -666,7 +748,8 @@ dot_msg db '.', 0
|
|||
ready_msg db 'ready.', CR, LF, 0
|
||||
err_oldkernel db 'Cannot load a ramdisk with an old kernel image.'
|
||||
db CR, LF, 0
|
||||
err_noinitrd db CR, LF, 'Could not find ramdisk image: ', 0
|
||||
err_noinitrd db CR, LF
|
||||
err_noinitrda db 'Could not find ramdisk image: ', 0
|
||||
err_nohighmem db 'Not enough memory to load specified kernel.', CR, LF, 0
|
||||
|
||||
boot_image db 'BOOT_IMAGE='
|
||||
|
|
47
ui.inc
47
ui.inc
|
@ -44,6 +44,11 @@ no_config_file:
|
|||
|
||||
.no_bootonce:
|
||||
|
||||
%ifdef WITH_GFX
|
||||
; build gfx menu
|
||||
call gfx_setup_menu
|
||||
%endif
|
||||
|
||||
;
|
||||
; Check whether or not we are supposed to display the boot prompt.
|
||||
;
|
||||
|
@ -57,6 +62,21 @@ enter_command:
|
|||
cmp word [NoEscape],0 ; If NOESCAPE, no prompt,
|
||||
jne auto_boot ; always run default cmd
|
||||
|
||||
%ifdef WITH_GFX
|
||||
cmp byte [gfx_ok],0
|
||||
jz .nogfx
|
||||
mov edi,ds
|
||||
shl edi,4
|
||||
add edi,command_line
|
||||
mov ecx,max_cmd_len
|
||||
xor eax,eax
|
||||
xchg eax,[KbdTimeout] ; only the first time
|
||||
call gfx_input
|
||||
cmp ax,1
|
||||
jnz load_kernel
|
||||
.nogfx:
|
||||
%endif
|
||||
|
||||
mov si,boot_prompt
|
||||
call cwritestr
|
||||
|
||||
|
@ -323,9 +343,21 @@ vk_check:
|
|||
push word real_mode_seg
|
||||
pop es
|
||||
mov di,cmd_line_here
|
||||
|
||||
%ifdef WITH_GFX
|
||||
; gfx code includes them
|
||||
cmp byte [gfx_ok],0
|
||||
jnz .isgfx
|
||||
%endif
|
||||
|
||||
mov si,VKernelBuf+vk_append
|
||||
mov cx,[VKernelBuf+vk_appendlen]
|
||||
rep movsb
|
||||
|
||||
%ifdef WITH_GFX
|
||||
.isgfx:
|
||||
%endif
|
||||
|
||||
mov [CmdLinePtr],di ; Where to add rest of cmd
|
||||
pop es
|
||||
mov di,KernelName
|
||||
|
@ -343,7 +375,7 @@ vk_check:
|
|||
mov al, [VKernelBuf+vk_type]
|
||||
mov [KernelType], al
|
||||
|
||||
%if IS_PXELINUX || IS_ISOLINUX
|
||||
%if IS_PXELINUX || IS_ISOLINUX || IS_SYSLINUX
|
||||
; Is this a "localboot" pseudo-kernel?
|
||||
%if IS_PXELINUX
|
||||
cmp byte [VKernelBuf+vk_rname+4], 0
|
||||
|
@ -421,6 +453,19 @@ bad_kernel:
|
|||
push di
|
||||
call unmangle_name ; Get human form
|
||||
mov si,err_notfound ; Complain about missing kernel
|
||||
|
||||
%ifdef WITH_GFX
|
||||
cmp byte [gfx_ok],0
|
||||
jz .nogfx
|
||||
pop si
|
||||
xor di,di
|
||||
mov al,2
|
||||
call gfx_infobox
|
||||
mov si,no_msg
|
||||
jmp abort_load
|
||||
.nogfx:
|
||||
%endif
|
||||
|
||||
call cwritestr
|
||||
pop si ; KernelCName
|
||||
call cwritestr
|
||||
|
|
Loading…
Reference in New Issue