syslinux/syslinux-3.81.diff

177 lines
4.4 KiB
Diff

---
add_crc | 57 ++++++++++++++++++++++++++++++++++++++++++++++++
com32/libutil/get_key.c | 4 +++
com32/samples/keytest.c | 4 +++
core/diskstart.inc | 2 +
core/isolinux.asm | 27 ++++++++++++++++++++++
doc/syslinux.txt | 13 +++++-----
6 files changed, 100 insertions(+), 7 deletions(-)
--- /dev/null
+++ b/add_crc
@@ -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;
+
--- a/com32/libutil/get_key.c
+++ b/com32/libutil/get_key.c
@@ -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;
--- a/com32/samples/keytest.c
+++ b/com32/samples/keytest.c
@@ -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;
--- a/core/diskstart.inc
+++ b/core/diskstart.inc
@@ -254,6 +254,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
;
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -949,11 +964,17 @@ getlinsec_cdrom:
; INT 13h with retry
xint13: mov byte [RetryCount],retry_count
.try: pushad
+ ; seen buggy bios that overwrites buffer address on error...
+ push dword [dapa + 4]
call int13
+ pop dword [dapa + 4]
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
@@ -1120,6 +1141,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
@@ -1187,6 +1211,9 @@ get_fs_structures:
call crlf
%endif
.no_isolinux_dir:
+ ret
+
+get_fs_struct_done:
;
; Locate the configuration file
--- a/doc/syslinux.txt
+++ b/doc/syslinux.txt
@@ -240,7 +240,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.
@@ -254,12 +254,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.
INITRD initrd_file
Starting with version 3.71, an initrd can be specified in a