summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2011-03-16 20:01:36 -0400
committerGene Cumm <gene.cumm@gmail.com>2011-03-16 20:01:36 -0400
commit92dd6530682617f9b02e7564548c637f5e9e049e (patch)
tree4f18dd0b4d8242fcdd04ed15eb73da85a9978932
parenta472e4b4f1bd14781c5ae012eedf9f189668945e (diff)
parent372dfd113cb87e4b3f983db620ca5a55ab821036 (diff)
downloadsyslinux-92dd6530682617f9b02e7564548c637f5e9e049e.tar.gz
Merge branch 'master' into diag-mbr-handoff-for-hpa
Conflicts: diag/mbr/handoff.S diag/mbr/handoff.S: Remove the attempt to zero pad/prevent overflow
-rw-r--r--Makefile6
-rw-r--r--NEWS14
-rw-r--r--README2
-rw-r--r--com32/cmenu/adv_menu.tpl2
-rw-r--r--com32/cmenu/libmenu/help.c7
-rw-r--r--com32/hdt/hdt-cli-kernel.c4
-rw-r--r--com32/hdt/hdt-menu-summary.c2
-rw-r--r--com32/lib/jpeg/tinyjpeg.c7
-rw-r--r--com32/lib/sys/rawcon_read.c3
-rw-r--r--com32/lib/syslinux/shuffle.c12
-rw-r--r--com32/lib/vsscanf.c7
-rw-r--r--com32/lua/src/syslinux.c13
-rw-r--r--com32/lua/src/vesa.c5
-rw-r--r--com32/modules/chain.c9
-rw-r--r--com32/rosh/rosh.c7
-rw-r--r--com32/rosh/rosh.h1
-rw-r--r--com32/tools/relocs.c2
-rw-r--r--core/fs/fat/fat.c6
-rw-r--r--core/fs/iso9660/iso9660.c3
-rw-r--r--core/fs/pxe/pxe.c1
-rw-r--r--diag/Makefile2
-rw-r--r--diag/geodsp/Makefile63
-rw-r--r--diag/geodsp/README5
-rw-r--r--diag/geodsp/geodsp1s.asm269
-rw-r--r--diag/geodsp/geodsplib.inc100
-rw-r--r--diag/geodsp/geodspms.asm196
-rw-r--r--diag/geodsp/mk-lba-img.c75
-rw-r--r--doc/memdisk.txt6
-rw-r--r--doc/pxelinux.txt14
-rw-r--r--doc/syslinux.txt25
-rw-r--r--dos/dosexe.ld11
-rwxr-xr-xextlinux/main.c4
-rw-r--r--libinstaller/fat.c3
-rw-r--r--memdisk/setup.c8
34 files changed, 809 insertions, 85 deletions
diff --git a/Makefile b/Makefile
index a2c08551..a09448a6 100644
--- a/Makefile
+++ b/Makefile
@@ -39,9 +39,7 @@ MODULES = memdisk/memdisk memdump/memdump.com modules/*.com \
# mingw suite installed
BTARGET = version.gen version.h version.mk
BOBJECTS = $(BTARGET) \
- mbr/mbr.bin mbr/altmbr.bin mbr/gptmbr.bin \
- mbr/mbr_c.bin mbr/altmbr_c.bin mbr/gptmbr_c.bin \
- mbr/mbr_f.bin mbr/altmbr_f.bin mbr/gptmbr_f.bin \
+ mbr/*.bin \
core/pxelinux.0 core/isolinux.bin core/isolinux-debug.bin \
gpxe/gpxelinux.0 dos/syslinux.com \
win32/syslinux.exe win64/syslinux64.exe \
@@ -55,7 +53,7 @@ BOBJECTS = $(BTARGET) \
# files that depend only on the B phase, but may have to be regenerated
# for "make installer".
BSUBDIRS = codepage com32 lzo core memdisk modules mbr memdump gpxe sample \
- libinstaller dos win32 win64 dosutil
+ diag libinstaller dos win32 win64 dosutil
ITARGET =
IOBJECTS = $(ITARGET) \
utils/gethostip utils/isohybrid utils/mkdiskimage \
diff --git a/NEWS b/NEWS
index 0897a649..9d3e4c95 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,20 @@ Changes in 4.04:
* HDT: Release 0.4.1 to support ACPI parsing,
improved mutli-core/cpu reporting
* LUA: Updating to 5.1.4-2
+ * SYSLINUX: core/diskstart.inc: Reset DS after checksum in case
+ it isn't 0 (Gene Cumm).
+ * win64: Script update for additional mingw compiler names
+ (Gene Cumm).
+ * diag: New directory for diagnostic-related tools. Add a
+ handoff MBR/VBR and geometry display images (Gene Cumm).
+ * MEMDISK: use "mem=" parameter to mark available memory above
+ this point as reserved (core already does alignment) (Gene Cumm).
+ * MEMDISK: Additional disk probe checks and debug output
+ (Shao Miller, Gene Cumm).
+ * gpxe: add gpxelinuxk.0, based off of undionly.kpxe + new
+ script (Gene Cumm).
+ * isohybrid: install the isohdpfx*.bin files to make isohybrid
+ images in one step with GNU xorriso.
Changes in 4.03:
* Don't hang if no configuration file is found.
diff --git a/README b/README
index ff905aa8..08a82e42 100644
--- a/README
+++ b/README
@@ -25,7 +25,7 @@ for details.
SYSLINUX is:
- Copyright 1994-2010 H. Peter Anvin et al - All Rights Reserved
+ Copyright 1994-2011 H. Peter Anvin et al - 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
diff --git a/com32/cmenu/adv_menu.tpl b/com32/cmenu/adv_menu.tpl
index 871c7827..e60383f8 100644
--- a/com32/cmenu/adv_menu.tpl
+++ b/com32/cmenu/adv_menu.tpl
@@ -312,7 +312,7 @@ void runcommand(pt_menuitem mi)
x = (pt_xtra) mi->extra_data;
ipappend = (x ? x->ipappend : 0);
- runsyslinuximage(line,x->ipappend);
+ runsyslinuximage(line,ipappend);
free(line);
}
diff --git a/com32/cmenu/libmenu/help.c b/com32/cmenu/libmenu/help.c
index 0df1e103..ff917d92 100644
--- a/com32/cmenu/libmenu/help.c
+++ b/com32/cmenu/libmenu/help.c
@@ -54,10 +54,9 @@ static int countlines(char *buffer)
static void printtext(char *buf, int from)
{
char *f, *t;
- int right, nlines, i;
+ int nlines, i;
// clear window to print
- right = nc - HELP_RIGHT_MARGIN;
nlines = nr - HELP_BODY_ROW - HELP_BOTTOM_MARGIN - 1;
f = findline(buf, from);
@@ -66,7 +65,8 @@ static void printtext(char *buf, int from)
if (*f == '\n')
f++; // start of from+1st line
t = f;
- while (i < nlines) {
+
+ for (i = 0; i < nlines; i++) {
gotoxy(HELP_BODY_ROW + i, HELP_LEFT_MARGIN);
clear_end_of_line();
putchar(SO);
@@ -83,7 +83,6 @@ static void printtext(char *buf, int from)
}
putchar('\n');
t++;
- i++;
}
}
diff --git a/com32/hdt/hdt-cli-kernel.c b/com32/hdt/hdt-cli-kernel.c
index 89d013b4..0160bed9 100644
--- a/com32/hdt/hdt-cli-kernel.c
+++ b/com32/hdt/hdt-cli-kernel.c
@@ -92,19 +92,15 @@ static void show_kernel_modules(int argc __unused, char **argv __unused,
struct pci_device *pci_device;
char kernel_modules[LINUX_KERNEL_MODULE_SIZE *
MAX_KERNEL_MODULES_PER_PCI_DEVICE];
- bool nopciids = false;
- bool nomodulespcimap = false;
char modules[MAX_PCI_CLASSES][256] = {{0}};
char category_name[MAX_PCI_CLASSES][256] = {{0}};
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
- nopciids = true;
more_printf(" Missing pci.ids, we can't compute the list\n");
return;
}
if (hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) {
- nomodulespcimap = true;
more_printf(" Missing modules.pcimap, we can't compute the list\n");
return;
}
diff --git a/com32/hdt/hdt-menu-summary.c b/com32/hdt/hdt-menu-summary.c
index b9395559..ad87c299 100644
--- a/com32/hdt/hdt-menu-summary.c
+++ b/com32/hdt/hdt-menu-summary.c
@@ -158,7 +158,6 @@ void compute_summarymenu(struct s_my_menu *menu, struct s_hardware *hardware)
if (hardware->modules_pcimap_return_code != -ENOMODULESPCIMAP) {
add_item("", "", OPT_SEP, "", 0);
- bool kmod = false;
struct pci_device *pci_device;
char kernel_modules[LINUX_KERNEL_MODULE_SIZE *
MAX_KERNEL_MODULES_PER_PCI_DEVICE];
@@ -191,7 +190,6 @@ void compute_summarymenu(struct s_my_menu *menu, struct s_hardware *hardware)
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu->items_count++;
- kmod = true;
}
}
}
diff --git a/com32/lib/jpeg/tinyjpeg.c b/com32/lib/jpeg/tinyjpeg.c
index 3c6070f4..2927b718 100644
--- a/com32/lib/jpeg/tinyjpeg.c
+++ b/com32/lib/jpeg/tinyjpeg.c
@@ -332,7 +332,6 @@ static void build_huffman_table(const unsigned char *bits, const unsigned char *
unsigned int i, j, code, code_size, val, nbits;
unsigned char huffsize[HUFFMAN_BITS_SIZE+1], *hz;
unsigned int huffcode[HUFFMAN_BITS_SIZE+1], *hc;
- int next_free_entry;
/*
* Build a temp array
@@ -371,7 +370,6 @@ static void build_huffman_table(const unsigned char *bits, const unsigned char *
/*
* Build the lookup table, and the slowtable if needed.
*/
- next_free_entry = -1;
for (i=0; huffsize[i]; i++)
{
val = vals[i];
@@ -442,8 +440,8 @@ static void build_default_huffman_tables(struct jdec_private *priv)
static void print_SOF(const unsigned char *stream)
{
- int width, height, nr_components, precision;
#if DEBUG
+ int width, height, nr_components, precision;
const char *nr_components_to_string[] = {
"????",
"Grayscale",
@@ -451,7 +449,6 @@ static void print_SOF(const unsigned char *stream)
"YCbCr",
"CYMK"
};
-#endif
precision = stream[2];
height = be16_to_cpu(stream+3);
@@ -463,6 +460,8 @@ static void print_SOF(const unsigned char *stream)
width, height,
nr_components, nr_components_to_string[nr_components],
precision);
+#endif
+ (void)stream;
}
/*******************************************************************************
diff --git a/com32/lib/sys/rawcon_read.c b/com32/lib/sys/rawcon_read.c
index 92c9b294..f7e89c7a 100644
--- a/com32/lib/sys/rawcon_read.c
+++ b/com32/lib/sys/rawcon_read.c
@@ -45,14 +45,11 @@ ssize_t __rawcon_read(struct file_info *fp, void *buf, size_t count)
com32sys_t ireg, oreg;
char *bufp = buf;
size_t n = 0;
- clock_t start;
(void)fp;
memset(&ireg, 0, sizeof ireg);
- start = times(NULL);
-
while (n < count) {
/* Poll */
ireg.eax.b[1] = 0x0B;
diff --git a/com32/lib/syslinux/shuffle.c b/com32/lib/syslinux/shuffle.c
index 6b5a601f..54a7e651 100644
--- a/com32/lib/syslinux/shuffle.c
+++ b/com32/lib/syslinux/shuffle.c
@@ -93,7 +93,7 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist,
int np;
int desc_blocks, need_blocks;
int need_ptrs;
- addr_t desczone, descfree, descaddr, descoffs;
+ addr_t desczone, descfree, descaddr;
int nmoves, nzero;
com32sys_t ireg;
@@ -182,11 +182,13 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist,
if (!dbuf)
goto bail;
- descoffs = descaddr - (addr_t) dbuf;
-
#if DEBUG
- dprintf("nmoves = %d, nzero = %d, dbuf = %p, offs = 0x%08x\n",
- nmoves, nzero, dbuf, descoffs);
+ {
+ addr_t descoffs = descaddr - (addr_t) dbuf;
+
+ dprintf("nmoves = %d, nzero = %d, dbuf = %p, offs = 0x%08x\n",
+ nmoves, nzero, dbuf, descoffs);
+ }
#endif
/* Copy the move sequence into the descriptor buffer */
diff --git a/com32/lib/vsscanf.c b/com32/lib/vsscanf.c
index 9a462c6a..751f22a7 100644
--- a/com32/lib/vsscanf.c
+++ b/com32/lib/vsscanf.c
@@ -69,7 +69,6 @@ int vsscanf(const char *buffer, const char *format, va_list ap)
} state = st_normal;
char *sarg = NULL; /* %s %c or %[ string argument */
enum bail bail = bail_none;
- int sign;
int converted = 0; /* Successful conversions */
unsigned long matchmap[((1 << CHAR_BIT) + (LONG_BIT - 1)) / LONG_BIT];
int matchinv = 0; /* Is match map inverted? */
@@ -176,33 +175,27 @@ int vsscanf(const char *buffer, const char *format, va_list ap)
#endif
rank = rank_ptr;
base = 0;
- sign = 0;
goto scan_int;
case 'i': /* Base-independent integer */
base = 0;
- sign = 1;
goto scan_int;
case 'd': /* Decimal integer */
base = 10;
- sign = 1;
goto scan_int;
case 'o': /* Octal integer */
base = 8;
- sign = 0;
goto scan_int;
case 'u': /* Unsigned decimal integer */
base = 10;
- sign = 0;
goto scan_int;
case 'x': /* Hexadecimal integer */
case 'X':
base = 16;
- sign = 0;
goto scan_int;
case 'n': /* Number of characters consumed */
diff --git a/com32/lua/src/syslinux.c b/com32/lua/src/syslinux.c
index f47f888c..9b207db7 100644
--- a/com32/lua/src/syslinux.c
+++ b/com32/lua/src/syslinux.c
@@ -190,6 +190,9 @@ static int sl_boot_linux(lua_State * L)
int ret;
char **argv, **argp, *arg, *p;
+ (void)mem_limit;
+ (void)video_mode;
+
ret = __parse_argv(&argv, cmdline);
newcmdline = malloc(strlen(kernel) + 12);
@@ -397,14 +400,12 @@ static int sl_boot_it(lua_State * L)
const char *cmdline = luaL_optstring(L, 3, "");
uint32_t mem_limit = luaL_optint(L, 4, 0);
uint16_t video_mode = luaL_optint(L, 5, 0);
- int ret;
/* Preventing gcc to complain about unused variables */
- video_mode=video_mode;
- mem_limit=mem_limit;
+ (void)video_mode;
+ (void)mem_limit;
- ret = syslinux_boot_linux(kernel->data, kernel->size, initramfs, (char *)cmdline);
-
- return 0;
+ return syslinux_boot_linux(kernel->data, kernel->size,
+ initramfs, (char *)cmdline);
}
static int sl_derivative(lua_State * L)
diff --git a/com32/lua/src/vesa.c b/com32/lua/src/vesa.c
index 75911199..9f281348 100644
--- a/com32/lua/src/vesa.c
+++ b/com32/lua/src/vesa.c
@@ -13,10 +13,9 @@ int vesacon_load_background(const char *filename);
static int vesa_getmodes(lua_State *L)
{
com32sys_t rm;
- uint16_t mode, bestmode, *mode_ptr;
+ uint16_t mode, *mode_ptr;
struct vesa_general_info *gi;
struct vesa_mode_info *mi;
- enum vesa_pixel_format bestpxf;
int nmode = 1;
/* Allocate space in the bounce buffer for these structures */
@@ -47,8 +46,6 @@ static int vesa_getmodes(lua_State *L)
/* Search for a 640x480 mode with a suitable color and memory model... */
mode_ptr = GET_PTR(gi->video_mode_ptr);
- bestmode = 0;
- bestpxf = PXF_NONE;
while ((mode = *mode_ptr++) != 0xFFFF) {
mode &= 0x1FF; /* The rest are attributes of sorts */
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index 89489d18..48f53ffd 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
- * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2011 Intel Corporation; author: H. Peter Anvin
* Significant portions copyright (C) 2010 Shao Miller
* [partition iteration, GPT, "fs"]
*
@@ -988,7 +988,7 @@ static int find_by_guid(const struct guid *gpt_guid,
#if DEBUG
gpt_dump(header);
#endif
- is_me = !memcmp(&header->disk_guid, &gpt_guid, sizeof(*gpt_guid));
+ is_me = !memcmp(&header->disk_guid, gpt_guid, sizeof(*gpt_guid));
free(header);
if (!is_me) {
/* Check for a matching partition */
@@ -1387,6 +1387,8 @@ int main(int argc, char *argv[])
|| !strncmp(argv[i], "mbr=", 4)
|| !strncmp(argv[i], "guid:", 5)
|| !strncmp(argv[i], "guid=", 5)
+ || !strncmp(argv[i], "uuid:", 5)
+ || !strncmp(argv[i], "uuid=", 5)
|| !strncmp(argv[i], "label:", 6)
|| !strncmp(argv[i], "label=", 6)
|| !strcmp(argv[i], "boot")
@@ -1425,7 +1427,8 @@ int main(int argc, char *argv[])
error("Unable to find requested MBR signature\n");
goto bail;
}
- } else if (!strncmp(drivename, "guid", 4)) {
+ } else if (!strncmp(drivename, "guid", 4) ||
+ !strncmp(drivename, "uuid", 4)) {
if (str_to_guid(drivename + 5, &gpt_guid))
goto bail;
drive = find_by_guid(&gpt_guid, &cur_part);
diff --git a/com32/rosh/rosh.c b/com32/rosh/rosh.c
index 0581087e..68dad3f3 100644
--- a/com32/rosh/rosh.c
+++ b/com32/rosh/rosh.c
@@ -555,7 +555,6 @@ int rosh_ls_de_size(const char *filestr, struct dirent *de)
char filestr2[ROSH_PATH_SZ];
int fd2, file2pos;
struct stat fdstat;
- int status;
filestr2[0] = 0;
file2pos = -1;
@@ -566,7 +565,7 @@ int rosh_ls_de_size(const char *filestr, struct dirent *de)
}
strcpy(filestr2 + file2pos + 1, de->d_name);
fd2 = open(filestr2, O_RDONLY);
- status = fstat(fd2, &fdstat);
+ fstat(fd2, &fdstat);
fd2 = close(fd2);
de_size = (int)fdstat.st_size;
return de_size;
@@ -602,6 +601,7 @@ int rosh_ls_de_size_mode(const char *filestr, struct dirent *de, mode_t * st_mod
errno = 0;
ROSH_DEBUG2("stat(%s) ", filestr2);
status = stat(filestr2, &fdstat);
+ (void)status;
ROSH_DEBUG2("\t--stat()=%d\terr=%d\n", status, errno);
if (errno) {
rosh_error(errno, "ls:szmd.stat", de->d_name);
@@ -987,13 +987,12 @@ void rosh_more_buf(char *buf, int buflen, int rows, int cols, char *scrbuf)
void rosh_more_fd(int fd, int rows, int cols, char *scrbuf)
{
struct stat fdstat;
- int status;
char *buf;
int bufpos;
int numrd;
FILE *f;
- status = fstat(fd, &fdstat);
+ fstat(fd, &fdstat);
if (S_ISREG(fdstat.st_mode)) {
buf = malloc((int)fdstat.st_size);
if (buf != NULL) {
diff --git a/com32/rosh/rosh.h b/com32/rosh/rosh.h
index 87c15b7d..415a9fbc 100644
--- a/com32/rosh/rosh.h
+++ b/com32/rosh/rosh.h
@@ -95,6 +95,7 @@ int stat(const char *pathname, struct stat *buf)
if (fd != -1) {
ROSH_DEBUG2_STAT("(%d)stat:fstat() ", fd);
status = fstat(fd, buf);
+ (void)status;
ROSH_DEBUG2_STAT("stat:close() ");
close(fd);
ret = 0;
diff --git a/com32/tools/relocs.c b/com32/tools/relocs.c
index be57bf7e..24742060 100644
--- a/com32/tools/relocs.c
+++ b/com32/tools/relocs.c
@@ -403,13 +403,11 @@ static void print_absolute_symbols(void)
for (i = 0; i < ehdr.e_shnum; i++) {
struct section *sec = &secs[i];
char *sym_strtab;
- Elf32_Sym *sh_symtab;
int j;
if (sec->shdr.sh_type != SHT_SYMTAB) {
continue;
}
- sh_symtab = sec->symtab;
sym_strtab = sec->link->strtab;
for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Sym); j++) {
Elf32_Sym *sym;
diff --git a/core/fs/fat/fat.c b/core/fs/fat/fat.c
index 5902f481..c896b5e6 100644
--- a/core/fs/fat/fat.c
+++ b/core/fs/fat/fat.c
@@ -592,7 +592,7 @@ static int vfat_readdir(struct file *file, struct dirent *dirent)
char filename[261];
int name_len = 0;
- uint8_t vfat_init, vfat_next, vfat_csum;
+ uint8_t vfat_next, vfat_csum;
uint8_t id;
int entries_left;
bool long_entry = false;
@@ -619,14 +619,12 @@ static int vfat_readdir(struct file *file, struct dirent *dirent)
id = long_de->id;
if (id & 0x40) {
- /* init vfat_csum and vfat_init */
+ /* init vfat_csum */
vfat_csum = long_de->checksum;
id &= 0x3f;
if (id >= 20)
goto invalid; /* Too long! */
- vfat_init = id;
-
/* ZERO the long_name buffer */
memset(long_name, 0, sizeof long_name);
} else {
diff --git a/core/fs/iso9660/iso9660.c b/core/fs/iso9660/iso9660.c
index 46f5f175..5c04528e 100644
--- a/core/fs/iso9660/iso9660.c
+++ b/core/fs/iso9660/iso9660.c
@@ -118,9 +118,10 @@ static bool iso_compare_name(const char *de_name, size_t len,
char iso_file_name[256];
char *p = iso_file_name;
char c1, c2;
- size_t i;
+ int i;
i = iso_convert_name(iso_file_name, de_name, len);
+ (void)i;
dprintf("Compare: \"%s\" to \"%s\" (len %zu)\n",
file_name, iso_file_name, i);
diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index a1e40974..aef2e7e1 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -332,6 +332,7 @@ static void ack_packet(struct inode *inode, uint16_t ack_num)
udp_write.buffer_size = 4;
err = pxe_call(PXENV_UDP_WRITE, &udp_write);
+ (void)err;
#if 0
printf("sent %s\n", err ? "FAILED" : "OK");
#endif
diff --git a/diag/Makefile b/diag/Makefile
index 46044548..969acbb3 100644
--- a/diag/Makefile
+++ b/diag/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS = mbr
+SUBDIRS = mbr geodsp
all tidy dist clean spotless install:
set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
diff --git a/diag/geodsp/Makefile b/diag/geodsp/Makefile
new file mode 100644
index 00000000..4c8eff6f
--- /dev/null
+++ b/diag/geodsp/Makefile
@@ -0,0 +1,63 @@
+## -----------------------------------------------------------------------
+##
+## Copyright 2010-2011 Gene Cumm
+##
+## Portions from core/Makefile:
+## Copyright 1998-2009 H. Peter Anvin - All Rights Reserved
+## Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+##
+## 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
+## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+## Boston MA 02111-1307, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+#
+# Makefile for the SYSLINUX geometry display for diagnostics
+#
+
+topdir = ../..
+# include $(topdir)/MCONFIG.embedded
+coredir = $(topdir)/core
+
+BTARGET = geodsp1s.bin geodspms.bin mk-lba-img \
+ geodsp1s.img.xz geodspms.img.xz
+# lba-1s.img.xz lba-ms.img.xz
+ # lba-1s.img lba-ms.img
+
+NASMOPT = -i $(coredir)/ -Ox -f bin
+NASMOPT += -w+orphan-labels
+
+all: $(BTARGET)
+
+.PRECIOUS: %.img
+# .PRECIOUS: lba-%.img
+
+# Higher compression levels result in larger files
+%.img.xz: %.img
+ xz -k0f $<
+
+%.img.gz: %.img
+ gzip -9c $< > $@
+
+%.img: %.bin lba.img
+ (cp -a lba.img $@ && dd conv=notrunc if=$< of=$@) || rm -f $@
+
+%.bin: %.asm $(coredir)/writehex.inc $(coredir)/macros.inc $(coredir)/diskboot.inc
+ nasm $(NASMOPT) -o $@ -l $(@:.bin=.lst) $<
+
+mk-lba-img: mk-lba-img.c
+ gcc -o $@ $<
+
+lba.img: mk-lba-img
+ ./$< $@
+
+tidy dist:
+ rm -Rf *.img
+
+clean: tidy
+ rm -f $(BTARGET) *.lst *.bin *_bin.c
+
+spotless: clean
diff --git a/diag/geodsp/README b/diag/geodsp/README
new file mode 100644
index 00000000..43a3edc2
--- /dev/null
+++ b/diag/geodsp/README
@@ -0,0 +1,5 @@
+GeoDsp: Images to display the geometry as the BIOS has choosen to interpret it. Both images are intended to be written to the first ~8MiB of a raw device (ie /dev/hda, /dev/sda) and be over one large cylinder of 255*63 512-byte sectors in size.
+
+GeoDsp1S is a one-sector variant containing all code in one sector that is intended to test behavior with a typical MBR/partition table layout. A partition table should be written after writting an image.
+
+GeoDspMS is a multi sector variant intended to look like Syslinux installed on a file system on the raw device (as opposed to a file system within a partition).
diff --git a/diag/geodsp/geodsp1s.asm b/diag/geodsp/geodsp1s.asm
new file mode 100644
index 00000000..4ea84c4a
--- /dev/null
+++ b/diag/geodsp/geodsp1s.asm
@@ -0,0 +1,269 @@
+; -----------------------------------------------------------------------
+;
+; Copyright 2010 Gene Cumm
+;
+; Portions from diskstart.inc:
+; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
+; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+;
+; 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
+; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+; Boston MA 02110-1301, USA; either version 2 of the License, or
+; (at your option) any later version; incorporated herein by reference.
+;
+; -----------------------------------------------------------------------
+
+;
+; geodsp1s.asm
+;
+; Display geometry translation info for diagnosing misconceptions
+; 1 sector variant
+;
+; nasm -Ox -f bin -o geodsp.bin -l geodsp.lst geodsp.asm
+;
+; nasm -Ox -f elf -o geodsp.o -l geodsp.lst geodsp.asm
+; ld -m elf_i386 -T syslinux.ld -M -o geodsp.elf geodsp.o > geodsp.map
+; objcopy -O binary geodsp.elf geodsp.raw
+;
+; # OF=/dev/sdb
+; # dd if=core/geodsp.bin of=$OF
+; # dd skip=1 seek=1 if=../dbg/lba-img/lba-img.bin of=$OF
+; # eject $OF
+; # dd count=$() if=/dev/zero of=$OF
+;
+; # OF=geo-2.255.63.i
+; # (dd if=core/geodsp.bin; dd skip=1 if=../dbg/lba-img/lba-img.bin; dd count=$((2*255*63 - 256*63 - 1)) if=/dev/zero )|dd of=$OF
+; # OF=geo-20.16.63.i
+; # (dd if=core/geodsp.bin; dd skip=1 if=../dbg/lba-img/lba-img.bin; dd count=$((40*16*63 - 256*63 - 1)) if=/dev/zero )|dd of=$OF
+;
+
+%include "macros.inc"
+; %include "layout.inc"
+
+; global STACK_LEN, STACK_TOP, STACK_BASE
+; STACK_LEN equ 4096
+STACK_TOP equ 7c00h
+; STACK_BASE equ STACK_TOP - STACK_LEN
+
+StackBuf equ STACK_TOP-44-92 ; Start the stack here (grow down - 4K)
+DriveNumber equ StackBuf-4 ; Drive number
+m_CHS0 equ 00534843h ;'CHS',0
+m_EDD0 equ 00444445h ;'EDD',0
+m_EDD_SP equ 20444445h ;'EDD '
+retry_count equ 16
+dbuf equ 8000h
+int13_ret equ 7e00h
+
+
+
+; extern real_mode_seg
+; section .real_mode write nobits align=65536
+; global core_real_mode
+; core_real_mode resb 65536
+; extern xfer_buf_seg
+; section .xfer_buf write nobits align=65536
+; global core_xfer_buf
+; core_xfer_buf resb 65536
+
+ section .text
+ org STACK_TOP
+
+
+ global _start
+bootsec equ $
+_start:
+ ; In case we want to pull more of the standard diskstart stuff in
+; jmp short start ; 2 bytes
+; nop ; 1 byte
+start:
+ cli
+ cld
+ xor cx,cx
+ mov ss,cx
+ mov sp,StackBuf-2 ; Just below BSS (-2 for alignment)
+ push dx ; Save drive number (in DL)
+ ; Kill everything else and let the BIOS sort it out later
+ mov es,cx
+ mov ds,cx
+ sti
+
+get_geo: ; DL and ES ready
+ mov ah,08h
+ mov di,0
+ int 13h
+write_geo:
+ jc .bad_geo
+ mov si,s_chs
+ call writestr_early
+ call write_chs
+ call crlf
+ jmp short .done
+.bad_geo:
+.done:
+
+ mov bx,dbuf
+get_h1c: ; 0,1,1
+ mov cx,0001h
+ mov dh,01h
+ call getonesec_chs
+ call write_chs_lba
+get_c1c: ; 1,0,1
+ mov cx,0101h
+ mov dh,00h
+ call getonesec_chs
+ call write_chs_lba
+
+;
+; Do we have EBIOS (EDD)?
+;
+edd:
+.check:
+ mov bx,55AAh
+ mov ah,41h ; EDD existence query
+ mov dl,[DriveNumber]
+ int 13h
+ jc .noedd
+ cmp bx,0AA55h
+ jne .noedd
+ test cl,1 ; Extended disk access functionality set
+ jz .noedd
+ ;
+ ; We have EDD support...
+ ;
+ mov bx,dbuf
+ xor edx,edx
+ mov dword [s_chs],m_EDD_SP
+.get_lba63:
+ mov eax,63 ; Same length as mov al,64; movzx eax,al
+ call getonesec_ebios
+ jc .bad_edd ;read error
+ call write_edd_lba
+.get_lba16065:
+ mov eax,16065
+ call getonesec_ebios
+ jc .bad_edd ;read error
+ call write_edd_lba
+.good_edd:
+ mov dword [s_type],m_EDD0
+.bad_edd:
+.noedd:
+.end:
+
+write_final_type:
+ mov si,s_typespec
+ call writestr_early
+
+ jmp short kaboom
+
+;
+; getonesec_ebios:
+;
+; getonesec implementation for EBIOS (EDD)
+;
+getonesec_ebios:
+ mov cx,retry_count
+.retry:
+ ; Form DAPA on stack
+ push edx
+ push eax
+ push es
+ push bx
+ push word 1
+ push word 16
+ mov si,sp
+ pushad
+ mov ah,42h ; Extended Read
+ call xint13
+ popad
+ lea sp,[si+16] ; Remove DAPA
+ jc .error
+ ret
+
+.error:
+ ; Some systems seem to get "stuck" in an error state when
+ ; using EBIOS. Doesn't happen when using CBIOS, which is
+ ; good, since some other systems get timeout failures
+ ; waiting for the floppy disk to spin up.
+
+ pushad ; Try resetting the device
+ xor ax,ax
+ call xint13
+ popad
+ loop .retry ; CX-- and jump if not zero
+
+ ; Total failure.
+ stc
+ ret
+
+;
+; getonesec_chs:
+;
+; CX,DH specifies CHS address
+;
+getonesec_chs: ; We could use an xchg and get a loop
+; mov cx,retry_count
+.retry:
+ pushad
+ mov ax,0201h ; Read one sector
+ call xint13
+ popad
+ jc .error
+ ret
+
+.error:
+; loop .retry
+ ; Fall through to disk_error
+;
+; kaboom: write a message and bail out.
+;
+ global kaboom
+disk_error:
+kaboom:
+.patch:
+ mov si,bailmsg
+ call writestr_early
+ xor eax,eax
+.again: int 16h ; Wait for keypress
+ ; NB: replaced by int 18h if
+ ; chosen at install time..
+ int 19h ; And try once more to boot...
+.norge: hlt ; If int 19h returned; this is the end
+ jmp short .norge
+
+;
+; INT 13h wrapper function
+;
+xint13:
+ mov dl,[DriveNumber]
+ int 13h
+ mov [int13_ret],ax
+ ret
+
+;
+;
+; writestr_early: write a null-terminated string to the console
+; This assumes we're on page 0. This is only used for early
+; messages, so it should be OK.
+;
+writestr_early:
+ pushad
+.loop: lodsb
+ and al,al
+ jz .return
+ call writechr
+ jmp short .loop
+.return: popad
+ ret
+
+%include "geodsplib.inc"
+bailmsg equ s_end
+
+ ; This fails if the boot sector overflowsg
+ zb 1BEh-($-$$)
+
+ptable zb 40h ; Partition table
+
+bootsignature dw 0xAA55
+
+sector_2:
diff --git a/diag/geodsp/geodsplib.inc b/diag/geodsp/geodsplib.inc
new file mode 100644
index 00000000..5d6f7051
--- /dev/null
+++ b/diag/geodsp/geodsplib.inc
@@ -0,0 +1,100 @@
+; -----------------------------------------------------------------------
+;
+; Copyright 2010 Gene Cumm
+;
+; Portions from diskstart.inc:
+; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
+; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+;
+; 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
+; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+; Boston MA 02110-1301, USA; either version 2 of the License, or
+; (at your option) any later version; incorporated herein by reference.
+;
+; -----------------------------------------------------------------------
+
+;
+; geodsplib.inc
+;
+; Library file for geodsp*.asm
+;
+
+ ; ES:BX points to the buffer with address
+ ; DX,CX as they should be for INT13h,AH=02
+ ; For now assume C<256
+write_chs_lba:
+ pushad
+ mov si,s_atchs
+ call writestr_early
+ call write_chs
+ mov al,':'
+ call writechr
+ mov eax,[es:bx]
+ call writehex8
+ call crlf
+ popad
+ ret
+
+ ; DX,CX as they should be for INT13h,AH=02
+ ; For now assume C<256
+write_chs:
+ pushad
+ mov al,ch
+ mov ah,cl
+ shr ah,6
+ call writehex4
+ mov al,','
+ call writechr
+ mov al,dh
+ call writehex2
+ mov al,','
+ call writechr
+ mov al,cl
+ and al,3Fh
+ call writehex2
+ popad
+ ret
+
+write_edd_lba:
+ pushad
+ mov si,s_atchs
+ call writestr_early
+ call writehex8
+ mov al,':'
+ call writechr
+ mov eax,[es:bx]
+ call writehex8
+ call crlf
+ popad
+ ret
+
+
+crlf:
+ push si
+ mov si,s_crlf
+ call writestr_early
+ pop si
+ ret
+
+writechr:
+writechr_early:
+ pushad
+ mov ah,0Eh ; Write to screen as TTY
+ mov bx,0007h ; Attribute
+ int 10h
+ popad
+ ret
+
+%include "writehex.inc"
+
+s_atchs: db '@'
+s_chs: db 'CHS'
+s_space: db ' ', 0
+s_typespec: db 'D='
+s_type: db 'CHS', 0
+s_end: db 0Dh, 0Ah, 'end'
+s_crlf: db 0Dh, 0Ah, 0
+
+; This indicates the general format of the last few bytes in the boot sector
+BS_MAGIC_VER equ 0x1b << 9
diff --git a/diag/geodsp/geodspms.asm b/diag/geodsp/geodspms.asm
new file mode 100644
index 00000000..bd411eb1
--- /dev/null
+++ b/diag/geodsp/geodspms.asm
@@ -0,0 +1,196 @@
+; -----------------------------------------------------------------------
+;
+; Copyright 2010 Gene Cumm
+;
+; Portions from diskstart.inc:
+; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
+; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+;
+; 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
+; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+; Boston MA 02110-1301, USA; either version 2 of the License, or
+; (at your option) any later version; incorporated herein by reference.
+;
+; -----------------------------------------------------------------------
+
+;
+; geodspms.asm
+;
+; Display geometry translation info for diagnosing misconceptions
+; multi-sector variant
+;
+; nasm -Ox -f bin -o geodsp.bin -l geodsp.lst geodsp.asm
+;
+; nasm -Ox -f elf -o geodsp.o -l geodsp.lst geodsp.asm
+; ld -m elf_i386 -T syslinux.ld -M -o geodsp.elf geodsp.o > geodsp.map
+; objcopy -O binary geodsp.elf geodsp.raw
+;
+; # OF=/dev/sdb
+; # dd if=core/geodsp.bin of=$OF
+; # dd skip=1 seek=1 if=../dbg/lba-img/lba-img.bin of=$OF
+; # eject $OF
+; # dd count=$() if=/dev/zero of=$OF
+;
+; # OF=geo-2.255.63.i
+; # (dd if=core/geodsp.bin; dd skip=1 if=../dbg/lba-img/lba-img.bin; dd count=$((2*255*63 - 256*63 - 1)) if=/dev/zero )|dd of=$OF
+; # OF=geo-20.16.63.i
+; # (dd if=core/geodsp.bin; dd skip=1 if=../dbg/lba-img/lba-img.bin; dd count=$((40*16*63 - 256*63 - 1)) if=/dev/zero )|dd of=$OF
+;
+
+; Just to define it to look like SYSLINUX
+%define IS_SYSLINUX 1
+
+%include "macros.inc"
+; %include "layout.inc"
+
+m_CHS0 equ 00534843h ;'CHS',0
+m_EDD0 equ 00444445h ;'EDD',0
+m_EDD_SP equ 20444445h ;'EDD '
+retry_count equ 16
+dbuf equ 8000h
+; int13_ret equ 7e00h
+LDLINUX_MAGIC equ 0x3eb202fe ; A random number to identify ourselves with
+
+Sect1Ptr0_VAL equ 1
+Sect1Ptr1_VAL equ 0
+
+; global STACK_LEN, STACK_TOP, STACK_BASE
+; STACK_LEN equ 4096
+STACK_TOP equ 7c00h
+; STACK_BASE equ STACK_TOP - STACK_LEN
+ section .init
+ org STACK_TOP
+geodsp_start:
+
+%include "diskboot.inc"
+
+HEXDATE equ 1
+
+ section .init
+sector_1:
+ldlinux_sys:
+ alignz 8
+ldlinux_magic dd LDLINUX_MAGIC
+ dd LDLINUX_MAGIC^HEXDATE
+
+
+ldlinux_ent:
+
+get_geo: ; DL and ES ready
+ mov ah,08h
+ mov di,0
+ call xint13
+write_geo:
+ jc .bad_geo
+ mov si,s_chs
+ call writestr_early
+ call write_chs
+ call crlf
+ jmp short .done
+.bad_geo:
+.done:
+
+ mov bx,dbuf
+get_h1c: ; 0,1,1
+ mov cx,0001h
+ mov dh,01h
+ call getonesec_chs
+ call write_chs_lba
+get_c1c: ; 1,0,1
+ mov cx,0101h
+ mov dh,00h
+ call getonesec_chs
+ call write_chs_lba
+
+
+
+; Do we have EBIOS (EDD)?
+;
+edd:
+.check:
+ mov bx,55AAh
+ mov ah,41h ; EDD existence query
+ call xint13
+ jc .noedd
+ cmp bx,0AA55h
+ jne .noedd
+ test cl,1 ; Extended disk access functionality set
+ jz .noedd
+ ;
+ ; We have EDD support...
+ ;
+ mov bx,dbuf ; ES should still be safe.
+ xor edx,edx
+ mov dword [s_chs],m_EDD_SP
+.get_lba63:
+ mov eax,63 ; Same length as mov al,64; movzx eax,al
+ call getonesec_ebios
+ jc .bad_edd ;read error
+ call write_edd_lba
+.get_lba16065:
+ mov eax,16065
+ call getonesec_ebios
+ jc .bad_edd ;read error
+ call write_edd_lba
+.good_edd:
+ mov dword [s_type],m_EDD0
+.bad_edd:
+.noedd:
+.end:
+
+write_final_type:
+ mov si,s_typespec
+ call writestr_early
+ jmp kaboom
+
+;
+; getonesec_chs:
+;
+; CX,DH specifies CHS address
+;
+getonesec_chs: ; We could use an xchg and get a loop
+; mov cx,retry_count
+.retry:
+ pushad
+ mov ax,0201h ; Read one sector
+ call xint13
+ popad
+ jc .error
+ ret
+
+.error:
+; loop .retry
+ ; Fall through to disk_error
+ jmp disk_error
+
+%include "geodsplib.inc"
+
+;
+;
+; writestr_early: write a null-terminated string to the console
+; This assumes we're on page 0. This is only used for early
+; messages, so it should be OK.
+;
+writestr_early:
+ pushad
+.loop: lodsb
+ and al,al
+ jz .return
+ mov ah,0Eh ; Write to screen as TTY
+ mov bx,0007h ; Attribute
+ int 10h
+ jmp short .loop
+.return: popad
+ ret
+
+SuperInfo: zd 32 ; The first 16 bytes expanded 8 times
+
+ ; This fails if the sector overflowsg
+ zb 400h-($-$$)
+end:
+
+ absolute 4*1Eh
+fdctab equ $
+fdctab1 resw 1
+fdctab2 resw 1
diff --git a/diag/geodsp/mk-lba-img.c b/diag/geodsp/mk-lba-img.c
new file mode 100644
index 00000000..795de1a7
--- /dev/null
+++ b/diag/geodsp/mk-lba-img.c
@@ -0,0 +1,75 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2010 Gene Cumm
+ *
+ * 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
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * mk-lba-img.c
+ *
+ * Makes an image that contains the LBA in every *word of every sector
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#define NUM_SECT (256*63+1)
+#define BPS (512)
+#define SECT_INT (512 / sizeof(int))
+
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+
+const char DEF_FN[] = "lba.img";
+
+int main(int argc, char *argv[])
+{
+ int i, j, b[SECT_INT], rv = 0, one = 0;
+ FILE *f;
+ uint8_t tt = 0;
+ const char *fn;
+
+ if (argc >= 2) {
+ if (argc >= 3) {
+ if (strcasecmp("-1", argv[1]) == 0) {
+ fn = argv[2];
+ one = 1;
+ } else {
+ fn = argv[1];
+ }
+ } else {
+ fn = argv[1];
+ }
+ } else {
+ fn = DEF_FN;
+ }
+
+ f = fopen(fn, "w");
+
+ if (f) {
+ for (i = 0; i < NUM_SECT; i++) {
+ if (one) {
+ b[0] = i;
+ } else {
+ for (j = 0; j < (512 / sizeof(int)); j++) {
+ b[j] = i;
+ }
+ }
+ fwrite(b, 512, 1, f);
+ }
+ fclose(f);
+ } else {
+ puts("Unable to open for writing");
+ rv = 1;
+ }
+ return rv;
+}
diff --git a/doc/memdisk.txt b/doc/memdisk.txt
index fecf2dcb..0d6293d6 100644
--- a/doc/memdisk.txt
+++ b/doc/memdisk.txt
@@ -141,6 +141,12 @@ h) Some systems without a floppy drive have been known to have
nopass Hide all real drives of the same type (floppy or hard disk)
nopassany Hide all real drives (floppy and hard disk)
+i) The following standard Linux option will mark memory as reserved.
+ Please note that the Syslinux core already loads MEMDISK and its
+ initrd below this point:
+
+ mem=size Mark available memory above this point as Reserved.
+
Some interesting things to note:
diff --git a/doc/pxelinux.txt b/doc/pxelinux.txt
index 47aea903..69c1a645 100644
--- a/doc/pxelinux.txt
+++ b/doc/pxelinux.txt
@@ -99,6 +99,20 @@ boot, if you have such a setup. MTFTP server setup is beyond the
scope of this document.
+ ++++ gPXE-ENHANCED VARIANTS ++++
+
+gPXE can be used to enhance PXELINUX's functionality to also include
+HTTP transfers, greatly increasing load speed and allowing for standard
+HTTP scripts to present PXELINUX's configuration file. pxelinux.0 is
+the plain variant. gpxelinux.0 (included as of 3.70) is gPXE's
+undionly.kkpxe, pxelinux.0 and a script to run pxelinux.0. gpxelinuxk.0
+(included as of 4.04) is gPXE's undionly.kpxe, pxelinux.0 and a script
+to run pxelinux.0. gpxelinuxk.0 should only be used with systems that
+are incompatible with gpxelinux.0 as it prevents certain functionality
+from working (LOCALBOOT with a type not equal to -1) and is incompatible
+with certain hardware, PXE stacks and network setups.
+
+
++++ SETTING UP THE TFTP SERVER ++++
PXELINUX currently requires that the boot server has a TFTP server
diff --git a/doc/syslinux.txt b/doc/syslinux.txt
index 5b27a6eb..07d5df9a 100644
--- a/doc/syslinux.txt
+++ b/doc/syslinux.txt
@@ -2,7 +2,7 @@
A suite of bootloaders for Linux
- Copyright 1994-2010 H. Peter Anvin and contributors
+ Copyright 1994-2011 H. Peter Anvin and contributors
This program is provided under the terms of the GNU General Public
License, version 2 or, at your option, any later version. There is no
@@ -233,21 +233,25 @@ LABEL label
filetype, regardless of the filename.
CONFIG means restart the boot loader using a different
- configuration file.
+ configuration file. The configuration file is read, the
+ working directory is changed (if specified via an APPEND), then
+ the configuration file is parsed.
APPEND -
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]
- 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.
+ LOCALBOOT type
+ Attempt a different local boot method. The special value -1
+ causes the boot loader to report failure to the BIOS, which, on
+ recent BIOSes, should mean that the next boot device in the
+ boot sequence should be activated. Values other than those
+ documented may produce undesired results.
- The argument 0 means perform a normal boot. The argument 4
+ On PXELINUX, "type" 0 means perform a normal boot. "type" 4
will perform a local boot with the Universal Network Driver
Interface (UNDI) driver still resident in memory. Finally,
- the argument 5 will perform a local boot with the entire PXE
+ "type" 5 will perform a local boot with the entire PXE
stack, including the UNDI driver, still resident in memory.
All other values are undefined. If you don't know what the
UNDI or PXE stacks are, don't worry -- you don't want them,
@@ -255,10 +259,7 @@ LABEL label
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.
+ primary hard drive.
INITRD initrd_file
Starting with version 3.71, an initrd can be specified in a
diff --git a/dos/dosexe.ld b/dos/dosexe.ld
index c67c5060..833368aa 100644
--- a/dos/dosexe.ld
+++ b/dos/dosexe.ld
@@ -27,11 +27,11 @@ SECTIONS
__payload_lma = .;
. = 0x100000000 - syslinux_ldlinux_size;
+ __payload_start = .;
.payload : AT (__payload_lma) {
- __payload_start = .;
*(.payload)
- __payload_end = .;
}
+ __payload_end = .;
__payload_len = __payload_end - __payload_start;
__payload_dwords = __payload_len >> 2;
@@ -39,9 +39,10 @@ SECTIONS
__payload_sseg = (__payload_lma - __text_lma) >> 4;
_exe_text_seg = (__text_lma - __header_size) >> 4;
- __assert1 = ASSERT((__payload_len == syslinux_ldlinux_size),
- "syslinux_ldlinux_size must equal the size of .payload");
-
+/*
+ * __assert1 = ASSERT((__payload_len == syslinux_ldlinux_size),
+ * "syslinux_ldlinux_size must equal the size of .payload");
+ */
. = 0;
.text : AT (__text_lma) {
*(.text .stub .text.* .gnu.linkonce.t.*)
diff --git a/extlinux/main.c b/extlinux/main.c
index 30422c2d..21369e46 100755
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -216,7 +216,7 @@ int patch_file_and_bootblock(int fd, const char *dir, int devfd)
uint64_t totalbytes, totalsectors;
int nsect;
struct boot_sector *sbs;
- char *dirpath, *subpath, *xdirpath, *xsubpath;
+ char *dirpath, *subpath, *xdirpath;
int rv;
dirpath = realpath(dir, NULL);
@@ -237,10 +237,8 @@ int patch_file_and_bootblock(int fd, const char *dir, int devfd)
if (*subpath == '/') {
if (subpath > dirpath) {
*subpath = '\0';
- xsubpath = subpath+1;
xdirpath = dirpath;
} else {
- xsubpath = subpath;
xdirpath = "/";
}
if (lstat(xdirpath, &xdst) || dirst.st_dev != xdst.st_dev) {
diff --git a/libinstaller/fat.c b/libinstaller/fat.c
index e2101353..9cde00c2 100644
--- a/libinstaller/fat.c
+++ b/libinstaller/fat.c
@@ -42,15 +42,12 @@ void syslinux_make_bootsect(void *bs)
*/
const char *syslinux_check_bootsect(const void *bs)
{
- int veryold;
int sectorsize;
long long sectors, fatsectors, dsectors;
long long clusters;
int rootdirents, clustersize;
const struct boot_sector *sectbuf = bs;
- veryold = 0;
-
/* Must be 0xF0 or 0xF8..0xFF */
if (get_8(&sectbuf->bsMedia) != 0xF0 && get_8(&sectbuf->bsMedia) < 0xF8)
return "invalid media signature (not a FAT filesystem?)";
diff --git a/memdisk/setup.c b/memdisk/setup.c
index 61cf420c..bc79e127 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -523,6 +523,8 @@ static const struct geometry *get_disk_image_geometry(uint32_t where,
sectors at the end of the image... */
xsectors++;
}
+
+ hd_geometry.type = type;
}
} else {
/* Assume it is a hard disk image and scan for a partition table */
@@ -558,6 +560,8 @@ static const struct geometry *get_disk_image_geometry(uint32_t where,
}
}
}
+
+ hd_geometry.type = 0;
}
}
@@ -566,8 +570,8 @@ static const struct geometry *get_disk_image_geometry(uint32_t where,
if (!max_s)
max_s = xsectors > 2097152 ? 63 : 32;
- hd_geometry.h = max_h;
- hd_geometry.s = max_s;
+ hd_geometry.h = max_h;
+ hd_geometry.s = max_s;
}
if (!hd_geometry.c)