Skip to content

Commit

Permalink
Merge branch 'master' into diag-mbr-handoff-for-hpa
Browse files Browse the repository at this point in the history
Conflicts:
	diag/mbr/handoff.S

diag/mbr/handoff.S: Remove the attempt to zero pad/prevent overflow
  • Loading branch information
geneC committed Mar 17, 2011
2 parents a472e4b + 372dfd1 commit 92dd653
Show file tree
Hide file tree
Showing 34 changed files with 809 additions and 85 deletions.
6 changes: 2 additions & 4 deletions Makefile
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
14 changes: 14 additions & 0 deletions NEWS
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion com32/cmenu/adv_menu.tpl
Expand Up @@ -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);
}

Expand Down
7 changes: 3 additions & 4 deletions com32/cmenu/libmenu/help.c
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -83,7 +83,6 @@ static void printtext(char *buf, int from)
}
putchar('\n');
t++;
i++;
}
}

Expand Down
4 changes: 0 additions & 4 deletions com32/hdt/hdt-cli-kernel.c
Expand Up @@ -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;
}
Expand Down
2 changes: 0 additions & 2 deletions com32/hdt/hdt-menu-summary.c
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions com32/lib/jpeg/tinyjpeg.c
Expand Up @@ -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
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -442,16 +440,15 @@ 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",
"????",
"YCbCr",
"CYMK"
};
#endif

precision = stream[2];
height = be16_to_cpu(stream+3);
Expand All @@ -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;
}

/*******************************************************************************
Expand Down
3 changes: 0 additions & 3 deletions com32/lib/sys/rawcon_read.c
Expand Up @@ -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;
Expand Down
12 changes: 7 additions & 5 deletions com32/lib/syslinux/shuffle.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Expand Down
7 changes: 0 additions & 7 deletions com32/lib/vsscanf.c
Expand Up @@ -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? */
Expand Down Expand Up @@ -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 */
Expand Down
13 changes: 7 additions & 6 deletions com32/lua/src/syslinux.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions com32/lua/src/vesa.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down
9 changes: 6 additions & 3 deletions 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"]
*
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 3 additions & 4 deletions com32/rosh/rosh.c
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions com32/rosh/rosh.h
Expand Up @@ -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;
Expand Down

0 comments on commit 92dd653

Please sign in to comment.