aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-03-26 18:36:50 +0100
committerErwan Velu <erwan.velu@free.fr>2009-03-26 18:36:50 +0100
commit151dd2c8122bc2cf6abfb67330cba9356d46e0c9 (patch)
tree99470d46443a2b600aeb1c6bc338243bbc7cd99f
parent9169a71155fc18d78bd90b364a29e2c88f0e29b6 (diff)
parentff6af96bc7c8c3575b0b554ec98c8ede1263e5ab (diff)
downloadsyslinux.git-151dd2c8122bc2cf6abfb67330cba9356d46e0c9.tar.gz
syslinux.git-151dd2c8122bc2cf6abfb67330cba9356d46e0c9.tar.xz
syslinux.git-151dd2c8122bc2cf6abfb67330cba9356d46e0c9.zip
Merge commit 'origin/repair'
-rw-r--r--NEWS1
-rw-r--r--com32/lib/sys/ansicon_write.c12
-rw-r--r--com32/lib/sys/vesacon_write.c18
-rw-r--r--core/extlinux.asm2
-rw-r--r--core/getc.inc29
-rw-r--r--core/isolinux.asm2
-rw-r--r--core/ldlinux.asm2
-rw-r--r--core/pxelinux.asm2
-rw-r--r--memdisk/Makefile14
-rw-r--r--memdisk/memdisk.inc (renamed from memdisk/memdisk.asm)52
-rw-r--r--memdisk/memdisk_chs.asm2
-rw-r--r--memdisk/memdisk_edd.asm2
-rwxr-xr-xmemdisk/postprocess.pl6
-rw-r--r--memdisk/setup.c39
14 files changed, 95 insertions, 88 deletions
diff --git a/NEWS b/NEWS
index e9bde135..81bc5139 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Changes in 3.74:
* SYSLINUX: fix the handling of .bss files on FAT12/16.
* Suppress the Loading ... message if "quiet" is specified on
the kernel command line.
+ * Fix the use of "CONSOLE 0" with menu.c32.
Changes in 3.73:
* Upgrade gPXE to release version 0.9.5.
diff --git a/com32/lib/sys/ansicon_write.c b/com32/lib/sys/ansicon_write.c
index 711f8b5a..01d69da1 100644
--- a/com32/lib/sys/ansicon_write.c
+++ b/com32/lib/sys/ansicon_write.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
+ * Copyright 2004-2009 H. Peter Anvin - All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -38,6 +38,7 @@
#include <minmax.h>
#include <colortbl.h>
#include <klibc/compiler.h>
+#include <syslinux/config.h>
#include "file.h"
#include "ansi.h"
@@ -83,11 +84,10 @@ int __ansicon_open(struct file_info *fp)
if (!ansicon_counter) {
/* Are we disabled? */
- ireg.eax.w[0] = 0x000b;
- __intcall(0x22, &ireg, &oreg);
-
- if ( (signed char)oreg.ebx.b[1] < 0 ) {
+ if (syslinux_serial_console_info()->flowctl & 0x8000) {
ti.disabled = 1;
+ ti.rows = 25;
+ ti.cols = 80;
} else {
/* Force text mode */
ireg.eax.w[0] = 0x0005;
@@ -228,7 +228,7 @@ ssize_t __ansicon_write(struct file_info *fp, const void *buf, size_t count)
(void)fp;
if ( ti.disabled )
- return n; /* Nothing to do */
+ return count; /* Nothing to do */
while ( count-- ) {
__ansi_putchar(&ti, *bufp++);
diff --git a/com32/lib/sys/vesacon_write.c b/com32/lib/sys/vesacon_write.c
index fda967c0..48c1ed44 100644
--- a/com32/lib/sys/vesacon_write.c
+++ b/com32/lib/sys/vesacon_write.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
+ * Copyright 2004-2009 H. Peter Anvin - All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -39,6 +39,7 @@
#include <colortbl.h>
#include <console.h>
#include <klibc/compiler.h>
+#include <syslinux/config.h>
#include "ansi.h"
#include "file.h"
#include "vesa/video.h"
@@ -66,24 +67,21 @@ static struct term_info ti =
.op = &op
};
-/* Reference counter to the screen, to keep track of if we need reinitialization. */
+/* Reference counter to the screen, to keep track of if we need
+ reinitialization. */
static int vesacon_counter = 0;
/* Common setup */
int __vesacon_open(struct file_info *fp)
{
- static com32sys_t ireg; /* Auto-initalized to all zero */
- com32sys_t oreg;
-
(void)fp;
if (!vesacon_counter) {
/* Are we disabled? */
- ireg.eax.w[0] = 0x000b;
- __intcall(0x22, &ireg, &oreg);
-
- if ( (signed char)oreg.ebx.b[1] < 0 ) {
+ if (syslinux_serial_console_info()->flowctl & 0x8000) {
ti.disabled = 1;
+ ti.rows = 25;
+ ti.cols = 80;
} else {
/* Switch mode */
if (__vesacon_init()) {
@@ -147,7 +145,7 @@ ssize_t __vesacon_write(struct file_info *fp, const void *buf, size_t count)
(void)fp;
if ( ti.disabled )
- return n; /* Nothing to do */
+ return count; /* Nothing to do */
/* This only updates the shadow text buffer... */
while ( count-- ) {
diff --git a/core/extlinux.asm b/core/extlinux.asm
index 9684c8a9..5c6c023c 100644
--- a/core/extlinux.asm
+++ b/core/extlinux.asm
@@ -1553,7 +1553,7 @@ build_curdir_str:
section .data
copyright_str db ' Copyright (C) 1994-'
asciidec YEAR
- db ' H. Peter Anvin', CR, LF, 0
+ db ' H. Peter Anvin and contributors', CR, LF, 0
err_bootfailed db CR, LF, 'Boot failed: please change disks and press '
db 'a key to continue.', CR, LF, 0
config_name db 'extlinux.conf',0 ; Unmangled form
diff --git a/core/getc.inc b/core/getc.inc
index 4c273a2b..3fb88566 100644
--- a/core/getc.inc
+++ b/core/getc.inc
@@ -242,21 +242,6 @@ getint:
.loaded: mov byte [di],0
mov si,NumBuf
; Fall through to parseint
-
-;
-; parseint_esdi:
-; Same as parseint, but takes the input in ES:DI
-;
-parseint_esdi:
- push ds
- push es
- pop ds
- xchg si,di
- call parseint
- xchg si,di
- pop ds
- ret
-
;
; parseint: Convert an integer to a number in EBX
; Get characters from string in DS:SI
@@ -413,3 +398,17 @@ getline:
stosb
.xret: popf
ret
+
+;
+; parseint_esdi:
+; Same as parseint, but takes the input in ES:DI
+;
+parseint_esdi:
+ push ds
+ push es
+ pop ds
+ xchg si,di
+ call parseint
+ xchg si,di
+ pop ds
+ ret
diff --git a/core/isolinux.asm b/core/isolinux.asm
index 51d3bcd3..2da96d4a 100644
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -1029,7 +1029,7 @@ writestr_early equ writestr
syslinux_banner db CR, LF, 'ISOLINUX ', VERSION_STR, ' ', DATE_STR, ' ', 0
copyright_str db ' Copyright (C) 1994-'
asciidec YEAR
- db ' H. Peter Anvin', CR, LF, 0
+ db ' H. Peter Anvin and contributors', CR, LF, 0
isolinux_str db 'isolinux: ', 0
%ifdef DEBUG_MESSAGES
startup_msg: db 'Starting up, DL = ', 0
diff --git a/core/ldlinux.asm b/core/ldlinux.asm
index 2219d5f3..b05a7e1c 100644
--- a/core/ldlinux.asm
+++ b/core/ldlinux.asm
@@ -2056,7 +2056,7 @@ getfatsector:
section .data
copyright_str db ' Copyright (C) 1994-'
asciidec YEAR
- db ' H. Peter Anvin', CR, LF, 0
+ db ' H. Peter Anvin and contributors', CR, LF, 0
err_bootfailed db CR, LF, 'Boot failed: please change disks and press '
db 'a key to continue.', CR, LF, 0
syslinux_cfg1 db '/boot' ; /boot/syslinux/syslinux.cfg
diff --git a/core/pxelinux.asm b/core/pxelinux.asm
index 7c535af3..6a38e5fe 100644
--- a/core/pxelinux.asm
+++ b/core/pxelinux.asm
@@ -2657,7 +2657,7 @@ writestr_early equ writestr
copyright_str db ' Copyright (C) 1994-'
asciidec YEAR
- db ' H. Peter Anvin', CR, LF, 0
+ db ' H. Peter Anvin and contributors', CR, LF, 0
err_bootfailed db CR, LF, 'Boot failed: press a key to retry, or wait for reset...', CR, LF, 0
bailmsg equ err_bootfailed
err_nopxe db "No !PXE or PXENV+ API found; we're dead...", CR, LF, 0
diff --git a/memdisk/Makefile b/memdisk/Makefile
index 93575c30..d9c16206 100644
--- a/memdisk/Makefile
+++ b/memdisk/Makefile
@@ -20,7 +20,7 @@ LDFLAGS = $(GCCOPT) -g
INCLUDE = -I$(topdir)/com32/include
NASM = nasm
NASMOPT = -O9999
-NFLAGS = -dDATE='"$(DATE)"' -dWITH_EDD
+NFLAGS = -dDATE='"$(DATE)"'
NINCLUDE =
SRCS = $(wildcard *.asm *.c *.h)
@@ -38,11 +38,11 @@ endif
# Important: init.o16 must be first!!
OBJS16 = init.o16 init32.o
OBJS32 = start32.o setup.o msetup.o e820func.o conio.o memcpy.o memset.o \
- unzip.o memdisk.o
+ unzip.o memdisk_chs.o memdisk_edd.o
CSRC = setup.c msetup.c e820func.c conio.c unzip.c
SSRC = start32.S memcpy.S memset.S
-NASMSRC = memdisk.asm memdisk16.asm
+NASMSRC = memdisk_chs.asm memdisk_edd.asm memdisk16.asm
all: memdisk # e820test
@@ -56,7 +56,7 @@ clean: tidy
spotless: clean
rm -f memdisk .depend
-%.o: %.asm
+memdisk16.o: memdisk16.asm
$(NASM) $(NASMOPT) $(NFLAGS) $(NINCLUDE) -f elf -l $*.lst -o $@ $<
%.o: %.s
@@ -92,6 +92,9 @@ spotless: clean
%.bin: %.asm
$(NASM) -f bin $(NASMOPT) $(NFLAGS) $(NINCLUDE) -o $@ -l $*.lst $<
+memdisk_%.o: memdisk_%.bin
+ $(LD) -r -b binary -o $@ $<
+
memdisk16.elf: $(OBJS16)
$(LD) -Ttext 0 -o $@ $^
@@ -107,9 +110,6 @@ memdisk: memdisk16.bin memdisk32.bin postprocess.pl
e820test: e820test.c e820func.c msetup.c
$(CC) -m32 -g -W -Wall -DTEST -o $@ $^
-memdisk.o: memdisk.bin
- $(LD) -r -b binary -o $@ $<
-
.depend:
rm -f .depend
for csrc in *.c ; do $(CC) $(INCLUDE) $(CFLAGS) -MM $$csrc >> .depend ; done ; true
diff --git a/memdisk/memdisk.asm b/memdisk/memdisk.inc
index 0d489614..0df6c770 100644
--- a/memdisk/memdisk.asm
+++ b/memdisk/memdisk.inc
@@ -1,12 +1,12 @@
; -*- fundamental -*- (asm-mode sucks)
; ****************************************************************************
;
-; memdisk.asm
+; memdisk.inc
;
; A program to emulate an INT 13h disk BIOS from a "disk" in extended
; memory.
;
-; Copyright 2001-2008 H. Peter Anvin - All Rights Reserved
+; Copyright 2001-2009 H. Peter Anvin - All Rights Reserved
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
@@ -22,12 +22,6 @@
; %define DEBUG_TRACERS ; Uncomment to get debugging tracers
-%ifdef WITH_EDD
-%define EDD 1
-%else
-%define EDD 0
-%endif
-
%ifdef DEBUG_TRACERS
%macro TRACER 1
@@ -42,6 +36,7 @@
%endif ; DEBUG_TRACERS
+; Flags we test our configuration against
%define CONFIG_READONLY 0x01
%define CONFIG_RAW 0x02
%define CONFIG_SAFEINT 0x04
@@ -110,6 +105,8 @@ Int13Start:
xor dl,[cs:DriveNo]
pop dx
js .nomatch ; If SF=0, we have a class match here
+ ; 0x00 the sign bit for FD
+ ; 0x80 the sign bit for HD
jz .our_drive ; If ZF=1, we have an exact match
cmp dl,[cs:DriveNo]
jb .nomatch ; Drive < Our drive
@@ -121,13 +118,13 @@ Int13Start:
pushf
push bp
mov bp,sp
- cmp byte [cs:SavedAX+1],08h
+ cmp byte [cs:SavedAX+1],08h ; Get drive params function?
je .norestoredl
- cmp byte [cs:SavedAX+1],15h
+ cmp byte [cs:SavedAX+1],15h ; Get disk type function?
jne .restoredl
test byte [bp+4],80h ; Hard disk?
jnz .norestoredl
-.restoredl:
+.restoredl: ; DL should have number of drives
mov dl,[bp+4]
.norestoredl:
push ax
@@ -135,7 +132,7 @@ Int13Start:
push ds
mov ax,[bp+2] ; Flags
lds ebx,[cs:Stack]
- mov [bx+4],al ; Arithmetric flags
+ mov [bx+4],al ; Arithmetic flags
pop ds
pop ebx
pop ax
@@ -154,7 +151,7 @@ Int13Start:
mov bp,sp ; Point BP to the entry stack frame
TRACER 'F'
; Note: AH == P_AH here
- cmp ah,[Int13MaxFunc]
+ cmp ah,[Int13FuncsCnt-1]
ja Invalid_jump
xor al,al ; AL = 0 is standard entry condition
mov di,ax
@@ -172,7 +169,7 @@ DoneWeird:
and ah,ah
lds ebx,[Stack]
- ; This sets the low byte (the arithmetric flags) of the
+ ; This sets the low byte (the arithmetic flags) of the
; FLAGS on stack to either 00h (no flags) or 01h (CF)
; depending on if AH was zero or not.
setnz [bx+4] ; Set CF iff error
@@ -187,7 +184,8 @@ Reset:
TRACER 'R'
xor ax,ax ; Bottom of memory
mov es,ax
- test dl,dl ; Always pass it on if we are resetting HD
+ test dl,dl ; Always pass it on if we are
+ ; resetting HD
js .hard_disk ; Bit 7 set
; Some BIOSes get very unhappy if we pass a reset floppy
; command to them and don't actually have any floppies.
@@ -200,7 +198,8 @@ Reset:
jmp .pass_on ; ... otherwise pass it to the BIOS
.hard_disk:
; ... same thing for hard disks, sigh ...
- cmp byte [es:0x475],1 ; BIOS variable for number of hard disks
+ cmp byte [es:0x475],1 ; BIOS variable for number of hard
+ ; disks
jbe success
.pass_on:
@@ -360,7 +359,7 @@ EDDWrite:
TRACER 'w'
call edd_setup_regs
- xchg esi,edi
+ xchg esi,edi ; Opposite direction of a Read!
call bcopy
xor ax,ax
ret
@@ -403,7 +402,8 @@ EDDGetParms:
ret
%endif ; EDD
- ; Set up registers as for a "Read", and compares against disk size.
+ ; Set up registers as for a "Read", and compares against disk
+ ; size.
; WARNING: This fails immediately, even if we can transfer some
; sectors. This isn't really the correct behaviour.
setup_regs:
@@ -595,21 +595,22 @@ Int15Start:
oldint15: pop bp
jmp far [cs:OldInt15]
-int15_e801:
+int15_e801: ; Get mem size for > 64 MB config
mov ax,[cs:Mem1MB]
mov cx,ax
mov bx,[cs:Mem16MB]
mov dx,bx
jmp short int15_success
-int15_e881:
+int15_e881: ; Get mem size for > 64 MB config
+ ; 32-bit code
mov eax,[cs:Mem1MB]
mov ecx,eax
mov ebx,[cs:Mem16MB]
mov edx,ebx
jmp short int15_success
-int15_88:
+int15_88: ; Get extended mem size
mov ax,[cs:MemInt1588]
jmp short int15_success
@@ -811,7 +812,8 @@ Int13Funcs dw Reset ; 00h - RESET
dw Invalid ; 06h - FORMAT TRACK AND SET BAD FLAGS
dw Invalid ; 07h - FORMAT DRIVE AT TRACK
dw GetParms ; 08h - GET PARAMETERS
- dw InitWithParms ; 09h - INITIALIZE CONTROLLER WITH DRIVE PARAMETERS
+ dw InitWithParms ; 09h - INITIALIZE CONTROLLER WITH
+ ; DRIVE PARAMETERS
dw Invalid ; 0Ah
dw Invalid ; 0Bh
dw Seek ; 0Ch - SEEK TO CYLINDER
@@ -884,7 +886,7 @@ Int13FuncsCnt equ (Int13FuncsEnd-Int13Funcs) >> 1
alignb 8, db 0
-Shaker dw ShakerEnd-$
+Shaker dw ShakerEnd-$-1 ; Descriptor table limit
dd 0 ; Pointer to self
dw 0
@@ -935,10 +937,6 @@ DPT_ptr dw 0 ; If nonzero, pointer to DPT
MDI_Len equ $-MemDisk_Info
; ---- MDI structure ends here ---
-Int13MaxFunc db Int13FuncsCnt-1 ; Max INT 13h function (to disable EDD)
- db 0 ; pad
-
- dw 0 ; pad
MemInt1588 dw 0 ; 1MB-65MB memory amount (1K)
Cylinders dw 0 ; Cylinder count
diff --git a/memdisk/memdisk_chs.asm b/memdisk/memdisk_chs.asm
new file mode 100644
index 00000000..4b06a856
--- /dev/null
+++ b/memdisk/memdisk_chs.asm
@@ -0,0 +1,2 @@
+%define EDD 0
+%include "memdisk.inc"
diff --git a/memdisk/memdisk_edd.asm b/memdisk/memdisk_edd.asm
new file mode 100644
index 00000000..d2e7b1cf
--- /dev/null
+++ b/memdisk/memdisk_edd.asm
@@ -0,0 +1,2 @@
+%define EDD 1
+%include "memdisk.inc"
diff --git a/memdisk/postprocess.pl b/memdisk/postprocess.pl
index f8cba963..fcda4782 100755
--- a/memdisk/postprocess.pl
+++ b/memdisk/postprocess.pl
@@ -12,8 +12,10 @@
## -----------------------------------------------------------------------
#
-# Postprocess the memdisk binary.
-#
+# Postprocess the memdisk binary. Used during the 'make' process.
+# We write memdisk16.bin out to the final memdisk kernel, pad it to an
+# integral 512-byte sector length, write this number of sectors into the
+# kernel header field "setup_sects", then append memdisk32.bin
eval { use bytes; };
diff --git a/memdisk/setup.c b/memdisk/setup.c
index db644ae2..1939a691 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -20,10 +20,14 @@
const char memdisk_version[] =
"MEMDISK " VERSION_STR " " DATE;
const char copyright[] =
-"Copyright " FIRSTYEAR "-" YEAR_STR " H. Peter Anvin";
+"Copyright " FIRSTYEAR "-" YEAR_STR " H. Peter Anvin and contributors";
-extern const char _binary_memdisk_bin_start[], _binary_memdisk_bin_end[];
-extern const char _binary_memdisk_bin_size[]; /* Weird, I know */
+extern const char _binary_memdisk_chs_bin_start[];
+extern const char _binary_memdisk_chs_bin_end[];
+extern const char _binary_memdisk_chs_bin_size[];
+extern const char _binary_memdisk_edd_bin_start[];
+extern const char _binary_memdisk_edd_bin_end[];
+extern const char _binary_memdisk_edd_bin_size[];
struct memdisk_header {
uint16_t int13_offs;
@@ -92,11 +96,6 @@ struct patch_area {
uint16_t dpt_ptr;
/* End of the official MemDisk_Info */
- uint8_t maxint13func;
-#define MAXINT13_NOEDD 0x16
- uint8_t _pad2;
-
- uint16_t _pad3;
uint16_t memint1588;
uint16_t cylinders;
@@ -672,7 +671,8 @@ void *sys_bounce;
__cdecl void setup(__cdecl syscall_t cs_syscall, void *cs_bounce)
{
- unsigned int bin_size = (int) &_binary_memdisk_bin_size;
+ unsigned int bin_size;
+ char *memdisk_hook;
struct memdisk_header *hptr;
struct patch_area *pptr;
uint16_t driverseg;
@@ -684,7 +684,7 @@ __cdecl void setup(__cdecl syscall_t cs_syscall, void *cs_bounce)
com32sys_t regs;
uint32_t ramdisk_image, ramdisk_size;
int bios_drives;
- int do_edd = -1; /* -1 = default, 0 = no, 1 = yes */
+ int do_edd = 1; /* 0 = no, 1 = yes, default is yes */
int no_bpt; /* No valid BPT presented */
/* Set up global variables */
@@ -723,13 +723,22 @@ __cdecl void setup(__cdecl syscall_t cs_syscall, void *cs_bounce)
else
do_edd = (geometry->driveno & 0x80) ? 1 : 0;
+ /* Choose the appropriate installable memdisk hook */
+ if (do_edd) {
+ bin_size = (int) &_binary_memdisk_edd_bin_size;
+ memdisk_hook = (char *) &_binary_memdisk_edd_bin_start;
+ } else {
+ bin_size = (int) &_binary_memdisk_chs_bin_size;
+ memdisk_hook = (char *) &_binary_memdisk_chs_bin_start;
+ }
+
/* Reserve the ramdisk memory */
insertrange(ramdisk_image, ramdisk_size, 2, 1);
parse_mem(); /* Recompute variables */
/* Figure out where it needs to go */
- hptr = (struct memdisk_header *) &_binary_memdisk_bin_start;
- pptr = (struct patch_area *)(_binary_memdisk_bin_start + hptr->patch_offs);
+ hptr = (struct memdisk_header *) memdisk_hook;
+ pptr = (struct patch_area *)(memdisk_hook + hptr->patch_offs);
dosmem_k = rdz_16(BIOS_BASEMEM);
pptr->olddosmem = dosmem_k;
@@ -800,10 +809,6 @@ __cdecl void setup(__cdecl syscall_t cs_syscall, void *cs_bounce)
}
puts(" access to high memory\n");
- /* pptr->maxint13func defaults to EDD enabled, if compiled in */
- if (!do_edd)
- pptr->maxint13func = MAXINT13_NOEDD;
-
/* Set up a drive parameter table */
if ( geometry->driveno & 0x80 ) {
/* Hard disk */
@@ -972,7 +977,7 @@ __cdecl void setup(__cdecl syscall_t cs_syscall, void *cs_bounce)
hptr = (struct memdisk_header *)dpp;
/* Actually copy to low memory */
- dpp = mempcpy(dpp, &_binary_memdisk_bin_start, bin_size);
+ dpp = mempcpy(dpp, memdisk_hook, bin_size);
dpp = mempcpy(dpp, ranges, (nranges+1)*sizeof(ranges[0]));
dpp = mempcpy(dpp, shdr->cmdline, cmdlinelen+1);
}