[-]
[+]
|
Added |
syslinux.changes
|
|
[-]
[+]
|
Changed |
syslinux.spec
^
|
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/.gitignore
^
|
@@ -9,6 +9,8 @@
*.elf
*.exe
*.gen
+*.img
+*.img.xz
*.lib
*.lnx
*.lo
@@ -29,6 +31,7 @@
.\#*
.depend
/com32/lib/sys/vesa/alphatbl.c
+/diag/geodsp/mk-lba-img
/extlinux/extlinux
/memdisk/memdisk
/mtools/syslinux
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/MCONFIG
^
|
@@ -23,6 +23,7 @@
LIBDIR = /usr/lib
DATADIR = /usr/share
AUXDIR = $(DATADIR)/syslinux
+DIAGDIR = $(AUXDIR)/diag
MANDIR = /usr/man
INCDIR = /usr/include
TFTPBOOT = /tftpboot
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/Makefile
^
|
@@ -39,9 +39,7 @@
# 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 @@
# 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 \
@@ -67,11 +65,13 @@
# Things to install in /sbin
INSTALL_SBIN = extlinux/extlinux
# Things to install in /usr/lib/syslinux
-INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 core/isolinux.bin \
- core/isolinux-debug.bin \
+INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 gpxe/gpxelinuxk.0 \
+ core/isolinux.bin core/isolinux-debug.bin \
dos/syslinux.com \
mbr/*.bin $(MODULES)
INSTALL_AUX_OPT = win32/syslinux.exe win64/syslinux64.exe
+INSTALL_DIAG = diag/mbr/handoff.bin \
+ diag/geodsp/geodsp1s.img.xz diag/geodsp/geodspms.img.xz
# These directories manage their own installables
INSTALLSUBDIRS = com32 utils dosutil
@@ -112,6 +112,8 @@
mkdir -m 755 -p $(INSTALLROOT)$(AUXDIR)
install -m 644 -c $(INSTALL_AUX) $(INSTALLROOT)$(AUXDIR)
-install -m 644 -c $(INSTALL_AUX_OPT) $(INSTALLROOT)$(AUXDIR)
+ mkdir -m 755 -p $(INSTALLROOT)$(DIAGDIR)
+ install -m 644 -c $(INSTALL_DIAG) $(INSTALLROOT)$(DIAGDIR)
mkdir -m 755 -p $(INSTALLROOT)$(MANDIR)/man1
install -m 644 -c man/*.1 $(INSTALLROOT)$(MANDIR)/man1
: mkdir -m 755 -p $(INSTALLROOT)$(MANDIR)/man8
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/NEWS
^
|
@@ -2,6 +2,57 @@
or EXTLINUX apply to that specific program only; other changes apply
to all derivatives.
+Changes in 4.04:
+ * PXELINUX: Fix handling of unqualified DNS names.
+ * PXELINUX: Fix timer bug when PXELINUX might be unloaded
+ (Gene Cumm).
+ * core/writedec.inc: Fix duplicate declaration and overflow
+ (Gene Cumm).
+ * GCC 4.5 fixes.
+ * sample directory: Fix Makefile include (Gene Cumm).
+ * ver.com: New universal DOS/COMBOOT application to display
+ version information (includes DRMK) (Gene Cumm).
+ * rosh.c32: updated; Using getopt() for internal commands to aid
+ parsing options; Fix bugs in ls; add warm reboot and echo
+ (Gene Cumm).
+ * com32: fix a file descriptor leak.
+ * gfxboot.c32: handle TEXT..ENDTEXT; error out on no LABELs
+ found (Sebastian Herbszt).
+ * Fix booting on non-partitioned devices.
+ * MBR, isohybrid: Workaround for a BIOS issue on Acer
+ Travelmate and possibly other machines.
+ * COM32: Adding ACPI parsing libary
+ * 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/isohdppx*.bin files to
+ make isohybrid images in one step with GNU xorriso.
+ * PXELINUX: disable a hack that would make localboot work on
+ some machines, but break just about as many. Some machines
+ which worked with "localboot 0" in previous versions may
+ need "localboot -1" in this one. If you have a machine
+ which requires "localboot -1", a copy of the dmidecode
+ or sysdump output would be appreciated.
+ * Include a set of diagnostics by Gene Cumm.
+ * Fixes for gcc 4.6 and binutils 2.21.51.
+ * chain.c32: Allow "uuid" as a synonym to "guid".
+ * Handle directory names starting with .. for vfat and
+ iso9660.
+ * New MENU HIDDENKEY command to provide a one-keystroke way to
+ activate a boot option from a hidden menu intro screen.
+
Changes in 4.03:
* Don't hang if no configuration file is found.
* Better support for booting from MBRs which don't pass
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/README
^
|
@@ -25,7 +25,7 @@
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
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gfxboot/gfxboot.c
^
|
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <minmax.h>
+#include <ctype.h>
#include <syslinux/loadfile.h>
#include <syslinux/config.h>
@@ -39,6 +40,7 @@
// must be at least block size; can in theory be larger than 4k, but there's
// not enough space left
#define REALMODE_BUF_SIZE 4096
+#define LOWMEM_BUF_SIZE 65536
// gfxboot working memory in MB
#define GFX_MEMORY_SIZE 7
@@ -60,8 +62,8 @@
#define GFX_CB_PASSWORD_INIT 10
#define GFX_CB_PASSWORD_DONE 11
-// real mode code chunk, will be placed into bounce buffer
-extern void realmode_callback_start, realmode_callback_end;
+// real mode code chunk, will be placed into lowmem buffer
+extern const char realmode_callback_start[], realmode_callback_end[];
// gets in the way
#undef linux
@@ -144,15 +146,11 @@
} gfx;
void *lowmem_buf;
-unsigned lowmem_buf_size;
int timeout;
char cmdline[MAX_CMDLINE_LEN];
-void *save_buf;
-unsigned save_buf_size;
-
// progress bar is visible
unsigned progress_active;
@@ -160,7 +158,6 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void show_message(char *file);
char *get_config_file_name(void);
-char *skip_spaces(char *s);
char *skip_nonspaces(char *s);
void chop_line(char *s);
int read_config_file(const char *filename);
@@ -174,7 +171,6 @@
void gfx_progress_init(ssize_t kernel_size, char *label);
void gfx_progress_update(ssize_t size);
void gfx_progress_done(void);
-ssize_t save_read(int fd, void *buf, size_t size);
void *load_one(char *file, ssize_t *file_size);
void boot(int index);
void boot_entry(menu_t *menu_ptr, char *arg);
@@ -188,8 +184,11 @@
openconsole(&dev_stdcon_r, &dev_stdcon_w);
- lowmem_buf = __com32.cs_bounce;
- lowmem_buf_size = __com32.cs_bounce_size;
+ lowmem_buf = lmalloc(LOWMEM_BUF_SIZE);
+ if (!lowmem_buf) {
+ printf("Could not allocate memory.\n");
+ return 1;
+ }
sdi = syslinux_derivative_info();
@@ -211,9 +210,6 @@
gfx_config.sysconfig_size = sizeof gfx_config;
gfx_config.bootloader_seg = 0; // apparently not needed
- save_buf_size = lowmem_buf_size;
- save_buf = malloc(save_buf_size);
-
if(argc < 2) {
printf("Usage: gfxboot.c32 bootlogo_file [message_file]\n");
if(argc > 2) show_message(argv[2]);
@@ -274,15 +270,6 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-char *skip_spaces(char *s)
-{
- while(*s && (*s == ' ' || *s == '\t')) s++;
-
- return s;
-}
-
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
char *skip_nonspaces(char *s)
{
while(*s && *s != ' ' && *s != '\t') s++;
@@ -319,7 +306,7 @@
{
FILE *f;
char *s, *t, buf[MAX_CONFIG_LINE_LEN];
- unsigned u, top_level = 0;
+ unsigned u, top_level = 0, text = 0;
if(!strcmp(filename, "~")) {
top_level = 1;
@@ -336,11 +323,19 @@
while((s = fgets(buf, sizeof buf, f))) {
chop_line(s);
- s = skip_spaces(s);
+ s = skipspace(s);
if(!*s || *s == '#') continue;
t = skip_nonspaces(s);
if(*t) *t++ = 0;
- t = skip_spaces(t);
+ t = skipspace(t);
+
+ if(!strcasecmp(s, "endtext")) {
+ text = 0;
+ continue;
+ }
+
+ if (text)
+ continue;
if(!strcasecmp(s, "timeout")) {
timeout = atoi(t);
@@ -396,11 +391,16 @@
continue;
}
+ if(!strcasecmp(s, "text")) {
+ text = 1;
+ continue;
+ }
+
if(!strcasecmp(s, "menu") && menu_ptr) {
- s = skip_spaces(t);
+ s = skipspace(t);
t = skip_nonspaces(s);
if(*t) *t++ = 0;
- t = skip_spaces(t);
+ t = skipspace(t);
if(!strcasecmp(s, "label")) {
menu_ptr->menu_label = strdup(t);
@@ -428,6 +428,11 @@
if (!top_level)
return 0;
+ if (gfx_menu.entries == 0) {
+ printf("No LABEL keywords found.\n");
+ return 1;
+ }
+
// final '\0'
gfx_menu.label_size++;
gfx_menu.arg_size++;
@@ -524,7 +529,7 @@
unsigned code_start, code_size, file_start, file_len, u;
com32sys_t r;
void *lowmem = lowmem_buf;
- unsigned lowmem_size = lowmem_buf_size;
+ unsigned lowmem_size = LOWMEM_BUF_SIZE;
progress_active = 0;
@@ -557,15 +562,16 @@
gfx_config.file = gfx_config.archive_start + file_start;
- u = &realmode_callback_end - &realmode_callback_start;
+ u = realmode_callback_end - realmode_callback_start;
u = (u + REALMODE_BUF_SIZE + 0xf) & ~0xf;
if(u + code_size > lowmem_size) {
- printf("bounce buffer too small: size %u, needed %u\n", lowmem_size, u + code_size);
+ printf("lowmem buffer too small: size %u, needed %u\n", lowmem_size, u + code_size);
return 1;
}
- memcpy(lowmem + REALMODE_BUF_SIZE, &realmode_callback_start, &realmode_callback_end - &realmode_callback_start);
+ memcpy(lowmem + REALMODE_BUF_SIZE, realmode_callback_start,
+ realmode_callback_end - realmode_callback_start);
// fill in buffer size and location
*(uint16_t *) (lowmem + REALMODE_BUF_SIZE) = REALMODE_BUF_SIZE;
@@ -730,21 +736,6 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Like read(2) but preserve bounce buffer.
-//
-ssize_t save_read(int fd, void *buf, size_t size)
-{
- ssize_t i;
-
- memcpy(save_buf, lowmem_buf, save_buf_size);
- i = read(fd, buf, size);
- memcpy(lowmem_buf, save_buf, save_buf_size);
-
- return i;
-}
-
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Read file and update progress bar.
//
void *load_one(char *file, ssize_t *file_size)
@@ -771,7 +762,7 @@
if(size) {
buf = malloc(size);
for(i = 1, cur = 0 ; cur < size && i > 0; cur += i) {
- i = save_read(fd, buf + cur, min(CHUNK_SIZE, size - cur));
+ i = read(fd, buf + cur, min(CHUNK_SIZE, size - cur));
if(i == -1) break;
gfx_progress_update(i);
}
@@ -779,7 +770,7 @@
else {
do {
buf = realloc(buf, size + CHUNK_SIZE);
- i = save_read(fd, buf + size, CHUNK_SIZE);
+ i = read(fd, buf + size, CHUNK_SIZE);
if(i == -1) break;
size += i;
gfx_progress_update(i);
@@ -823,7 +814,7 @@
// invalid index or menu entry
if(!menu_ptr || !menu_ptr->menu_label) return;
- arg = skip_spaces(cmdline);
+ arg = skipspace(cmdline);
label_len = strlen(menu_ptr->menu_label);
// if it does not start with label string, assume first word is kernel name
@@ -837,7 +828,7 @@
arg += label_len;
}
- arg = skip_spaces(arg);
+ arg = skipspace(arg);
// handle IPAPPEND
if(menu_ptr->ipappend && (ipapp = atoi(menu_ptr->ipappend))) {
@@ -923,7 +914,7 @@
s = s0 = strdup(arg);
while(*s && strncmp(s, "initrd=", sizeof "initrd=" - 1)) {
- s = skip_spaces(skip_nonspaces(s));
+ s = skipspace(skip_nonspaces(s));
}
if(*s) {
|
|
Changed |
syslinux-4.04.tar.bz2/com32/gfxboot/gfxboot.c32
^
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi
^
|
+(directory)
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/acpi.h
^
|
@@ -0,0 +1,98 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef ACPI_H
+#define ACPI_H
+
+#define DEBUG_ACPI 0
+
+void dbg_printf(const char *fmt, ...);
+#define DEBUG_PRINT(x) do { if (DEBUG_ACPI) dbg_printf x; } while (0)
+
+#include <inttypes.h>
+#include <stdbool.h>
+#include <acpi/structs.h>
+#include <acpi/rsdp.h>
+#include <acpi/rsdt.h>
+#include <acpi/xsdt.h>
+#include <acpi/fadt.h>
+#include <acpi/madt.h>
+#include <acpi/dsdt.h>
+#include <acpi/ssdt.h>
+#include <acpi/sbst.h>
+#include <acpi/ecdt.h>
+#include <acpi/facs.h>
+#include <acpi/hpet.h>
+#include <acpi/tcpa.h>
+#include <acpi/mcfg.h>
+#include <acpi/slic.h>
+#include <acpi/boot.h>
+
+enum { ACPI_FOUND = 1, ENO_ACPI = 2 , MADT_FOUND = 3 , ENO_MADT = 4 };
+
+#define MAX_SSDT 128
+
+/* Some other description HEADERS : ACPI doc: 5.2.6*/
+#define OEMX "OEMx"
+#define SRAR "SRAT"
+#define BERT "BERT"
+#define BOOT "BOOT"
+#define CPEP "CPEP"
+#define DBGP "DGBP"
+#define DMAR "DMAR"
+#define ERST "ERST"
+#define ETDT "ETDT"
+#define HEST "HEST"
+#define HPET "HPET"
+#define IBFT "IBFT"
+#define MCFG "MCFG"
+#define SPCR "SPCR"
+#define SPMI "SPMI"
+#define TCPA "TCPA"
+#define UEFI "UEFI"
+#define WAET "WAET"
+#define WDAT "WDAT"
+#define WDRT "WDRT"
+#define WSPT "WSPT"
+#define SLIC "SLIC"
+
+/* This macro are used to extract ACPI structures
+ * please be careful about the q (interator) naming */
+#define cp_struct(dest) memcpy(dest,q,sizeof(*dest)); q+=sizeof(*dest)
+#define cp_str_struct(dest) memcpy(dest,q,sizeof(dest)-1); dest[sizeof(dest)-1]=0;q+=sizeof(dest)-1
+
+typedef struct {
+ s_rsdp rsdp;
+ s_rsdt rsdt;
+ s_xsdt xsdt;
+ s_fadt fadt;
+ s_madt madt;
+ s_dsdt dsdt;
+ s_ssdt *ssdt[MAX_SSDT];
+ uint8_t ssdt_count;
+ s_sbst sbst;
+ s_ecdt ecdt;
+ s_facs facs;
+ s_hpet hpet;
+ s_tcpa tcpa;
+ s_mcfg mcfg;
+ s_slic slic;
+ s_boot boot;
+} s_acpi;
+
+int parse_acpi(s_acpi * acpi);
+int parse_xsdt(s_acpi * acpi);
+void parse_madt(s_acpi * acpi);
+int search_rsdp(s_acpi *acpi);
+void get_acpi_description_header(uint8_t *q, s_acpi_description_header * adh);
+bool parse_header(uint64_t *address, s_acpi *acpi);
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/boot.h
^
|
@@ -0,0 +1,29 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef BOOT_H
+#define BOOT_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define BOOT "BOOT"
+
+enum { BOOT_TABLE_FOUND = 1 };
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ /* What's inside ? */
+ bool valid;
+} s_boot;
+
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/dsdt.h
^
|
@@ -0,0 +1,28 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef DSDT_H
+#define DSDT_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define DSDT "DSDT"
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ uint8_t *definition_block;
+ bool valid;
+} s_dsdt;
+
+void parse_dsdt(s_dsdt *dsdt);
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/ecdt.h
^
|
@@ -0,0 +1,38 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef ECDT_H
+#define ECDT_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define ECDT "ECDT"
+
+/* Offset of the EC_ID in the structure */
+#define EC_ID_OFFSET 65
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ bool valid;
+ uint32_t warning_energy_level;
+ uint32_t low_energy_level;
+ uint32_t critical_energy_level;
+ s_gas ec_control;
+ s_gas ec_data;
+ uint32_t uid;
+ uint8_t gpe_bit;
+ char *ec_id;
+} s_ecdt;
+
+void parse_ecdt(s_ecdt * ecdt);
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/facs.h
^
|
@@ -0,0 +1,41 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef FACS_H
+#define FACS_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define FACS "FACS"
+
+/* Features Flags for "flags" */
+#define S4BIOS_F 1
+
+/* Features flags for global_lock */
+#define PENDING 1
+#define OWNED 1<<1
+
+typedef struct {
+ uint64_t *address;
+ uint8_t signature[4+1];
+ uint8_t length;
+ uint32_t hardware_signature;
+ uint32_t firmware_waking_vector;
+ uint32_t global_lock;
+ uint32_t flags;
+ uint64_t x_firmware_waking_vector;
+ uint8_t version;
+ bool valid;
+} s_facs;
+
+void parse_facs(s_facs *facs);
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/fadt.h
^
|
@@ -0,0 +1,121 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef FADT_H
+#define FADT_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+enum { FADT_TABLE_FOUND = 1};
+
+#define FACP "FACP"
+#define FADT "FADT"
+
+/* prefered pm profiles */
+enum { PM_UNSPECIFIED = 0,
+ PM_DESKTOP = 1,
+ PM_MOBILE = 2,
+ PM_WORKSTATION = 3,
+ PM_ENTERPRISE_SERVER = 4,
+ PM_SOHO_SERVER = 5,
+ PM_APPLIANCE_PC = 6,
+ PM_PERFORMANCE_SERVER = 7
+};
+
+/* iapc_boot_arch flags*/
+#define IAPC_LEGAGY_DEVICE 1
+#define IAPC_8042 1<<1
+#define IAPC_VGA_NOT_PRESENT 1<<2
+#define IAPC_MSI_NOT_SUPPORTED 1<<3
+#define IAPC_PCIE_ASPM_CONTROLS 1<<4
+
+/* feature flags for "flags" */
+#define WBINVD 1
+#define WBINVD_FLUSH 1<<1
+#define PROC_C1 1<<2
+#define P_LVL2_UP 1<<3
+#define PWR_BUTTON 1<<4
+#define SLP_BUTTON 1<<5
+#define FIX_RTC 1<<6
+#define RTC_S4 1<<7
+#define TMR_VAL_EXT 1<<8
+#define DCK_CAP 1<<9
+#define RESET_REG_SUP 1<<10
+#define SEALED_CASE 1<<11
+#define HEADLESS 1<<12
+#define CPU_SW_SLP 1<<13
+#define PCI_EXP_WAK 1<<14
+#define USE_PLATEFORM_CLOCK 1<<15
+#define S4_RTC_STS_VALID 1<<16
+#define REMOTE_POWER_ON_CAPABLE 1<<17
+#define FORCE_APIC_CLUSTER_MODEL 1<<18
+#define FORCE_APIC_PHYSICAL_DESTINATION_MODE 1<<19
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ bool valid;
+ uint32_t *firmware_ctrl;
+ uint32_t *dsdt_address;
+ uint8_t reserved;
+ uint8_t prefered_pm_profile;
+ uint16_t sci_int;
+ uint32_t smi_cmd;
+ uint8_t acpi_enable;
+ uint8_t acpi_disable;
+ uint8_t s4bios_req;
+ uint8_t pstate_cnt;
+ uint32_t pm1a_evt_blk;
+ uint32_t pm1b_evt_blk;
+ uint32_t pm1a_cnt_blk;
+ uint32_t pm1b_cnt_blk;
+ uint32_t pm2_cnt_blk;
+ uint32_t pm_tmr_blk;
+ uint32_t gpe0_blk;
+ uint32_t gpe1_blk;
+ uint8_t pm1_evt_len;
+ uint8_t pm1_cnt_len;
+ uint8_t pm2_cnt_len;
+ uint8_t pm_tmr_len;
+ uint8_t gpe0_blk_len;
+ uint8_t gpe1_blk_len;
+ uint8_t gpe1_base;
+ uint8_t cst_cnt;
+ uint16_t p_lvl2_lat;
+ uint16_t p_lvl3_lat;
+ uint16_t flush_size;
+ uint16_t flush_stride;
+ uint8_t duty_offset;
+ uint8_t duty_width;
+ uint8_t day_alarm;
+ uint8_t mon_alarm;
+ uint8_t century;
+ uint16_t iapc_boot_arch;
+ uint8_t reserved_2;
+ uint32_t flags;
+ s_gas reset_reg;
+ uint8_t reset_value;
+ uint8_t reserved_3[3];
+ uint64_t *x_firmware_ctrl;
+ uint64_t *x_dsdt;
+ s_gas x_pm1a_evt_blk;
+ s_gas x_pm1b_evt_blk;
+ s_gas x_pm1a_cnt_blk;
+ s_gas x_pm1b_cnt_blk;
+ s_gas x_pm2_cnt_blk;
+ s_gas x_pm_tmr_blk;
+ s_gas x_gpe0_blk;
+ s_gas x_gpe1_blk;
+} s_fadt;
+
+void parse_fadt(s_fadt * fadt);
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/hpet.h
^
|
@@ -0,0 +1,29 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef HPET_H
+#define HPET_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define HPET "HPET"
+
+enum { HPET_TABLE_FOUND = 1 };
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ /* What's inside ? */
+ bool valid;
+} s_hpet;
+
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/madt.h
^
|
@@ -0,0 +1,156 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef MADT_H
+#define MADT_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define MADT "MADT"
+#define APIC "APIC"
+
+enum {
+ PROCESSOR_LOCAL_APIC = 0,
+ IO_APIC = 1,
+ INTERRUPT_SOURCE_OVERRIDE = 2,
+ NMI = 3,
+ LOCAL_APIC_NMI_STRUCTURE = 4,
+ LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE = 5,
+ IO_SAPIC = 6,
+ LOCAL_SAPIC = 7,
+ PLATEFORM_INTERRUPT_SOURCES = 8
+};
+
+/* Features flags for
+ * - processor_local_apic flags
+ * - local sapic flags
+ */
+#define PROCESSOR_LOCAL_APIC_ENABLE 1
+
+#define MAX_S_L_P 255
+typedef struct {
+ uint8_t type;
+ uint8_t length;
+ uint8_t acpi_id;
+ uint8_t apic_id;
+ uint32_t flags;
+} __attribute__ ((packed)) s_processor_local_apic;
+
+#define MAX_IO_APIC 255
+typedef struct {
+ uint8_t type;
+ uint8_t length;
+ uint8_t io_apic_id;
+ uint8_t reserved;
+ uint32_t io_apic_address;
+ uint32_t global_system_interrupt_base;
+} __attribute__ ((packed)) s_io_apic;
+
+/* Features flags for
+ * - interrupt_source_override
+ * - nmi
+ */
+/* Bits 1&2 must be set to 0 */
+#define POLARITY_CONFORM_MASK 0x0
+#define POLARITY_ACTIVE_HIGH 0x1
+#define POLARITY_RESERVED 0x2
+#define POLARITY_ACTIVE_LOW 0x3
+/* Bits 3&4 must be set to 0 */
+#define TRIGGER_CONFORM_MASK 0x3
+#define TRIGGER_EDGE 0x4
+#define TRIGGER_RESERVED 0x8
+#define TRIGGER_LEVEL 0xA
+
+#define MAX_I_S_O 255
+typedef struct {
+ uint8_t type;
+ uint8_t length;
+ uint8_t bus;
+ uint8_t source;
+ uint32_t global_system_interrupt;
+ uint16_t flags;
+} __attribute__ ((packed)) s_interrupt_source_override;
+
+typedef struct {
+ uint8_t type;
+ uint8_t length;
+ uint8_t flags;
+ uint32_t global_system_interrupt;
+} __attribute__ ((packed)) s_nmi;
+
+#define MAX_LOCAL_APIC_NMI 255
+typedef struct {
+ uint8_t type;
+ uint8_t length;
+ uint8_t acpi_processor_id;
+ uint16_t flags;
+ uint8_t local_apic_lint;
+} __attribute__ ((packed)) s_local_apic_nmi;
+
+#define MAX_L_A_A_O 255
+typedef struct {
+ uint8_t type;
+ uint8_t length;
+ uint16_t reserved;
+ uint64_t local_apic_address;
+} __attribute__ ((packed)) s_local_apic_address_override;
+
+#define MAX_IO_SAPIC 255
+typedef struct {
+ uint8_t type;
+ uint8_t length;
+ uint8_t io_apic_id;
+ uint8_t reserved;
+ uint32_t global_system_interrupt_base;
+ uint64_t io_sapic_address;
+} __attribute__ ((packed)) s_io_sapic;
+
+#define ACPI_PROCESSOR_UID_STRING_OFFSET 16
+#define MAX_LOCAL_SAPIC 255
+typedef struct {
+ uint8_t type;
+ uint8_t length;
+ uint8_t acpi_processor_id;
+ uint8_t local_sapic_id;
+ uint8_t local_sapic_eid;
+ uint8_t reserved[3];
+ uint32_t flags;
+ uint32_t acpi_processor_uid_value;
+ char *acpi_processor_uid_string;
+} __attribute__ ((packed)) s_local_sapic;
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ uint32_t local_apic_address;
+ uint32_t flags;
+ s_processor_local_apic processor_local_apic[MAX_S_L_P];
+ uint8_t processor_local_apic_count;
+ s_io_apic io_apic[MAX_IO_APIC];
+ uint8_t io_apic_count;
+ s_interrupt_source_override interrupt_source_override[MAX_I_S_O];
+ uint8_t interrupt_source_override_count;
+ s_nmi nmi[MAX_I_S_O];
+ uint8_t nmi_count;
+ s_local_apic_nmi local_apic_nmi[MAX_LOCAL_APIC_NMI];
+ uint8_t local_apic_nmi_count;
+ s_local_apic_address_override local_apic_address_override[MAX_L_A_A_O];
+ uint8_t local_apic_address_override_count;
+ s_io_sapic io_sapic[MAX_IO_SAPIC];
+ uint8_t io_sapic_count;
+ s_local_sapic local_sapic[MAX_LOCAL_SAPIC];
+ uint8_t local_sapic_count;
+ bool valid;
+} s_madt;
+
+void print_madt(s_madt * madt);
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/mcfg.h
^
|
@@ -0,0 +1,29 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef MCFG_H
+#define MCFG_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define MCFG "MCFG"
+
+enum { MCFG_TABLE_FOUND = 1 };
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ /* What's inside ? */
+ bool valid;
+} s_mcfg;
+
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/rsdp.h
^
|
@@ -0,0 +1,38 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef RSDP_H
+#define RSDP_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define RSDP_MIN_ADDRESS 0x0E0000
+#define RSDP_MAX_ADDRESS 0x0FFFFF
+
+#define RSDP "RSD PTR"
+
+enum { RSDP_TABLE_FOUND = 1 };
+
+typedef struct {
+ uint8_t *address;
+ uint8_t signature[8 + 1];
+ uint8_t checksum;
+ uint8_t oem_id[6 + 1];
+ uint8_t revision;
+ uint8_t *rsdt_address;
+ uint32_t length;
+ uint8_t *xsdt_address;
+ uint8_t extended_checksum;
+ bool valid;
+} s_rsdp;
+
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/rsdt.h
^
|
@@ -0,0 +1,31 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef RSDT_H
+#define RSDT_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+enum { RSDT_TABLE_FOUND = 1};
+
+#define RSDT "RSDT"
+
+typedef struct {
+ uint8_t *address;
+ s_acpi_description_header header;
+ uint8_t *entry[255];
+ uint8_t entry_count;
+ bool valid;
+} s_rsdt;
+
+int parse_rsdt(s_rsdt * rsdt);
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/sbst.h
^
|
@@ -0,0 +1,30 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef SBST_H
+#define SBST_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define SBST "SBST"
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ bool valid;
+ uint32_t warning_energy_level;
+ uint32_t low_energy_level;
+ uint32_t critical_energy_level;
+} s_sbst;
+
+void parse_sbst(s_sbst * sbst);
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/slic.h
^
|
@@ -0,0 +1,29 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef SLIC_H
+#define SLIC_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define SLIC "SLIC"
+
+enum { SLIC_TABLE_FOUND = 1 };
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ /* What's inside ? */
+ bool valid;
+} s_slic;
+
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/ssdt.h
^
|
@@ -0,0 +1,28 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef SSDT_H
+#define SSDT_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define SSDT "SSDT"
+#define PSDT "PSDT"
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ uint8_t *definition_block;
+ bool valid;
+} s_ssdt;
+
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/structs.h
^
|
@@ -0,0 +1,47 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef ACPI_STRUCTS_H
+#define ACPI_STRUCTS_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+/* This value define the real size of the acpi structure
+ * Our is bigger as we manage the \0 of strings
+ * */
+#define ACPI_HEADER_SIZE 36
+
+enum { GAS_SYSTEM_MEMORY=0, GAS_SYSTEM_IO=1 };
+
+/* Generic Address Structure (GAS) Format */
+typedef struct {
+ /* address_space_id could be {GAS_SYSTEM_MEMORY | GAS_SYSTEM_IO} */
+ uint8_t address_space_id;
+ uint8_t register_bit_width;
+ uint8_t register_bit_offset;
+ uint8_t reserved;
+ uint64_t address;
+} __attribute__ ((packed)) s_gas;
+
+typedef struct {
+ uint8_t signature[4 + 1];
+ uint32_t length;
+ uint8_t revision;
+ uint8_t checksum;
+ uint8_t oem_id[6 + 1];
+ uint8_t oem_table_id[8 + 1];
+ uint32_t oem_revision;
+ uint8_t creator_id[4 + 1];
+ uint32_t creator_revision;
+} s_acpi_description_header;
+
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/tcpa.h
^
|
@@ -0,0 +1,29 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef TCPA_H
+#define TCPA_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define TCPA "TCPA"
+
+enum { TCPA_TABLE_FOUND = 1 };
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ /* What's inside ? */
+ bool valid;
+} s_tcpa;
+
+#endif
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gplinclude/acpi/xsdt.h
^
|
@@ -0,0 +1,30 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - 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
+ * 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.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef XSDT_H
+#define XSDT_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+enum { XSDT_TABLE_FOUND = 1 };
+
+#define XSDT "XSDT"
+
+typedef struct {
+ uint8_t *address;
+ s_acpi_description_header header;
+ uint64_t *entry[255];
+ uint8_t entry_count;
+ bool valid;
+} s_xsdt;
+
+#endif
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gplinclude/cpuid.h
^
|
@@ -19,6 +19,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <cpufeature.h>
+#include <sys/bitops.h>
#include <sys/cpu.h>
#include <klibc/compiler.h>
@@ -173,11 +174,6 @@
#define X86_VENDOR_NUM 9
#define X86_VENDOR_UNKNOWN 0xff
-static inline __purefunc bool test_bit(int nr, const uint32_t * addr)
-{
- return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
-}
-
#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability)
/*
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gplinclude/dmi/dmi_base_board.h
^
|
@@ -14,17 +14,19 @@
#define DMI_BASE_BOARD_H
#include "stdbool.h"
-#define BASE_BOARD_MANUFACTURER_SIZE 32
-#define BASE_BOARD_PRODUCT_NAME_SIZE 32
-#define BASE_BOARD_VERSION_SIZE 16
-#define BASE_BOARD_SERIAL_SIZE 32
-#define BASE_BOARD_ASSET_TAG_SIZE 32
-#define BASE_BOARD_LOCATION_SIZE 32
+#define BASE_BOARD_MANUFACTURER_SIZE 65
+#define BASE_BOARD_PRODUCT_NAME_SIZE 65
+#define BASE_BOARD_VERSION_SIZE 65
+#define BASE_BOARD_SERIAL_SIZE 65
+#define BASE_BOARD_ASSET_TAG_SIZE 65
+#define BASE_BOARD_LOCATION_SIZE 65
#define BASE_BOARD_FEATURES_SIZE 32
#define BASE_BOARD_TYPE_SIZE 32
#define BASE_BOARD_NB_ELEMENTS 5
+#define BASE_BOARD_DEVICE_DESCRIPTION 65
+
extern const char *base_board_features_strings[];
/* this struct have BASE_BOARD_NB_ELEMENTS */
@@ -51,7 +53,7 @@
struct {
char type[16];
uint8_t status;
- char description[10];
+ char description[BASE_BOARD_DEVICE_DESCRIPTION];
} devices_information[10];
} s_base_board;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gplinclude/dmi/dmi_battery.h
^
|
@@ -16,11 +16,11 @@
#include <stdbool.h>
#include <inttypes.h>
-#define BATTERY_LOCATION_SIZE 255
-#define BATTERY_MANUFACTURER_SIZE 255
-#define BATTERY_MANUFACTURE_DATE_SIZE 255
-#define BATTERY_SERIAL_SIZE 255
-#define BATTERY_DEVICE_NAME_SIZE 255
+#define BATTERY_LOCATION_SIZE 65
+#define BATTERY_MANUFACTURER_SIZE 65
+#define BATTERY_MANUFACTURE_DATE_SIZE 65
+#define BATTERY_SERIAL_SIZE 65
+#define BATTERY_DEVICE_NAME_SIZE 65
#define BATTERY_CHEMISTRY_SIZE 32
#define BATTERY_CAPACITY_SIZE 16
#define BATTERY_DESIGN_VOLTAGE_SIZE 16
@@ -28,7 +28,7 @@
#define BATTERY_MAXIMUM_ERROR_SIZE 32
#define BATTERY_SBDS_SERIAL_SIZE 32
#define BATTERY_SBDS_MANUFACTURE_DATE_SIZE 255
-#define BATTERY_SBDS_CHEMISTRY_SIZE 16
+#define BATTERY_SBDS_CHEMISTRY_SIZE 65
#define BATTERY_OEM_INFO_SIZE 255
typedef struct {
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gplinclude/dmi/dmi_bios.h
^
|
@@ -14,9 +14,9 @@
#define DMI_BIOS_H
#include "stdbool.h"
-#define BIOS_VENDOR_SIZE 32
-#define BIOS_VERSION_SIZE 32
-#define BIOS_RELEASE_SIZE 16
+#define BIOS_VENDOR_SIZE 65
+#define BIOS_VERSION_SIZE 65
+#define BIOS_RELEASE_SIZE 65
#define BIOS_RUNTIME_SIZE_UNIT_SIZE 16
#define BIOS_ROM_UNIT_SIZE 16
#define BIOS_BIOS_REVISION_SIZE 16
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gplinclude/dmi/dmi_cache.h
^
|
@@ -22,8 +22,10 @@
#include "stdbool.h"
+#define CACHE_SOCKET_DESIGNATION_SIZE 65
+
typedef struct {
- char socket_designation[32];
+ char socket_designation[CACHE_SOCKET_DESIGNATION_SIZE];
char configuration[32];
char mode[32];
char location[8];
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gplinclude/dmi/dmi_chassis.h
^
|
@@ -13,12 +13,12 @@
#ifndef DMI_CHASSIS_H
#define DMI_CHASSIS_H
-#define CHASSIS_MANUFACTURER_SIZE 32
+#define CHASSIS_MANUFACTURER_SIZE 65
#define CHASSIS_TYPE_SIZE 16
#define CHASSIS_LOCK_SIZE 16
-#define CHASSIS_VERSION_SIZE 16
-#define CHASSIS_SERIAL_SIZE 32
-#define CHASSIS_ASSET_TAG_SIZE 32
+#define CHASSIS_VERSION_SIZE 65
+#define CHASSIS_SERIAL_SIZE 65
+#define CHASSIS_ASSET_TAG_SIZE 65
#define CHASSIS_BOOT_UP_STATE_SIZE 32
#define CHASSIS_POWER_SUPPLY_STATE_SIZE 32
#define CHASSIS_THERMAL_STATE_SIZE 32
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gplinclude/dmi/dmi_memory.h
^
|
@@ -13,21 +13,22 @@
#ifndef DMI_MEMORY_H
#define DMI_MEMORY_H
-#define MEMORY_MANUFACTURER_SIZE 32
+#define MEMORY_MANUFACTURER_SIZE 65
#define MEMORY_ERROR_SIZE 16
#define MEMORY_TOTAL_WIDTH_SIZE 16
#define MEMORY_DATA_WIDTH_SIZE 16
#define MEMORY_SIZE_SIZE 32
#define MEMORY_FORM_FACTOR_SIZE 32
#define MEMORY_DEVICE_SET_SIZE 32
-#define MEMORY_DEVICE_LOCATOR_SIZE 32
-#define MEMORY_BANK_LOCATOR_SIZE 32
+#define MEMORY_DEVICE_LOCATOR_SIZE 65
+#define MEMORY_BANK_LOCATOR_SIZE 65
#define MEMORY_TYPE_SIZE 32
#define MEMORY_TYPE_DETAIL_SIZE 16
#define MEMORY_SPEED_SIZE 16
-#define MEMORY_SERIAL_SIZE 16
-#define MEMORY_ASSET_TAG_SIZE 16
-#define MEMORY_PART_NUMBER_SIZE 16
+#define MEMORY_SERIAL_SIZE 65
+#define MEMORY_ASSET_TAG_SIZE 65
+#define MEMORY_PART_NUMBER_SIZE 65
+#define MEMORY_SOCKET_DESIGNATION_SIZE 65
typedef struct {
char manufacturer[MEMORY_MANUFACTURER_SIZE];
@@ -50,7 +51,7 @@
} s_memory;
typedef struct {
- char socket_designation[8];
+ char socket_designation[MEMORY_SOCKET_DESIGNATION_SIZE];
char bank_connections[8];
char speed[8];
char type[48];
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gplinclude/dmi/dmi_processor.h
^
|
@@ -15,18 +15,18 @@
#include "stdbool.h"
#include "string.h"
-#define PROCESSOR_SOCKET_DESIGNATION_SIZE 32
+#define PROCESSOR_SOCKET_DESIGNATION_SIZE 65
#define PROCESSOR_TYPE_SIZE 32
#define PROCESSOR_FAMILY_SIZE 32
-#define PROCESSOR_MANUFACTURER_SIZE 64
-#define PROCESSOR_VERSION_SIZE 64
+#define PROCESSOR_MANUFACTURER_SIZE 65
+#define PROCESSOR_VERSION_SIZE 65
#define PROCESSOR_VOLTAGE_SIZE 16
#define PROCESSOR_STATUS_SIZE 16
#define PROCESSOR_UPGRADE_SIZE 16
#define PROCESSOR_CACHE_SIZE 16
-#define PROCESSOR_SERIAL_SIZE 32
-#define PROCESSOR_ASSET_TAG_SIZE 32
-#define PROCESSOR_PART_NUMBER_SIZE 32
+#define PROCESSOR_SERIAL_SIZE 65
+#define PROCESSOR_ASSET_TAG_SIZE 65
+#define PROCESSOR_PART_NUMBER_SIZE 65
#define PROCESSOR_ID_SIZE 32
#define PROCESSOR_FLAGS_ELEMENTS 32
@@ -97,6 +97,9 @@
char asset_tag[PROCESSOR_ASSET_TAG_SIZE];
char part_number[PROCESSOR_PART_NUMBER_SIZE];
char id[PROCESSOR_ID_SIZE];
+ uint16_t core_count;
+ uint16_t core_enabled;
+ uint16_t thread_count;
s_dmi_cpu_flags cpu_flags;
s_signature signature;
/* The filled field have to be set to true when the dmitable implement that item */
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gplinclude/dmi/dmi_system.h
^
|
@@ -13,14 +13,14 @@
#ifndef DMI_SYSTEM_H
#define DMI_SYSTEM_H
-#define SYSTEM_MANUFACTURER_SIZE 32
-#define SYSTEM_PRODUCT_NAME_SIZE 32
-#define SYSTEM_VERSION_SIZE 16
-#define SYSTEM_SERIAL_SIZE 32
+#define SYSTEM_MANUFACTURER_SIZE 65
+#define SYSTEM_PRODUCT_NAME_SIZE 65
+#define SYSTEM_VERSION_SIZE 65
+#define SYSTEM_SERIAL_SIZE 65
#define SYSTEM_UUID_SIZE 40
#define SYSTEM_WAKEUP_TYPE_SIZE 32
-#define SYSTEM_SKU_NUMBER_SIZE 32
-#define SYSTEM_FAMILY_SIZE 32
+#define SYSTEM_SKU_NUMBER_SIZE 65
+#define SYSTEM_FAMILY_SIZE 65
#define SYSTEM_BOOT_STATUS_SIZE 50
#define SYSTEM_CONFIGURATION_OPTIONS_SIZE 50
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gpllib/Makefile
^
|
@@ -8,7 +8,7 @@
REQFLAGS += -I../gplinclude
-GPLDIRS := . disk dmi vpd
+GPLDIRS := . disk dmi vpd acpi
LIBOBJS := $(foreach dir,$(GPLDIRS),$(patsubst %.c,%.o,$(wildcard $(dir)/*.c)))
BINDIR = /usr/bin
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi
^
|
+(directory)
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/acpi.c
^
|
@@ -0,0 +1,241 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+#include "acpi/acpi.h"
+
+void dbg_printf(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+}
+
+void init_acpi(s_acpi * acpi)
+{
+ memset(acpi, 0, sizeof(s_acpi));
+}
+
+int parse_acpi(s_acpi * acpi)
+{
+ int ret_val;
+ init_acpi(acpi);
+
+ /* Let's seach for RSDP table */
+ if ((ret_val = search_rsdp(acpi)) != RSDP_TABLE_FOUND)
+ return ret_val;
+
+ /* Let's seach for RSDT table
+ * That's not a big deal not having it, XSDT is far more relevant */
+ parse_rsdt(&acpi->rsdt);
+ if (parse_xsdt(acpi) != XSDT_TABLE_FOUND) {
+ DEBUG_PRINT(("XSDT Detection failed\n"));
+ for (int table=0; table <acpi->rsdt.entry_count; table++) {
+ parse_header((uint64_t *)acpi->rsdt.entry[table],acpi);
+ }
+ }
+ return ACPI_FOUND;
+}
+
+void get_acpi_description_header(uint8_t * q, s_acpi_description_header * adh)
+{
+ cp_str_struct(adh->signature);
+ cp_struct(&adh->length);
+ cp_struct(&adh->revision);
+ cp_struct(&adh->checksum);
+ cp_str_struct(adh->oem_id);
+ cp_str_struct(adh->oem_table_id);
+ cp_struct(&adh->oem_revision);
+ cp_str_struct(adh->creator_id);
+ cp_struct(&adh->creator_revision);
+ DEBUG_PRINT(("acpi_header at %p = %s | %s | %s\n", q, adh->signature,adh->oem_id, adh->creator_id ));
+}
+
+bool parse_header(uint64_t *address, s_acpi *acpi) {
+ s_acpi_description_header adh;
+ memset(&adh, 0, sizeof(adh));
+
+ get_acpi_description_header((uint8_t *)address, &adh);
+
+ /* Trying to determine the pointed table */
+ /* Looking for FADT */
+ if (memcmp(adh.signature, FACP, sizeof(FACP) - 1) == 0) {
+ DEBUG_PRINT(("FACP table found\n"));
+ s_fadt *f = &acpi->fadt;
+ s_facs *fa = &acpi->facs;
+ s_dsdt *d = &acpi->dsdt;
+ /* This structure is valid, let's fill it */
+ f->valid = true;
+ f->address = address;
+ memcpy(&f->header, &adh, sizeof(adh));
+ parse_fadt(f);
+
+ /* FACS wasn't already detected
+ * FADT points to it, let's try to detect it */
+ if (fa->valid == false) {
+ fa->address = (uint64_t *)f->x_firmware_ctrl;
+ parse_facs(fa);
+ if (fa->valid == false) {
+ /* Let's try again */
+ fa->address = (uint64_t *)f->firmware_ctrl;
+ parse_facs(fa);
+ }
+ }
+
+ /* DSDT wasn't already detected
+ * FADT points to it, let's try to detect it */
+ if (d->valid == false) {
+ s_acpi_description_header new_adh;
+ get_acpi_description_header((uint8_t *)f->x_dsdt,
+ &new_adh);
+ if (memcmp(new_adh.signature, DSDT, sizeof(DSDT) - 1) == 0) {
+ DEBUG_PRINT(("DSDT table found via x_dsdt\n"));
+ d->valid = true;
+ d->address = (uint64_t *)f->x_dsdt;
+ memcpy(&d->header, &new_adh, sizeof(new_adh));
+ parse_dsdt(d);
+ } else {
+ /* Let's try again */
+ get_acpi_description_header((uint8_t *)f->dsdt_address,
+ &new_adh);
+ if (memcmp(new_adh.signature, DSDT, sizeof(DSDT) - 1) ==
+ 0) {
+ DEBUG_PRINT(("DSDT table found via dsdt_address\n"));
+ d->valid = true;
+ d->address = (uint64_t *)f->dsdt_address;
+ memcpy(&d->header, &new_adh, sizeof(new_adh));
+ parse_dsdt(d);
+ }
+ }
+ }
+ } /* Looking for MADT */
+ else if (memcmp(adh.signature, APIC, sizeof(APIC) - 1) == 0) {
+ DEBUG_PRINT(("MADT table found\n"));
+ s_madt *m = &acpi->madt;
+ /* This structure is valid, let's fill it */
+ m->valid = true;
+ m->address =address;
+ memcpy(&m->header, &adh, sizeof(adh));
+ parse_madt(acpi);
+ } else if (memcmp(adh.signature, DSDT, sizeof(DSDT) - 1) == 0) {
+ DEBUG_PRINT(("DSDT table found\n"));
+ s_dsdt *d = &acpi->dsdt;
+ /* This structure is valid, let's fill it */
+ d->valid = true;
+ d->address = address;
+ memcpy(&d->header, &adh, sizeof(adh));
+ parse_dsdt(d);
+ /* PSDT have to be considered as SSDT. Intel ACPI Spec @ 5.2.11.3 */
+ } else if ((memcmp(adh.signature, SSDT, sizeof(SSDT) - 1) == 0)
+ || (memcmp(adh.signature, PSDT, sizeof(PSDT) - 1) == 0)) {
+
+ DEBUG_PRINT(("SSDT table found with %s \n",adh.signature));
+
+ if ((acpi->ssdt_count >= MAX_SSDT - 1))
+ return false;
+
+ /* We can have many SSDT, so let's allocate a new one */
+ if ((acpi->ssdt[acpi->ssdt_count] =
+ malloc(sizeof(s_ssdt))) == NULL)
+ return false;
+ s_ssdt *s = acpi->ssdt[acpi->ssdt_count];
+
+ /* This structure is valid, let's fill it */
+ s->valid = true;
+ s->address = address;
+ memcpy(&s->header, &adh, sizeof(adh));
+
+ /* Searching how much definition blocks we must copy */
+ uint32_t definition_block_size = adh.length - ACPI_HEADER_SIZE;
+ if ((s->definition_block =
+ malloc(definition_block_size)) != NULL) {
+ memcpy(s->definition_block,
+ (s->address + ACPI_HEADER_SIZE),
+ definition_block_size);
+ }
+ /* Increment the number of ssdt we have */
+ acpi->ssdt_count++;
+ } else if (memcmp(adh.signature, SBST, sizeof(SBST) - 1) == 0) {
+ DEBUG_PRINT(("SBST table found\n"));
+ s_sbst *s = &acpi->sbst;
+ /* This structure is valid, let's fill it */
+ s->valid = true;
+ s->address = address;
+ memcpy(&s->header, &adh, sizeof(adh));
+ parse_sbst(s);
+ } else if (memcmp(adh.signature, ECDT, sizeof(ECDT) - 1) == 0) {
+ DEBUG_PRINT(("ECDT table found\n"));
+ s_ecdt *e = &acpi->ecdt;
+ /* This structure is valid, let's fill it */
+ e->valid = true;
+ e->address = address;
+ memcpy(&e->header, &adh, sizeof(adh));
+ parse_ecdt(e);
+ } else if (memcmp(adh.signature, HPET, sizeof(HPET) - 1) == 0) {
+ DEBUG_PRINT(("HPET table found\n"));
+ s_hpet *h = &acpi->hpet;
+ /* This structure is valid, let's fill it */
+ h->valid = true;
+ h->address = address;
+ memcpy(&h->header, &adh, sizeof(adh));
+ } else if (memcmp(adh.signature, TCPA, sizeof(TCPA) - 1) == 0) {
+ DEBUG_PRINT(("TCPA table found\n"));
+ s_tcpa *t = &acpi->tcpa;
+ /* This structure is valid, let's fill it */
+ t->valid = true;
+ t->address = address;
+ memcpy(&t->header, &adh, sizeof(adh));
+ } else if (memcmp(adh.signature, MCFG, sizeof(MCFG) - 1) == 0) {
+ DEBUG_PRINT(("MCFG table found\n"));
+ s_mcfg *m = &acpi->mcfg;
+ /* This structure is valid, let's fill it */
+ m->valid = true;
+ m->address = address;
+ memcpy(&m->header, &adh, sizeof(adh));
+ } else if (memcmp(adh.signature, SLIC, sizeof(SLIC) - 1) == 0) {
+ DEBUG_PRINT(("SLIC table found\n"));
+ s_slic *s = &acpi->slic;
+ /* This structure is valid, let's fill it */
+ s->valid = true;
+ s->address = address;
+ memcpy(&s->header, &adh, sizeof(adh));
+ } else if (memcmp(adh.signature, BOOT, sizeof(BOOT) - 1) == 0) {
+ DEBUG_PRINT(("BOOT table found\n"));
+ s_boot *b = &acpi->boot;
+ /* This structure is valid, let's fill it */
+ b->valid = true;
+ b->address = address;
+ memcpy(&b->header, &adh, sizeof(adh));
+ }
+
+ return true;
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/dsdt.c
^
|
@@ -0,0 +1,48 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+#include <dprintf.h>
+#include "acpi/acpi.h"
+
+void parse_dsdt(s_dsdt * d)
+{
+ uint8_t *q;
+ q = (uint8_t *)d->address;
+ q += ACPI_HEADER_SIZE;
+
+ /* Searching how much definition blocks we must copy */
+ uint32_t definition_block_size=d->header.length-ACPI_HEADER_SIZE;
+ if ((d->definition_block=malloc(definition_block_size)) != NULL) {
+ memcpy(d->definition_block,q,definition_block_size);
+ }
+
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/ecdt.c
^
|
@@ -0,0 +1,53 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+#include <stdlib.h>
+#include <dprintf.h>
+#include "acpi/acpi.h"
+
+void parse_ecdt(s_ecdt * e)
+{
+ uint8_t *q;
+ q = (uint8_t *)e->address;
+ q += ACPI_HEADER_SIZE;
+
+ /* Copying remaining structs */
+ cp_struct(&e->ec_control);
+ cp_struct(&e->ec_data);
+ cp_struct(&e->uid);
+ cp_struct(&e->gpe_bit);
+
+ /* Searching ec_id size we must copy */
+ uint32_t ec_id_size = e->header.length - EC_ID_OFFSET;
+ if ((e->ec_id = malloc(ec_id_size)) != NULL) {
+ memcpy(e->ec_id, (uint64_t *) (e->address + EC_ID_OFFSET), ec_id_size);
+ }
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/facs.c
^
|
@@ -0,0 +1,52 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+#include <dprintf.h>
+#include "acpi/acpi.h"
+
+void parse_facs(s_facs * f)
+{
+ uint8_t *q;
+ q = (uint8_t *) f->address;
+
+ DEBUG_PRINT(("Searching FACS at %p\n",q));
+ if (memcmp(q, FACS, sizeof(FACS) - 1) == 0) {
+ f->valid = true;
+ cp_str_struct(f->signature);
+ cp_struct(&f->length);
+ cp_struct(&f->hardware_signature);
+ cp_struct(&f->firmware_waking_vector);
+ cp_struct(&f->global_lock);
+ cp_struct(&f->flags);
+ cp_struct(&f->x_firmware_waking_vector);
+ cp_struct(&f->version);
+ }
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/fadt.c
^
|
@@ -0,0 +1,99 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+#include <dprintf.h>
+#include "acpi/acpi.h"
+
+void parse_fadt(s_fadt * f)
+{
+ /* Let's seach for FADT table */
+ uint8_t *q;
+
+ /* Fixing table name */
+ memcpy(f->header.signature,FADT,sizeof(FADT));
+
+ /* Copying remaining structs */
+ q = (uint8_t *)f->address;
+ q += ACPI_HEADER_SIZE;
+ DEBUG_PRINT(("- Parsing FADT at %p\n",q));
+
+ cp_struct(&f->firmware_ctrl);
+ cp_struct(&f->dsdt_address);
+ cp_struct(&f->reserved);
+ cp_struct(&f->prefered_pm_profile);
+ cp_struct(&f->sci_int);
+ cp_struct(&f->smi_cmd);
+ cp_struct(&f->acpi_enable);
+ cp_struct(&f->acpi_disable);
+ cp_struct(&f->s4bios_req);
+ cp_struct(&f->pstate_cnt);
+ cp_struct(&f->pm1a_evt_blk);
+ cp_struct(&f->pm1b_evt_blk);
+ cp_struct(&f->pm1a_cnt_blk);
+ cp_struct(&f->pm1b_cnt_blk);
+ cp_struct(&f->pm2_cnt_blk);
+ cp_struct(&f->pm_tmr_blk);
+ cp_struct(&f->gpe0_blk);
+ cp_struct(&f->gpe1_blk);
+ cp_struct(&f->pm1_evt_len);
+ cp_struct(&f->pm1_cnt_len);
+ cp_struct(&f->pm2_cnt_len);
+ cp_struct(&f->pm_tmr_len);
+ cp_struct(&f->gpe0_blk_len);
+ cp_struct(&f->gpe1_blk_len);
+ cp_struct(&f->gpe1_base);
+ cp_struct(&f->cst_cnt);
+ cp_struct(&f->p_lvl2_lat);
+ cp_struct(&f->p_lvl3_lat);
+ cp_struct(&f->flush_size);
+ cp_struct(&f->flush_stride);
+ cp_struct(&f->duty_offset);
+ cp_struct(&f->duty_width);
+ cp_struct(&f->day_alarm);
+ cp_struct(&f->mon_alarm);
+ cp_struct(&f->century);
+ cp_struct(&f->iapc_boot_arch);
+ cp_struct(&f->reserved_2);
+ cp_struct(&f->flags);
+ cp_struct(&f->reset_reg);
+ cp_struct(&f->reset_value);
+ cp_struct(f->reserved_3);
+ cp_struct(&f->x_firmware_ctrl);
+ cp_struct(&f->x_dsdt);
+ cp_struct(&f->x_pm1a_evt_blk);
+ cp_struct(&f->x_pm1b_evt_blk);
+ cp_struct(&f->x_pm1a_cnt_blk);
+ cp_struct(&f->x_pm1b_cnt_blk);
+ cp_struct(&f->x_pm2_cnt_blk);
+ cp_struct(&f->x_pm_tmr_blk);
+ cp_struct(&f->x_gpe0_blk);
+ cp_struct(&f->x_gpe1_blk);
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/madt.c
^
|
@@ -0,0 +1,172 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+#include <dprintf.h>
+#include <stdlib.h>
+#include "acpi/acpi.h"
+
+/* Parse the apic structures */
+static uint8_t *add_apic_structure(s_acpi * acpi, uint8_t * q)
+{
+ uint8_t type = *q;
+ q++;
+ uint8_t length = *q;
+ q++;
+ s_processor_local_apic *sla;
+ s_io_apic *sio;
+ s_interrupt_source_override *siso;
+ s_nmi *snmi;
+ s_local_apic_nmi *slan;
+ s_local_apic_address_override *slaao;
+ s_io_sapic *siosapic;
+ s_local_sapic *sls;
+ s_madt *madt = &acpi->madt;
+
+ switch (type) {
+ case PROCESSOR_LOCAL_APIC:
+ sla = &madt->processor_local_apic[madt->processor_local_apic_count];
+ sla->type = type;
+ sla->length = length;
+ cp_struct(&sla->acpi_id);
+ cp_struct(&sla->apic_id);
+ cp_struct(&sla->flags);
+ madt->processor_local_apic_count++;
+ break;
+ case IO_APIC:
+ sio = &madt->io_apic[madt->io_apic_count];
+ sio->type = type;
+ sio->length = length;
+ cp_struct(&sio->io_apic_id);
+ cp_struct(&sio->reserved);
+ cp_struct(&sio->io_apic_address);
+ cp_struct(&sio->global_system_interrupt_base);
+ madt->io_apic_count++;
+ break;
+ case INTERRUPT_SOURCE_OVERRIDE:
+ siso =
+ &madt->interrupt_source_override[madt->
+ interrupt_source_override_count];
+ siso->type = type;
+ siso->length = length;
+ siso->bus = *q;
+ q++;
+ siso->source = *q;
+ q++;
+ cp_struct(&siso->global_system_interrupt);
+ cp_struct(&siso->flags);
+ madt->interrupt_source_override_count++;
+ break;
+ case NMI:
+ snmi = &madt->nmi[madt->nmi_count];
+ snmi->type = type;
+ snmi->length = length;
+ cp_struct(&snmi->flags);
+ cp_struct(&snmi->global_system_interrupt);
+ madt->nmi_count++;
+ break;
+ case LOCAL_APIC_NMI_STRUCTURE:
+ slan = &madt->local_apic_nmi[madt->local_apic_nmi_count];
+ slan->type = type;
+ slan->length = length;
+ cp_struct(&slan->acpi_processor_id);
+ cp_struct(&slan->flags);
+ cp_struct(&slan->local_apic_lint);
+ madt->local_apic_nmi_count++;
+ break;
+ case LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE:
+ slaao =
+ &madt->local_apic_address_override[madt->
+ local_apic_address_override_count];
+ slaao->type = type;
+ slaao->length = length;
+ cp_struct(&slaao->reserved);
+ cp_struct(&slaao->local_apic_address);
+ madt->local_apic_address_override_count++;
+ break;
+ case IO_SAPIC:
+ siosapic = &madt->io_sapic[madt->io_sapic_count];
+ siosapic->type = type;
+ siosapic->length = length;
+ cp_struct(&siosapic->io_apic_id);
+ cp_struct(&siosapic->reserved);
+ cp_struct(&siosapic->global_system_interrupt_base);
+ cp_struct(&siosapic->io_sapic_address);
+ madt->io_sapic_count++;
+ break;
+ case LOCAL_SAPIC:
+ sls = &madt->local_sapic[madt->local_sapic_count];
+ sls->type = type;
+ sls->length = length;
+ cp_struct(&sls->acpi_processor_id);
+ cp_struct(&sls->local_sapic_id);
+ cp_struct(&sls->local_sapic_eid);
+ cp_struct(sls->reserved);
+ cp_struct(&sls->flags);
+ cp_struct(&sls->acpi_processor_uid_value);
+ if ((sls->acpi_processor_uid_string =
+ malloc(length - ACPI_PROCESSOR_UID_STRING_OFFSET)) != NULL) {
+ memcpy(sls->acpi_processor_uid_string, q,
+ length - ACPI_PROCESSOR_UID_STRING_OFFSET);
+ q += length - ACPI_PROCESSOR_UID_STRING_OFFSET;
+ }
+ madt->local_sapic_count++;
+ break;
+ default:
+ printf("Unkown APIC structure type %u, size=%u \n", type, length);
+ q += length - 2;
+ break;
+ }
+ return q;
+}
+
+void parse_madt(s_acpi * acpi)
+{
+ /* Let's seach for FADT table */
+ uint8_t *q, *max_address;
+ s_madt *m = &acpi->madt;
+
+ /* Fixing table name */
+ memcpy(m->header.signature, APIC, sizeof(APIC));
+
+ /* Copying remaining structs */
+ q = (uint8_t *)m->address;
+ q += ACPI_HEADER_SIZE;
+
+ max_address = (uint8_t *)m->address;
+ max_address += m->header.length;
+
+ cp_struct(&m->local_apic_address);
+ cp_struct(&m->flags);
+
+ while (q < max_address) {
+ q = add_apic_structure(acpi, q);
+ }
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/rsdp.c
^
|
@@ -0,0 +1,82 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+#include <dprintf.h>
+#include "acpi/acpi.h"
+
+int search_rsdp(s_acpi * acpi)
+{
+ /* Let's seach for RSDT table */
+ uint8_t *q;
+
+ /* Let's start for the base address */
+ for (q = (uint8_t *)RSDP_MIN_ADDRESS; q < (uint8_t *)RSDP_MAX_ADDRESS; q+=16 ) {
+ /* Searching for RSDP with "RSD PTR" signature */
+ if (memcmp(q, RSDP, sizeof(RSDP)-1) == 0) {
+ s_rsdp *r = &acpi->rsdp;
+ r->valid = true;
+ r->address = q;
+ cp_str_struct(r->signature);
+ cp_struct(&r->checksum);
+ cp_str_struct(r->oem_id);
+ cp_struct(&r->revision);
+ cp_struct(&r->rsdt_address);
+ cp_struct(&r->length);
+ cp_struct(&r->xsdt_address);
+ cp_struct(&r->extended_checksum);
+ q += 3; /* reserved field */
+ acpi->rsdt.address = r->rsdt_address;
+ acpi->xsdt.address = r->xsdt_address;
+ DEBUG_PRINT(("RSDT should be at %p\n",r->rsdt_address));
+ DEBUG_PRINT(("XSDT should be at %p\n",r->xsdt_address));
+ return RSDP_TABLE_FOUND;
+ }
+ }
+ return -RSDP_TABLE_FOUND;
+}
+
+void print_rsdp(s_acpi * acpi)
+{
+ s_rsdp *r = &acpi->rsdp;
+
+ if (!r->valid)
+ return;
+ printf("RSDP Table @ 0x%p\n", r->address);
+ printf(" signature : %s\n", r->signature);
+ printf(" checksum : %u\n", r->checksum);
+ printf(" oem id : %s\n", r->oem_id);
+ printf(" revision : %u\n", r->revision);
+ printf(" RDST address : %p\n", r->rsdt_address);
+ printf(" length : %u\n", r->length);
+ printf(" XSDT address : %p\n", r->xsdt_address);
+ printf(" extended checksum : %u\n", r->extended_checksum);
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/rsdt.c
^
|
@@ -0,0 +1,72 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+#include <dprintf.h>
+#include "acpi/acpi.h"
+
+int parse_rsdt(s_rsdt *r)
+{
+ /* Let's seach for RSDT table */
+ uint8_t *q;
+
+ /* Let's start for the base address */
+ q = r->address;
+
+ DEBUG_PRINT(("Searching for RSDT at %p\n",q));
+ /* Searching for MADT with APIC signature */
+ if (memcmp(q, RSDT, sizeof(RSDT)-1) == 0) {
+// DEBUG_PRINT(("RSDT : %c %c %c %c\n",q[0], q[1], q[2], q[3]));
+ r->valid = true;
+ DEBUG_PRINT(("Before \n"));
+ get_acpi_description_header(q, &r->header);
+ DEBUG_PRINT(("RSDT table at %p found with %d bytes long with %d items\n",r->address, r->header.length,(r->header.length-ACPI_HEADER_SIZE)/4));
+
+ uint32_t *start = (uint32_t *)r->address;
+ start += (ACPI_HEADER_SIZE / 4);
+ uint32_t *max = (uint32_t *)r->address;
+ max += (r->header.length / 4);
+ DEBUG_PRINT(("Searching starting at %p till %p\n",start,max));
+ uint32_t *p;
+ for (p = start ; p < max; p++) {
+ /* Let's grab the pointed table header */
+ char address[16] = { 0 };
+ sprintf(address, "%x", *p);
+ uint32_t *pointed_address = (uint32_t *)strtoul(address, NULL, 16);
+ r->entry[r->entry_count] = (uint8_t *)pointed_address;
+ DEBUG_PRINT(("%d : %p\n",r->entry_count, r->entry[r->entry_count]));
+ r->entry_count++;
+ }
+ return RSDT_TABLE_FOUND;
+ }
+
+ return -RSDT_TABLE_FOUND;
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/sbst.c
^
|
@@ -0,0 +1,45 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+#include <dprintf.h>
+#include "acpi/acpi.h"
+
+void parse_sbst(s_sbst * s)
+{
+ uint8_t *q;
+ q = (uint8_t *)s->address;
+ q += ACPI_HEADER_SIZE;
+
+ /* Copying remaining structs */
+ cp_struct(&s->warning_energy_level);
+ cp_struct(&s->low_energy_level);
+ cp_struct(&s->critical_energy_level);
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/gpllib/acpi/xsdt.c
^
|
@@ -0,0 +1,77 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+#include <stdlib.h>
+#include "acpi/acpi.h"
+
+int parse_xsdt(s_acpi * acpi)
+{
+ /* Let's seach for XSDT table */
+ uint8_t *q;
+
+ /* Let's start for the base address */
+ q = acpi->xsdt.address;
+
+ /* If address is null return an error */
+ if (q == 0 ) {
+ DEBUG_PRINT(("XSDT is null, exiting\n"));
+ return -XSDT_TABLE_FOUND;
+ }
+
+ DEBUG_PRINT(("Searching XSDT at %p",q));
+ /* Searching for MADT with APIC signature */
+ if (memcmp(q, XSDT, sizeof(XSDT) - 1) == 0) {
+ s_xsdt *x = &acpi->xsdt;
+ x->valid = true;
+ get_acpi_description_header(q, &x->header);
+ DEBUG_PRINT(("XSDT table found at %p : length=%d\n",x->address,x->header.length));
+ DEBUG_PRINT(("Expected Tables = %d\n",(x->header.length-ACPI_HEADER_SIZE)/8));
+
+ /* We now have a set of pointers to some tables */
+ uint64_t *p = NULL;
+ for (p = ((uint64_t *)(x->address + ACPI_HEADER_SIZE));
+ p < ((uint64_t *)(x->address + x->header.length)); p++) {
+ DEBUG_PRINT((" Looking for HEADER at %p = %x\n",p,*p));
+
+ /* Let's grab the pointed table header */
+ char address[16] = { 0 };
+ sprintf(address, "%llx", *p);
+ uint64_t *pointed_address = (uint64_t *)strtoul(address, NULL, 16);
+
+ x->entry[x->entry_count] = pointed_address;
+ if (parse_header(pointed_address, acpi)) {
+ x->entry_count++;
+ }
+ }
+ return XSDT_TABLE_FOUND;
+ }
+ return -XSDT_TABLE_FOUND;
+}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gpllib/disk/mbrs.c
^
|
@@ -27,8 +27,6 @@
switch (s_label) {
case 0x0000:
- case 0xfa33:
- case 0xfab8:
case 0xfabe:
strlcpy(buffer, "No bootloader", buffer_size - 1);
break;
@@ -39,7 +37,18 @@
strlcpy(buffer, "Acer 3", buffer_size - 1);
break;
case 0x33c0:
- strlcpy(buffer, "Windows", buffer_size - 1);
+ /* We need more than 2 bytes */
+ if (((label >> 8) & 0xff) == 0x8e)
+ strlcpy(buffer, "Windows", buffer_size - 1);
+ else if (((label >> 8) & 0xff) == 0x90)
+ strlcpy(buffer, "DiskCryptor", buffer_size - 1);
+ else if (((label >> 8) & 0xff) == 0xfa)
+ strlcpy(buffer, "Syslinux", buffer_size - 1);
+ else
+ strlcpy(buffer, "Unknown mbr", buffer_size - 1);
+ break;
+ case 0x33ed:
+ strlcpy(buffer, "Syslinux ISOhybrid", buffer_size - 1);
break;
case 0x33ff:
strlcpy(buffer, "HP/Gateway", buffer_size - 1);
@@ -56,6 +65,9 @@
case 0xeb04:
strlcpy(buffer, "Solaris", buffer_size - 1);
break;
+ case 0xeb31:
+ strlcpy(buffer, "Paragon", buffer_size - 1);
+ break;
case 0xeb48:
strlcpy(buffer, "Grub", buffer_size - 1);
break;
@@ -78,13 +90,19 @@
break;
case 0xfa31:
/* We need more than 2 bytes */
- if (((label >> 8) & 0xff) == 0xc9)
- strlcpy(buffer, "Master Boot LoaDeR", buffer_size - 1);
- else if (((label >> 8) & 0xff) == 0xc0)
+ if (((label >> 8) & 0xff) == 0xc0)
strlcpy(buffer, "Syslinux", buffer_size - 1);
+ else if (((label >> 8) & 0xff) == 0xc9)
+ strlcpy(buffer, "Master Boot LoaDeR", buffer_size - 1);
else
strlcpy(buffer, "Unknown mbr", buffer_size - 1);
break;
+ case 0xfa33:
+ strlcpy(buffer, "MS-DOS 3.30 through Windows 95 (A)", buffer_size - 1);
+ break;
+ case 0xfab8:
+ strlcpy(buffer, "FreeDOS (eXtended FDisk)", buffer_size - 1);
+ break;
case 0xfaeb:
strlcpy(buffer, "Lilo", buffer_size - 1);
break;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gpllib/disk/msdos.c
^
|
@@ -20,13 +20,13 @@
#include <disk/partition.h>
#include <disk/read.h>
-static inline int is_extended_partition(struct part_entry *ptab)
+static int is_extended_partition(struct part_entry *ptab)
{
return (ptab->ostype == 0x05 ||
ptab->ostype == 0x0f || ptab->ostype == 0x85);
}
-static inline int msdos_magic_present(const char *ptab)
+static int msdos_magic_present(const char *ptab)
{
return (*(uint16_t *) (ptab + 0x1fe) == 0xaa55);
}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gpllib/dmi/dmi.c
^
|
@@ -299,6 +299,35 @@
}
}
+static void dmi_base_board_type(uint8_t code, s_dmi * dmi)
+{
+ /* 3.3.3.2 */
+ static const char *type[] = {
+ "Unknown", /* 0x01 */
+ "Other",
+ "Server Blade",
+ "Connectivity Switch",
+ "System Management Module",
+ "Processor Module",
+ "I/O Module",
+ "Memory Module",
+ "Daughter Board",
+ "Motherboard",
+ "Processor+Memory Module",
+ "Processor+I/O Module",
+ "Interconnect Board" /* 0x0D */
+ };
+
+ if (code >= 0x01 && code <= 0x0D) {
+ strlcpy(dmi->base_board.type, type[code],
+ sizeof(dmi->base_board.type));
+ } else {
+ strlcpy(dmi->base_board.type, out_of_spec,
+ sizeof(dmi->base_board.type));
+ }
+ return;
+}
+
static void dmi_processor_voltage(uint8_t code, s_dmi * dmi)
{
/* 3.3.5.4 */
@@ -652,8 +681,7 @@
dmi_base_board_features(data[0x09], dmi);
strlcpy(dmi->base_board.location, dmi_string(h, data[0x0A]),
sizeof(dmi->base_board.location));
- strlcpy(dmi->base_board.type, dmi_string(h, data[0x0D]),
- sizeof(dmi->base_board.type));
+ dmi_base_board_type(data[0x0D], dmi);
if (h->length < 0x0F + data[0x0E] * sizeof(uint16_t))
break;
break;
@@ -743,6 +771,14 @@
sizeof(dmi->processor.asset_tag));
strlcpy(dmi->processor.part_number, dmi_string(h, data[0x22]),
sizeof(dmi->processor.part_number));
+ dmi->processor.core_count = 0;
+ dmi->processor.core_enabled = 0;
+ dmi->processor.thread_count = 0;
+ if (h->length < 0x28)
+ break;
+ dmi->processor.core_count = data[0x23];
+ dmi->processor.core_enabled = data[0x24];
+ dmi->processor.thread_count = data[0x25];
break;
case 6: /* 3.3.7 Memory Module Information */
if (h->length < 0x0C)
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gpllib/dmi/dmi_cache.c
^
|
@@ -125,10 +125,15 @@
"4-way Set-associative",
"Fully Associative",
"8-way Set-associative",
- "16-way Set-associative" /* 0x08 */
+ "16-way Set-associative", /* 0x08 */
+ "12-way Set-associative",
+ "24-way Set-associative",
+ "32-way Set-associative",
+ "48-way Set-associative",
+ "64-way Set-associative" /* 0x0D */
};
- if (code >= 0x01 && code <= 0x08)
+ if (code >= 0x01 && code <= 0x0D)
return type[code - 0x01];
return out_of_spec;
}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gpllib/dmi/dmi_memory.c
^
|
@@ -124,10 +124,15 @@
"RDRAM",
"DDR",
"DDR2",
- "DDR2 FB-DIMM" /* 0x14 */
+ "DDR2 FB-DIMM", /* 0x14 */
+ NULL,
+ NULL,
+ NULL,
+ "DDR3", /* 0x18 */
+ "FBD2" /* 0x19 */
};
- if (code >= 0x01 && code <= 0x14)
+ if (code >= 0x01 && code <= 0x19)
return type[code - 0x01];
return out_of_spec;
}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/gpllib/dmi/dmi_processor.c
^
|
@@ -49,6 +49,7 @@
const char *dmi_processor_family(uint8_t code, char *manufacturer)
{
/* 3.3.5.2 */
+ /* TODO : Need to implement code/value (see dmidecode) insteed of array to address large index */
static const char *family[256] = {
NULL, /* 0x00 */
"Other",
@@ -221,11 +222,11 @@
"Dual-Core Xeon 7100",
"Quad-Core Xeon 5400",
"Quad-Core Xeon", /* 0xAA */
- NULL,
- NULL,
- NULL,
- NULL,
- NULL, /* 0xAF */
+ "Dual-Core Xeon 5200",
+ "Dual-Core Xeon 7200",
+ "Quad-Core Xeon 7300",
+ "Quad-Core Xeon 7400",
+ "Multi-Core Xeon 7400", /* 0xAF */
"Pentium III Xeon",
"Pentium III Speedstep",
"Pentium 4",
@@ -248,8 +249,8 @@
"Core 2 Extreme Mobile",
"Core 2 Duo Mobile",
"Core 2 Solo Mobile",
- NULL,
- NULL, /* 0xC7 */
+ "Core i7",
+ "Dual-Core Celeron", /* 0xC7 */
"IBM390",
"G4",
"G5",
@@ -264,16 +265,16 @@
"C7-D",
"C7",
"Eden",
- NULL, /*0xD6 */
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ "Multi-Core Xeon", /*0xD6 */
+ "Dual-Core Xeon 3xxx",
+ "Quad-Core Xeon 3xxx", /*0xD8 */
+ NULL,
+ "Dual-Core Xeon 5xxx", /*0xDA */
+ "Quad-Core Xeon 5xxx",
+ NULL,
+ "Dual-Core Xeon 7xxx", /*0xDD */
+ "Quad-Core Xeon 7xxx",
+ "Multi-Core Xeon 7xxx",
NULL, /*0xE0 */
NULL,
NULL,
@@ -373,9 +374,10 @@
"Socket S1",
"Socket AM2",
"Socket F (1207)"
+ "Socket LGA1366" /* 0x19 */
};
- if (code >= 0x01 && code <= 0x18)
+ if (code >= 0x01 && code <= 0x19)
return upgrade[code - 0x01];
return out_of_spec;
}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/hdt/.gitignore
^
|
@@ -0,0 +1,7 @@
+floppy/memtest.bin
+floppy/pci.ids.gz
+floppy/syslinux.cfg
+*.img
+*.iso
+iso/
+*gz
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/Makefile
^
|
@@ -30,7 +30,7 @@
CODENAME = $(shell $(SED) -n 's/\#define CODENAME \"\(.*\)\"/\1/p' hdt.h)
VERSION_C32 = $(shell echo $(VERSION) | $(SED) -e 's/-/_/g' | $(SED) -e 's/\./_/g')
-MEMTEST_URL = http://memtest.org/download/4.10/memtest86+-4.10.bin
+MEMTEST_URL = http://memtest.org/download/4.20/memtest86+-4.20.bin
MEMTEST = memtest.bin
KERNEL_VERSION ?= $(shell uname -r)
@@ -45,6 +45,7 @@
GZ_PCI_IDS_FILE ?= $(PCI_IDS_FILE).gz
MENU_COM32 ?= $(com32)/menu/menu.c32
ART_DIR ?= art/
+QEMU ?= qemu-kvm
all: $(MODULES) $(TESTFILES)
@@ -108,6 +109,9 @@
release: spotless hdt.c32 hdt.img hdt.img.gz hdt.iso
mv hdt.c32 hdt_$(VERSION_C32).c32
+test: hdt.img
+ $(QEMU) -fda hdt.img
+
tidy dist:
rm -f *.o *.lo *.a *.lst *.elf .*.d *.tmp
@@ -117,7 +121,7 @@
spotless: clean
rm -f *.lss *.c32 *.com hdt*.img hdt*.iso hdt*.img.gz
rm -rf $(ISO_DIR)
- rm -rf $(FLOPPY_DIR)/memtest
+ rm -rf $(FLOPPY_DIR)/$(MEMTEST)
rm -rf $(FLOPPY_DIR)/pci.ids*
rm -f *~ \#*
|
|
Added |
syslinux-4.04.tar.bz2/com32/hdt/art/HDT.ai
^
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/hdt/art/HDT.svg
^
|
@@ -0,0 +1,535 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="1280px" height="720px" viewBox="0 0 1280 720" enable-background="new 0 0 1280 720" xml:space="preserve">
+<rect fill="#2C3238" width="1280" height="720"/>
+<g>
+ <g>
+ <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="545.0864" y1="489.623" x2="606.1919" y2="489.623">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_1_)" d="M560.927,515.72c0.128,1.287,0.386,2.285,0.771,2.992c0.386,0.707,0.82,1.238,1.303,1.592
+ c0.482,0.354,0.972,0.611,1.471,0.771c0.499,0.16,0.957,0.346,1.375,0.555c0.417,0.209,0.747,0.506,0.989,0.893
+ c0.241,0.385,0.344,0.98,0.312,1.785h-22.044c-0.065-0.869,0.041-1.496,0.313-1.881c0.272-0.387,0.644-0.686,1.11-0.893
+ c0.466-0.209,0.972-0.402,1.519-0.58c0.547-0.176,1.069-0.506,1.568-0.988c0.498-0.482,0.916-1.191,1.254-2.123
+ c0.337-0.932,0.522-2.25,0.555-3.955h0.048v-49.64h-0.048c-0.097-1.445-0.322-2.571-0.675-3.375
+ c-0.355-0.805-0.765-1.407-1.231-1.81c-0.466-0.401-0.965-0.69-1.495-0.867c-0.531-0.177-1.013-0.362-1.448-0.555
+ c-0.434-0.193-0.788-0.467-1.061-0.82c-0.272-0.354-0.393-0.917-0.361-1.688c0-0.064,0-0.12,0-0.17
+ c0-0.047,0.112-0.071,0.337-0.071h21.418c0.16,0,0.248,0.031,0.265,0.097c0.016,0.064,0.023,0.128,0.023,0.192
+ c0,0.74-0.128,1.287-0.386,1.641c-0.258,0.354-0.603,0.627-1.037,0.82c-0.435,0.192-0.901,0.369-1.399,0.53
+ c-0.5,0.161-0.982,0.435-1.447,0.82c-0.466,0.385-0.885,0.956-1.254,1.712c-0.37,0.756-0.603,1.81-0.699,3.16h-0.048V515.72z
+ M599.807,514.948c0.097,1.447,0.32,2.572,0.675,3.377s0.765,1.408,1.23,1.809c0.466,0.404,0.965,0.691,1.495,0.869
+ c0.53,0.176,1.014,0.361,1.447,0.555c0.435,0.193,0.788,0.475,1.061,0.844c0.273,0.371,0.41,0.941,0.41,1.713
+ c0,0.031-0.007,0.08-0.023,0.145s-0.138,0.096-0.361,0.096c-3.409,0-6.834,0-10.275,0s-7.156-0.016-11.143-0.047
+ c-0.161,0-0.25-0.033-0.265-0.096c-0.017-0.066-0.041-0.131-0.073-0.195c0-0.738,0.137-1.285,0.41-1.639
+ c0.273-0.354,0.619-0.627,1.037-0.82c0.417-0.193,0.885-0.369,1.399-0.531c0.514-0.16,1.004-0.434,1.471-0.82
+ s0.885-0.957,1.254-1.711c0.369-0.758,0.619-1.809,0.748-3.16v-23.493H564.4c-0.708,0-1.085-0.201-1.133-0.602
+ c-0.048-0.404,0.152-0.91,0.603-1.521c0.45-0.611,1.102-1.27,1.954-1.977c0.852-0.707,1.849-1.377,2.991-2.002
+ c1.141-0.627,2.395-1.143,3.762-1.545c1.367-0.402,2.757-0.604,4.172-0.604c1.544,0,2.79,0,3.739,0s1.729,0,2.34,0
+ c0.61,0,1.101-0.008,1.47-0.023c0.37-0.018,0.74-0.031,1.11-0.047c0.369-0.018,0.796-0.033,1.278-0.049
+ c0.482-0.018,1.141-0.041,1.979-0.072c0.643-0.033,1.077-0.217,1.302-0.557c0.224-0.336,0.354-0.617,0.387-0.844l-0.049-18.425
+ c-0.162-1.287-0.427-2.284-0.796-2.991c-0.37-0.707-0.796-1.247-1.278-1.617c-0.482-0.37-0.982-0.627-1.496-0.771
+ c-0.514-0.146-0.973-0.322-1.375-0.53c-0.402-0.211-0.732-0.499-0.989-0.868c-0.258-0.37-0.354-0.974-0.29-1.81l22.093,0.049
+ c0.064,0.867-0.049,1.494-0.338,1.881c-0.289,0.386-0.668,0.674-1.133,0.868c-0.467,0.193-0.974,0.377-1.521,0.554
+ s-1.068,0.5-1.567,0.965c-0.499,0.467-0.916,1.167-1.254,2.099c-0.338,0.934-0.523,2.252-0.555,3.956V514.948z"/>
+ </g>
+ <g>
+ <linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="677.4297" y1="509.0273" x2="732.7426" y2="453.7145">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_2_)" d="M734.411,455.47c0.434,0.226,0.587,0.548,0.459,0.965c-0.129,0.419-0.499,0.924-1.109,1.521
+ c-0.611,0.595-1.32,1.245-2.123,1.953c-1.447,1.222-2.99,2.171-4.631,2.846s-3.217,0.981-4.729,0.918h0.05h-14.279v50.698
+ c0.065,1.607,0.266,2.846,0.603,3.715c0.338,0.867,0.74,1.527,1.208,1.979c0.464,0.449,0.964,0.762,1.494,0.939
+ c0.531,0.176,1.013,0.369,1.446,0.578c0.436,0.211,0.788,0.5,1.062,0.867c0.272,0.371,0.379,0.99,0.315,1.859h-9.456h-5.596
+ c-0.74,0-1.464,0-2.171,0s-1.359-0.01-1.953-0.025c-0.596-0.016-1.104-0.023-1.521-0.023c-0.418,0-0.691,0-0.819,0
+ c-0.066-0.869,0.041-1.486,0.314-1.857c0.271-0.369,0.626-0.65,1.061-0.844c0.434-0.193,0.908-0.379,1.422-0.555
+ c0.514-0.178,1.014-0.482,1.496-0.916s0.899-1.07,1.254-1.906c0.354-0.836,0.563-2.041,0.627-3.617v-50.892h-7.525h-15.772
+ c-1.319,0-2.202-0.113-2.654-0.339c-0.449-0.225-0.603-0.546-0.458-0.964c0.145-0.419,0.523-0.916,1.134-1.496
+ c0.611-0.578,1.335-1.238,2.171-1.979c1.446-1.222,2.998-2.17,4.654-2.846s3.225-0.98,4.704-0.916c0.578,0,1.688,0,3.329,0
+ c1.639,0,3.601,0,5.885,0c2.282,0,4.799,0,7.549,0s5.522,0,8.32,0h21.708C733.133,455.133,733.978,455.245,734.411,455.47z"/>
+ </g>
+ <g>
+ <linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="614.4233" y1="489.5566" x2="671.4414" y2="489.5566">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_3_)" d="M667.872,472.496c1.447,2.51,2.404,5.26,2.869,8.252c0.467,2.99,0.7,6.061,0.7,9.213
+ c0,6.237-1.512,11.931-4.535,17.075c-2.99,5.115-7.268,9.312-12.83,12.592c-2.605,1.512-5.709,2.654-9.311,3.426
+ c-0.933,0.193-1.978,0.369-3.136,0.529c-1.158,0.16-2.276,0.297-3.353,0.41s-2.025,0.201-2.847,0.266
+ c-0.818,0.064-1.357,0.096-1.615,0.096c-0.45,0-0.9-0.006-1.352-0.023c-0.449-0.016-0.674-0.25-0.674-0.699
+ c0-0.289,0.145-0.773,0.434-1.447c0.289-0.676,0.748-1.398,1.375-2.172c0.628-0.77,1.431-1.512,2.413-2.219
+ c0.979-0.707,2.176-1.238,3.593-1.592c1.801-0.643,3.321-1.156,4.559-1.543c1.238-0.385,2.371-0.805,3.4-1.254
+ s2.033-1.014,3.015-1.688c0.98-0.676,2.114-1.609,3.401-2.799c2.604-2.412,4.613-5.209,6.029-8.393
+ c1.415-3.186,2.122-6.739,2.122-10.661c0-1.996-0.104-3.947-0.313-5.863c-0.209-1.912-0.563-3.73-1.061-5.449
+ c-0.5-1.721-1.182-3.33-2.051-4.824s-1.96-2.838-3.279-4.027c-1.094-1.094-2.524-2.1-4.293-3.016s-3.65-1.689-5.645-2.316
+ c-1.995-0.627-4.004-1.116-6.031-1.471c-2.025-0.354-3.851-0.538-5.475-0.555c-1.624-0.016-2.951,0.16-3.979,0.531
+ c-1.03,0.37-1.545,0.957-1.545,1.76l0.049,48.722h0.048v10.951h-14.133c0-0.645,0.12-1.125,0.361-1.449
+ c0.241-0.32,0.538-0.57,0.892-0.746c0.355-0.178,0.741-0.305,1.159-0.387c0.417-0.08,0.812-0.201,1.181-0.361
+ c0.37-0.16,0.692-0.395,0.966-0.699c0.272-0.305,0.458-0.764,0.555-1.375c0-1.865,0-4.115,0-6.752
+ c0-2.639-0.009-5.492-0.024-8.564c-0.018-3.07-0.024-6.254-0.024-9.552c0-3.295,0-6.535,0-9.719s-0.008-6.217-0.023-9.094
+ c-0.017-2.879-0.024-5.443-0.024-7.693c0-2.252,0.008-4.077,0.024-5.476c0.016-1.397,0.023-2.211,0.023-2.436
+ c0.032-1.157,0.596-2.099,1.688-2.823c1.093-0.723,2.468-1.277,4.124-1.663s3.497-0.619,5.523-0.699
+ c2.027-0.08,4.004-0.08,5.935,0c1.929,0.08,3.714,0.218,5.354,0.41c1.641,0.192,2.895,0.401,3.763,0.628
+ c1.479,0.449,3.2,1.091,5.161,1.929c1.961,0.835,3.963,1.929,6.006,3.279c2.043,1.352,4.02,2.967,5.934,4.849
+ C664.888,467.795,666.521,469.99,667.872,472.496z"/>
+ </g>
+</g>
+<g>
+ <linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="505.0664" y1="544.8008" x2="510.741" y2="544.8008">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_4_)" d="M509.132,551.499c0.033,0.33,0.099,0.584,0.198,0.766s0.21,0.318,0.334,0.41
+ c0.124,0.09,0.25,0.156,0.378,0.197c0.127,0.041,0.246,0.088,0.353,0.143c0.107,0.055,0.192,0.129,0.253,0.229
+ c0.062,0.1,0.089,0.252,0.081,0.457h-5.658c-0.017-0.221,0.011-0.383,0.08-0.48c0.07-0.1,0.165-0.178,0.286-0.23
+ c0.119-0.053,0.249-0.102,0.39-0.148c0.14-0.045,0.274-0.131,0.402-0.254c0.127-0.123,0.235-0.305,0.322-0.543
+ c0.086-0.242,0.134-0.578,0.143-1.018h0.012v-12.738h-0.012c-0.025-0.371-0.083-0.66-0.174-0.867
+ c-0.091-0.205-0.196-0.359-0.315-0.463c-0.12-0.104-0.248-0.178-0.384-0.223c-0.135-0.045-0.259-0.092-0.371-0.143
+ c-0.111-0.049-0.202-0.121-0.272-0.211c-0.07-0.09-0.101-0.234-0.092-0.432c0-0.018,0-0.033,0-0.045
+ c0-0.014,0.028-0.018,0.086-0.018h5.497c0.041,0,0.063,0.008,0.068,0.023c0.004,0.018,0.006,0.033,0.006,0.051
+ c0,0.189-0.033,0.33-0.099,0.42c-0.066,0.09-0.155,0.162-0.267,0.211c-0.111,0.051-0.231,0.096-0.358,0.135
+ c-0.128,0.043-0.252,0.113-0.372,0.211c-0.12,0.1-0.228,0.246-0.322,0.439c-0.096,0.195-0.155,0.465-0.18,0.812h-0.013V551.499z
+ M519.11,551.3c0.024,0.371,0.082,0.66,0.173,0.865c0.091,0.209,0.196,0.363,0.316,0.465c0.119,0.104,0.248,0.178,0.384,0.223
+ c0.137,0.047,0.26,0.094,0.371,0.143c0.112,0.051,0.202,0.123,0.272,0.217c0.07,0.096,0.105,0.24,0.105,0.439
+ c0,0.01-0.002,0.021-0.007,0.037c-0.003,0.018-0.035,0.025-0.092,0.025c-0.875,0-1.754,0-2.637,0c-0.883,0-1.836-0.004-2.859-0.014
+ c-0.042,0-0.064-0.006-0.068-0.023c-0.005-0.016-0.011-0.033-0.019-0.049c0-0.191,0.035-0.33,0.104-0.422
+ c0.07-0.09,0.159-0.16,0.267-0.211c0.107-0.049,0.227-0.094,0.359-0.137c0.132-0.039,0.258-0.109,0.378-0.209
+ c0.119-0.1,0.227-0.246,0.322-0.439c0.094-0.193,0.159-0.465,0.192-0.811v-6.029h-6.648c-0.182,0-0.278-0.053-0.292-0.154
+ c-0.012-0.104,0.04-0.234,0.155-0.391c0.115-0.158,0.282-0.326,0.501-0.508c0.218-0.182,0.474-0.354,0.768-0.514
+ c0.292-0.162,0.614-0.291,0.966-0.396c0.35-0.104,0.708-0.154,1.07-0.154c0.396,0,0.716,0,0.96,0c0.243,0,0.443,0,0.6,0
+ s0.283-0.002,0.377-0.008c0.095-0.002,0.19-0.006,0.286-0.01c0.094-0.004,0.204-0.01,0.328-0.014s0.293-0.01,0.508-0.02
+ c0.165-0.006,0.276-0.055,0.334-0.141c0.057-0.088,0.091-0.16,0.099-0.217l-0.012-4.73c-0.042-0.33-0.11-0.586-0.205-0.768
+ s-0.204-0.318-0.328-0.414c-0.124-0.094-0.251-0.16-0.383-0.197c-0.132-0.037-0.25-0.084-0.354-0.137
+ c-0.103-0.053-0.188-0.129-0.253-0.223s-0.091-0.25-0.074-0.465l5.67,0.012c0.017,0.225-0.012,0.385-0.086,0.484
+ c-0.075,0.1-0.171,0.174-0.291,0.223c-0.121,0.049-0.25,0.098-0.391,0.143c-0.14,0.045-0.274,0.127-0.402,0.248
+ c-0.128,0.119-0.236,0.299-0.322,0.537c-0.087,0.24-0.135,0.578-0.143,1.016V551.3z"/>
+ <linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="521.4248" y1="547.6602" x2="534.7334" y2="547.6602">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_5_)" d="M533.669,552.858c0.066,0.066,0.142,0.117,0.229,0.148c0.086,0.033,0.177,0.062,0.272,0.082
+ c0.094,0.02,0.183,0.049,0.266,0.086c0.083,0.037,0.15,0.092,0.204,0.162c0.053,0.068,0.085,0.176,0.093,0.314
+ c0,0.033-0.017,0.049-0.049,0.049h-3.318h-0.013v-6.016c0-1.246-0.354-2.27-1.064-3.068c-0.718-0.787-1.646-1.178-2.785-1.178
+ c-1.123,0-2.051,0.389-2.786,1.164c-0.727,0.791-1.089,1.791-1.089,2.996c0,1.246,0.375,2.27,1.126,3.07
+ c0.743,0.791,1.692,1.188,2.847,1.188c0.537,0,1.048-0.09,1.535-0.271c0.248-0.092,0.495-0.205,0.743-0.342
+ c0.247-0.135,0.499-0.299,0.755-0.488v2.328c-0.512,0.279-1.032,0.486-1.56,0.617c-0.272,0.066-0.553,0.115-0.842,0.148
+ c-0.289,0.033-0.582,0.051-0.879,0.051c-0.569,0-1.139-0.086-1.708-0.26c-0.562-0.182-1.073-0.43-1.535-0.742
+ c-0.867-0.604-1.531-1.35-1.994-2.242c-0.462-0.906-0.693-1.91-0.693-3.008c0-1.799,0.57-3.289,1.709-4.469
+ c1.139-1.172,2.587-1.758,4.345-1.758c1.164,0,2.224,0.289,3.182,0.867c0.479,0.287,0.905,0.643,1.282,1.062
+ c0.375,0.422,0.683,0.869,0.922,1.338c0.115,0.23,0.219,0.475,0.31,0.725c0.091,0.252,0.161,0.51,0.21,0.773
+ c0.099,0.562,0.148,1.379,0.148,2.451v3.924C533.557,552.694,533.603,552.794,533.669,552.858z"/>
+ <linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="535.335" y1="547.5957" x2="545.2256" y2="547.5957">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_6_)" d="M540.28,541.892c0.627-0.248,1.199-0.379,1.714-0.396c0.516-0.016,0.974,0.035,1.375,0.154
+ c0.399,0.119,0.738,0.281,1.015,0.49c0.276,0.205,0.485,0.41,0.625,0.611c0.14,0.203,0.212,0.379,0.217,0.527
+ c0.004,0.148-0.068,0.221-0.217,0.221c-0.207,0.01-0.398,0.014-0.575,0.014c-0.178,0-0.333,0-0.464,0h-0.434
+ c-0.372,0-0.735,0.016-1.089,0.049c-0.355,0.033-0.692,0.09-1.009,0.168c-0.318,0.08-0.607,0.186-0.866,0.322
+ c-0.261,0.135-0.478,0.307-0.65,0.514c-0.314,0.371-0.557,0.838-0.73,1.398s-0.26,1.242-0.26,2.043v3.641
+ c0.033,0.312,0.09,0.553,0.173,0.725c0.083,0.168,0.18,0.295,0.291,0.383c0.112,0.086,0.225,0.148,0.341,0.186
+ s0.221,0.08,0.316,0.129c0.094,0.051,0.168,0.119,0.223,0.211c0.053,0.09,0.076,0.232,0.067,0.42h-5.001
+ c-0.017-0.197,0.006-0.342,0.068-0.432c0.062-0.092,0.143-0.162,0.241-0.211c0.099-0.051,0.208-0.092,0.328-0.131
+ c0.12-0.035,0.236-0.104,0.347-0.203c0.112-0.1,0.206-0.244,0.285-0.434c0.078-0.189,0.13-0.461,0.154-0.818v-9.828h1.993v1.783
+ C539.137,542.708,539.644,542.196,540.28,541.892z"/>
+ <linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="545.4424" y1="545.1094" x2="557.5869" y2="545.1094">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_7_)" d="M546.136,544.8c0.462-0.883,1.135-1.633,2.018-2.252c0.454-0.307,0.965-0.553,1.535-0.744
+ c0.569-0.172,1.143-0.258,1.721-0.258c0.611,0,1.18,0.064,1.708,0.197c0.544,0.139,1.065,0.35,1.56,0.631
+ c-0.173,0.297-0.4,0.549-0.681,0.756c-0.239,0.172-0.553,0.316-0.941,0.432c-0.388,0.117-0.867,0.125-1.436,0.025
+ c-0.272-0.033-0.541-0.025-0.805,0.02s-0.516,0.119-0.755,0.223c-0.239,0.102-0.47,0.232-0.693,0.391
+ c-0.223,0.154-0.425,0.33-0.606,0.518c-0.734,0.77-1.102,1.768-1.102,2.998c0,1.27,0.359,2.301,1.077,3.094
+ c0.718,0.775,1.659,1.164,2.822,1.164c1.131,0,2.055-0.389,2.773-1.164c0.709-0.783,1.064-1.807,1.064-3.07v-10.461
+ c-0.041-0.182-0.124-0.301-0.248-0.359c-0.124-0.059-0.254-0.104-0.39-0.137c-0.137-0.031-0.261-0.084-0.372-0.154
+ c-0.112-0.068-0.171-0.209-0.18-0.414c0-0.033,0.017-0.051,0.05-0.051h3.33v1.623v9c0,0.545-0.015,1.02-0.044,1.424
+ s-0.068,0.744-0.117,1.016c-0.099,0.537-0.268,1.031-0.508,1.484c-0.52,1.033-1.258,1.838-2.216,2.414
+ c-0.966,0.596-2.034,0.893-3.207,0.893c-1.75,0-3.194-0.596-4.333-1.783c-1.147-1.189-1.721-2.686-1.721-4.494
+ C545.442,546.687,545.673,545.7,546.136,544.8z"/>
+ <linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="558.8647" y1="547.7764" x2="578.2983" y2="547.7764">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_8_)" d="M578.211,541.567c0.025,0,0.045,0.01,0.062,0.027c0.033,0.033,0.033,0.086,0,0.16
+ c-0.05,0.115-0.124,0.295-0.223,0.539c-0.1,0.244-0.231,0.6-0.396,1.07l-2.984,8.318c-0.264,0.834-0.553,1.412-0.866,1.734
+ c-0.314,0.338-0.71,0.508-1.189,0.508c-0.487,0-0.887-0.17-1.201-0.508c-0.148-0.166-0.272-0.389-0.371-0.668
+ c-0.1-0.281-0.215-0.629-0.347-1.041h-0.013l-2.08-5.521l-1.981,5.57c-0.264,0.826-0.553,1.4-0.867,1.723
+ c-0.313,0.336-0.714,0.506-1.201,0.506c-0.479,0-0.875-0.164-1.188-0.494c-0.157-0.166-0.283-0.391-0.377-0.676
+ c-0.096-0.285-0.209-0.633-0.341-1.045l-0.013,0.012l-3.095-8.256c-0.182-0.463-0.322-0.816-0.421-1.059
+ c-0.099-0.244-0.173-0.424-0.223-0.539c-0.041-0.074-0.045-0.129-0.012-0.162c0.017-0.018,0.041-0.023,0.074-0.023
+ c0.396-0.016,0.784,0.053,1.164,0.209c0.157,0.066,0.322,0.154,0.495,0.268c0.174,0.111,0.341,0.252,0.501,0.426
+ c0.162,0.174,0.316,0.381,0.465,0.619c0.148,0.24,0.281,0.521,0.396,0.842l2.612,6.809l2.513-6.857
+ c0.066-0.189,0.136-0.361,0.21-0.514s0.153-0.299,0.235-0.439c0.272-0.33,0.549-0.537,0.829-0.619
+ c0.124-0.033,0.252-0.039,0.384-0.018c0.132,0.02,0.269,0.086,0.409,0.197s0.283,0.275,0.427,0.496
+ c0.144,0.219,0.287,0.508,0.427,0.871l2.625,6.822l2.501-6.859c0.107-0.32,0.235-0.604,0.383-0.848
+ c0.149-0.242,0.304-0.451,0.464-0.625c0.161-0.174,0.328-0.316,0.502-0.434c0.173-0.115,0.342-0.211,0.507-0.285
+ C577.399,541.64,577.799,541.562,578.211,541.567z"/>
+ <linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="579.251" y1="547.6602" x2="592.5596" y2="547.6602">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_9_)" d="M591.495,552.858c0.065,0.066,0.143,0.117,0.229,0.148c0.086,0.033,0.177,0.062,0.272,0.082
+ c0.094,0.02,0.183,0.049,0.266,0.086s0.15,0.092,0.205,0.162c0.052,0.068,0.084,0.176,0.092,0.314c0,0.033-0.017,0.049-0.05,0.049
+ h-3.317h-0.013v-6.016c0-1.246-0.354-2.27-1.064-3.068c-0.718-0.787-1.646-1.178-2.786-1.178c-1.123,0-2.051,0.389-2.786,1.164
+ c-0.727,0.791-1.089,1.791-1.089,2.996c0,1.246,0.375,2.27,1.126,3.07c0.743,0.791,1.692,1.188,2.847,1.188
+ c0.537,0,1.048-0.09,1.536-0.271c0.248-0.092,0.495-0.205,0.743-0.342c0.247-0.135,0.499-0.299,0.755-0.488v2.328
+ c-0.512,0.279-1.031,0.486-1.56,0.617c-0.272,0.066-0.553,0.115-0.842,0.148s-0.582,0.051-0.879,0.051
+ c-0.569,0-1.138-0.086-1.708-0.26c-0.562-0.182-1.074-0.43-1.536-0.742c-0.867-0.604-1.531-1.35-1.994-2.242
+ c-0.462-0.906-0.693-1.91-0.693-3.008c0-1.799,0.57-3.289,1.709-4.469c1.139-1.172,2.587-1.758,4.346-1.758
+ c1.164,0,2.224,0.289,3.182,0.867c0.478,0.287,0.905,0.643,1.281,1.062c0.375,0.422,0.683,0.869,0.922,1.338
+ c0.115,0.23,0.219,0.475,0.31,0.725c0.091,0.252,0.161,0.51,0.21,0.773c0.1,0.562,0.149,1.379,0.149,2.451v3.924
+ C591.384,552.694,591.429,552.794,591.495,552.858z"/>
+ <linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="593.1611" y1="547.5957" x2="603.0527" y2="547.5957">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_10_)" d="M598.105,541.892c0.628-0.248,1.199-0.379,1.715-0.396c0.516-0.016,0.974,0.035,1.375,0.154
+ c0.399,0.119,0.738,0.281,1.015,0.49c0.276,0.205,0.485,0.41,0.625,0.611c0.141,0.203,0.213,0.379,0.218,0.527
+ c0.003,0.148-0.069,0.221-0.218,0.221c-0.206,0.01-0.398,0.014-0.575,0.014c-0.178,0-0.333,0-0.465,0h-0.433
+ c-0.372,0-0.735,0.016-1.09,0.049s-0.691,0.09-1.009,0.168c-0.317,0.08-0.606,0.186-0.866,0.322
+ c-0.261,0.135-0.478,0.307-0.65,0.514c-0.313,0.371-0.557,0.838-0.73,1.398s-0.26,1.242-0.26,2.043v3.641
+ c0.033,0.312,0.091,0.553,0.173,0.725c0.082,0.168,0.18,0.295,0.291,0.383c0.111,0.086,0.225,0.148,0.341,0.186
+ c0.115,0.037,0.221,0.08,0.315,0.129c0.095,0.051,0.169,0.119,0.224,0.211c0.053,0.09,0.075,0.232,0.067,0.42h-5.002
+ c-0.017-0.197,0.007-0.342,0.068-0.432c0.062-0.092,0.143-0.162,0.241-0.211c0.1-0.051,0.208-0.092,0.328-0.131
+ c0.12-0.035,0.235-0.104,0.347-0.203c0.112-0.1,0.207-0.244,0.285-0.434s0.13-0.461,0.155-0.818v-9.828h1.992v1.783
+ C596.963,542.708,597.471,542.196,598.105,541.892z"/>
+ <linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="603.1699" y1="547.7412" x2="615.2402" y2="547.7412">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_11_)" d="M612.888,549.776c0.38-0.346,0.715-0.596,1.009-0.748c0.293-0.152,0.539-0.254,0.736-0.303
+ c0.231-0.059,0.434-0.07,0.607-0.039c-0.074,0.43-0.17,0.824-0.285,1.184s-0.254,0.693-0.415,1.002
+ c-0.161,0.311-0.346,0.6-0.558,0.873c-0.209,0.271-0.451,0.533-0.724,0.781c-1.098,0.998-2.426,1.498-3.986,1.498
+ c-0.536,0-1.064-0.076-1.584-0.225c-0.529-0.139-1.02-0.35-1.474-0.631c-0.949-0.578-1.695-1.35-2.24-2.314
+ c-0.537-0.957-0.805-2.002-0.805-3.133c0-0.42,0.038-0.828,0.116-1.225c0.079-0.396,0.192-0.785,0.341-1.166
+ c0.306-0.748,0.751-1.43,1.338-2.041c0.586-0.594,1.246-1.049,1.98-1.361c0.768-0.314,1.551-0.471,2.352-0.471
+ c1.222,0,2.315,0.32,3.281,0.965c0.966,0.652,1.746,1.588,2.34,2.811l-7.91,4.383c-0.083-0.363-0.079-0.727,0.012-1.09
+ c0.074-0.312,0.236-0.646,0.489-1.002c0.251-0.355,0.662-0.686,1.231-0.99c0.041-0.025,0.117-0.07,0.229-0.137
+ c0.111-0.066,0.248-0.145,0.408-0.236c0.161-0.09,0.337-0.189,0.526-0.297s0.38-0.215,0.569-0.322
+ c0.454-0.256,0.949-0.535,1.485-0.84c-0.355-0.396-0.76-0.697-1.213-0.904c-0.438-0.207-0.929-0.311-1.474-0.311
+ c-1.081,0-1.993,0.404-2.735,1.215c-0.743,0.809-1.114,1.807-1.114,2.996c0,1.188,0.371,2.182,1.114,2.982
+ c0.742,0.818,1.654,1.227,2.735,1.227c1.031,0,1.891-0.34,2.575-1.016c0.231-0.197,0.415-0.391,0.551-0.576
+ C612.535,550.13,612.697,549.95,612.888,549.776z"/>
+ <linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="623.3115" y1="544.7832" x2="637.9443" y2="544.7832">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_12_)" d="M637.028,540.405c0.372,0.645,0.617,1.35,0.737,2.117c0.119,0.768,0.179,1.555,0.179,2.363
+ c0,1.602-0.388,3.062-1.163,4.385c-0.769,1.311-1.865,2.389-3.294,3.23c-0.668,0.387-1.464,0.682-2.389,0.879
+ c-0.24,0.051-0.508,0.096-0.805,0.135c-0.297,0.043-0.584,0.078-0.859,0.105c-0.278,0.029-0.521,0.053-0.731,0.068
+ c-0.21,0.018-0.35,0.025-0.415,0.025c-0.116,0-0.23-0.002-0.347-0.006c-0.115-0.004-0.173-0.064-0.173-0.18
+ c0-0.076,0.036-0.197,0.111-0.371c0.073-0.174,0.191-0.359,0.352-0.557c0.163-0.199,0.368-0.389,0.62-0.57
+ c0.251-0.182,0.559-0.318,0.922-0.41c0.462-0.164,0.852-0.297,1.17-0.395c0.318-0.1,0.608-0.207,0.873-0.32
+ c0.264-0.117,0.522-0.262,0.773-0.436c0.252-0.172,0.543-0.412,0.873-0.717c0.668-0.619,1.186-1.338,1.548-2.154
+ c0.363-0.818,0.545-1.729,0.545-2.736c0-0.512-0.028-1.014-0.08-1.504c-0.055-0.49-0.146-0.957-0.273-1.4
+ c-0.127-0.439-0.303-0.854-0.526-1.238c-0.223-0.383-0.503-0.727-0.841-1.033c-0.281-0.281-0.648-0.537-1.102-0.773
+ c-0.455-0.234-0.938-0.434-1.449-0.594s-1.027-0.287-1.548-0.377c-0.52-0.092-0.988-0.139-1.405-0.143s-0.758,0.041-1.021,0.137
+ s-0.396,0.244-0.396,0.451l0.014,12.504h0.013v2.809h-3.628c0-0.164,0.031-0.287,0.093-0.369s0.139-0.146,0.229-0.193
+ c0.092-0.045,0.19-0.078,0.298-0.098c0.107-0.021,0.207-0.053,0.304-0.094c0.095-0.041,0.177-0.102,0.248-0.18
+ c0.068-0.076,0.116-0.195,0.142-0.354c0-0.479,0-1.057,0-1.732c0-0.678-0.003-1.408-0.007-2.197s-0.005-1.604-0.005-2.451
+ c0-0.846,0-1.678,0-2.494c0-0.818-0.003-1.596-0.007-2.334c-0.006-0.74-0.007-1.396-0.007-1.975s0.001-1.045,0.007-1.406
+ c0.004-0.357,0.007-0.566,0.007-0.625c0.007-0.297,0.151-0.537,0.433-0.723c0.28-0.188,0.633-0.328,1.057-0.428
+ c0.426-0.098,0.899-0.158,1.419-0.18c0.521-0.02,1.027-0.02,1.522,0c0.495,0.021,0.954,0.055,1.374,0.104
+ c0.422,0.051,0.743,0.105,0.966,0.162c0.38,0.117,0.822,0.281,1.324,0.496c0.505,0.215,1.018,0.494,1.542,0.842
+ c0.523,0.346,1.03,0.762,1.523,1.244C636.264,539.198,636.682,539.763,637.028,540.405z"/>
+ <linearGradient id="SVGID_13_" gradientUnits="userSpaceOnUse" x1="639.6777" y1="547.7412" x2="651.748" y2="547.7412">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_13_)" d="M649.396,549.776c0.379-0.346,0.717-0.596,1.009-0.748c0.293-0.152,0.539-0.254,0.737-0.303
+ c0.231-0.059,0.433-0.07,0.606-0.039c-0.074,0.43-0.169,0.824-0.285,1.184c-0.115,0.359-0.254,0.693-0.415,1.002
+ c-0.159,0.311-0.347,0.6-0.556,0.873c-0.211,0.271-0.453,0.533-0.725,0.781c-1.099,0.998-2.427,1.498-3.987,1.498
+ c-0.535,0-1.063-0.076-1.584-0.225c-0.529-0.139-1.02-0.35-1.474-0.631c-0.948-0.578-1.696-1.35-2.24-2.314
+ c-0.536-0.957-0.805-2.002-0.805-3.133c0-0.42,0.039-0.828,0.118-1.225c0.077-0.396,0.19-0.785,0.339-1.166
+ c0.307-0.748,0.753-1.43,1.337-2.041c0.588-0.594,1.248-1.049,1.981-1.361c0.769-0.314,1.551-0.471,2.354-0.471
+ c1.221,0,2.314,0.32,3.279,0.965c0.966,0.652,1.745,1.588,2.34,2.811l-7.91,4.383c-0.082-0.363-0.079-0.727,0.013-1.09
+ c0.073-0.312,0.235-0.646,0.488-1.002c0.252-0.355,0.662-0.686,1.231-0.99c0.042-0.025,0.117-0.07,0.23-0.137
+ c0.11-0.066,0.247-0.145,0.408-0.236c0.16-0.09,0.336-0.189,0.525-0.297c0.19-0.107,0.38-0.215,0.569-0.322
+ c0.454-0.256,0.949-0.535,1.485-0.84c-0.354-0.396-0.759-0.697-1.213-0.904c-0.438-0.207-0.929-0.311-1.474-0.311
+ c-1.08,0-1.992,0.404-2.735,1.215c-0.743,0.809-1.114,1.807-1.114,2.996c0,1.188,0.371,2.182,1.114,2.982
+ c0.743,0.818,1.655,1.227,2.735,1.227c1.033,0,1.892-0.34,2.575-1.016c0.23-0.197,0.415-0.391,0.552-0.576
+ S649.207,549.95,649.396,549.776z"/>
+ <linearGradient id="SVGID_14_" gradientUnits="userSpaceOnUse" x1="653.9395" y1="545.9385" x2="660.0059" y2="545.9385">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_14_)" d="M659.721,550.778c0.024,0.01,0.037,0.021,0.037,0.039v2.871v0.012h-0.719c-0.09,0-0.176,0-0.259,0
+ c-0.082,0-0.17-0.004-0.261-0.012h-0.024c-1.437-0.074-2.53-0.439-3.28-1.102c-0.852-0.742-1.275-1.863-1.275-3.367v-8.406v-0.049
+ v-0.484c0.008-0.461,0.123-0.83,0.347-1.105c0.223-0.277,0.47-0.49,0.742-0.639c0.314-0.174,0.673-0.293,1.077-0.359v2.945v0.533
+ v7.182c0,0.973,0.235,1.682,0.706,2.129c0.445,0.42,1.144,0.643,2.091,0.668c0.133-0.033,0.222-0.096,0.267-0.186
+ c0.045-0.092,0.081-0.184,0.106-0.279c0.023-0.094,0.063-0.18,0.118-0.26C659.445,550.831,659.557,550.788,659.721,550.778z
+ M656.7,541.581h0.26c0.157,0.01,0.31,0.014,0.457,0.014H658c0.438,0.008,0.787,0.119,1.052,0.334
+ c0.264,0.213,0.467,0.449,0.606,0.705c0.166,0.297,0.281,0.635,0.348,1.016h-2.811h-0.508L656.7,541.581z"/>
+ <linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="661.4053" y1="547.7412" x2="673.4746" y2="547.7412">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_15_)" d="M671.123,549.776c0.379-0.346,0.715-0.596,1.009-0.748c0.292-0.152,0.538-0.254,0.735-0.303
+ c0.231-0.059,0.434-0.07,0.607-0.039c-0.074,0.43-0.169,0.824-0.284,1.184c-0.116,0.359-0.255,0.693-0.415,1.002
+ c-0.161,0.311-0.347,0.6-0.558,0.873c-0.21,0.271-0.451,0.533-0.724,0.781c-1.098,0.998-2.427,1.498-3.986,1.498
+ c-0.536,0-1.065-0.076-1.585-0.225c-0.528-0.139-1.019-0.35-1.474-0.631c-0.947-0.578-1.695-1.35-2.24-2.314
+ c-0.537-0.957-0.804-2.002-0.804-3.133c0-0.42,0.038-0.828,0.116-1.225c0.079-0.396,0.192-0.785,0.341-1.166
+ c0.306-0.748,0.751-1.43,1.337-2.041c0.586-0.594,1.247-1.049,1.98-1.361c0.768-0.314,1.552-0.471,2.353-0.471
+ c1.222,0,2.314,0.32,3.281,0.965c0.965,0.652,1.745,1.588,2.339,2.811l-7.91,4.383c-0.083-0.363-0.078-0.727,0.012-1.09
+ c0.074-0.312,0.237-0.646,0.49-1.002c0.251-0.355,0.662-0.686,1.23-0.99c0.042-0.025,0.118-0.07,0.23-0.137
+ c0.11-0.066,0.247-0.145,0.407-0.236c0.162-0.09,0.337-0.189,0.527-0.297c0.188-0.107,0.38-0.215,0.568-0.322
+ c0.455-0.256,0.95-0.535,1.485-0.84c-0.354-0.396-0.759-0.697-1.212-0.904c-0.438-0.207-0.929-0.311-1.474-0.311
+ c-1.081,0-1.992,0.404-2.736,1.215c-0.742,0.809-1.114,1.807-1.114,2.996c0,1.188,0.372,2.182,1.114,2.982
+ c0.744,0.818,1.655,1.227,2.736,1.227c1.031,0,1.89-0.34,2.574-1.016c0.231-0.197,0.415-0.391,0.552-0.576
+ S670.933,549.95,671.123,549.776z"/>
+ <linearGradient id="SVGID_16_" gradientUnits="userSpaceOnUse" x1="675.1084" y1="547.6904" x2="683.2793" y2="547.6904">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_16_)" d="M678.711,544.813c-0.908,0.732-1.36,1.699-1.36,2.895c0,1.189,0.452,2.152,1.36,2.887
+ c0.009,0,0.021,0.008,0.037,0.023l-0.049-0.049c0.206,0.164,0.412,0.309,0.619,0.434c0.692,0.379,1.502,0.598,2.426,0.656h0.396
+ c0.132-0.025,0.229-0.072,0.291-0.143c0.062-0.07,0.109-0.152,0.142-0.248c0.033-0.094,0.06-0.195,0.082-0.303
+ c0.02-0.107,0.049-0.205,0.085-0.291c0.038-0.086,0.092-0.16,0.162-0.223c0.069-0.062,0.176-0.098,0.314-0.105
+ c0.043,0,0.062,0.016,0.062,0.049l-0.013,3.33h-1.076h-0.149l-0.396-0.012c-1.906-0.092-3.446-0.641-4.618-1.646
+ c-1.278-1.107-1.919-2.57-1.919-4.395c0-0.99,0.229-1.912,0.681-2.76c0.472-0.852,1.122-1.564,1.957-2.143
+ c0.595-0.396,1.222-0.682,1.882-0.855c0.396-0.105,0.802-0.172,1.22-0.197c0.416-0.023,0.863-0.045,1.343-0.062h1.076v2.068v1.262
+ c0,0.033-0.012,0.049-0.037,0.049c-0.14-0.006-0.247-0.039-0.321-0.098c-0.074-0.057-0.127-0.133-0.161-0.223
+ c-0.032-0.092-0.061-0.188-0.081-0.291c-0.02-0.104-0.047-0.201-0.08-0.297s-0.082-0.18-0.148-0.254s-0.161-0.125-0.284-0.148
+ c-0.742-0.033-1.396,0.053-1.957,0.26S679.141,544.466,678.711,544.813z"/>
+ <linearGradient id="SVGID_17_" gradientUnits="userSpaceOnUse" x1="685.3955" y1="545.9385" x2="691.4629" y2="545.9385">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_17_)" d="M691.178,550.778c0.024,0.01,0.038,0.021,0.038,0.039v2.871v0.012h-0.72c-0.09,0-0.177,0-0.259,0
+ c-0.083,0-0.17-0.004-0.26-0.012h-0.026c-1.436-0.074-2.528-0.439-3.279-1.102c-0.851-0.742-1.276-1.863-1.276-3.367v-8.406v-0.049
+ v-0.484c0.01-0.461,0.126-0.83,0.347-1.105c0.225-0.277,0.472-0.49,0.743-0.639c0.313-0.174,0.673-0.293,1.077-0.359v2.945v0.533
+ v7.182c0,0.973,0.236,1.682,0.705,2.129c0.446,0.42,1.145,0.643,2.094,0.668c0.132-0.033,0.22-0.096,0.266-0.186
+ c0.045-0.092,0.08-0.184,0.104-0.279c0.025-0.094,0.064-0.18,0.119-0.26C690.903,550.831,691.013,550.788,691.178,550.778z
+ M688.157,541.581h0.26c0.157,0.01,0.31,0.014,0.458,0.014h0.582c0.438,0.008,0.788,0.119,1.053,0.334
+ c0.264,0.213,0.466,0.449,0.607,0.705c0.164,0.297,0.28,0.635,0.346,1.016h-2.811h-0.507L688.157,541.581z"/>
+ <linearGradient id="SVGID_18_" gradientUnits="userSpaceOnUse" x1="692.9678" y1="545.2891" x2="698.0781" y2="545.2891">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_18_)" d="M696.601,551.263c0.008,0.404,0.052,0.717,0.131,0.936c0.078,0.217,0.174,0.385,0.287,0.5
+ c0.112,0.115,0.232,0.193,0.36,0.236c0.13,0.041,0.248,0.086,0.356,0.135c0.108,0.051,0.195,0.119,0.263,0.211
+ c0.067,0.09,0.092,0.238,0.074,0.445h-5.1c-0.017-0.207,0.009-0.355,0.075-0.445c0.065-0.092,0.153-0.158,0.262-0.205
+ c0.108-0.045,0.227-0.09,0.355-0.135c0.13-0.047,0.251-0.125,0.363-0.236c0.111-0.111,0.208-0.275,0.287-0.494
+ s0.123-0.529,0.131-0.936v-9.619c0.427,0.01,0.804,0.154,1.132,0.434c0.139,0.123,0.275,0.281,0.406,0.471
+ c0.132,0.189,0.247,0.428,0.346,0.719c0.098,0.287,0.172,0.629,0.222,1.021c0.049,0.391,0.064,0.85,0.049,1.379V551.263z
+ M696.563,540.491c-0.346-0.057-0.656-0.156-0.936-0.297c-0.245-0.115-0.481-0.277-0.708-0.488
+ c-0.226-0.211-0.375-0.488-0.449-0.836v-2.018c0.336-0.008,0.646,0.037,0.924,0.137c0.123,0.039,0.244,0.102,0.363,0.18
+ c0.117,0.078,0.23,0.174,0.338,0.289c0.106,0.115,0.202,0.258,0.283,0.422c0.081,0.166,0.143,0.359,0.185,0.582v0.123V540.491z"/>
+ <linearGradient id="SVGID_19_" gradientUnits="userSpaceOnUse" x1="699.4717" y1="547.6787" x2="711.6787" y2="547.6787">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_19_)" d="M699.472,547.659c0-0.824,0.157-1.621,0.471-2.389c0.306-0.75,0.76-1.432,1.362-2.043
+ c0.578-0.594,1.23-1.043,1.956-1.35c0.718-0.305,1.49-0.457,2.315-0.457c0.842,0,1.621,0.152,2.34,0.457
+ c0.751,0.314,1.407,0.764,1.969,1.35c0.585,0.602,1.03,1.279,1.337,2.031c0.305,0.742,0.457,1.543,0.457,2.4
+ c0,0.859-0.152,1.668-0.457,2.428c-0.314,0.775-0.76,1.451-1.337,2.029c-0.562,0.588-1.218,1.035-1.969,1.35
+ c-0.743,0.314-1.523,0.471-2.34,0.471c-0.802,0-1.572-0.156-2.315-0.471c-0.726-0.305-1.378-0.756-1.956-1.35
+ c-0.603-0.602-1.057-1.283-1.362-2.041C699.629,549.306,699.472,548.501,699.472,547.659z M701.726,547.636
+ c0,1.162,0.375,2.152,1.127,2.971c0.76,0.826,1.667,1.238,2.724,1.238c1.063,0,1.972-0.412,2.724-1.238
+ c0.76-0.809,1.139-1.799,1.139-2.971c0-1.156-0.376-2.145-1.127-2.971c-0.759-0.809-1.672-1.215-2.735-1.215
+ c-1.057,0-1.964,0.406-2.724,1.215C702.101,545.491,701.726,546.479,701.726,547.636z"/>
+ <linearGradient id="SVGID_20_" gradientUnits="userSpaceOnUse" x1="712.3057" y1="547.5791" x2="725.4473" y2="547.5791">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_20_)" d="M712.312,553.726c-0.018-0.207,0.007-0.352,0.072-0.439c0.066-0.086,0.149-0.154,0.248-0.203
+ s0.212-0.096,0.342-0.137c0.127-0.041,0.245-0.113,0.352-0.217c0.108-0.104,0.2-0.258,0.278-0.465
+ c0.078-0.205,0.127-0.498,0.144-0.879v-4.244c0-1.75,0.469-3.143,1.41-4.174c0.934-1.023,2.179-1.535,3.739-1.535
+ c1.552,0,2.794,0.512,3.727,1.535c0.925,1.023,1.387,2.414,1.387,4.174v4.295c0.016,0.363,0.065,0.643,0.148,0.842
+ c0.082,0.197,0.177,0.348,0.285,0.451c0.106,0.104,0.222,0.176,0.347,0.217c0.122,0.041,0.235,0.088,0.339,0.137
+ c0.104,0.049,0.185,0.119,0.242,0.211c0.058,0.09,0.083,0.234,0.074,0.432h-2.203h-2.799c-0.016-0.197,0.008-0.342,0.069-0.432
+ c0.061-0.092,0.142-0.162,0.24-0.211s0.209-0.094,0.328-0.131c0.12-0.037,0.235-0.105,0.347-0.203
+ c0.112-0.1,0.207-0.244,0.285-0.436c0.077-0.188,0.129-0.461,0.155-0.814v-4.754c0-0.951-0.276-1.727-0.83-2.328
+ c-0.561-0.594-1.276-0.891-2.142-0.891c-0.867,0-1.584,0.297-2.155,0.891c-0.561,0.611-0.842,1.387-0.842,2.328v4.914
+ c0.034,0.312,0.093,0.557,0.175,0.73c0.083,0.172,0.18,0.303,0.29,0.389c0.111,0.088,0.226,0.148,0.341,0.188
+ c0.115,0.035,0.221,0.08,0.314,0.129c0.096,0.049,0.17,0.121,0.225,0.209c0.053,0.094,0.075,0.232,0.068,0.422H712.312z"/>
+ <linearGradient id="SVGID_21_" gradientUnits="userSpaceOnUse" x1="730.5518" y1="544.8242" x2="746.6016" y2="544.8242">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_21_)" d="M746.473,536.036c0.11,0.057,0.15,0.141,0.117,0.246c-0.033,0.107-0.127,0.238-0.285,0.391
+ c-0.155,0.154-0.337,0.32-0.545,0.502c-0.37,0.312-0.767,0.557-1.188,0.729c-0.419,0.176-0.825,0.254-1.211,0.236h0.011h-3.664
+ v13.012c0.016,0.412,0.068,0.73,0.155,0.953c0.085,0.223,0.188,0.391,0.309,0.508c0.119,0.115,0.248,0.195,0.385,0.24
+ c0.135,0.047,0.26,0.096,0.37,0.148c0.111,0.055,0.203,0.129,0.273,0.223c0.068,0.096,0.098,0.256,0.08,0.477h-2.426h-1.437
+ c-0.19,0-0.376,0-0.558,0s-0.349,0-0.501-0.006c-0.153-0.004-0.283-0.006-0.391-0.006s-0.177,0-0.211,0
+ c-0.016-0.223,0.012-0.381,0.081-0.477c0.07-0.094,0.162-0.166,0.273-0.217c0.11-0.049,0.233-0.096,0.365-0.143
+ c0.132-0.045,0.259-0.123,0.383-0.234s0.231-0.273,0.322-0.488s0.144-0.525,0.16-0.93V538.14h-1.932h-4.047
+ c-0.339,0-0.564-0.027-0.681-0.086c-0.115-0.059-0.155-0.141-0.117-0.248c0.037-0.107,0.134-0.234,0.289-0.385
+ c0.158-0.148,0.344-0.316,0.559-0.508c0.37-0.312,0.77-0.557,1.193-0.73c0.425-0.172,0.828-0.25,1.208-0.232
+ c0.148,0,0.434,0,0.854,0c0.422,0,0.924,0,1.511,0c0.586,0,1.231,0,1.937,0c0.708,0,1.419,0,2.137,0h5.57
+ C746.145,535.95,746.361,535.978,746.473,536.036z"/>
+ <linearGradient id="SVGID_22_" gradientUnits="userSpaceOnUse" x1="743.793" y1="547.6787" x2="755.999" y2="547.6787">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_22_)" d="M743.793,547.659c0-0.824,0.156-1.621,0.47-2.389c0.306-0.75,0.76-1.432,1.362-2.043
+ c0.577-0.594,1.229-1.043,1.956-1.35c0.718-0.305,1.489-0.457,2.315-0.457c0.842,0,1.621,0.152,2.339,0.457
+ c0.751,0.314,1.408,0.764,1.969,1.35c0.585,0.602,1.031,1.279,1.337,2.031c0.305,0.742,0.458,1.543,0.458,2.4
+ c0,0.859-0.153,1.668-0.458,2.428c-0.313,0.775-0.759,1.451-1.337,2.029c-0.561,0.588-1.218,1.035-1.969,1.35
+ c-0.743,0.314-1.523,0.471-2.339,0.471c-0.802,0-1.573-0.156-2.315-0.471c-0.727-0.305-1.379-0.756-1.956-1.35
+ c-0.603-0.602-1.057-1.283-1.362-2.041C743.949,549.306,743.793,548.501,743.793,547.659z M746.045,547.636
+ c0,1.162,0.375,2.152,1.128,2.971c0.759,0.826,1.667,1.238,2.724,1.238c1.062,0,1.971-0.412,2.724-1.238
+ c0.759-0.809,1.139-1.799,1.139-2.971c0-1.156-0.376-2.145-1.127-2.971c-0.76-0.809-1.673-1.215-2.735-1.215
+ c-1.057,0-1.965,0.406-2.724,1.215C746.42,545.491,746.045,546.479,746.045,547.636z"/>
+ <linearGradient id="SVGID_23_" gradientUnits="userSpaceOnUse" x1="757.584" y1="547.6787" x2="769.79" y2="547.6787">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_23_)" d="M757.584,547.659c0-0.824,0.156-1.621,0.47-2.389c0.306-0.75,0.76-1.432,1.362-2.043
+ c0.577-0.594,1.229-1.043,1.956-1.35c0.718-0.305,1.489-0.457,2.314-0.457c0.841,0,1.622,0.152,2.34,0.457
+ c0.751,0.314,1.407,0.764,1.968,1.35c0.588,0.602,1.033,1.279,1.337,2.031c0.308,0.742,0.459,1.543,0.459,2.4
+ c0,0.859-0.151,1.668-0.459,2.428c-0.313,0.775-0.759,1.451-1.337,2.029c-0.561,0.588-1.217,1.035-1.968,1.35
+ c-0.743,0.314-1.521,0.471-2.34,0.471c-0.8,0-1.572-0.156-2.314-0.471c-0.727-0.305-1.379-0.756-1.956-1.35
+ c-0.603-0.602-1.057-1.283-1.362-2.041C757.74,549.306,757.584,548.501,757.584,547.659z M759.836,547.636
+ c0,1.162,0.377,2.152,1.127,2.971c0.759,0.826,1.667,1.238,2.724,1.238c1.065,0,1.974-0.412,2.723-1.238
+ c0.76-0.809,1.14-1.799,1.14-2.971c0-1.156-0.375-2.145-1.126-2.971c-0.76-0.809-1.671-1.215-2.736-1.215
+ c-1.057,0-1.965,0.406-2.724,1.215C760.213,545.491,759.836,546.479,759.836,547.636z"/>
+ <linearGradient id="SVGID_24_" gradientUnits="userSpaceOnUse" x1="771.0596" y1="544.9199" x2="776.0684" y2="544.9199">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="1" style="stop-color:#D0D2D3"/>
+ </linearGradient>
+ <path fill="url(#SVGID_24_)" d="M774.805,552.327c0.082,0.189,0.177,0.332,0.284,0.428c0.107,0.094,0.22,0.164,0.341,0.203
+ c0.119,0.043,0.229,0.084,0.327,0.131c0.1,0.045,0.178,0.113,0.236,0.205c0.056,0.09,0.082,0.234,0.073,0.432h-2.451
+ c-0.312,0-0.619,0-0.917,0c-0.297,0-0.563-0.002-0.797-0.006c-0.235-0.004-0.43-0.006-0.582-0.006c-0.153,0-0.238,0-0.255,0
+ c-0.017-0.189,0.005-0.33,0.062-0.42c0.058-0.092,0.134-0.16,0.229-0.205c0.095-0.047,0.2-0.088,0.315-0.123
+ c0.115-0.039,0.229-0.1,0.34-0.188c0.112-0.086,0.208-0.211,0.291-0.377c0.082-0.164,0.142-0.404,0.174-0.719v-15.561
+ c0.403-0.033,0.767,0.059,1.09,0.273c0.132,0.088,0.265,0.215,0.396,0.369c0.132,0.158,0.247,0.359,0.346,0.602
+ c0.1,0.244,0.18,0.537,0.241,0.879s0.093,0.744,0.093,1.207v12.07C774.667,551.868,774.722,552.138,774.805,552.327z"/>
+</g>
+<g>
+
+ <linearGradient id="SVGID_25_" gradientUnits="userSpaceOnUse" x1="765.6445" y1="277.7368" x2="808.3828" y2="277.7368" gradientTransform="matrix(0 1.7627 -0.5313 0 746.2548 -985.7871)">
+ <stop offset="0" style="stop-color:#006838"/>
+ <stop offset="1" style="stop-color:#8BC53F"/>
+ </linearGradient>
+ <rect x="596.305" y="363.814" fill="url(#SVGID_25_)" width="4.777" height="75.334"/>
+
+ <linearGradient id="SVGID_26_" gradientUnits="userSpaceOnUse" x1="756.1133" y1="247.3013" x2="811.0918" y2="247.3013" gradientTransform="matrix(0 1.8836 -0.5313 0 746.2548 -1090.623)">
+ <stop offset="0" style="stop-color:#006838"/>
+ <stop offset="1" style="stop-color:#8BC53F"/>
+ </linearGradient>
+ <rect x="611.807" y="333.592" fill="url(#SVGID_26_)" width="6.113" height="103.557"/>
+
+ <linearGradient id="SVGID_27_" gradientUnits="userSpaceOnUse" x1="762.0664" y1="215.625" x2="817.0459" y2="215.625" gradientTransform="matrix(0 2.3897 -0.5313 0 746.2548 -1517.3457)">
+ <stop offset="0" style="stop-color:#006838"/>
+ <stop offset="1" style="stop-color:#8BC53F"/>
+ </linearGradient>
+ <rect x="628.637" y="303.764" fill="url(#SVGID_27_)" width="6.113" height="131.385"/>
+
+ <linearGradient id="SVGID_28_" gradientUnits="userSpaceOnUse" x1="553.5811" y1="411.0479" x2="599.8867" y2="411.0479" gradientTransform="matrix(0.7605 0 0 0.5313 144.8682 147.8136)">
+ <stop offset="0" style="stop-color:#8BC53F"/>
+ <stop offset="1" style="stop-color:#006838"/>
+ </linearGradient>
+ <rect x="565.866" y="363.814" fill="url(#SVGID_28_)" width="35.216" height="4.777"/>
+
+ <linearGradient id="SVGID_29_" gradientUnits="userSpaceOnUse" x1="557.6221" y1="354.8657" x2="612.6035" y2="354.8657" gradientTransform="matrix(0.9408 0 0 0.5313 41.583 147.8136)">
+ <stop offset="0" style="stop-color:#8BC53F"/>
+ <stop offset="1" style="stop-color:#006838"/>
+ </linearGradient>
+ <rect x="566.193" y="333.297" fill="url(#SVGID_29_)" width="51.727" height="6.113"/>
+
+ <linearGradient id="SVGID_30_" gradientUnits="userSpaceOnUse" x1="555.4624" y1="299.3047" x2="614.6807" y2="299.3047" gradientTransform="matrix(1.1577 0 0 0.5313 -76.8652 147.8136)">
+ <stop offset="0" style="stop-color:#8BC53F"/>
+ <stop offset="1" style="stop-color:#006838"/>
+ </linearGradient>
+ <rect x="566.193" y="303.777" fill="url(#SVGID_30_)" width="68.557" height="6.113"/>
+ <linearGradient id="SVGID_31_" gradientUnits="userSpaceOnUse" x1="616.7539" y1="416.6992" x2="663.481" y2="463.4263">
+ <stop offset="0" style="stop-color:#8BC53F"/>
+ <stop offset="1" style="stop-color:#8BC53F"/>
+ </linearGradient>
+ <path fill="url(#SVGID_31_)" d="M593.305,440.148c0,0,36.604-12.721,47.389-12.721s43.484,11.75,46.117,12.5s-40.199-5-45.533-5"/>
+
+ <radialGradient id="SVGID_32_" cx="576.5234" cy="382.7012" r="10.5059" gradientTransform="matrix(0 1 1 0 173.9805 -210.3203)" gradientUnits="userSpaceOnUse">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="0.9632" style="stop-color:#67CA32"/>
+ </radialGradient>
+ <path fill="url(#SVGID_32_)" d="M546.176,366.203c0-5.803,4.704-10.506,10.506-10.506s10.506,4.703,10.506,10.506
+ s-4.704,10.506-10.506,10.506S546.176,372.006,546.176,366.203z M556.682,372.906c1.851,0,3.526-0.751,4.739-1.964
+ s1.963-2.889,1.963-4.739c0-3.702-3.001-6.703-6.702-6.703c-3.702,0-6.703,3.001-6.703,6.703
+ C549.979,369.904,552.979,372.906,556.682,372.906z"/>
+
+ <radialGradient id="SVGID_33_" cx="546.9448" cy="382.7012" r="10.5056" gradientTransform="matrix(0 1 1 0 173.9805 -210.3203)" gradientUnits="userSpaceOnUse">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="0.9632" style="stop-color:#67CA32"/>
+ </radialGradient>
+ <path fill="url(#SVGID_33_)" d="M546.176,336.624c0-5.802,4.704-10.505,10.506-10.505s10.506,4.703,10.506,10.505
+ c0,5.803-4.704,10.506-10.506,10.506S546.176,342.427,546.176,336.624z M556.682,343.327c1.851,0,3.526-0.75,4.739-1.963
+ s1.963-2.889,1.963-4.74c0-3.702-3.001-6.703-6.702-6.703c-3.702,0-6.703,3.001-6.703,6.703S552.979,343.327,556.682,343.327z"/>
+
+ <radialGradient id="SVGID_34_" cx="517.1543" cy="382.7012" r="10.5059" gradientTransform="matrix(0 1 1 0 173.9805 -210.3203)" gradientUnits="userSpaceOnUse">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="0.9632" style="stop-color:#67CA32"/>
+ </radialGradient>
+ <path fill="url(#SVGID_34_)" d="M546.176,306.834c0-5.802,4.704-10.506,10.506-10.506s10.506,4.704,10.506,10.506
+ c0,5.803-4.704,10.506-10.506,10.506S546.176,312.637,546.176,306.834z M556.682,313.537c1.851,0,3.526-0.751,4.739-1.963
+ c1.213-1.214,1.963-2.89,1.963-4.74c0-3.702-3.001-6.703-6.702-6.703c-3.702,0-6.703,3.001-6.703,6.703
+ C549.979,310.535,552.979,313.537,556.682,313.537z"/>
+
+ <linearGradient id="SVGID_35_" gradientUnits="userSpaceOnUse" x1="765.6445" y1="357.6123" x2="808.3828" y2="357.6123" gradientTransform="matrix(0 1.7627 0.5313 0 491.3075 -985.7871)">
+ <stop offset="0" style="stop-color:#006838"/>
+ <stop offset="1" style="stop-color:#8BC53F"/>
+ </linearGradient>
+ <rect x="678.918" y="363.814" fill="url(#SVGID_35_)" width="4.777" height="75.334"/>
+
+ <linearGradient id="SVGID_36_" gradientUnits="userSpaceOnUse" x1="756.1133" y1="327.1772" x2="811.0918" y2="327.1772" gradientTransform="matrix(0 1.8836 0.5313 0 491.3075 -1090.623)">
+ <stop offset="0" style="stop-color:#006838"/>
+ <stop offset="1" style="stop-color:#8BC53F"/>
+ </linearGradient>
+ <rect x="662.08" y="333.592" fill="url(#SVGID_36_)" width="6.113" height="103.557"/>
+
+ <linearGradient id="SVGID_37_" gradientUnits="userSpaceOnUse" x1="762.0664" y1="295.5005" x2="817.0459" y2="295.5005" gradientTransform="matrix(0 2.3897 0.5313 0 491.3075 -1517.3457)">
+ <stop offset="0" style="stop-color:#006838"/>
+ <stop offset="1" style="stop-color:#8BC53F"/>
+ </linearGradient>
+ <rect x="645.25" y="303.764" fill="url(#SVGID_37_)" width="6.113" height="131.385"/>
+
+ <linearGradient id="SVGID_38_" gradientUnits="userSpaceOnUse" x1="497.7793" y1="411.0479" x2="544.084" y2="411.0479" gradientTransform="matrix(-0.7605 0 0 0.5313 1092.6943 147.8136)">
+ <stop offset="0" style="stop-color:#8BC53F"/>
+ <stop offset="1" style="stop-color:#006838"/>
+ </linearGradient>
+ <rect x="678.918" y="363.814" fill="url(#SVGID_38_)" width="35.215" height="4.777"/>
+
+ <linearGradient id="SVGID_39_" gradientUnits="userSpaceOnUse" x1="512.5137" y1="354.8657" x2="567.4951" y2="354.8657" gradientTransform="matrix(-0.9408 0 0 0.5313 1195.9795 147.8136)">
+ <stop offset="0" style="stop-color:#8BC53F"/>
+ <stop offset="1" style="stop-color:#006838"/>
+ </linearGradient>
+ <rect x="662.08" y="333.297" fill="url(#SVGID_39_)" width="51.727" height="6.113"/>
+
+ <linearGradient id="SVGID_40_" gradientUnits="userSpaceOnUse" x1="518.8047" y1="299.3047" x2="578.0229" y2="299.3047" gradientTransform="matrix(-1.1577 0 0 0.5313 1314.4268 147.8136)">
+ <stop offset="0" style="stop-color:#8BC53F"/>
+ <stop offset="1" style="stop-color:#006838"/>
+ </linearGradient>
+ <rect x="645.25" y="303.777" fill="url(#SVGID_40_)" width="68.557" height="6.113"/>
+
+ <radialGradient id="SVGID_41_" cx="576.5234" cy="340.2637" r="10.5059" gradientTransform="matrix(0 1 -1 0 1063.582 -210.3203)" gradientUnits="userSpaceOnUse">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="0.9632" style="stop-color:#67CA32"/>
+ </radialGradient>
+ <path fill="url(#SVGID_41_)" d="M723.318,376.709c-5.803,0-10.506-4.703-10.506-10.506s4.703-10.506,10.506-10.506
+ c5.801,0,10.506,4.703,10.506,10.506S729.119,376.709,723.318,376.709z M730.021,366.203c0-3.702-3.002-6.703-6.703-6.703
+ s-6.703,3.001-6.703,6.703c0,1.851,0.75,3.526,1.963,4.739s2.889,1.964,4.74,1.964C727.02,372.906,730.021,369.904,730.021,366.203
+ z"/>
+
+ <radialGradient id="SVGID_42_" cx="546.9448" cy="340.2637" r="10.5056" gradientTransform="matrix(0 1 -1 0 1063.582 -210.3203)" gradientUnits="userSpaceOnUse">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="0.9632" style="stop-color:#67CA32"/>
+ </radialGradient>
+ <path fill="url(#SVGID_42_)" d="M723.318,347.13c-5.803,0-10.506-4.703-10.506-10.506c0-5.802,4.703-10.505,10.506-10.505
+ c5.801,0,10.506,4.703,10.506,10.505C733.824,342.427,729.119,347.13,723.318,347.13z M730.021,336.624
+ c0-3.702-3.002-6.703-6.703-6.703s-6.703,3.001-6.703,6.703c0,1.852,0.75,3.527,1.963,4.74s2.889,1.963,4.74,1.963
+ C727.02,343.327,730.021,340.326,730.021,336.624z"/>
+
+ <radialGradient id="SVGID_43_" cx="517.1543" cy="340.2637" r="10.5059" gradientTransform="matrix(0 1 -1 0 1063.582 -210.3203)" gradientUnits="userSpaceOnUse">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="0.9632" style="stop-color:#67CA32"/>
+ </radialGradient>
+ <path fill="url(#SVGID_43_)" d="M723.318,317.34c-5.803,0-10.506-4.703-10.506-10.506c0-5.802,4.703-10.506,10.506-10.506
+ c5.801,0,10.506,4.704,10.506,10.506C733.824,312.637,729.119,317.34,723.318,317.34z M730.021,306.834
+ c0-3.702-3.002-6.703-6.703-6.703s-6.703,3.001-6.703,6.703c0,1.851,0.75,3.526,1.963,4.74c1.213,1.212,2.889,1.963,4.74,1.963
+ C727.02,313.537,730.021,310.535,730.021,306.834z"/>
+</g>
+</svg>
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/floppy/hdt.cfg
^
|
@@ -60,19 +60,28 @@
APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids quiet vesa nomenu auto='show summary'
LABEL verbose
-MENU LABEL CLI (Verbose)
+MENU LABEL CLI (VESA mode & Verbose)
TEXT HELP
Starts HDT using the Command Line Interface (CLI) using the verbose mode
VESA mode is enabled
ENDTEXT
COM32 hdt.c32
-APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids vesa nomenu
+APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids vesa nomenu verbose
+
+LABEL verbose-text
+MENU LABEL CLI (Text mode & Verbose)
+TEXT HELP
+ Starts HDT using the Command Line Interface (CLI)
+ VESA mode is disabled
+ENDTEXT
+COM32 hdt.c32
+APPEND modules_pcimap=modules.pcimap modules_alias=modules.alias pciids=pci.ids verbose nomenu
MENU SEPARATOR
LABEL memtest
-MENU LABEL Memtest86+ 4.10
+MENU LABEL Memtest86+ 4.20
TEXT HELP
- Starts Memtest86+ 4.10
+ Starts Memtest86+ 4.20
ENDTEXT
LINUX memtest.bin
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-acpi.c
^
|
@@ -0,0 +1,307 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009 Erwan Velu - All Rights Reserved
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * -----------------------------------------------------------------------
+*/
+
+#include "hdt-cli.h"
+#include "hdt-common.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <acpi/acpi.h>
+
+/* Print ACPI's table header in a defined formating */
+static void show_header(void *address, s_acpi_description_header * h)
+{
+ more_printf("%-4s v%03x %-6s %-7s 0x%08x %-4s 0x%08x @ 0x%p\n",
+ h->signature, h->revision, h->oem_id, h->oem_table_id,
+ h->oem_revision, h->creator_id, h->creator_revision, address)
+}
+
+/* That's an helper to visualize columns*/
+static void show_table_separator(void)
+{
+ more_printf
+ ("----|----|------|--------|----------|-------|-----------|--------------------\n");
+}
+
+/* Display the main header before displaying the ACPI tables */
+static void show_table_name(void)
+{
+ more_printf
+ ("ACPI rev oem table_id oem_rev creator creat_rev @ address \n");
+ show_table_separator();
+}
+
+/* called by "show acpi" */
+void main_show_acpi(int argc __unused, char **argv __unused,
+ struct s_hardware *hardware)
+{
+ reset_more_printf();
+
+ if (hardware->is_acpi_valid == false) {
+ more_printf("No ACPI Tables detected\n");
+ return;
+ }
+
+ show_table_name();
+
+ /* RSDP tables aren't using the same headers as the other
+ * So let's use a dedicated rendering */
+ if (hardware->acpi.rsdp.valid) {
+ s_rsdp *r = &hardware->acpi.rsdp;
+ more_printf
+ ("RSDP v%03x %-6s @ %p\n",
+ r->revision, r->oem_id, r->address);
+ }
+
+ if (hardware->acpi.rsdt.valid)
+ show_header(hardware->acpi.rsdt.address,
+ &hardware->acpi.rsdt.header);
+
+ if (hardware->acpi.xsdt.valid)
+ show_header(hardware->acpi.xsdt.address,
+ &hardware->acpi.xsdt.header);
+
+ if (hardware->acpi.fadt.valid)
+ show_header(hardware->acpi.fadt.address, &hardware->acpi.fadt.header);
+
+ if (hardware->acpi.dsdt.valid)
+ show_header(hardware->acpi.dsdt.address, &hardware->acpi.dsdt.header);
+
+ /* SSDT includes many optional tables, let's display them */
+ for (int i = 0; i < hardware->acpi.ssdt_count; i++) {
+ if ((hardware->acpi.ssdt[i] != NULL) && (hardware->acpi.ssdt[i]->valid))
+ show_header(hardware->acpi.ssdt[i]->address,
+ &hardware->acpi.ssdt[i]->header);
+ }
+
+ if (hardware->acpi.sbst.valid)
+ show_header(hardware->acpi.sbst.address, &hardware->acpi.sbst.header);
+
+ if (hardware->acpi.ecdt.valid)
+ show_header(hardware->acpi.ecdt.address, &hardware->acpi.ecdt.header);
+
+ if (hardware->acpi.hpet.valid)
+ show_header(hardware->acpi.hpet.address, &hardware->acpi.hpet.header);
+
+ if (hardware->acpi.tcpa.valid)
+ show_header(hardware->acpi.tcpa.address, &hardware->acpi.tcpa.header);
+
+ if (hardware->acpi.mcfg.valid)
+ show_header(hardware->acpi.mcfg.address, &hardware->acpi.mcfg.header);
+
+ if (hardware->acpi.slic.valid)
+ show_header(hardware->acpi.slic.address, &hardware->acpi.slic.header);
+
+ if (hardware->acpi.boot.valid)
+ show_header(hardware->acpi.boot.address, &hardware->acpi.boot.header);
+
+ /* FACS isn't having the same headers, let's use a dedicated rendering */
+ if (hardware->acpi.facs.valid) {
+ s_facs *fa = &hardware->acpi.facs;
+ more_printf
+ ("FACS @ 0x%p\n",
+ fa->address);
+ }
+
+ if (hardware->acpi.madt.valid)
+ show_header(hardware->acpi.madt.address, &hardware->acpi.madt.header);
+
+ more_printf("\nLocal APIC at 0x%08x\n", hardware->acpi.madt.local_apic_address);
+}
+
+/* Let's display the Processor Local APIC configuration */
+static void show_local_apic(s_madt * madt)
+{
+ if (madt->processor_local_apic_count == 0) {
+ more_printf("No Processor Local APIC found\n");
+ return;
+ }
+
+ /* For all detected logical CPU */
+ for (int i = 0; i < madt->processor_local_apic_count; i++) {
+ s_processor_local_apic *sla = &madt->processor_local_apic[i];
+ char buffer[8];
+ memset(buffer, 0, sizeof(buffer));
+ strcpy(buffer, "disable");
+ /* Let's check if the flags reports the cpu as enabled */
+ if ((sla->flags & PROCESSOR_LOCAL_APIC_ENABLE) ==
+ PROCESSOR_LOCAL_APIC_ENABLE)
+ strcpy(buffer, "enable");
+ more_printf("CPU #%u, LAPIC (acpi_id[0x%02x] apic_id[0x%02x]) %s\n",
+ sla->apic_id, sla->acpi_id, sla->apic_id, buffer);
+ }
+}
+
+/* M1PS flags have to be interpreted as strings */
+static char *flags_to_string(char *buffer, uint16_t flags)
+{
+ memset(buffer, 0, sizeof(buffer));
+ strcpy(buffer, "default");
+ if ((flags & POLARITY_ACTIVE_HIGH) == POLARITY_ACTIVE_HIGH)
+ strcpy(buffer, "high");
+ else if ((flags & POLARITY_ACTIVE_LOW) == POLARITY_ACTIVE_LOW)
+ strcpy(buffer, "low");
+ if ((flags & TRIGGER_EDGE) == TRIGGER_EDGE)
+ strncat(buffer, " edge", 5);
+ else if ((flags & TRIGGER_LEVEL) == TRIGGER_LEVEL)
+ strncat(buffer, " level", 6);
+ else
+ strncat(buffer, " default", 8);
+
+ return buffer;
+}
+
+/* Display the local apic NMI configuration */
+static void show_local_apic_nmi(s_madt * madt)
+{
+ if (madt->local_apic_nmi_count == 0) {
+ more_printf("No Local APIC NMI found\n");
+ return;
+ }
+
+ for (int i = 0; i < madt->local_apic_nmi_count; i++) {
+ s_local_apic_nmi *slan = &madt->local_apic_nmi[i];
+ char buffer[20];
+ more_printf("LAPIC_NMI (acpi_id[0x%02x] %s lint(0x%02x))\n",
+ slan->acpi_processor_id, flags_to_string(buffer,
+ slan->flags),
+ slan->local_apic_lint);
+ }
+}
+
+/* Display the IO APIC configuration */
+static void show_io_apic(s_madt * madt)
+{
+ if (madt->io_apic_count == 0) {
+ more_printf("No IO APIC found\n");
+ return;
+ }
+
+ /* For all IO APICS */
+ for (int i = 0; i < madt->io_apic_count; i++) {
+ s_io_apic *sio = &madt->io_apic[i];
+ char buffer[15];
+ memset(buffer, 0, sizeof(buffer));
+ /* GSI base reports the GSI configuration
+ * Let's interpret it as string */
+ switch (sio->global_system_interrupt_base) {
+ case 0:
+ strcpy(buffer, "GSI 0-23");
+ break;
+ case 24:
+ strcpy(buffer, "GSI 24-39");
+ break;
+ case 40:
+ strcpy(buffer, "GSI 40-55");
+ break;
+ default:
+ strcpy(buffer, "GSI Unknown");
+ break;
+ }
+
+ more_printf("IO_APIC[%d] : apic_id[0x%02x] adress[0x%08x] %s\n",
+ i, sio->io_apic_id, sio->io_apic_address, buffer);
+ }
+}
+
+/* Display the interrupt source override configuration */
+static void show_interrupt_source_override(s_madt * madt)
+{
+ if (madt->interrupt_source_override_count == 0) {
+ more_printf("No interrupt source override found\n");
+ return;
+ }
+
+ /* Let's process each interrupt source override */
+ for (int i = 0; i < madt->interrupt_source_override_count; i++) {
+ s_interrupt_source_override *siso = &madt->interrupt_source_override[i];
+ char buffer[20];
+ char bus_type[10];
+ memset(bus_type, 0, sizeof(bus_type));
+ /* Spec report bus type 0 as ISA */
+ if (siso->bus == 0)
+ strcpy(bus_type, "ISA");
+ else
+ strcpy(bus_type, "unknown");
+
+ more_printf("INT_SRC_OVR (bus %s (%d) bus_irq %d global_irq %d %s)\n",
+ bus_type, siso->bus, siso->source,
+ siso->global_system_interrupt, flags_to_string(buffer,
+ siso->
+ flags));
+ }
+}
+
+/* Display the apic configuration
+ * This is called by acpi> show apic */
+static void show_acpi_apic(int argc __unused, char **argv __unused,
+ struct s_hardware *hardware)
+{
+ if (hardware->is_acpi_valid == false) {
+ more_printf("No ACPI Tables detected\n");
+ return;
+ }
+
+ s_madt *madt = &hardware->acpi.madt;
+
+ if (madt->valid == false) {
+ more_printf("No APIC (MADT) table found\n");
+ return;
+ }
+
+ more_printf("Local APIC at 0x%08x\n", madt->local_apic_address);
+ show_local_apic(madt);
+ show_local_apic_nmi(madt);
+ show_io_apic(madt);
+ show_interrupt_source_override(madt);
+}
+
+struct cli_callback_descr list_acpi_show_modules[] = {
+ {
+ .name = "apic",
+ .exec = show_acpi_apic,
+ },
+ {
+ .name = NULL,
+ .exec = NULL,
+ },
+};
+
+struct cli_module_descr acpi_show_modules = {
+ .modules = list_acpi_show_modules,
+ .default_callback = main_show_acpi,
+};
+
+struct cli_mode_descr acpi_mode = {
+ .mode = ACPI_MODE,
+ .name = CLI_ACPI,
+ .default_modules = NULL,
+ .show_modules = &acpi_show_modules,
+ .set_modules = NULL,
+};
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-cpu.c
^
|
@@ -38,12 +38,21 @@
struct s_hardware *hardware)
{
char features[81];
- cpu_detect(hardware);
- detect_dmi(hardware);
- more_printf("CPU\n");
+ /* We know the total number of logical cores and we
+ * know the number of cores of the first CPU. Let's consider
+ * the system as symetrical, and so compute the number of
+ * physical CPUs. This is only possible if ACPI is present */
+ if (hardware->acpi.madt.processor_local_apic_count > 0) {
+ more_printf("CPU (%d logical / %d phys)\n",
+ hardware->acpi.madt.processor_local_apic_count,
+ hardware->physical_cpu_count);
+ } else
+ more_printf("CPU\n");
more_printf(" Manufacturer : %s \n", hardware->cpu.vendor);
more_printf(" Product : %s \n", hardware->cpu.model);
more_printf(" CPU Cores : %d \n", hardware->cpu.num_cores);
+ if (hardware->dmi.processor.thread_count != 0)
+ more_printf(" CPU Threads : %d \n", hardware->dmi.processor.thread_count);
more_printf(" L2 Cache : %dK\n", hardware->cpu.l2_cache_size);
memset(features, 0, sizeof(features));
@@ -55,15 +64,24 @@
strcat(features, "x86 32bit ");
if (hardware->cpu.flags.smp)
strcat(features, "SMP ");
+
+ /* This CPU is featuring Intel or AMD Virtualisation Technology */
if (hardware->cpu.flags.vmx || hardware->cpu.flags.svm)
strcat(features, "HwVIRT ");
more_printf("%s\n", features);
}
+/* Let's compute the cpu flags display
+ * We have to maximize the number of flags per line */
static void show_flag(char *buffer, bool flag, char *flag_name, bool flush)
{
char output_buffer[81];
+ /* Flush is only set when no more flags are present
+ * When it's set, or if the line is complete,
+ * we have to end the string computation and display the line.
+ * Before adding the flag into the buffer, let's check that adding it
+ * will not overflow the rendering.*/
if ((((strlen(buffer) + strlen(flag_name)) > 66) && flag) || flush) {
snprintf(output_buffer, sizeof output_buffer, "Flags : %s\n",
buffer);
@@ -72,6 +90,7 @@
if (flush)
return;
}
+ /* Let's add the flag name only if the flag is present */
if (flag)
strcat(buffer, flag_name);
}
@@ -81,10 +100,24 @@
{
char buffer[81];
reset_more_printf();
- more_printf("CPU\n");
+ /* We know the total number of logical cores and we
+ * know the number of cores of the first CPU. Let's consider
+ * the system as symetrical, and so compute the number of
+ * physical CPUs. This is only possible if ACPI is present*/
+ if (hardware->acpi.madt.processor_local_apic_count > 0) {
+ more_printf("CPU (%d logical / %d phys)\n",
+ hardware->acpi.madt.processor_local_apic_count,
+ hardware->acpi.madt.processor_local_apic_count /
+ hardware->cpu.num_cores);
+ } else
+ more_printf("CPU\n");
more_printf("Vendor : %s\n", hardware->cpu.vendor);
more_printf("Model : %s\n", hardware->cpu.model);
more_printf("CPU Cores : %d\n", hardware->cpu.num_cores);
+ if (hardware->dmi.processor.core_enabled != 0)
+ more_printf("CPU Enable: %d\n", hardware->dmi.processor.core_enabled);
+ if (hardware->dmi.processor.thread_count != 0)
+ more_printf("CPU Thread: %d \n", hardware->dmi.processor.thread_count);
more_printf("L1 Cache : %dK + %dK (I + D) \n",
hardware->cpu.l1_instruction_cache_size,
hardware->cpu.l1_data_cache_size);
@@ -104,11 +137,13 @@
hardware->dmi.processor.voltage_mv -
((hardware->dmi.processor.voltage_mv / 1000) * 1000));
}
+
if (hardware->cpu.flags.smp) {
more_printf("SMP : yes\n");
} else {
more_printf("SMP : no\n");
}
+
if (hardware->cpu.flags.lm) {
more_printf("x86_64 : yes\n");
} else {
@@ -121,6 +156,7 @@
more_printf("HwVirt : no\n");
}
+ /* Let's display the supported cpu flags */
memset(buffer, 0, sizeof(buffer));
show_flag(buffer, hardware->cpu.flags.fpu, "fpu ", false);
show_flag(buffer, hardware->cpu.flags.vme, "vme ", false);
@@ -209,7 +245,7 @@
show_flag(buffer, hardware->cpu.flags.ept, "ept ", false);
show_flag(buffer, hardware->cpu.flags.vpid, "vpid ", false);
- /* Let's flush the remaining flags */
+ /* No more flags, let's display the remaining flags */
show_flag(buffer, false, "", true);
}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-disk.c
^
|
@@ -111,7 +111,6 @@
char disk_size[11];
char mbr_name[50];
- detect_disks(hardware);
reset_more_printf();
if (!hardware->disk_info[i].cbios) {
@@ -161,7 +160,6 @@
{
bool found = false;
reset_more_printf();
- detect_disks(hardware);
int first_one = 0;
for (int drive = 0x80; drive < 0xff; drive++) {
@@ -189,7 +187,6 @@
int i = -1;
bool found = false;
- detect_disks(hardware);
reset_more_printf();
for (int drive = 0x80; drive < 0xff; drive++) {
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-dmi.c
^
|
@@ -338,7 +338,10 @@
hardware->dmi.processor.signature.stepping);
more_printf(" Cpu Minor Stepping : %u\n",
hardware->dmi.processor.signature.minor_stepping);
-// more_printf(" Voltage : %f\n",hardware->dmi.processor.voltage);
+ more_printf("Voltage : %d.%02d\n",
+ hardware->dmi.processor.voltage_mv / 1000,
+ hardware->dmi.processor.voltage_mv -
+ ((hardware->dmi.processor.voltage_mv / 1000) * 1000));
more_printf(" Status : %s\n", hardware->dmi.processor.status);
more_printf(" Upgrade : %s\n", hardware->dmi.processor.upgrade);
more_printf(" Cache L1 Handle : %s\n", hardware->dmi.processor.cache1);
@@ -347,6 +350,13 @@
more_printf(" Serial : %s\n", hardware->dmi.processor.serial);
more_printf(" Part Number : %s\n",
hardware->dmi.processor.part_number);
+ if (hardware->dmi.processor.core_count != 0)
+ more_printf(" Cores Count : %d\n", hardware->dmi.processor.core_count);
+ if (hardware->dmi.processor.core_enabled != 0)
+ more_printf(" Cores Enabled : %d\n", hardware->dmi.processor.core_enabled);
+ if (hardware->dmi.processor.thread_count != 0)
+ more_printf(" Threads Count : %d\n", hardware->dmi.processor.thread_count);
+
more_printf(" ID : %s\n", hardware->dmi.processor.id);
for (int i = 0; i < PROCESSOR_FLAGS_ELEMENTS; i++) {
if (((bool *) (&hardware->dmi.processor.cpu_flags))[i] == true) {
@@ -493,8 +503,6 @@
struct s_hardware *hardware)
{
- detect_dmi(hardware);
-
if (hardware->is_dmi_valid == false) {
more_printf("No valid DMI table found, exiting.\n");
return;
@@ -513,12 +521,6 @@
/* Do we have so display unpopulated banks ? */
int show_free_banks = 1;
- /* Needed, if called by the memory mode */
- detect_dmi(hardware);
-
- /* Detecting installed memory */
- detect_memory(hardware);
-
more_printf("Memory Size : %lu MB (%lu KB)\n",
(hardware->detected_memory_size + (1 << 9)) >> 10,
hardware->detected_memory_size);
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-hdt.c
^
|
@@ -130,6 +130,28 @@
printf("\n");
}
+ /* List finally the default modules of the hdt mode */
+ if (current_mode->mode != hdt_mode.mode &&
+ hdt_mode.default_modules && hdt_mode.default_modules->modules) {
+ j = 0;
+ while (hdt_mode.default_modules->modules[j].name) {
+ /*
+ * Any default command that is present in hdt mode but
+ * not in the current mode is available. A default
+ * command can be redefined in the current mode though.
+ * This next call test this use case: if it is
+ * overwritten, do not print it again.
+ */
+ find_cli_callback_descr(hdt_mode.default_modules->modules[j].name,
+ current_mode->default_modules,
+ &associated_module);
+ if (associated_module == NULL)
+ printf("%s ", hdt_mode.default_modules->modules[j].name);
+ j++;
+ }
+ printf("\n");
+ }
+
/* List secondly the show modules of the mode */
if (current_mode->show_modules && current_mode->show_modules->modules) {
printf("\nshow commands:\n");
@@ -152,27 +174,6 @@
printf("\n");
}
- /* List finally the default modules of the hdt mode */
- if (current_mode->mode != hdt_mode.mode &&
- hdt_mode.default_modules && hdt_mode.default_modules->modules) {
- j = 0;
- while (hdt_mode.default_modules->modules[j].name) {
- /*
- * Any default command that is present in hdt mode but
- * not in the current mode is available. A default
- * command can be redefined in the current mode though.
- * This next call test this use case: if it is
- * overwritten, do not print it again.
- */
- find_cli_callback_descr(hdt_mode.default_modules->modules[j].name,
- current_mode->default_modules,
- &associated_module);
- if (associated_module == NULL)
- printf("%s ", hdt_mode.default_modules->modules[j].name);
- j++;
- }
- printf("\n");
- }
printf("\n");
main_show_modes(argc, argv, hardware);
@@ -197,10 +198,6 @@
void main_show_summary(int argc __unused, char **argv __unused,
struct s_hardware *hardware)
{
- detect_pci(hardware); /* pxe is detected in the pci */
- detect_dmi(hardware);
- cpu_detect(hardware);
- detect_memory(hardware);
reset_more_printf();
clear_screen();
main_show_cpu(argc, argv, hardware);
@@ -232,6 +229,7 @@
more_printf(" Product : %s\n", PRODUCT_NAME);
more_printf(" Version : %s (%s)\n", VERSION, CODENAME);
more_printf(" Website : %s\n", WEBSITE_URL);
+ more_printf(" IRC Channel : %s\n", IRC_CHANNEL);
more_printf(" Mailing List : %s\n", CONTACT);
more_printf(" Project Leader : %s\n", AUTHOR);
more_printf(" Core Developer : %s\n", CORE_DEVELOPER);
@@ -333,6 +331,10 @@
.exec = show_dmi_memory_modules,
},
{
+ .name = CLI_ACPI,
+ .exec = main_show_acpi,
+ },
+ {
.name = "modes",
.exec = main_show_modes,
},
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-kernel.c
^
|
@@ -43,7 +43,6 @@
char kernel_modules[LINUX_KERNEL_MODULE_SIZE *
MAX_KERNEL_MODULES_PER_PCI_DEVICE];
- detect_pci(hardware);
reset_more_printf();
more_printf("Kernel modules\n");
@@ -93,21 +92,15 @@
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}};
- detect_pci(hardware);
-
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;
}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-pci.c
^
|
@@ -36,7 +36,6 @@
void main_show_pci(int argc __unused, char **argv __unused,
struct s_hardware *hardware)
{
- cli_detect_pci(hardware);
reset_more_printf();
more_printf("PCI\n");
more_printf(" NB Devices : %d\n", hardware->nb_pci_devices);
@@ -290,29 +289,3 @@
.show_modules = &pci_show_modules,
.set_modules = NULL,
};
-
-void cli_detect_pci(struct s_hardware *hardware)
-{
- bool error = false;
- if (hardware->pci_detection == false) {
- detect_pci(hardware);
- if (hardware->pci_ids_return_code == -ENOPCIIDS) {
- more_printf
- ("The pci.ids file is missing, device names can't be computed.\n");
- more_printf("Please put one in same dir as hdt\n");
- error = true;
- }
- if ((hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) &&
- (hardware->modules_alias_return_code == -ENOMODULESALIAS)) {
- more_printf
- ("The modules.pcimap or modules.alias files are missing, device names can't be computed.\n");
- more_printf("Please put one of them in same dir as hdt\n");
- error = true;
- }
- if (error == true) {
- char tempbuf[10];
- more_printf("Press enter to continue\n");
- fgets(tempbuf, sizeof(tempbuf), stdin);
- }
- }
-}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-pxe.c
^
|
@@ -48,7 +48,6 @@
return;
}
- detect_pxe(hardware);
more_printf("PXE\n");
if (hardware->is_pxe_valid == false) {
more_printf(" No valid PXE ROM found\n");
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-vesa.c
^
|
@@ -37,7 +37,6 @@
struct s_hardware *hardware)
{
reset_more_printf();
- detect_vesa(hardware);
if (hardware->is_vesa_valid == false) {
more_printf("No VESA BIOS detected\n");
return;
@@ -56,7 +55,6 @@
static void show_vesa_modes(int argc __unused, char **argv __unused,
struct s_hardware *hardware)
{
- detect_vesa(hardware);
reset_more_printf();
if (hardware->is_vesa_valid == false) {
more_printf("No VESA BIOS detected\n");
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli-vpd.c
^
|
@@ -36,7 +36,6 @@
struct s_hardware *hardware)
{
reset_more_printf();
- detect_vpd(hardware);
if (!hardware->is_vpd_valid) {
more_printf("No VPD structure detected.\n");
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli.c
^
|
@@ -30,6 +30,7 @@
#include <string.h>
#include <syslinux/config.h>
#include <getkey.h>
+#include <acpi/acpi.h>
#include "hdt-cli.h"
#include "hdt-common.h"
@@ -45,6 +46,7 @@
&disk_mode,
&vpd_mode,
&memory_mode,
+ &acpi_mode,
NULL,
};
@@ -137,7 +139,6 @@
snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ", CLI_PXE);
break;
case KERNEL_MODE:
- detect_pci(hardware);
hdt_cli.mode = mode;
snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ", CLI_KERNEL);
break;
@@ -152,19 +153,12 @@
case PCI_MODE:
hdt_cli.mode = mode;
snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ", CLI_PCI);
- if (!hardware->pci_detection)
- cli_detect_pci(hardware);
break;
case CPU_MODE:
hdt_cli.mode = mode;
snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ", CLI_CPU);
- if (!hardware->dmi_detection)
- detect_dmi(hardware);
- if (!hardware->cpu_detection)
- cpu_detect(hardware);
break;
case DMI_MODE:
- detect_dmi(hardware);
if (!hardware->is_dmi_valid) {
printf("No valid DMI table found, exiting.\n");
break;
@@ -173,12 +167,10 @@
snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ", CLI_DMI);
break;
case DISK_MODE:
- detect_disks(hardware);
hdt_cli.mode = mode;
snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ", CLI_DISK);
break;
case VPD_MODE:
- detect_vpd(hardware);
if (!hardware->is_vpd_valid) {
printf("No valid VPD table found, exiting.\n");
break;
@@ -190,6 +182,10 @@
hdt_cli.mode = mode;
snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ", CLI_MEMORY);
break;
+ case ACPI_MODE:
+ hdt_cli.mode = mode;
+ snprintf(hdt_cli.prompt, sizeof(hdt_cli.prompt), "%s> ", CLI_ACPI);
+ break;
default:
/* Invalid mode */
printf("Unknown mode, please choose among:\n");
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-cli.h
^
|
@@ -62,6 +62,7 @@
#define CLI_MODES "modes"
#define CLI_VPD "vpd"
#define CLI_MEMORY "memory"
+#define CLI_ACPI "acpi"
#define CLI_ENABLE "enable"
#define CLI_DISABLE "disable"
@@ -79,6 +80,7 @@
DISK_MODE,
VPD_MODE,
MEMORY_MODE,
+ ACPI_MODE
} cli_mode_t;
#define PROMPT_SIZE 32
@@ -140,6 +142,7 @@
struct cli_mode_descr disk_mode;
struct cli_mode_descr vpd_mode;
struct cli_mode_descr memory_mode;
+struct cli_mode_descr acpi_mode;
/* cli helpers */
void find_cli_mode_descr(cli_mode_t mode, struct cli_mode_descr **mode_found);
@@ -178,7 +181,6 @@
// PCI STUFF
#define CLI_PCI_DEVICE "device"
void main_show_pci(int argc, char **argv, struct s_hardware *hardware);
-void cli_detect_pci(struct s_hardware *hardware);
// CPU STUFF
void main_show_cpu(int argc, char **argv, struct s_hardware *hardware);
@@ -201,4 +203,9 @@
// VPD STUFF
void main_show_vpd(int argc __unused, char **argv __unused,
struct s_hardware *hardware);
+
+// ACPI STUFF
+void main_show_acpi(int argc __unused, char **argv __unused,
+ struct s_hardware *hardware);
+
#endif
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-common.c
^
|
@@ -61,14 +61,22 @@
struct s_hardware *hardware)
{
/* Quiet mode - make the output more quiet */
- quiet = false;
+ quiet = true;
/* Vesa mode isn't set until we explictly call it */
vesamode = false;
+ /* Automode isn't the default*/
+ automode = false;
+
+ /* Menu mode is the default*/
+ menumode = true;
+
for (int i = 1; i < argc; i++) {
if (!strncmp(argv[i], "quiet", 5)) {
quiet = true;
+ } else if (!strncmp(argv[i], "verbose", 7)) {
+ quiet = false;
} else if (!strncmp(argv[i], "modules_pcimap=", 15)) {
strlcpy(hardware->modules_pcimap_path, argv[i] + 15,
sizeof(hardware->modules_pcimap_path));
@@ -87,7 +95,7 @@
convert_isolinux_filename(hardware->memtest_label, hardware);
} else if (!strncmp(argv[i], "vesa", 4)) {
vesamode = true;
- max_console_lines = MAX_CLI_LINES;
+ max_console_lines = MAX_VESA_CLI_LINES;
/* If the user defines a background image */
if (!strncmp(argv[i], "vesa=", 5)) {
strlcpy(hardware->vesa_background, argv[i] + 5,
@@ -95,7 +103,9 @@
}
} else if (!strncmp(argv[i], "novesa", 6)) {
vesamode = false;
- max_console_lines = MAX_VESA_CLI_LINES;
+ max_console_lines = MAX_CLI_LINES;
+ } else if (!strncmp(argv[i], "nomenu", 6)) {
+ menumode = false;
} else if (!strncmp(argv[i], "auto=", 5)) {
/* The auto= parameter is separated in several argv[]
* as it can contains spaces.
@@ -104,6 +114,7 @@
* i.e auto='show dmi; show pci'
*/
+ automode=true;
/* Extracting the first parameter */
strcpy(hardware->auto_label, argv[i] + 6);
strcat(hardware->auto_label, " ");
@@ -165,12 +176,15 @@
hardware->vesa_detection = false;
hardware->vpd_detection = false;
hardware->memory_detection = false;
+ hardware->acpi_detection = false;
hardware->nb_pci_devices = 0;
hardware->is_dmi_valid = false;
hardware->is_pxe_valid = false;
hardware->is_vpd_valid = false;
+ hardware->is_acpi_valid = false;
hardware->pci_domain = NULL;
hardware->detected_memory_size = 0;
+ hardware->physical_cpu_count =1; /* we have at least one cpu */
/* Cleaning structures */
memset(hardware->disk_info, 0, sizeof(hardware->disk_info));
@@ -180,6 +194,7 @@
memset(&hardware->pxe, 0, sizeof(struct s_pxe));
memset(&hardware->vesa, 0, sizeof(struct s_vesa));
memset(&hardware->vpd, 0, sizeof(s_vpd));
+ memset(&hardware->acpi, 0, sizeof(s_acpi));
memset(hardware->syslinux_fs, 0, sizeof hardware->syslinux_fs);
memset(hardware->pciids_path, 0, sizeof hardware->pciids_path);
memset(hardware->modules_pcimap_path, 0,
@@ -216,6 +231,25 @@
return 0;
}
+/*
+ * Detecting ACPI
+ * if yes, let's parse it
+ */
+int detect_acpi(struct s_hardware *hardware)
+{
+ int retval;
+ if (hardware->acpi_detection == true)
+ return -1;
+ hardware->acpi_detection = true;
+ if ((retval=parse_acpi(&hardware->acpi)) != ACPI_FOUND) {
+ hardware->is_acpi_valid = false;
+ return retval;
+ }
+
+ hardware->is_acpi_valid = true;
+ return retval;
+}
+
/**
* vpd_detection - populate the VPD structure
*
@@ -412,8 +446,6 @@
return -1;
break;
}
- /* Let's try to find the associated pci device */
- detect_pci(hardware);
/* The firt pass try to find the exact pci device */
hardware->pxe.pci_device = NULL;
@@ -515,8 +547,6 @@
get_module_name_from_alias(hardware->pci_domain,
hardware->modules_alias_path);
- /* We try to detect the pxe stuff to populate the PXE: field of pci devices */
- detect_pxe(hardware);
}
void cpu_detect(struct s_hardware *hardware)
@@ -534,6 +564,10 @@
* That makes some weird display in console/menu
* Let's remove that mulitple spaces */
strlcpy(hardware->cpu.model,del_multi_spaces(hardware->cpu.model),sizeof(hardware->cpu.model));
+
+ if ((hardware->is_acpi_valid) && (hardware->acpi.madt.valid)) {
+ hardware->physical_cpu_count=hardware->acpi.madt.processor_local_apic_count / hardware->cpu.num_cores;
+ }
hardware->cpu_detection = true;
}
@@ -627,9 +661,6 @@
* the content from the second space*/
strlcpy(p, p + 1, strlen(p + 1));
- /* The string is 1 char smaller */
- *(p + strlen(p) - 1) = '\0';
-
/* Don't increment the pointer as we
* changed the content of the current position*/
continue;
@@ -664,3 +695,51 @@
} else
console_ansi_raw();
}
+
+void detect_hardware(struct s_hardware *hardware)
+{
+ if (!quiet)
+ more_printf("ACPI: Detecting\n");
+ detect_acpi(hardware);
+
+ if (!quiet)
+ more_printf("MEMORY: Detecting\n");
+ detect_memory(hardware);
+
+ if (!quiet)
+ more_printf("DMI: Detecting Table\n");
+ if (detect_dmi(hardware) == -ENODMITABLE) {
+ printf("DMI: ERROR ! Table not found ! \n");
+ printf("DMI: Many hardware components will not be detected ! \n");
+ } else {
+ if (!quiet)
+ more_printf("DMI: Table found ! (version %u.%u)\n",
+ hardware->dmi.dmitable.major_version,
+ hardware->dmi.dmitable.minor_version);
+ }
+
+ if (!quiet)
+ more_printf("CPU: Detecting\n");
+ cpu_detect(hardware);
+
+ if (!quiet)
+ more_printf("DISKS: Detecting\n");
+ detect_disks(hardware);
+
+ if (!quiet)
+ more_printf("VPD: Detecting\n");
+ detect_vpd(hardware);
+
+ detect_pci(hardware);
+ if (!quiet)
+ more_printf("PCI: %d Devices Found\n", hardware->nb_pci_devices);
+
+ if (!quiet)
+ more_printf("PXE: Detecting\n");
+ detect_pxe(hardware);
+
+ if (!quiet)
+ more_printf("VESA: Detecting\n");
+ detect_vesa(hardware);
+}
+
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-common.h
^
|
@@ -51,6 +51,7 @@
#include "../lib/sys/vesa/vesa.h"
#include <vpd/vpd.h>
#include <libansi.h>
+#include <acpi/acpi.h>
/* Declare a variable or data structure as unused. */
#define __unused __attribute__ (( unused ))
@@ -85,6 +86,12 @@
/* Defines if we must use the vesa mode */
bool vesamode;
+/* Defines if we must use the menu mode */
+bool menumode;
+
+/* Defines if we are running the auto mode */
+bool automode;
+
/* Defines the number of lines in the console
* Default is 20 for a std console */
extern int max_console_lines;
@@ -166,7 +173,9 @@
struct s_hardware {
s_dmi dmi; /* DMI table */
s_cpu cpu; /* CPU information */
+ uint8_t physical_cpu_count; /* Number of physical cpu */
s_vpd vpd; /* VPD information */
+ s_acpi acpi;
struct pci_domain *pci_domain; /* PCI Devices */
struct driveinfo disk_info[256]; /* Disk Information */
uint32_t mbr_ids[256]; /* MBR ids */
@@ -183,6 +192,7 @@
bool is_pxe_valid;
bool is_vesa_valid;
bool is_vpd_valid;
+ bool is_acpi_valid;
bool dmi_detection; /* Does the dmi stuff has already been detected? */
bool pci_detection; /* Does the pci stuff has already been detected? */
@@ -192,6 +202,7 @@
bool vesa_detection; /* Does the vesa sutff have been already detected? */
bool vpd_detection; /* Does the vpd stuff has already been detected? */
bool memory_detection; /* Does the memory size got detected ?*/
+ bool acpi_detection; /* Does the acpi got detected ?*/
char syslinux_fs[22];
const struct syslinux_version *sv;
@@ -218,9 +229,11 @@
void init_hardware(struct s_hardware *hardware);
void clear_screen(void);
void detect_syslinux(struct s_hardware *hardware);
+int detect_acpi(struct s_hardware *hardware);
void detect_parameters(const int argc, const char *argv[],
struct s_hardware *hardware);
int detect_vesa(struct s_hardware *hardware);
void detect_memory(struct s_hardware *hardware);
void init_console(struct s_hardware *hardware);
+void detect_hardware(struct s_hardware *hardware);
#endif
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt-util.c
^
|
@@ -75,6 +75,9 @@
}
}
+/* Return the human readable size of device
+ * This function avoid disk's size rounding while
+ * not using float as they aren't currently supported */
void sectors_to_size_dec2(int sectors, char *buffer)
{
int b = (sectors / 2);
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt.c
^
|
@@ -48,7 +48,6 @@
int main(const int argc, const char *argv[])
{
char version_string[256];
- const char *arg;
struct s_hardware hardware;
snprintf(version_string, sizeof version_string, "%s %s (%s)",
@@ -66,14 +65,16 @@
/* Opening the Syslinux console */
init_console(&hardware);
+ /* Detect hardware */
+ detect_hardware(&hardware);
+
/* Clear the screen and reset position of the cursor */
clear_screen();
printf("\033[1;1H");
printf("%s\n", version_string);
- if ((arg = find_argument(argv + 1, "nomenu"))
- || (find_argument(argv + 1, "auto")))
+ if (!menumode || automode)
start_cli_mode(&hardware);
else {
int return_code = start_menu_mode(&hardware, version_string);
|
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/hdt/hdt.h
^
|
@@ -33,15 +33,15 @@
#define AUTHOR "Erwan Velu"
#define CORE_DEVELOPER "Pierre-Alexandre Meyer"
#define CONTACT "hdt@zytor.com"
-#define VERSION "0.3.6.1"
-#define CODENAME "cachaca"
+#define VERSION "0.4.1"
+#define CODENAME "chouffe"
#define NB_CONTRIBUTORS 3
#define CONTRIBUTORS {"Sebastien Gonzalve (Patches)", "Gert Hulselmans (Tests)", "Alexander Andino (Design)"}
#define WEBSITE_URL "http://hdt-project.org"
+#define IRC_CHANNEL "#hdt on freenode"
#define ATTR_PACKED __attribute__((packed))
-#define WITH_PCI 1
#define WITH_MENU_DISPLAY 1
#endif
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/include/ctype.h
^
|
@@ -7,6 +7,8 @@
#ifndef _CTYPE_H
#define _CTYPE_H
+#include <klibc/extern.h>
+
#ifndef __CTYPE_NO_INLINE
# define __ctype_inline static __inline__
#else
@@ -114,4 +116,6 @@
return isupper(__c) ? _tolower(__c) : __c;
}
+__extern char *skipspace(const char *p);
+
#endif /* _CTYPE_H */
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/include/suffix_number.h
^
|
@@ -0,0 +1,41 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2007-2008 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
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * suffix_number.h
+ *
+ * Definitions used to convert a string of a number with potential SI suffix
+ * to int-type.
+ */
+
+#ifndef LIBUTIL_SUFFIX_NUMBER_H
+#define LIBUTIL_SUFFIX_NUMBER_H
+
+unsigned long long suffix_number(const char *);
+
+#endif /* LIBUTIL_SUFFIX_NUMBER_H */
+
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/include/sys/bitops.h
^
|
@@ -0,0 +1,62 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2010-2011 Intel Corporation; author: H. Peter Anvin
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * bitops.h
+ *
+ * Simple bitwise operations
+ */
+
+#ifndef _BITOPS_H
+#define _BITOPS_H
+
+#include <klibc/compiler.h>
+
+static inline void set_bit(long __bit, void *__bitmap)
+{
+ asm volatile("btsl %1,%0"
+ : "+m" (*(unsigned char *)__bitmap)
+ : "Ir" (__bit) : "memory");
+}
+
+static inline void clr_bit(long __bit, void *__bitmap)
+{
+ asm volatile("btcl %1,%0"
+ : "+m" (*(unsigned char *)__bitmap)
+ : "Ir" (__bit) : "memory");
+}
+
+static inline int __purefunc test_bit(long __bit, const void *__bitmap)
+{
+ unsigned char __r;
+ asm("btl %2,%1; setc %0"
+ : "=qm" (__r)
+ : "m" (*(const unsigned char *)__bitmap), "Ir" (__bit));
+ return __r;
+}
+
+#endif /* _BITOPS_H */
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/include/unistd.h
^
|
@@ -28,6 +28,10 @@
__extern unsigned int sleep(unsigned int);
__extern unsigned int msleep(unsigned int);
+__extern int getopt(int, char *const *, const char *);
+__extern char *optarg;
+__extern int optind, opterr, optopt;
+
/* Standard file descriptor numbers. */
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lib/Makefile
^
|
@@ -27,11 +27,14 @@
strtoumax.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o \
asprintf.o vasprintf.o strlcpy.o strlcat.o \
vsscanf.o zalloc.o \
+ skipspace.o \
\
lmalloc.o lstrdup.o \
\
dprintf.o vdprintf.o \
\
+ suffix_number.o \
+ \
sys/readdir.o getcwd.o chdir.o fdopendir.o \
\
libgcc/__ashldi3.o libgcc/__udivdi3.o \
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lib/jpeg/tinyjpeg-internal.h
^
|
@@ -152,7 +152,7 @@
#define SANITY_CHECK 1
-#if DEBUG
+#if JPEG_DEBUG
#define error(fmt, args...) do { \
snprintf(error_string, sizeof(error_string), fmt, ## args); \
return -1; \
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lib/jpeg/tinyjpeg.c
^
|
@@ -332,7 +332,6 @@
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 @@
/*
* 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 print_SOF(const unsigned char *stream)
{
+#if JPEG_DEBUG
int width, height, nr_components, precision;
-#if DEBUG
const char *nr_components_to_string[] = {
"????",
"Grayscale",
@@ -451,7 +449,6 @@
"YCbCr",
"CYMK"
};
-#endif
precision = stream[2];
height = be16_to_cpu(stream+3);
@@ -463,6 +460,8 @@
width, height,
nr_components, nr_components_to_string[nr_components],
precision);
+#endif
+ (void)stream;
}
/*******************************************************************************
@@ -665,7 +664,7 @@
priv->restart_interval = be16_to_cpu(stream+2);
-#if DEBUG
+#if JPEG_DEBUG
trace("Restart interval = %d\n", priv->restart_interval);
#endif
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lib/pci/scan.c
^
|
@@ -39,6 +39,7 @@
#include <sys/pci.h>
#include <com32.h>
#include <stdbool.h>
+#include <ctype.h>
#include <syslinux/zio.h>
#ifdef DEBUG
@@ -49,15 +50,6 @@
#define MAX_LINE 512
-/* searching the next char that is not a space */
-static char *skipspace(char *p)
-{
- while (*p && *p <= ' ')
- p++;
-
- return p;
-}
-
/* removing any \n found in a string */
static void remove_eol(char *string)
{
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/lib/skipspace.c
^
|
@@ -0,0 +1,8 @@
+#include <ctype.h>
+
+char *skipspace(const char *p)
+{
+ while (isspace((unsigned char)*p))
+ p++;
+ return (char *)p;
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/lib/suffix_number.c
^
|
@@ -0,0 +1,72 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
+ * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * suffix_number.c
+ *
+ * Convert a string of a number with potential SI suffix to int-type
+ */
+
+#include <stdlib.h>
+#include <suffix_number.h>
+
+/* Get a value with a potential suffix (k/m/g/t/p/e) */
+unsigned long long suffix_number(const char *str)
+{
+ char *ep;
+ unsigned long long v;
+ int shift;
+
+ v = strtoull(str, &ep, 0);
+ switch (*ep | 0x20) {
+ case 'k':
+ shift = 10;
+ break;
+ case 'm':
+ shift = 20;
+ break;
+ case 'g':
+ shift = 30;
+ break;
+ case 't':
+ shift = 40;
+ break;
+ case 'p':
+ shift = 50;
+ break;
+ case 'e':
+ shift = 60;
+ break;
+ default:
+ shift = 0;
+ break;
+ }
+ v <<= shift;
+
+ return v;
+}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lib/sys/open.c
^
|
@@ -56,15 +56,17 @@
struct file_info *fp;
fd = opendev(&__file_dev, NULL, flags);
-
if (fd < 0)
return -1;
fp = &__file_info[fd];
handle = __com32.cs_pm->open_file(pathname, &fp->i.fd);
- if (handle < 0)
+ if (handle < 0) {
+ close(fd);
+ errno = ENOENT;
return -1;
+ }
fp->i.offset = 0;
fp->i.nbytes = 0;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lib/sys/rawcon_read.c
^
|
@@ -45,14 +45,11 @@
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;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lib/syslinux/load_linux.c
^
|
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2011 Intel Corporation; author: H. Peter Anvin
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -38,6 +38,7 @@
#include <inttypes.h>
#include <string.h>
#include <minmax.h>
+#include <suffix_number.h>
#include <syslinux/align.h>
#include <syslinux/linux.h>
#include <syslinux/bootrm.h>
@@ -86,6 +87,13 @@
uint8_t relocatable_kernel;
uint8_t pad2[3];
uint32_t cmdline_max_len;
+ uint32_t hardware_subarch;
+ uint64_t hardware_subarch_data;
+ uint32_t payload_offset;
+ uint32_t payload_length;
+ uint64_t setup_data;
+ uint64_t pref_address;
+ uint32_t init_size;
} __packed;
#define BOOT_MAGIC 0xAA55
@@ -96,42 +104,6 @@
#define LOAD_HIGH 0x01
#define CAN_USE_HEAP 0x80
-/* Get a value with a potential suffix (k/m/g/t/p/e) */
-static unsigned long long suffix_number(const char *str)
-{
- char *ep;
- unsigned long long v;
- int shift;
-
- v = strtoull(str, &ep, 0);
- switch (*ep | 0x20) {
- case 'k':
- shift = 10;
- break;
- case 'm':
- shift = 20;
- break;
- case 'g':
- shift = 30;
- break;
- case 't':
- shift = 40;
- break;
- case 'p':
- shift = 50;
- break;
- case 'e':
- shift = 60;
- break;
- default:
- shift = 0;
- break;
- }
- v <<= shift;
-
- return v;
-}
-
/*
* Find the last instance of a particular command line argument
* (which should include the final =; do not use for boolean arguments)
@@ -307,6 +279,17 @@
prot_mode_base = (hdr.loadflags & LOAD_HIGH) ? 0x100000 : 0x10000;
prot_mode_size = kernel_size - real_mode_size;
+ if (hdr.version < 0x020a) {
+ /*
+ * The 3* here is a total fudge factor... it's supposed to
+ * account for the fact that the kernel needs to be
+ * decompressed, and then followed by the BSS and BRK regions.
+ * This doesn't, however, account for the fact that the kernel
+ * is decompressed into a whole other place, either.
+ */
+ hdr.init_size = 3 * prot_mode_size;
+ }
+
if (!(hdr.loadflags & LOAD_HIGH) && prot_mode_size > 512 * 1024)
goto bail; /* Kernel cannot be loaded low */
@@ -376,12 +359,7 @@
if (start >= end)
continue;
- /* The 3* here is a total fudge factor... it's supposed to
- account for the fact that the kernel needs to be decompressed,
- and then followed by the BSS and BRK regions. This doesn't,
- however, account for the fact that the kernel is decompressed
- into a whole other place, either. */
- if (end - start >= 3 * prot_mode_size) {
+ if (end - start >= hdr.init_size) {
whdr->code32_start += start - prot_mode_base;
prot_mode_base = start;
ok = true;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lib/syslinux/shuffle.c
^
|
@@ -93,7 +93,7 @@
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 @@
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 */
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lib/vsscanf.c
^
|
@@ -12,6 +12,7 @@
#include <string.h>
#include <limits.h>
#include <stdio.h>
+#include <sys/bitops.h>
#ifndef LONG_BIT
#define LONG_BIT (CHAR_BIT*sizeof(long))
@@ -19,9 +20,8 @@
enum flags {
FL_SPLAT = 0x01, /* Drop the value, do not assign */
- FL_INV = 0x02, /* Character-set with inverse */
- FL_WIDTH = 0x04, /* Field width specified */
- FL_MINUS = 0x08, /* Negative number */
+ FL_WIDTH = 0x02, /* Field width specified */
+ FL_MINUS = 0x04, /* Negative number */
};
enum ranks {
@@ -46,25 +46,6 @@
bail_err /* Conversion mismatch */
};
-static inline const char *skipspace(const char *p)
-{
- while (isspace((unsigned char)*p))
- p++;
- return p;
-}
-
-#undef set_bit
-static inline void set_bit(unsigned long *bitmap, unsigned int bit)
-{
- bitmap[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT);
-}
-
-#undef test_bit
-static inline int test_bit(unsigned long *bitmap, unsigned int bit)
-{
- return (int)(bitmap[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1;
-}
-
int vsscanf(const char *buffer, const char *format, va_list ap)
{
const char *p = format;
@@ -87,7 +68,6 @@
} 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? */
@@ -194,33 +174,27 @@
#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 */
@@ -320,10 +294,11 @@
break;
case st_match_init: /* Initial state for %[ match */
- if (ch == '^' && !(flags & FL_INV)) {
+ if (ch == '^' && !matchinv) {
matchinv = 1;
} else {
- set_bit(matchmap, (unsigned char)ch);
+ range_start = (unsigned char)ch;
+ set_bit((unsigned char)ch, matchmap);
state = st_match;
}
break;
@@ -332,21 +307,21 @@
if (ch == ']') {
goto match_run;
} else if (ch == '-') {
- range_start = (unsigned char)ch;
state = st_match_range;
} else {
- set_bit(matchmap, (unsigned char)ch);
+ range_start = (unsigned char)ch;
+ set_bit((unsigned char)ch, matchmap);
}
break;
case st_match_range: /* %[ match after - */
if (ch == ']') {
- set_bit(matchmap, (unsigned char)'-'); /* - was last character */
+ set_bit((unsigned char)'-', matchmap); /* - was last character */
goto match_run;
} else {
int i;
- for (i = range_start; i < (unsigned char)ch; i++)
- set_bit(matchmap, i);
+ for (i = range_start; i <= (unsigned char)ch; i++)
+ set_bit(i, matchmap);
state = st_match;
}
break;
@@ -354,7 +329,7 @@
match_run: /* Match expression finished */
qq = q;
while (width && *q
- && test_bit(matchmap, (unsigned char)*q) ^ matchinv) {
+ && test_bit((unsigned char)*q, matchmap) ^ matchinv) {
*sarg++ = *q++;
}
if (q != qq) {
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/libutil/Makefile
^
|
@@ -32,7 +32,8 @@
topdir = ../..
include ../MCONFIG
-LIBOBJS = ansiline.o ansiraw.o get_key.o sha1hash.o unbase64.o \
+LIBOBJS = ansiline.o ansiraw.o get_key.o keyname.o \
+ sha1hash.o unbase64.o \
md5.o crypt-md5.o sha256crypt.o sha512crypt.o base64.o
LNXLIBOBJS = $(patsubst %.o,%.lo,$(LIBOBJS))
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/libutil/include/getkey.h
^
|
@@ -75,6 +75,10 @@
#define KEY_INSERT 0x0128
#define KEY_DELETE 0x0129
+#define KEY_MAX 0x012a
+
int get_key(FILE *, clock_t);
+int key_name_to_code(const char *);
+const char *key_code_to_name(int);
#endif /* LIBUTIL_GETKEY_H */
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/libutil/keyname.c
^
|
@@ -0,0 +1,138 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2011 Intel Corporation; author: H. Peter Anvin
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * keyname.c
+ *
+ * Conversion between strings and get_key() key numbers.
+ */
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/times.h>
+#include <getkey.h>
+#include <libutil.h>
+
+struct keyname {
+ const char *string;
+ int key;
+};
+
+static const struct keyname key_names[] = {
+ { "Backspace", KEY_BACKSPACE },
+ { "Tab", KEY_TAB },
+ { "Enter", KEY_ENTER },
+ { "Esc", KEY_ESC },
+ { "Escape", KEY_ESC },
+ { "Space", ' ' },
+ { "^?", KEY_DEL },
+ { "F1", KEY_F1 },
+ { "F2", KEY_F2},
+ { "F3", KEY_F3 },
+ { "F4", KEY_F4 },
+ { "F5", KEY_F5 },
+ { "F6", KEY_F6 },
+ { "F7", KEY_F7 },
+ { "F8", KEY_F8 },
+ { "F9", KEY_F9 },
+ { "F10", KEY_F10 },
+ { "F11", KEY_F11 },
+ { "F12", KEY_F12 },
+ { "Up", KEY_UP },
+ { "Down", KEY_DOWN },
+ { "Left", KEY_LEFT },
+ { "Right", KEY_RIGHT },
+ { "PgUp", KEY_PGUP },
+ { "PgDn", KEY_PGDN },
+ { "Home", KEY_HOME },
+ { "End", KEY_END },
+ { "Insert", KEY_INSERT },
+ { "Delete", KEY_DELETE },
+ { NULL, KEY_NONE }
+};
+
+int key_name_to_code(const char *code)
+{
+ const struct keyname *name;
+
+ if (code[0] && !code[1]) {
+ /* Single character */
+ return (unsigned char)code[0];
+ } else if (code[0] == '^' && code[1] && !code[2]) {
+ /* Control character */
+ if (code[1] == '?')
+ return 0x7f;
+ else
+ return (unsigned char)code[1] & 0x9f;
+ }
+
+
+ for (name = key_names; name->string; name++) {
+ if (!strcasecmp(name->string, code))
+ break;
+ }
+ return name->key; /* KEY_NONE at end of array */
+}
+
+const char *key_code_to_name(int key)
+{
+ static char buf[4];
+ const struct keyname *name;
+
+ if (key < 0)
+ return NULL;
+
+ if (key > ' ' && key < 0x100) {
+ if (key & 0x60) {
+ buf[0] = key;
+ buf[1] = '\0';
+ } else {
+ buf[0] = '^';
+ buf[1] = key | 0x40;
+ buf[2] = '\0';
+ }
+ return buf;
+ }
+
+ for (name = key_names; name->string; name++) {
+ if (key == name->key)
+ return name->string;
+ }
+
+ if (key < ' ') {
+ buf[0] = '^';
+ buf[1] = key | 0x40;
+ buf[2] = '\0';
+ return buf;
+ }
+
+ return NULL;
+}
|
|
Changed |
syslinux-4.04.tar.bz2/com32/libutil/libutil_com.a
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/libutil/libutil_lnx.a
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/doc/manual.html
^
|
@@ -3,8 +3,8 @@
<head>
<title>Lua 5.1 Reference Manual</title>
-<link rel="stylesheet" href="lua.css">
-<link rel="stylesheet" href="manual.css">
+<link rel="stylesheet" type="text/css" href="lua.css">
+<link rel="stylesheet" type="text/css" href="manual.css">
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
</head>
@@ -33,7 +33,7 @@
<!-- ====================================================================== -->
<p>
-<!-- $Id: manual.of,v 1.45 2008/01/19 00:17:30 roberto Exp $ -->
+<!-- $Id: manual.of,v 1.48 2008/08/18 15:24:20 roberto Exp $ -->
@@ -103,7 +103,8 @@
Non-terminals are shown like non-terminal,
keywords are shown like <b>kword</b>,
and other terminal symbols are shown like `<b>=</b>´.
-The complete syntax of Lua can be found at the end of this manual.
+The complete syntax of Lua can be found in <a href="#8">§8</a>
+at the end of this manual.
@@ -139,7 +140,7 @@
<code>and</code> is a reserved word, but <code>And</code> and <code>AND</code>
are two different, valid names.
As a convention, names starting with an underscore followed by
-uppercase letters (such as <code>_VERSION</code>)
+uppercase letters (such as <a href="#pdf-_VERSION"><code>_VERSION</code></a>)
are reserved for internal global variables used by Lua.
@@ -169,27 +170,16 @@
and '<code>\'</code>' (apostrophe [single quote]).
Moreover, a backslash followed by a real newline
results in a newline in the string.
-A character in a string may also be specified by its numerical value
+A character in a string can also be specified by its numerical value
using the escape sequence <code>\<em>ddd</em></code>,
where <em>ddd</em> is a sequence of up to three decimal digits.
(Note that if a numerical escape is to be followed by a digit,
it must be expressed using exactly three digits.)
-Strings in Lua may contain any 8-bit value, including embedded zeros,
+Strings in Lua can contain any 8-bit value, including embedded zeros,
which can be specified as '<code>\0</code>'.
<p>
-To put a double (single) quote, a newline, a backslash,
-a carriage return,
-or an embedded zero
-inside a literal string enclosed by double (single) quotes
-you must use an escape sequence.
-Any other character may be directly inserted into the literal.
-(Some control characters may cause problems for the file system,
-but Lua has no problem with them.)
-
-
-<p>
Literal strings can also be defined using a long format
enclosed by <em>long brackets</em>.
We define an <em>opening long bracket of level <em>n</em></em> as an opening
@@ -202,10 +192,10 @@
for instance, a closing long bracket of level 4 is written as <code>]====]</code>.
A long string starts with an opening long bracket of any level and
ends at the first closing long bracket of the same level.
-Literals in this bracketed form may run for several lines,
+Literals in this bracketed form can run for several lines,
do not interpret any escape sequences,
and ignore long brackets of any other level.
-They may contain anything except a closing bracket of the proper level.
+They can contain anything except a closing bracket of the proper level.
<p>
@@ -215,7 +205,7 @@
As an example, in a system using ASCII
(in which '<code>a</code>' is coded as 97,
newline is coded as 10, and '<code>1</code>' is coded as 49),
-the five literals below denote the same string:
+the five literal strings below denote the same string:
<pre>
a = 'alo\n123"'
@@ -229,7 +219,7 @@
</pre>
<p>
-A <em>numerical constant</em> may be written with an optional decimal part
+A <em>numerical constant</em> can be written with an optional decimal part
and an optional decimal exponent.
Lua also accepts integer hexadecimal constants,
by prefixing them with <code>0x</code>.
@@ -288,7 +278,7 @@
<em>String</em> represents arrays of characters.
Lua is 8-bit clean:
-strings may contain any 8-bit character,
+strings can contain any 8-bit character,
including embedded zeros ('<code>\0</code>') (see <a href="#2.1">§2.1</a>).
@@ -327,7 +317,7 @@
Tables can be <em>heterogeneous</em>;
that is, they can contain values of all types (except <b>nil</b>).
Tables are the sole data structuring mechanism in Lua;
-they may be used to represent ordinary arrays,
+they can be used to represent ordinary arrays,
symbol tables, sets, records, graphs, trees, etc.
To represent records, Lua uses the field name as an index.
The language supports this representation by
@@ -341,8 +331,8 @@
the value of a table field can be of any type (except <b>nil</b>).
In particular,
because functions are first-class values,
-table fields may contain functions.
-Thus tables may also carry <em>methods</em> (see <a href="#2.5.9">§2.5.9</a>).
+table fields can contain functions.
+Thus tables can also carry <em>methods</em> (see <a href="#2.5.9">§2.5.9</a>).
<p>
@@ -477,7 +467,7 @@
Lua supports an almost conventional set of statements,
similar to those in Pascal or C.
This set includes
-assignment, control structures, function calls,
+assignments, control structures, function calls,
and variable declarations.
@@ -505,15 +495,15 @@
<p>
-A chunk may be stored in a file or in a string inside the host program.
-When a chunk is executed, first it is pre-compiled into instructions for
-a virtual machine,
-and then the compiled code is executed
-by an interpreter for the virtual machine.
+A chunk can be stored in a file or in a string inside the host program.
+To execute a chunk,
+Lua first pre-compiles the chunk into instructions for a virtual machine,
+and then it executes the compiled code
+with an interpreter for the virtual machine.
<p>
-Chunks may also be pre-compiled into binary form;
+Chunks can also be pre-compiled into binary form;
see program <code>luac</code> for details.
Programs in source and compiled forms are interchangeable;
Lua automatically detects the file type and acts accordingly.
@@ -532,7 +522,7 @@
</pre>
<p>
-A block may be explicitly delimited to produce a single statement:
+A block can be explicitly delimited to produce a single statement:
<pre>
stat ::= <b>do</b> block <b>end</b>
@@ -550,7 +540,7 @@
<h3>2.4.3 - <a name="2.4.3">Assignment</a></h3>
<p>
-Lua allows multiple assignment.
+Lua allows multiple assignments.
Therefore, the syntax for assignment
defines a list of variables on the left side
and a list of expressions on the right side.
@@ -573,7 +563,7 @@
If there are fewer values than needed,
the list is extended with as many <b>nil</b>'s as needed.
If the list of expressions ends with a function call,
-then all values returned by this call enter in the list of values,
+then all values returned by that call enter the list of values,
before the adjustment
(except when the call is enclosed in parentheses; see <a href="#2.5">§2.5</a>).
@@ -595,7 +585,13 @@
<pre>
x, y = y, x
</pre><p>
-exchanges the values of <code>x</code> and <code>y</code>.
+exchanges the values of <code>x</code> and <code>y</code>,
+and
+
+<pre>
+ x, y, z = y, z, x
+</pre><p>
+cyclically permutes the values of <code>x</code>, <code>y</code>, and <code>z</code>.
<p>
@@ -644,7 +640,7 @@
<p>
The condition expression of a
-control structure may return any value.
+control structure can return any value.
Both <b>false</b> and <b>nil</b> are considered false.
All values different from <b>nil</b> and <b>false</b> are considered true
(in particular, the number 0 and the empty string are also true).
@@ -662,8 +658,8 @@
The <b>return</b> statement is used to return values
from a function or a chunk (which is just a function).
-Functions and chunks may return more than one value,
-so the syntax for the <b>return</b> statement is
+Functions and chunks can return more than one value,
+and so the syntax for the <b>return</b> statement is
<pre>
stat ::= <b>return</b> [explist]
@@ -745,7 +741,7 @@
<li>
<code><em>var</em></code>, <code><em>limit</em></code>, and <code><em>step</em></code> are invisible variables.
-The names are here for explanatory purposes only.
+The names shown here are for explanatory purposes only.
</li>
<li>
@@ -842,8 +838,8 @@
<h3>2.4.7 - <a name="2.4.7">Local Declarations</a></h3><p>
-Local variables may be declared anywhere inside a block.
-The declaration may include an initial assignment:
+Local variables can be declared anywhere inside a block.
+The declaration can include an initial assignment:
<pre>
stat ::= <b>local</b> namelist [`<b>=</b>´ explist]
@@ -908,12 +904,12 @@
<p>
-Both function calls and vararg expressions may result in multiple values.
-If the expression is used as a statement (see <a href="#2.4.6">§2.4.6</a>)
-(only possible for function calls),
+Both function calls and vararg expressions can result in multiple values.
+If an expression is used as a statement
+(only possible for function calls (see <a href="#2.4.6">§2.4.6</a>)),
then its return list is adjusted to zero elements,
thus discarding all returned values.
-If the expression is used as the last (or the only) element
+If an expression is used as the last (or the only) element
of a list of expressions,
then no adjustment is made
(unless the call is enclosed in parentheses).
@@ -931,7 +927,7 @@
g(x, f()) -- g gets x plus all results from f()
a,b,c = f(), x -- f() is adjusted to 1 result (c gets nil)
a,b = ... -- a gets the first vararg parameter, b gets
- -- the second (both a and b may get nil if there
+ -- the second (both a and b can get nil if there
-- is no corresponding vararg parameter)
a,b,c = x, f() -- f() is adjusted to 2 results
@@ -945,7 +941,7 @@
</pre>
<p>
-An expression enclosed in parentheses always results in only one value.
+Any expression enclosed in parentheses always results in only one value.
Thus,
<code>(f(x,y,z))</code> is always a single value,
even if <code>f</code> returns several values.
@@ -1023,6 +1019,8 @@
then their values are compared according to the current locale.
Otherwise, Lua tries to call the "lt" or the "le"
metamethod (see <a href="#2.8">§2.8</a>).
+A comparison <code>a > b</code> is translated to <code>b < a</code>
+and <code>a >= b</code> is translated to <code>b <= a</code>.
@@ -1060,7 +1058,7 @@
10 and 20 --> 20
</pre><p>
(In this manual,
---> indicates the result of the preceding expression.)
+<code>--></code> indicates the result of the preceding expression.)
@@ -1090,13 +1088,13 @@
The length of a table <code>t</code> is defined to be any
integer index <code>n</code>
such that <code>t[n]</code> is not <b>nil</b> and <code>t[n+1]</code> is <b>nil</b>;
-moreover, if <code>t[1]</code> is <b>nil</b>, <code>n</code> may be zero.
+moreover, if <code>t[1]</code> is <b>nil</b>, <code>n</code> can be zero.
For a regular array, with non-nil values from 1 to a given <code>n</code>,
its length is exactly that <code>n</code>,
the index of its last value.
If the array has "holes"
(that is, <b>nil</b> values between other non-nil values),
-then <code>#t</code> may be any of the indices that
+then <code>#t</code> can be any of the indices that
directly precedes a <b>nil</b> value
(that is, it may consider any such <b>nil</b> value as the end of
the array).
@@ -1132,7 +1130,7 @@
<h3>2.5.7 - <a name="2.5.7">Table Constructors</a></h3><p>
Table constructors are expressions that create tables.
Every time a constructor is evaluated, a new table is created.
-Constructors can be used to create empty tables,
+A constructor can be used to create an empty table
or to create a table and initialize some of its fields.
The general syntax for constructors is
@@ -1179,12 +1177,12 @@
then all values returned by this expression enter the list consecutively
(see <a href="#2.5.8">§2.5.8</a>).
To avoid this,
-enclose the function call (or the vararg expression)
+enclose the function call or the vararg expression
in parentheses (see <a href="#2.5">§2.5</a>).
<p>
-The field list may have an optional trailing separator,
+The field list can have an optional trailing separator,
as a convenience for machine-generated code.
@@ -1349,8 +1347,8 @@
This function instance (or <em>closure</em>)
is the final value of the expression.
Different instances of the same function
-may refer to different external local variables
-and may have different environment tables.
+can refer to different external local variables
+and can have different environment tables.
<p>
@@ -1377,7 +1375,7 @@
then its return list is adjusted to one element.
If the expression is used as the last element of a list of expressions,
then no adjustment is made
-(unless the call is enclosed in parentheses).
+(unless that last expression is enclosed in parentheses).
<p>
@@ -1520,7 +1518,7 @@
<h2>2.8 - <a name="2.8">Metatables</a></h2>
<p>
-Every value in Lua may have a <em>metatable</em>.
+Every value in Lua can have a <em>metatable</em>.
This <em>metatable</em> is an ordinary Lua table
that defines the behavior of the original value
under certain special operations.
@@ -1549,22 +1547,22 @@
through the <a href="#pdf-setmetatable"><code>setmetatable</code></a>
function.
You cannot change the metatable of other types from Lua
-(except using the debug library);
+(except by using the debug library);
you must use the C API for that.
<p>
Tables and full userdata have individual metatables
-(although multiple tables and userdata can share their metatables);
-values of all other types share one single metatable per type.
-So, there is one single metatable for all numbers,
+(although multiple tables and userdata can share their metatables).
+Values of all other types share one single metatable per type;
+that is, there is one single metatable for all numbers,
one for all strings, etc.
<p>
-A metatable may control how an object behaves in arithmetic operations,
+A metatable controls how an object behaves in arithmetic operations,
order comparisons, concatenation, length operation, and indexing.
-A metatable can also define a function to be called when a userdata
+A metatable also can define a function to be called when a userdata
is garbage collected.
For each of these operations Lua associates a specific key
called an <em>event</em>.
@@ -1806,7 +1804,7 @@
if h then
return (h(op1, op2))
else
- error(···);
+ error(···)
end
end
end
@@ -1833,7 +1831,7 @@
if h then
return not h(op2, op1)
else
- error(···);
+ error(···)
end
end
end
@@ -1860,7 +1858,7 @@
else
h = metatable(table).__index
if h == nil then
- error(···);
+ error(···)
end
end
if type(h) == "function" then
@@ -1886,7 +1884,7 @@
else
h = metatable(table).__newindex
if h == nil then
- error(···);
+ error(···)
end
end
if type(h) == "function" then
@@ -1934,6 +1932,17 @@
<p>
+Threads are created sharing the environment of the creating thread.
+Userdata and C functions are created sharing the environment
+of the creating C function.
+Non-nested Lua functions
+(created by <a href="#pdf-loadfile"><code>loadfile</code></a>, <a href="#pdf-loadstring"><code>loadstring</code></a> or <a href="#pdf-load"><code>load</code></a>)
+are created sharing the environment of the creating thread.
+Nested Lua functions are created sharing the environment of
+the creating Lua function.
+
+
+<p>
Environments associated with userdata have no meaning for Lua.
It is only a convenience feature for programmers to associate a table to
a userdata.
@@ -1942,23 +1951,22 @@
<p>
Environments associated with threads are called
<em>global environments</em>.
-They are used as the default environment for their threads and
-non-nested functions created by the thread
-(through <a href="#pdf-loadfile"><code>loadfile</code></a>, <a href="#pdf-loadstring"><code>loadstring</code></a> or <a href="#pdf-load"><code>load</code></a>)
+They are used as the default environment for threads and
+non-nested Lua functions created by the thread
and can be directly accessed by C code (see <a href="#3.3">§3.3</a>).
<p>
-Environments associated with C functions can be directly
+The environment associated with a C function can be directly
accessed by C code (see <a href="#3.3">§3.3</a>).
-They are used as the default environment for other C functions
-created by the function.
+It is used as the default environment for other C functions
+and userdata created by the function.
<p>
Environments associated with Lua functions are used to resolve
all accesses to global variables within the function (see <a href="#2.3">§2.3</a>).
-They are used as the default environment for other Lua functions
+They are used as the default environment for nested Lua functions
created by the function.
@@ -1985,9 +1993,9 @@
Lua manages memory automatically by running
a <em>garbage collector</em> from time to time
to collect all <em>dead objects</em>
-(that is, these objects that are no longer accessible from Lua).
-All objects in Lua are subject to automatic management:
-tables, userdata, functions, threads, and strings.
+(that is, objects that are no longer accessible from Lua).
+All memory used by Lua is subject to automatic management:
+tables, userdata, functions, threads, strings, etc.
<p>
@@ -1995,15 +2003,17 @@
It uses two numbers to control its garbage-collection cycles:
the <em>garbage-collector pause</em> and
the <em>garbage-collector step multiplier</em>.
+Both use percentage points as units
+(so that a value of 100 means an internal value of 1).
<p>
The garbage-collector pause
controls how long the collector waits before starting a new cycle.
Larger values make the collector less aggressive.
-Values smaller than 1 mean the collector will not wait to
+Values smaller than 100 mean the collector will not wait to
start a new cycle.
-A value of 2 means that the collector waits for the total memory in use
+A value of 200 means that the collector waits for the total memory in use
to double before starting a new cycle.
@@ -2013,17 +2023,15 @@
memory allocation.
Larger values make the collector more aggressive but also increase
the size of each incremental step.
-Values smaller than 1 make the collector too slow and
-may result in the collector never finishing a cycle.
-The default, 2, means that the collector runs at "twice"
+Values smaller than 100 make the collector too slow and
+can result in the collector never finishing a cycle.
+The default, 200, means that the collector runs at "twice"
the speed of memory allocation.
<p>
You can change these numbers by calling <a href="#lua_gc"><code>lua_gc</code></a> in C
or <a href="#pdf-collectgarbage"><code>collectgarbage</code></a> in Lua.
-Both get percentage points as arguments
-(so an argument of 100 means a real value of 1).
With these functions you can also control
the collector directly (e.g., stop and restart it).
@@ -2100,7 +2108,7 @@
<p>
After you use a table as a metatable,
-you should not change the value of its field <code>__mode</code>.
+you should not change the value of its <code>__mode</code> field.
Otherwise, the weak behavior of the tables controlled by this
metatable is undefined.
@@ -2133,7 +2141,7 @@
<p>
When you first call <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a>,
passing as its first argument
-the thread returned by <a href="#pdf-coroutine.create"><code>coroutine.create</code></a>,
+a thread returned by <a href="#pdf-coroutine.create"><code>coroutine.create</code></a>,
the coroutine starts its execution,
at the first line of its main function.
Extra arguments passed to <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a> are passed on
@@ -2383,7 +2391,7 @@
<code>lua_upvalueindex(1)</code>, and so on.
Any access to <code>lua_upvalueindex(<em>n</em>)</code>,
where <em>n</em> is greater than the number of upvalues of the
-current function,
+current function (but not greater than 256),
produces an acceptable (but invalid) index.
@@ -2431,7 +2439,7 @@
<p>
-Most functions in the API may throw an error,
+Most functions in the API can throw an error,
for instance due to a memory allocation error.
The documentation for each function indicates whether
it can throw errors.
@@ -2459,7 +2467,7 @@
The second field, <code>p</code>,
is how many elements the function pushes onto the stack.
(Any function always pushes its results after popping its arguments.)
-A field in the form <code>x|y</code> means the function may push (or pop)
+A field in the form <code>x|y</code> means the function can push (or pop)
<code>x</code> or <code>y</code> elements,
depending on the situation;
an interrogation mark '<code>?</code>' means that
@@ -2544,7 +2552,7 @@
Lua calls a <em>panic function</em>
and then calls <code>exit(EXIT_FAILURE)</code>,
thus exiting the host application.
-Your panic function may avoid this exit by
+Your panic function can avoid this exit by
never returning (e.g., doing a long jump).
@@ -2589,7 +2597,7 @@
<p>
-The following example shows how the host program may do the
+The following example shows how the host program can do the
equivalent to this Lua code:
<pre>
@@ -2858,13 +2866,13 @@
</li>
<li><b><code>LUA_GCSETPAUSE</code>:</b>
-sets <code>data</code>/100 as the new value
+sets <code>data</code> as the new value
for the <em>pause</em> of the collector (see <a href="#2.10">§2.10</a>).
The function returns the previous value of the pause.
</li>
<li><b><code>LUA_GCSETSTEPMUL</code>:</b>
-sets <code>data</code>/100 as the new value for the <em>step multiplier</em> of
+sets <code>data</code> as the new value for the <em>step multiplier</em> of
the collector (see <a href="#2.10">§2.10</a>).
The function returns the previous value of the step multiplier.
</li>
@@ -3485,6 +3493,10 @@
<a href="#lua_pushcclosure"><code>lua_pushcclosure</code></a> also pops these values from the stack.
+<p>
+The maximum value for <code>n</code> is 255.
+
+
@@ -3774,7 +3786,8 @@
with a new piece of the chunk
and set <code>size</code> to the block size.
The block must exist until the reader function is called again.
-To signal the end of the chunk, the reader must return <code>NULL</code>.
+To signal the end of the chunk,
+the reader must return <code>NULL</code> or set <code>size</code> to zero.
The reader function may return pieces of any size greater than zero.
@@ -4081,7 +4094,7 @@
to a string inside the Lua state.
This string always has a zero ('<code>\0</code>')
after its last character (as in C),
-but may contain other zeros in its body.
+but can contain other zeros in its body.
Because Lua has garbage collection,
there is no guarantee that the pointer returned by <a href="#lua_tolstring"><code>lua_tolstring</code></a>
will be valid after the corresponding value is removed from the stack.
@@ -4112,7 +4125,7 @@
<p>
Converts the value at the given acceptable index to a generic
C pointer (<code>void*</code>).
-The value may be a userdata, a table, a thread, or a function;
+The value can be a userdata, a table, a thread, or a function;
otherwise, <a href="#lua_topointer"><code>lua_topointer</code></a> returns <code>NULL</code>.
Different objects will give different pointers.
There is no way to convert the pointer back to its original value.
@@ -4350,8 +4363,8 @@
a reasonable name for the given function.
Because functions in Lua are first-class values,
they do not have a fixed name:
-some functions may be the value of multiple global variables,
-while others may be stored only in a table field.
+some functions can be the value of multiple global variables,
+while others can be stored only in a table field.
The <code>lua_getinfo</code> function checks how the function was
called to find a suitable name.
If it cannot find a name,
@@ -4581,7 +4594,7 @@
Moreover, for line events, the field <code>currentline</code> is also set.
To get the value of any other field in <code>ar</code>,
the hook must call <a href="#lua_getinfo"><code>lua_getinfo</code></a>.
-For return events, <code>event</code> may be <code>LUA_HOOKRET</code>,
+For return events, <code>event</code> can be <code>LUA_HOOKRET</code>,
the normal value, or <code>LUA_HOOKTAILRET</code>.
In the latter case, Lua is simulating a return from
a function that did a tail call;
@@ -5632,7 +5645,7 @@
<ul>
-<li>basic library;</li>
+<li>basic library,</li> which includes the coroutine sub-library;
<li>package library;</li>
@@ -5731,13 +5744,15 @@
</li>
<li><b>"setpause":</b>
-sets <code>arg</code>/100 as the new value for the <em>pause</em> of
+sets <code>arg</code> as the new value for the <em>pause</em> of
the collector (see <a href="#2.10">§2.10</a>).
+Returns the previous value for <em>pause</em>.
</li>
<li><b>"setstepmul":</b>
-sets <code>arg</code>/100 as the new value for the <em>step multiplier</em> of
+sets <code>arg</code> as the new value for the <em>step multiplier</em> of
the collector (see <a href="#2.10">§2.10</a>).
+Returns the previous value for <em>step</em>.
</li>
</ul>
@@ -5842,7 +5857,7 @@
Loads a chunk using function <code>func</code> to get its pieces.
Each call to <code>func</code> must return a string that concatenates
with previous results.
-A return of <b>nil</b> (or no value) signals the end of the chunk.
+A return of an empty string, <b>nil</b>, or no value signals the end of the chunk.
<p>
@@ -6088,7 +6103,7 @@
In bases above 10, the letter '<code>A</code>' (in either upper or lower case)
represents 10, '<code>B</code>' represents 11, and so forth,
with '<code>Z</code>' representing 35.
-In base 10 (the default), the number may have a decimal part,
+In base 10 (the default), the number can have a decimal part,
as well as an optional exponent part (see <a href="#2.1">§2.1</a>).
In other bases, only unsigned integers are accepted.
@@ -6335,7 +6350,7 @@
<p>
-This function may receive optional <em>options</em> after
+This function can receive optional <em>options</em> after
the module name,
where each option is a function to be applied over the module.
@@ -6442,7 +6457,7 @@
<a href="#pdf-require"><code>require</code></a> calls each of these searchers in ascending order,
with the module name (the argument given to <a href="#pdf-require"><code>require</code></a>) as its
sole parameter.
-The function may return another function (the module <em>loader</em>)
+The function can return another function (the module <em>loader</em>)
or a string explaining why it did not find that module
(or <b>nil</b> if it has nothing to say).
Lua initializes this table with four functions.
@@ -6618,6 +6633,10 @@
<p>
+The string library assumes one-byte character encodings.
+
+
+<p>
<hr><h3><a name="pdf-string.byte"><code>string.byte (s [, i [, j]])</code></a></h3>
Returns the internal numerical codes of the characters <code>s[i]</code>,
<code>s[i+1]</code>, ···, <code>s[j]</code>.
@@ -6667,7 +6686,7 @@
otherwise, it returns <b>nil</b>.
A third, optional numerical argument <code>init</code> specifies
where to start the search;
-its default value is 1 and may be negative.
+its default value is 1 and can be negative.
A value of <b>true</b> as a fourth, optional argument <code>plain</code>
turns off the pattern matching facilities,
so the function does a plain "find substring" operation,
@@ -6771,7 +6790,7 @@
in which all (or the first <code>n</code>, if given)
occurrences of the <code>pattern</code> have been
replaced by a replacement string specified by <code>repl</code>,
-which may be a string, a table, or a function.
+which can be a string, a table, or a function.
<code>gsub</code> also returns, as its second value,
the total number of matches that occurred.
@@ -6869,7 +6888,7 @@
then the whole match is returned.
A third, optional numerical argument <code>init</code> specifies
where to start the search;
-its default value is 1 and may be negative.
+its default value is 1 and can be negative.
@@ -6893,7 +6912,7 @@
<hr><h3><a name="pdf-string.sub"><code>string.sub (s, i [, j])</code></a></h3>
Returns the substring of <code>s</code> that
starts at <code>i</code> and continues until <code>j</code>;
-<code>i</code> and <code>j</code> may be negative.
+<code>i</code> and <code>j</code> can be negative.
If <code>j</code> is absent, then it is assumed to be equal to -1
(which is the same as the string length).
In particular,
@@ -6962,9 +6981,9 @@
<li><b><code>[<em>set</em>]</code>:</b>
represents the class which is the union of all
characters in <em>set</em>.
-A range of characters may be specified by
+A range of characters can be specified by
separating the end characters of the range with a '<code>-</code>'.
-All classes <code>%</code><em>x</em> described above may also be used as
+All classes <code>%</code><em>x</em> described above can also be used as
components in <em>set</em>.
All other characters in <em>set</em> represent themselves.
For example, <code>[%w_]</code> (or <code>[_%w]</code>)
@@ -7001,7 +7020,7 @@
<h4>Pattern Item:</h4><p>
-A <em>pattern item</em> may be
+A <em>pattern item</em> can be
<ul>
@@ -7070,7 +7089,7 @@
<h4>Captures:</h4><p>
-A pattern may contain sub-patterns enclosed in parentheses;
+A pattern can contain sub-patterns enclosed in parentheses;
they describe <em>captures</em>.
When a match succeeds, the substrings of the subject string
that match captures are stored (<em>captured</em>) for future use.
@@ -7320,7 +7339,8 @@
<p>
-Returns the remainder of the division of <code>x</code> by <code>y</code>.
+Returns the remainder of the division of <code>x</code> by <code>y</code>
+that rounds the quotient towards zero.
@@ -7657,7 +7677,7 @@
<li><b>"a+":</b> append update mode, previous data is preserved,
writing is only allowed at the end of file.</li>
</ul><p>
-The <code>mode</code> string may also have a '<code>b</code>' at the end,
+The <code>mode</code> string can also have a '<code>b</code>' at the end,
which is needed in some systems to open the file in binary mode.
This string is exactly what is used in the
standard C function <code>fopen</code>.
@@ -8115,6 +8135,22 @@
and explicitly removed when no longer needed.
+<p>
+On some systems (POSIX),
+this function also creates a file with that name,
+to avoid security risks.
+(Someone else might create the file with wrong permissions
+in the time between getting the name and creating the file.)
+You still have to open the file to use it
+and to remove it (even if you do not use it).
+
+
+<p>
+When possible,
+you may prefer to use <a href="#pdf-io.tmpfile"><code>io.tmpfile</code></a>,
+which automatically removes the file when the program ends.
+
+
@@ -8207,7 +8243,7 @@
<p>
-The returned table may contain all the fields returned by <a href="#lua_getinfo"><code>lua_getinfo</code></a>,
+The returned table can contain all the fields returned by <a href="#lua_getinfo"><code>lua_getinfo</code></a>,
with the string <code>what</code> describing which fields to fill in.
The default for <code>what</code> is to get all information available,
except the table of valid lines.
@@ -8326,7 +8362,8 @@
<p>
When the hook is called, its first parameter is a string
describing the event that has triggered its call:
-<code>"call"</code>, <code>"return"</code> (or <code>"tail return"</code>),
+<code>"call"</code>, <code>"return"</code> (or <code>"tail return"</code>,
+when simulating a return from a tail call),
<code>"line"</code>, and <code>"count"</code>.
For line events,
the hook also gets the new line number as its second parameter.
@@ -8754,10 +8791,10 @@
<HR>
<SMALL>
Last update:
-Fri Jan 18 22:32:24 BRST 2008
+Mon Aug 18 13:25:46 BRT 2008
</SMALL>
<!--
-Last change: revised for Lua 5.1.3
+Last change: revised for Lua 5.1.4
-->
</body></html>
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/doc/readme.html
^
|
@@ -12,7 +12,7 @@
Documentation
</H1>
-This is the documentation included in the source distribution of Lua 5.1.3.
+This is the documentation included in the source distribution of Lua 5.1.4.
<UL>
<LI><A HREF="contents.html">Reference manual</A>
@@ -33,7 +33,7 @@
<HR>
<SMALL>
Last update:
-Wed Dec 19 13:59:14 BRST 2007
+Tue Aug 12 14:46:07 BRT 2008
</SMALL>
</BODY>
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/etc/lua.pc
^
|
@@ -5,7 +5,7 @@
# grep '^V=' ../Makefile
V= 5.1
# grep '^R=' ../Makefile
-R= 5.1.3
+R= 5.1.4
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
prefix= /usr/local
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/Makefile
^
|
@@ -22,8 +22,9 @@
LNXLIBS =
# Temporarily allow warnings not being treated as errors
-GCCWARN += -Wno-error
+#GCCWARN += -Wno-error
+CFLAGS += -DSYSLINUX
MODULES = lua.c32
TESTFILES =
@@ -40,7 +41,7 @@
LIBLUA_OBJS += lstrlib.o loadlib.o linit.o
LIBLUA_OBJS += liolib.o
LIBLUA_OBJS += dmi.o
-
+LIBLUA_OBJS += cpu.o
LIBLUA_OBJS += pci.o
LIBLUA_OBJS += vesa.o
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/lua/src/cpu.c
^
|
@@ -0,0 +1,158 @@
+#include <stdlib.h>
+#include <string.h>
+
+#define llua_cpu /* Define the library */
+
+/* Include the Lua API header files */
+#include"lua.h"
+#include"lauxlib.h"
+#include"lualib.h"
+#include"cpuid.h"
+
+static void add_string_item(lua_State *L, const char *item, const char *value_str) {
+ lua_pushstring(L,item);
+ lua_pushstring(L,value_str);
+ lua_settable(L,-3);
+}
+
+static void add_int_item(lua_State *L, const char *item, int value_int) {
+ lua_pushstring(L,item);
+ lua_pushnumber(L,value_int);
+ lua_settable(L,-3);
+}
+
+static void add_flag(lua_State *L, bool value, const char *value_str) {
+ char buffer[32] = { 0 };
+ snprintf(buffer,sizeof(buffer), "flags.%s",value_str);
+ lua_pushstring(L,buffer);
+// printf("%s=%d\n",value_str,value);
+
+ if (value == true) {
+ lua_pushstring(L,"yes");
+ } else {
+ lua_pushstring(L,"no");
+ }
+
+ lua_settable(L,-3);
+}
+
+static int cpu_getflags(lua_State *L)
+{
+ s_cpu lua_cpu;
+
+ detect_cpu(&lua_cpu);
+
+ lua_newtable(L);
+
+ add_string_item(L, "vendor", lua_cpu.vendor);
+ add_string_item(L, "model", lua_cpu.model);
+ add_int_item(L, "cores", lua_cpu.num_cores);
+ add_int_item(L, "l1_instruction_cache", lua_cpu.l1_instruction_cache_size);
+ add_int_item(L, "l1_data_cache", lua_cpu.l1_data_cache_size);
+ add_int_item(L, "l2_cache", lua_cpu.l2_cache_size);
+ add_int_item(L, "family_id", lua_cpu.family);
+ add_int_item(L, "model_id", lua_cpu.model_id);
+ add_int_item(L, "stepping", lua_cpu.stepping);
+
+ add_flag(L, lua_cpu.flags.fpu, "fpu");
+ add_flag(L, lua_cpu.flags.vme, "vme");
+ add_flag(L, lua_cpu.flags.de, "de");
+ add_flag(L, lua_cpu.flags.pse, "pse");
+ add_flag(L, lua_cpu.flags.tsc, "tsc");
+ add_flag(L, lua_cpu.flags.msr, "msr");
+ add_flag(L, lua_cpu.flags.pae, "pae");
+ add_flag(L, lua_cpu.flags.mce, "mce");
+ add_flag(L, lua_cpu.flags.cx8, "cx8");
+ add_flag(L, lua_cpu.flags.apic, "apic");
+ add_flag(L, lua_cpu.flags.sep, "sep");
+ add_flag(L, lua_cpu.flags.mtrr, "mtrr");
+ add_flag(L, lua_cpu.flags.pge, "pge");
+ add_flag(L, lua_cpu.flags.mca, "mca");
+ add_flag(L, lua_cpu.flags.cmov, "cmov");
+ add_flag(L, lua_cpu.flags.pat, "pat");
+ add_flag(L, lua_cpu.flags.pse_36, "pse_36");
+ add_flag(L, lua_cpu.flags.psn, "psn");
+ add_flag(L, lua_cpu.flags.clflsh, "clflsh");
+ add_flag(L, lua_cpu.flags.dts, "dts");
+ add_flag(L, lua_cpu.flags.acpi, "acpi");
+ add_flag(L, lua_cpu.flags.mmx, "mmx");
+ add_flag(L, lua_cpu.flags.sse, "sse");
+ add_flag(L, lua_cpu.flags.sse2, "sse2");
+ add_flag(L, lua_cpu.flags.ss, "ss");
+ add_flag(L, lua_cpu.flags.htt, "ht");
+ add_flag(L, lua_cpu.flags.acc, "acc");
+ add_flag(L, lua_cpu.flags.syscall, "syscall");
+ add_flag(L, lua_cpu.flags.mp, "mp");
+ add_flag(L, lua_cpu.flags.nx, "nx");
+ add_flag(L, lua_cpu.flags.mmxext, "mmxext");
+ add_flag(L, lua_cpu.flags.lm, "lm");
+ add_flag(L, lua_cpu.flags.nowext, "3dnowext");
+ add_flag(L, lua_cpu.flags.now, "3dnow!");
+ add_flag(L, lua_cpu.flags.svm, "svm");
+ add_flag(L, lua_cpu.flags.vmx, "vmx");
+ add_flag(L, lua_cpu.flags.pbe, "pbe");
+ add_flag(L, lua_cpu.flags.fxsr_opt, "fxsr_opt");
+ add_flag(L, lua_cpu.flags.gbpages, "gbpages");
+ add_flag(L, lua_cpu.flags.rdtscp, "rdtscp");
+ add_flag(L, lua_cpu.flags.pni, "pni");
+ add_flag(L, lua_cpu.flags.pclmulqd, "pclmulqd");
+ add_flag(L, lua_cpu.flags.dtes64, "dtes64");
+ add_flag(L, lua_cpu.flags.smx, "smx");
+ add_flag(L, lua_cpu.flags.est, "est");
+ add_flag(L, lua_cpu.flags.tm2, "tm2");
+ add_flag(L, lua_cpu.flags.sse3, "sse3");
+ add_flag(L, lua_cpu.flags.fma, "fma");
+ add_flag(L, lua_cpu.flags.cx16, "cx16");
+ add_flag(L, lua_cpu.flags.xtpr, "xtpr");
+ add_flag(L, lua_cpu.flags.pdcm, "pdcm");
+ add_flag(L, lua_cpu.flags.dca, "dca");
+ add_flag(L, lua_cpu.flags.xmm4_1, "xmm4_1");
+ add_flag(L, lua_cpu.flags.xmm4_2, "xmm4_2");
+ add_flag(L, lua_cpu.flags.x2apic, "x2apic");
+ add_flag(L, lua_cpu.flags.movbe, "movbe");
+ add_flag(L, lua_cpu.flags.popcnt, "popcnt");
+ add_flag(L, lua_cpu.flags.aes, "aes");
+ add_flag(L, lua_cpu.flags.xsave, "xsave");
+ add_flag(L, lua_cpu.flags.osxsave, "osxsave");
+ add_flag(L, lua_cpu.flags.avx, "avx");
+ add_flag(L, lua_cpu.flags.hypervisor, "hypervisor");
+ add_flag(L, lua_cpu.flags.ace2, "ace2");
+ add_flag(L, lua_cpu.flags.ace2_en, "ace2_en");
+ add_flag(L, lua_cpu.flags.phe, "phe");
+ add_flag(L, lua_cpu.flags.phe_en, "phe_en");
+ add_flag(L, lua_cpu.flags.pmm, "pmm");
+ add_flag(L, lua_cpu.flags.pmm_en, "pmm_en");
+ add_flag(L, lua_cpu.flags.extapic, "extapic");
+ add_flag(L, lua_cpu.flags.cr8_legacy, "cr8_legacy");
+ add_flag(L, lua_cpu.flags.abm, "abm");
+ add_flag(L, lua_cpu.flags.sse4a, "sse4a");
+ add_flag(L, lua_cpu.flags.misalignsse, "misalignsse");
+ add_flag(L, lua_cpu.flags.nowprefetch, "3dnowprefetch");
+ add_flag(L, lua_cpu.flags.osvw, "osvw");
+ add_flag(L, lua_cpu.flags.ibs, "ibs");
+ add_flag(L, lua_cpu.flags.sse5, "sse5");
+ add_flag(L, lua_cpu.flags.skinit, "skinit");
+ add_flag(L, lua_cpu.flags.wdt, "wdt");
+ add_flag(L, lua_cpu.flags.ida, "ida");
+ add_flag(L, lua_cpu.flags.arat, "arat");
+ add_flag(L, lua_cpu.flags.tpr_shadow, "tpr_shadow");
+ add_flag(L, lua_cpu.flags.vnmi, "vnmi");
+ add_flag(L, lua_cpu.flags.flexpriority, "flexpriority");
+ add_flag(L, lua_cpu.flags.ept, "ept");
+ add_flag(L, lua_cpu.flags.vpid, "vpid");
+
+ /* return number of return values on stack */
+ return 1;
+}
+
+static const luaL_Reg cpulib[] = {
+ {"flags", cpu_getflags},
+ {NULL, NULL}
+};
+
+
+LUALIB_API int luaopen_cpu(lua_State *L) {
+ luaL_openlib(L, LUA_CPULIBNAME, cpulib, 0);
+ return 1;
+}
+
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/dmi.c
^
|
@@ -267,6 +267,18 @@
lua_pushstring(L, dmi.processor.id);
lua_settable(L,-3);
+ lua_pushstring(L, "processor.core_count");
+ lua_pushnumber(L, dmi.processor.core_count);
+ lua_settable(L,-3);
+
+ lua_pushstring(L, "processor.core_enabled");
+ lua_pushnumber(L, dmi.processor.core_enabled);
+ lua_settable(L,-3);
+
+ lua_pushstring(L, "processor.thread_count");
+ lua_pushnumber(L, dmi.processor.thread_count);
+ lua_settable(L,-3);
+
/* set global variable: lua_setglobal(L, "dmitable"); */
/* return number of return values on stack */
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lapi.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lapi.c,v 2.55.1.3 2008/01/03 15:20:39 roberto Exp $
+** $Id: lapi.c,v 2.55.1.5 2008/07/04 18:41:18 roberto Exp $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -93,15 +93,14 @@
LUA_API int lua_checkstack (lua_State *L, int size) {
- int res;
+ int res = 1;
lua_lock(L);
- if ((L->top - L->base + size) > LUAI_MAXCSTACK)
+ if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK)
res = 0; /* stack overflow */
- else {
+ else if (size > 0) {
luaD_checkstack(L, size);
if (L->ci->top < L->top + size)
L->ci->top = L->top + size;
- res = 1;
}
lua_unlock(L);
return res;
@@ -930,10 +929,13 @@
g->GCthreshold = g->totalbytes - a;
else
g->GCthreshold = 0;
- while (g->GCthreshold <= g->totalbytes)
+ while (g->GCthreshold <= g->totalbytes) {
luaC_step(L);
- if (g->gcstate == GCSpause) /* end of cycle? */
- res = 1; /* signal it */
+ if (g->gcstate == GCSpause) { /* end of cycle? */
+ res = 1; /* signal it */
+ break;
+ }
+ }
break;
}
case LUA_GCSETPAUSE: {
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lauxlib.c
^
|
@@ -552,9 +552,6 @@
LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) {
LoadF lf;
int status, readstatus;
-#if 0
- int c;
-#endif
int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */
lf.extraline = 0;
if (filename == NULL) {
@@ -566,7 +563,8 @@
lf.f = fopen(filename, "r");
if (lf.f == NULL) return errfile(L, "open", fnameindex);
}
-#if 0
+#ifndef SYSLINUX
+ int c;
c = getc(lf.f);
if (c == '#') { /* Unix exec. file? */
lf.extraline = 1;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lbaselib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lbaselib.c,v 1.191.1.4 2008/01/20 13:53:22 roberto Exp $
+** $Id: lbaselib.c,v 1.191.1.6 2008/02/14 16:46:22 roberto Exp $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -344,10 +344,12 @@
luaL_checktype(L, 1, LUA_TTABLE);
i = luaL_optint(L, 2, 1);
e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1));
+ if (i > e) return 0; /* empty range */
n = e - i + 1; /* number of elements */
- if (n <= 0) return 0; /* empty range */
- luaL_checkstack(L, n, "table too big to unpack");
- for (; i<=e; i++) /* push arg[i...e] */
+ if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */
+ return luaL_error(L, "too many results to unpack");
+ lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */
+ while (i++ < e) /* push arg[i + 1...e] */
lua_rawgeti(L, 1, i);
return n;
}
@@ -526,7 +528,7 @@
status = lua_resume(co, narg);
if (status == 0 || status == LUA_YIELD) {
int nres = lua_gettop(co);
- if (!lua_checkstack(L, nres))
+ if (!lua_checkstack(L, nres + 1))
luaL_error(L, "too many results to resume");
lua_xmove(co, L, nres); /* move yielded values */
return nres;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lcode.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: lcode.c,v 2.25.1.4 2009/06/15 14:12:25 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -544,15 +544,18 @@
pc = NO_JUMP; /* always true; do nothing */
break;
}
- case VFALSE: {
- pc = luaK_jump(fs); /* always jump */
- break;
- }
case VJMP: {
invertjump(fs, e);
pc = e->u.s.info;
break;
}
+ case VFALSE: {
+ if (!hasjumps(e)) {
+ pc = luaK_jump(fs); /* always jump */
+ break;
+ }
+ /* else go through */
+ }
default: {
pc = jumponcond(fs, e, 0);
break;
@@ -572,14 +575,17 @@
pc = NO_JUMP; /* always false; do nothing */
break;
}
- case VTRUE: {
- pc = luaK_jump(fs); /* always jump */
- break;
- }
case VJMP: {
pc = e->u.s.info;
break;
}
+ case VTRUE: {
+ if (!hasjumps(e)) {
+ pc = luaK_jump(fs); /* always jump */
+ break;
+ }
+ /* else go through */
+ }
default: {
pc = jumponcond(fs, e, 1);
break;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/ldblib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
+** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
@@ -45,6 +45,7 @@
static int db_getfenv (lua_State *L) {
+ luaL_checkany(L, 1);
lua_getfenv(L, 1);
return 1;
}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/ldebug.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: ldebug.c,v 2.29.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: ldebug.c,v 2.29.1.6 2008/05/08 16:56:26 roberto Exp $
** Debug Interface
** See Copyright Notice in lua.h
*/
@@ -275,12 +275,12 @@
static int precheck (const Proto *pt) {
check(pt->maxstacksize <= MAXSTACK);
- lua_assert(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
- lua_assert(!(pt->is_vararg & VARARG_NEEDSARG) ||
+ check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
+ check(!(pt->is_vararg & VARARG_NEEDSARG) ||
(pt->is_vararg & VARARG_HASARG));
check(pt->sizeupvalues <= pt->nups);
check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0);
- check(GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);
+ check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);
return 1;
}
@@ -346,9 +346,18 @@
int dest = pc+1+b;
check(0 <= dest && dest < pt->sizecode);
if (dest > 0) {
- /* cannot jump to a setlist count */
- Instruction d = pt->code[dest-1];
- check(!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0));
+ int j;
+ /* check that it does not jump to a setlist count; this
+ is tricky, because the count from a previous setlist may
+ have the same value of an invalid setlist; so, we must
+ go all the way back to the first of them (if any) */
+ for (j = 0; j < dest; j++) {
+ Instruction d = pt->code[dest-1-j];
+ if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break;
+ }
+ /* if 'j' is even, previous value is not a setlist (even if
+ it looks like one) */
+ check((j&1) == 0);
}
}
break;
@@ -363,7 +372,11 @@
}
switch (op) {
case OP_LOADBOOL: {
- check(c == 0 || pc+2 < pt->sizecode); /* check its jump */
+ if (c == 1) { /* does it jump? */
+ check(pc+2 < pt->sizecode); /* check its jump */
+ check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST ||
+ GETARG_C(pt->code[pc+1]) != 0);
+ }
break;
}
case OP_LOADNIL: {
@@ -428,7 +441,10 @@
}
case OP_SETLIST: {
if (b > 0) checkreg(pt, a + b);
- if (c == 0) pc++;
+ if (c == 0) {
+ pc++;
+ check(pc < pt->sizecode - 1);
+ }
break;
}
case OP_CLOSURE: {
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/linit.c
^
|
@@ -19,16 +19,21 @@
{LUA_LOADLIBNAME, luaopen_package},
{LUA_TABLIBNAME, luaopen_table},
{LUA_IOLIBNAME, luaopen_io},
-// {LUA_OSLIBNAME, luaopen_os},
+#ifndef SYSLINUX
+ {LUA_OSLIBNAME, luaopen_os},
+#endif
{LUA_STRLIBNAME, luaopen_string},
#if !defined LUA_NUMBER_INTEGRAL
{LUA_MATHLIBNAME, luaopen_math},
#endif
- {LUA_PCILIBNAME, luaopen_pci},
{LUA_DBLIBNAME, luaopen_debug},
+#ifdef SYSLINUX
+ {LUA_CPULIBNAME, luaopen_cpu},
{LUA_DMILIBNAME, luaopen_dmi},
+ {LUA_PCILIBNAME, luaopen_pci},
{LUA_SYSLINUXLIBNAME, luaopen_syslinux},
{LUA_VESALIBNAME, luaopen_vesa},
+#endif
{NULL, NULL}
};
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/liolib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
+** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -180,7 +180,7 @@
}
-#if 0
+#ifndef SYSLINUX
static int io_tmpfile (lua_State *L) {
FILE **pf = newfile(L);
*pf = tmpfile();
@@ -271,14 +271,17 @@
** =======================================================
*/
-#if 0
+#ifndef SYSLINUX
static int read_number (lua_State *L, FILE *f) {
lua_Number d;
if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) {
lua_pushnumber(L, d);
return 1;
}
- else return 0; /* read fails */
+ else {
+ lua_pushnil(L); /* "result" to be removed */
+ return 0; /* read fails */
+ }
}
@@ -312,7 +315,7 @@
}
}
-#if 0 /* Not used */
+#ifndef SYSLINUX /* Not used */
static int read_chars (lua_State *L, FILE *f, size_t n) {
size_t rlen; /* how much to read */
size_t nr; /* number of chars actually read */
@@ -329,9 +332,7 @@
luaL_pushresult(&b); /* close buffer */
return (n == 0 || lua_objlen(L, -1) > 0);
}
-#endif
-#if 0
static int g_read (lua_State *L, FILE *f, int first) {
int nargs = lua_gettop(L) - 1;
int success;
@@ -440,7 +441,7 @@
return g_write(L, tofile(L), 2);
}
-#if 0
+#ifndef SYSLINUX
static int f_seek (lua_State *L) {
static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END};
static const char *const modenames[] = {"set", "cur", "end", NULL};
@@ -455,10 +456,8 @@
return 1;
}
}
-#endif
-#if 0
static int f_setvbuf (lua_State *L) {
static const int mode[] = {_IONBF, _IOFBF, _IOLBF};
static const char *const modenames[] = {"no", "full", "line", NULL};
@@ -489,8 +488,10 @@
{"open", io_open},
{"output", io_output},
{"popen", io_popen},
-/* {"read", io_read}, */
-/* {"tmpfile", io_tmpfile}, */
+#ifndef SYSLINUX
+ {"read", io_read},
+ {"tmpfile", io_tmpfile},
+#endif
{"type", io_type},
{"write", io_write},
{NULL, NULL}
@@ -501,9 +502,11 @@
{"close", io_close},
{"flush", f_flush},
{"lines", f_lines},
-/* {"read", f_read}, */
-/* {"seek", f_seek}, */
-/* {"setvbuf", f_setvbuf}, */
+#ifndef SYSLINUX
+ {"read", f_read},
+ {"seek", f_seek},
+ {"setvbuf", f_setvbuf},
+#endif
{"write", f_write},
{"__gc", io_gc},
{"__tostring", io_tostring},
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/llex.c
^
|
@@ -1,12 +1,14 @@
/*
-** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
+** $Id: llex.c,v 2.20.1.2 2009/11/23 14:58:22 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
#include <ctype.h>
-//#include <locale.h>
+#ifndef SYSLINUX
+#include <locale.h>
+#endif
#include <string.h>
#define llex_c
@@ -118,8 +120,10 @@
lua_State *L = ls->L;
TString *ts = luaS_newlstr(L, str, l);
TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
- if (ttisnil(o))
+ if (ttisnil(o)) {
setbvalue(o, 1); /* make sure `str' will not be collected */
+ luaC_checkGC(L);
+ }
return ts;
}
@@ -176,9 +180,11 @@
static void trydecpoint (LexState *ls, SemInfo *seminfo) {
/* format error: try to update decimal point separator */
- //struct lconv *cv = localeconv();
char old = ls->decpoint;
- //ls->decpoint = (cv ? cv->decimal_point[0] : '.');
+#ifndef SYSLINUX
+ struct lconv *cv = localeconv();
+ ls->decpoint = (cv ? cv->decimal_point[0] : '.');
+#endif
buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */
if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
/* format error with correct decimal point: no more options */
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/loadlib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: loadlib.c,v 1.52.1.2 2007/12/28 14:58:43 roberto Exp $
+** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $
** Dynamic library loader for Lua
** See Copyright Notice in lua.h
**
@@ -506,8 +506,10 @@
static void setfenv (lua_State *L) {
lua_Debug ar;
- lua_getstack(L, 1, &ar);
- lua_getinfo(L, "f", &ar);
+ if (lua_getstack(L, 1, &ar) == 0 ||
+ lua_getinfo(L, "f", &ar) == 0 || /* get calling function */
+ lua_iscfunction(L, -1))
+ luaL_error(L, LUA_QL("module") " not called from a Lua function");
lua_pushvalue(L, -2);
lua_setfenv(L, -2);
lua_pop(L, 1);
@@ -589,7 +591,11 @@
static void setpath (lua_State *L, const char *fieldname, const char *envname,
const char *def) {
- const char *path = /*getenv(envname)*/ NULL;
+#ifdef SYSLINUX
+ const char *path = NULL;
+#else
+ const char *path = getenv(envname);
+#endif
(void)envname; /* Shut up gcc */
if (path == NULL) /* no environment variable? */
lua_pushstring(L, def); /* use default */
@@ -638,7 +644,7 @@
lua_pushvalue(L, -1);
lua_replace(L, LUA_ENVIRONINDEX);
/* create `loaders' table */
- lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1);
+ lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);
/* fill it with pre-defined loaders */
for (i=0; loaders[i] != NULL; i++) {
lua_pushcfunction(L, loaders[i]);
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lobject.h
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.h,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
+** $Id: lobject.h,v 2.20.1.2 2008/08/06 13:29:48 roberto Exp $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@@ -208,7 +208,7 @@
#define getstr(ts) cast(const char *, (ts) + 1)
-#define svalue(o) getstr(tsvalue(o))
+#define svalue(o) getstr(rawtsvalue(o))
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/loslib.c
^
|
@@ -66,7 +66,11 @@
static int os_getenv (lua_State *L) {
- lua_pushstring(L, /*getenv(luaL_checkstring(L, 1))*/); /* if NULL push nil */
+#ifdef SYSLINUX
+ lua_pushstring(L, NULL); /* if NULL push nil */
+#else
+ lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */
+#endif
return 1;
}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lstrlib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.132.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -35,7 +35,8 @@
static ptrdiff_t posrelat (ptrdiff_t pos, size_t len) {
/* relative string position: negative means back from end */
- return (pos>=0) ? pos : (ptrdiff_t)len+pos+1;
+ if (pos < 0) pos += (ptrdiff_t)len + 1;
+ return (pos >= 0) ? pos : 0;
}
@@ -753,6 +754,7 @@
static int str_format (lua_State *L) {
+ int top = lua_gettop(L);
int arg = 1;
size_t sfl;
const char *strfrmt = luaL_checklstring(L, arg, &sfl);
@@ -767,7 +769,8 @@
else { /* format item */
char form[MAX_FORMAT]; /* to store the format (`%...') */
char buff[MAX_ITEM]; /* to store the formatted item */
- arg++;
+ if (++arg > top)
+ luaL_argerror(L, arg, "no value");
strfrmt = scanformat(L, strfrmt, form);
switch (*strfrmt++) {
case 'c': {
@@ -784,13 +787,11 @@
sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg));
break;
}
-#if !defined LUA_NUMBER_INTEGRAL
case 'e': case 'E': case 'f':
case 'g': case 'G': {
sprintf(buff, form, (double)luaL_checknumber(L, arg));
break;
}
-#endif
case 'q': {
addquoted(L, &b, arg);
continue; /* skip the 'addsize' at the end */
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/ltablib.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: ltablib.c,v 1.38.1.2 2007/12/28 15:32:23 roberto Exp $
+** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $
** Library for Table Manipulation
** See Copyright Notice in lua.h
*/
@@ -132,6 +132,15 @@
}
+static void addfield (lua_State *L, luaL_Buffer *b, int i) {
+ lua_rawgeti(L, 1, i);
+ if (!lua_isstring(L, -1))
+ luaL_error(L, "invalid value (%s) at index %d in table for "
+ LUA_QL("concat"), luaL_typename(L, -1), i);
+ luaL_addvalue(b);
+}
+
+
static int tconcat (lua_State *L) {
luaL_Buffer b;
size_t lsep;
@@ -141,13 +150,12 @@
i = luaL_optint(L, 3, 1);
last = luaL_opt(L, luaL_checkint, 4, luaL_getn(L, 1));
luaL_buffinit(L, &b);
- for (; i <= last; i++) {
- lua_rawgeti(L, 1, i);
- luaL_argcheck(L, lua_isstring(L, -1), 1, "table contains non-strings");
- luaL_addvalue(&b);
- if (i != last)
- luaL_addlstring(&b, sep, lsep);
+ for (; i < last; i++) {
+ addfield(L, &b, i);
+ luaL_addlstring(&b, sep, lsep);
}
+ if (i == last) /* add last value (if interval was not empty) */
+ addfield(L, &b, i);
luaL_pushresult(&b);
return 1;
}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lua.c
^
|
@@ -4,13 +4,19 @@
** See Copyright Notice in lua.h
*/
-
-//#include <signal.h>
+#ifndef SYSLINUX
+#include <signal.h>
+#else
+#define signal(x,y)
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef SYSLINUX
#include <console.h>
+#endif
+
#define lua_c
#include "lua.h"
@@ -25,8 +31,7 @@
static const char *progname = LUA_PROGNAME;
-#if 0
-
+#ifndef SYSLINUX
static void lstop (lua_State *L, lua_Debug *ar) {
(void)ar; /* unused arg. */
lua_sethook(L, NULL, 0, 0);
@@ -99,16 +104,15 @@
int base = lua_gettop(L) - narg; /* function index */
lua_pushcfunction(L, traceback); /* push traceback function */
lua_insert(L, base); /* put it under chunk and args */
- /* signal(SIGINT, laction);*/
+ signal(SIGINT, laction);
status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base);
-/* signal(SIGINT, SIG_DFL);*/
+ signal(SIGINT, SIG_DFL);
lua_remove(L, base); /* remove traceback function */
/* force a complete garbage collection in case of errors */
if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0);
return status;
}
-
static void print_version (void) {
l_message(NULL, LUA_RELEASE " " LUA_COPYRIGHT);
}
@@ -322,7 +326,11 @@
static int handle_luainit (lua_State *L) {
- const char *init = /*getenv(LUA_INIT)*/ NULL;
+#ifndef SYSLINUX
+ const char *init = getenv(LUA_INIT);
+#else
+ const char *init = NULL;
+#endif
if (init == NULL) return 0; /* status OK */
else if (init[0] == '@')
return dofile(L, init+1);
@@ -378,9 +386,9 @@
int main (int argc, char **argv) {
int status;
struct Smain s;
-
+#ifdef SYSLINUX
openconsole(&dev_stdcon_r, &dev_stdcon_w);
-
+#endif
lua_State *L = lua_open(); /* create state */
if (L == NULL) {
l_message(argv[0], "cannot create state: not enough memory");
|
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lua.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lua.h
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lua.h,v 1.218.1.4 2008/01/03 15:41:15 roberto Exp $
+** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $
** Lua - An Extensible Extension Language
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
** See Copyright Notice at the end of this file
@@ -15,12 +15,13 @@
#include "luaconf.h"
+#ifdef SYSLINUX
#define feof(x) 0
#define ferror(x) 0
-
+#endif
#define LUA_VERSION "Lua 5.1"
-#define LUA_RELEASE "Lua 5.1.3"
+#define LUA_RELEASE "Lua 5.1.4"
#define LUA_VERSION_NUM 501
#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lualib.h
^
|
@@ -33,15 +33,16 @@
#define LUA_MATHLIBNAME "math"
LUALIB_API int (luaopen_math) (lua_State *L);
-#define LUA_PCILIBNAME "pci"
-LUALIB_API int (luaopen_pci) (lua_State *L);
-
#define LUA_DBLIBNAME "debug"
LUALIB_API int (luaopen_debug) (lua_State *L);
#define LUA_LOADLIBNAME "package"
LUALIB_API int (luaopen_package) (lua_State *L);
+#ifdef SYSLINUX
+#define LUA_PCILIBNAME "pci"
+LUALIB_API int (luaopen_pci) (lua_State *L);
+
#define LUA_SYSLINUXLIBNAME "syslinux"
LUALIB_API int (luaopen_syslinux) (lua_State *L);
@@ -51,6 +52,9 @@
#define LUA_VESALIBNAME "vesa"
LUALIB_API int (luaopen_vesa) (lua_State *L);
+#define LUA_CPULIBNAME "cpu"
+LUALIB_API int (luaopen_cpu) (lua_State *L);
+#endif
/* open all previous libraries */
LUALIB_API void (luaL_openlibs) (lua_State *L);
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lundump.c
^
|
@@ -1,5 +1,5 @@
/*
-** $Id: lundump.c,v 2.7.1.2 2008/01/18 16:39:11 roberto Exp $
+** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $
** load precompiled Lua chunks
** See Copyright Notice in lua.h
*/
@@ -48,7 +48,6 @@
static void LoadBlock(LoadState* S, void* b, size_t size)
{
size_t r=luaZ_read(S->Z,b,size);
- UNUSED(r);
IF (r!=0, "unexpected end");
}
@@ -115,7 +114,7 @@
setnilvalue(o);
break;
case LUA_TBOOLEAN:
- setbvalue(o,LoadChar(S));
+ setbvalue(o,LoadChar(S)!=0);
break;
case LUA_TNUMBER:
setnvalue(o,LoadNumber(S));
@@ -161,7 +160,9 @@
static Proto* LoadFunction(LoadState* S, TString* p)
{
- Proto* f=luaF_newproto(S->L);
+ Proto* f;
+ if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
+ f=luaF_newproto(S->L);
setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
f->source=LoadString(S); if (f->source==NULL) f->source=p;
f->linedefined=LoadInt(S);
@@ -175,6 +176,7 @@
LoadDebug(S,f);
IF (!luaG_checkcode(f), "bad code");
S->L->top--;
+ S->L->nCcalls--;
return f;
}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/lvm.c
^
|
@@ -1,10 +1,12 @@
/*
-** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: lvm.c,v 2.63.1.4 2009/07/01 21:10:33 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
-
+#ifdef SYSLINUX
+#define strcoll strcmp
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -152,6 +154,7 @@
void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
int loop;
+ TValue temp;
for (loop = 0; loop < MAXTAGLOOP; loop++) {
const TValue *tm;
if (ttistable(t)) { /* `t' is a table? */
@@ -171,7 +174,9 @@
callTM(L, tm, t, key, val);
return;
}
- t = tm; /* else repeat with `tm' */
+ /* else repeat with `tm' */
+ setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
+ t = &temp;
}
luaG_runerror(L, "loop in settable");
}
@@ -221,8 +226,7 @@
const char *r = getstr(rs);
size_t lr = rs->tsv.len;
for (;;) {
-// int temp = strcoll(l, r);
- int temp = strcmp(l, r);
+ int temp = strcoll(l, r);
if (temp != 0) return temp;
else { /* strings are equal up to a `\0' */
size_t len = strlen(l); /* index of first `\0' in both strings */
@@ -341,8 +345,8 @@
case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break;
case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break;
case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break;
- case TM_DIV: setnvalue(ra, luai_lnumdiv(nb, nc)); break;
- case TM_MOD: setnvalue(ra, luai_lnummod(nb, nc)); break;
+ case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break;
+ case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break;
case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break;
case TM_UNM: setnvalue(ra, luai_numunm(nb)); break;
default: lua_assert(0); break;
@@ -500,11 +504,11 @@
continue;
}
case OP_DIV: {
- arith_op(luai_lnumdiv, TM_DIV);
+ arith_op(luai_numdiv, TM_DIV);
continue;
}
case OP_MOD: {
- arith_op(luai_lnummod, TM_MOD);
+ arith_op(luai_nummod, TM_MOD);
continue;
}
case OP_POW: {
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/pci.c
^
|
@@ -1,6 +1,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#define lpcilib_c /* Define the library */
@@ -9,6 +10,15 @@
#include "lualib.h"
#include <sys/pci.h>
+/* removing any \n found in a string */
+static void remove_eol(char *string)
+{
+ int j = strlen(string);
+ int i = 0;
+ for (i = 0; i < j; i++)
+ if (string[i] == '\n')
+ string[i] = 0;
+}
static int pci_getinfo(lua_State *L)
{
@@ -59,24 +69,6 @@
return 1;
}
-/* searching the next char that is not a space */
-static char *skipspace(char *p)
-{
- while (*p && *p <= ' ')
- p++;
-
- return p;
-}
-
-/* removing any \n found in a string */
-static void remove_eol(char *string)
-{
- int j = strlen(string);
- int i = 0;
- for(i = 0; i < j; i++) if(string[i] == '\n') string[i] = 0;
-}
-
-
/* Try to match any pci device to the appropriate kernel module */
/* it uses the modules.pcimap from the boot device*/
static int pci_getidlist(lua_State *L)
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/syslinux.c
^
|
@@ -153,6 +153,8 @@
/* do default boot */
static int sl_run_default(lua_State * L)
{
+ /* Preventing GCC to complain against unused L */
+ L=L;
syslinux_run_default();
return 0;
}
@@ -188,6 +190,9 @@
int ret;
char **argv, **argp, *arg, *p;
+ (void)mem_limit;
+ (void)video_mode;
+
ret = __parse_argv(&argv, cmdline);
newcmdline = malloc(strlen(kernel) + 12);
@@ -321,7 +326,7 @@
}
file = malloc(sizeof(syslinux_file));
- file->name = filename;
+ strlcpy(file->name,filename,sizeof(syslinux_file));
file->size = file_len;
file->data = file_data;
@@ -367,7 +372,7 @@
static int sl_initramfs_load_archive(lua_State * L)
{
- const struct initramfs *initramfs = luaL_checkudata(L, 1, SYSLINUX_FILE);
+ struct initramfs *initramfs = luaL_checkudata(L, 1, SYSLINUX_FILE);
const char *filename = luaL_checkstring(L, 2);
if (initramfs_load_archive(initramfs, filename)) {
@@ -379,29 +384,28 @@
static int sl_initramfs_add_file(lua_State * L)
{
- const struct initramfs *initramfs = luaL_checkudata(L, 1, SYSLINUX_FILE);
- const char *filename = luaL_checkstring(L, 2);
- void *file_data;
+ struct initramfs *initramfs = luaL_checkudata(L, 1, SYSLINUX_FILE);
+ /* FIXME: This code is doing nothing */
+ //const char *filename = luaL_checkstring(L, 2);
+ void *file_data = NULL;
size_t file_len = 0;
- if (initramfs_add_file(initramfs, file_data, file_len, file_len,
- "/testfile1", 0, 0755))
-
- return 0;
+ return initramfs_add_file(initramfs, file_data, file_len, file_len, "/testfile1", 0, 0755);
}
static int sl_boot_it(lua_State * L)
{
const syslinux_file *kernel = luaL_checkudata(L, 1, SYSLINUX_FILE);
- const struct initramfs *initramfs = luaL_checkudata(L, 2, SYSLINUX_FILE);
+ struct initramfs *initramfs = luaL_checkudata(L, 2, SYSLINUX_FILE);
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 */
+ (void)video_mode;
+ (void)mem_limit;
- ret = syslinux_boot_linux(kernel->data, kernel->size, initramfs, cmdline);
-
- return 0;
+ return syslinux_boot_linux(kernel->data, kernel->size,
+ initramfs, (char *)cmdline);
}
static int sl_derivative(lua_State * L)
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/lua/src/vesa.c
^
|
@@ -10,35 +10,12 @@
int vesacon_load_background(const char *filename);
-static int __constfunc is_power_of_2(unsigned int x)
-{
- return x && !(x & (x-1));
-}
-
-static int vesacon_paged_mode_ok(const struct vesa_mode_info *mi)
-{
- int i;
-
- if (!is_power_of_2(mi->win_size) ||
- !is_power_of_2(mi->win_grain) ||
- mi->win_grain > mi->win_size)
- return 0; /* Impossible... */
-
- for (i = 0; i < 2; i++) {
- if ((mi->win_attr[i] & 0x05) == 0x05 && mi->win_seg[i])
- return 1; /* Usable window */
- }
-
- return 0; /* Nope... */
-}
-
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 */
@@ -69,8 +46,6 @@
/* 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 */
@@ -117,6 +92,8 @@
static int vesa_setmode(lua_State *L)
{
+ /* Preventing GCC to complain about unused L*/
+ L=L;
openconsole(&dev_rawcon_r, &dev_vesaserial_w);
return 0;
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/com32/lua/test/cpu.lua
^
|
@@ -0,0 +1,19 @@
+ cpuflags = cpu.flags()
+
+ print("Vendor = " .. cpuflags["vendor"])
+ print("Model = " .. cpuflags["model"])
+ print("Cores = " .. cpuflags["cores"])
+ print("L1 Instruction Cache = " .. cpuflags["l1_instruction_cache"])
+ print("L1 Data Cache = " .. cpuflags["l1_data_cache"])
+ print("L2 Cache = " .. cpuflags["l2_cache"])
+ print("Family ID = " .. cpuflags["family_id"])
+ print("Model ID = " .. cpuflags["model_id"])
+ print("Stepping = " .. cpuflags["stepping"])
+
+ if ( string.match(cpuflags["vendor"], "Intel") ) then
+ print("Intel Processor Found")
+-- syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw")
+ else
+ print("Does not match")
+ end
+
|
|
Changed |
syslinux-4.04.tar.bz2/com32/mboot/mboot.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/menu/menumain.c
^
|
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
- * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2011 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
@@ -726,8 +726,11 @@
this_timeout = min(timeout_left, CLK_TCK);
key = mygetkey(this_timeout);
- if (key != KEY_NONE)
- return NULL; /* Key pressed */
+ if (key != KEY_NONE) {
+ /* Clear the message from the screen */
+ print_timeout_message(0, HIDDEN_ROW, "");
+ return hide_key[key]; /* NULL if no MENU HIDEKEY in effect */
+ }
timeout_left -= this_timeout;
}
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/cat.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/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 @@
#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 @@
|| !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 @@
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);
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/chain.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/cmd.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/config.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/cpuid.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/cpuidtest.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/disk.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/dmitest.c
^
|
@@ -165,6 +165,12 @@
moreprintf("\tCache L3 Handle %s\n", dmi->processor.cache3);
moreprintf("\tSerial %s\n", dmi->processor.serial);
moreprintf("\tPart Number %s\n", dmi->processor.part_number);
+ if (dmi->processor.core_count != 0)
+ moreprintf("\tCores Count %d\n", dmi->processor.core_count);
+ if (dmi->processor.core_enabled != 0)
+ moreprintf("\tCores Enabled %d\n", dmi->processor.core_enabled);
+ if (dmi->processor.thread_count != 0)
+ moreprintf("\tThreads Count %d\n", dmi->processor.thread_count);
moreprintf("\tID %s\n", dmi->processor.id);
display_processor_flags(dmi);
}
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/dmitest.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/elf.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/ethersel.c
^
|
@@ -30,6 +30,7 @@
#include <inttypes.h>
#include <stdio.h>
+#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <console.h>
@@ -44,14 +45,6 @@
# define dprintf(...) ((void)0)
#endif
-static char *skipspace(char *p)
-{
- while (*p && *p <= ' ')
- p++;
-
- return p;
-}
-
#define MAX_LINE 512
/* Check to see if we are at a certain keyword (case insensitive) */
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/ethersel.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/gpxecmd.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/host.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/ifcpu.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/ifcpu64.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/ifplop.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/kbdmap.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/linux.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/ls.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/meminfo.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/pcitest.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/pmload.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/pwd.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/reboot.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/sanboot.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/sdi.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/vesainfo.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/vpdtest.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/modules/whichsys.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/rosh/rosh.c
^
|
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 2008-2010 Gene Cumm - All Rights Reserved
+ * Copyright 2008-2011 Gene Cumm - 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
@@ -20,7 +20,12 @@
/*
* ToDos:
- * rosh_ls(): sorted; then multiple columns
+ * prompt: Allow left/right arrow, home/end and more?
+ * commands Break into argv/argc-like array
+ * rosh_cfg: allow -s <file> to change config
+ * rosh_ls(): sorted; then multiple columns
+ * prompt: Possibly honor timeout on initial entry for usage as UI
+ * Also possibly honor totaltimeout
*/
/*#define DO_DEBUG 1
@@ -38,8 +43,10 @@
#define APP_NAME "rosh"
#define APP_AUTHOR "Gene Cumm"
#define APP_YEAR "2010"
-#define APP_VER "beta-b068"
+#define APP_VER "beta-b090"
+/* Print version information to stdout
+ */
void rosh_version(int vtype)
{
char env[256];
@@ -52,6 +59,8 @@
}
}
+/* Print beta message and if DO_DEBUG/DO_DEBUG2 are active
+ */
void print_beta(void)
{
puts(rosh_beta_str);
@@ -119,32 +128,156 @@
return epos;
}
+/*
+ * parse_args1: Try 1 at parsing a string to an argc/argv pair. use free_args1 to free memory malloc'd
+ *
+ * Derived from com32/lib/sys/argv.c:__parse_argv()
+ * Copyright 2004-2009 H. Peter Anvin - All Rights Reserved
+ * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ */
+int parse_args1(char ***iargv, const char *istr)
+{
+ int argc = 0;
+ const char *p;
+ char *q, *r, *args, **arg;
+ int sp = 1; //, qt = 0; /* Was a space; inside a quote */
+
+ /* Scan 1: Length */
+ /* I could eliminate this if I knew a max length, like strncpy() */
+ int len = strlen(istr);
+
+ /* Scan 2: Copy, nullify and make argc */
+ if (!(args = malloc(len + 1)))
+ goto fail_args;
+ q = args;
+ for (p = istr;; p++) {
+ if (*p <= ' ') {
+ if (!sp) {
+ sp = 1;
+ *q++ = '\0';
+ }
+ } else {
+ if (sp) {
+ argc++;
+ sp = 0;
+ }
+ *q++ = *p;
+ }
+ if (!*p)
+ break;
+ }
+
+ q--; /* Point q to final null */
+ /* Scan 3: Build array of pointers */
+ if (!(*iargv = malloc((argc + 1) * sizeof(char *))))
+ goto fail_args_ptr;
+ arg = *iargv;
+ arg[argc] = NULL; /* Nullify the last pointer */
+ if (*args != '\0')
+ *arg++ = args;
+ for (r = args; r < q ; r++) {
+ if (*r == '\0') {
+ *arg++ = r + 1;
+ }
+ }
+
+fail_args:
+ return argc;
+fail_args_ptr:
+ free(args);
+ return 0;
+}
+
+/* Free argv created by parse_args1()
+ * argv Argument Values
+ */
+void free_args1(char ***argv)
+{
+ char *s;
+ s = **argv;
+ free(*argv);
+ free(s);
+}
+
+/* Convert a string to an argc/argv pair
+ * str String to parse
+ * argv Argument Values
+ * returns Argument Count
+ */
+int rosh_str2argv(char ***argv, const char *str)
+{
+ return parse_args1(argv, str);
+}
+
+/* Free an argv created by rosh_str2argv()
+ * argv Argument Values to free
+ */
+void rosh_free_argv(char ***argv)
+{
+ free_args1(argv);
+}
+
+/* Print the contents of an argc/argv pair
+ * argc Argument Count
+ * argv Argument Values
+ */
+void rosh_pr_argv(int argc, char *argv[])
+{
+ int i;
+ for (i = 0; i < argc; i++) {
+ printf("%s%s", argv[i], (i < argc)? " " : "");
+ }
+ puts("");
+}
+
+/* Print the contents of an argc/argv pair verbosely
+ * argc Argument Count
+ * argv Argument Values
+ */
+void rosh_pr_argv_v(int argc, char *argv[])
+{
+ int i;
+ for (i = 0; i < argc; i++) {
+ printf("%4d '%s'\n", i, argv[i]);
+ }
+}
+
+/* Reset the getopt() environment
+ */
+void rosh_getopt_reset(void)
+{
+ optind = 0;
+ optopt = 0;
+}
+
/* Display help
* type Help type
- * cmdstr Command string
+ * cmdstr Command for which help is requested
*/
void rosh_help(int type, const char *cmdstr)
{
- const char *istr;
- istr = cmdstr;
switch (type) {
case 2:
- istr += rosh_search_nonsp(cmdstr, rosh_search_sp(cmdstr, 0));
- if ((cmdstr == NULL) || (strcmp(istr, "") == 0)) {
+ if ((cmdstr == NULL) || (strcmp(cmdstr, "") == 0)) {
rosh_version(0);
puts(rosh_help_str2);
} else {
- switch (istr[0]) {
+ switch (cmdstr[0]) {
+ case 'c':
+ puts(rosh_help_cd_str);
+ break;
case 'l':
puts(rosh_help_ls_str);
break;
default:
- printf(rosh_help_str_adv, istr);
+ printf(rosh_help_str_adv, cmdstr);
}
}
break;
case 1:
default:
+ if (cmdstr)
+ printf("%s: %s: unknown command\n", APP_NAME, cmdstr);
rosh_version(0);
puts(rosh_help_str1);
}
@@ -194,11 +327,13 @@
/* Concatenate command line arguments into one string
* cmdstr Output command string
+ * cmdlen Length of cmdstr
* argc Argument Count
* argv Argument Values
* barg Beginning Argument
*/
-int rosh_argcat(char *cmdstr, const int argc, char *argv[], const int barg)
+int rosh_argcat(char *cmdstr, const int cmdlen, const int argc, char *argv[],
+ const int barg)
{
int i, arglen, curpos; /* index, argument length, current position
in cmdstr */
@@ -207,15 +342,15 @@
for (i = barg; i < argc; i++) {
arglen = strlen(argv[i]);
/* Theoretically, this should never be met in SYSLINUX */
- if ((curpos + arglen) > (ROSH_CMD_SZ - 1))
- arglen = (ROSH_CMD_SZ - 1) - curpos;
+ if ((curpos + arglen) > (cmdlen - 1))
+ arglen = (cmdlen - 1) - curpos;
memcpy(cmdstr + curpos, argv[i], arglen);
curpos += arglen;
- if (curpos >= (ROSH_CMD_SZ - 1)) {
+ if (curpos >= (cmdlen - 1)) {
/* Hopefully, curpos should not be greater than
- (ROSH_CMD_SZ - 1) */
+ (cmdlen - 1) */
/* Still need a '\0' at the last character */
- cmdstr[(ROSH_CMD_SZ - 1)] = 0;
+ cmdstr[(cmdlen - 1)] = 0;
break; /* Escape out of the for() loop;
We can no longer process anything more */
} else {
@@ -285,26 +420,19 @@
}
/* Concatenate multiple files to stdout
- * cmdstr command string to process
+ * argc Argument Count
+ * argv Argument Values
*/
-void rosh_cat(const char *cmdstr)
+void rosh_cat(int argc, char *argv[])
{
FILE *f;
- char filestr[ROSH_PATH_SZ];
char buf[ROSH_BUF_SZ];
- int numrd;
- int cmdpos;
+ int i, numrd;
- ROSH_DEBUG("CMD: '%s'\n", cmdstr);
- /* Initialization */
- filestr[0] = 0;
- cmdpos = 0;
- /* skip the first word */
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- while (strlen(filestr) > 0) {
- printf("--File = '%s'\n", filestr);
- f = fopen(filestr, "r");
+ for (i = 0; i < argc; i++) {
+ printf("--File = '%s'\n", argv[i]);
+ errno = 0;
+ f = fopen(argv[i], "r");
if (f != NULL) {
numrd = fread(buf, 1, ROSH_BUF_SZ, f);
while (numrd > 0) {
@@ -313,36 +441,37 @@
}
fclose(f);
} else {
- rosh_error(errno, "cat", filestr);
+ rosh_error(errno, "cat", argv[i]);
errno = 0;
}
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
}
} /* rosh_cat */
/* Change PWD (Present Working Directory)
- * cmdstr command string to process
+ * argc Argument count
+ * argv Argument values
* ipwdstr Initial PWD
*/
-void rosh_cd(const char *cmdstr, const char *ipwdstr)
+void rosh_cd(int argc, char *argv[], const char *ipwdstr)
{
- int rv;
+ int rv = 0;
+#ifdef DO_DEBUG
char filestr[ROSH_PATH_SZ];
- int cmdpos;
- ROSH_DEBUG("CMD: '%s'\n", cmdstr);
- /* Initialization */
- filestr[0] = 0;
- cmdpos = 0;
- rv = 0;
- /* skip the first word */
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- if (strlen(filestr) != 0)
- rv = chdir(filestr);
- else
+#endif /* DO_DEBUG */
+ ROSH_DEBUG("CMD: \n");
+ ROSH_DEBUG_ARGV_V(argc, argv);
+ errno = 0;
+ if (argc == 2)
+ rv = chdir(argv[1]);
+ else if (argc == 1)
rv = chdir(ipwdstr);
+ else
+ rosh_help(2, argv[0]);
if (rv != 0) {
- rosh_error(errno, "cd", filestr);
+ if (argc == 2)
+ rosh_error(errno, "cd", argv[1]);
+ else
+ rosh_error(errno, "cd", ipwdstr);
errno = 0;
} else {
#ifdef DO_DEBUG
@@ -359,31 +488,61 @@
printf("CFG: '%s'\n", syslinux_config_file());
} /* rosh_cfg */
-/* Process optstr to optarr
- * optstr option string to process
- * optarr option array to populate
+/* Echo a string back to the screen
+ * cmdstr command string to process
*/
-void rosh_ls_arg_opt(const char *optstr, int *optarr)
+void rosh_echo(const char *cmdstr)
{
- char *cpos;
- cpos = strchr(optstr, 'l');
- if (cpos) {
- optarr[0] = cpos - optstr;
- } else {
- optarr[0] = -1;
- }
- cpos = strchr(optstr, 'F');
- if (cpos) {
- optarr[1] = cpos - optstr;
+ int bpos = 0;
+ ROSH_DEBUG("CMD: '%s'\n", cmdstr);
+ bpos = rosh_search_nonsp(cmdstr, rosh_search_sp(cmdstr, 0));
+ if (bpos > 1) {
+ ROSH_DEBUG(" bpos=%d\n", bpos);
+ printf("'%s'\n", cmdstr + bpos);
} else {
- optarr[1] = -1;
+ puts("");
}
- cpos = strchr(optstr, 'i');
- if (cpos) {
- optarr[2] = cpos - optstr;
- } else {
- optarr[2] = -1;
+} /* rosh_echo */
+
+/* Process argc/argv to optarr
+ * argc Argument count
+ * argv Argument values
+ * optarr option array to populate
+ */
+void rosh_ls_arg_opt(int argc, char *argv[], int optarr[])
+{
+ int rv = 0;
+
+ optarr[0] = -1;
+ optarr[1] = -1;
+ optarr[2] = -1;
+ rosh_getopt_reset();
+ while (rv != -1) {
+ ROSH_DEBUG2("getopt optind=%d rv=%d\n", optind, rv);
+ rv = getopt(argc, argv, rosh_ls_opt_str);
+ switch (rv) {
+ case 'l':
+ case 0:
+ optarr[0] = 1;
+ break;
+ case 'F':
+ case 1:
+ optarr[1] = 1;
+ break;
+ case 'i':
+ case 2:
+ optarr[2] = 1;
+ break;
+ case '?':
+ case -1:
+ default:
+ ROSH_DEBUG2("getopt optind=%d rv=%d\n", optind, rv);
+ break;
+ }
}
+ ROSH_DEBUG2(" end getopt optind=%d rv=%d\n", optind, rv);
+ ROSH_DEBUG2("\tIn rosh_ls_arg_opt() opt[0]=%d\topt[1]=%d\topt[2]=%d\n", optarr[0], optarr[1],
+ optarr[2]);
} /* rosh_ls_arg_opt */
/* Retrieve the size of a file argument
@@ -396,7 +555,6 @@
char filestr2[ROSH_PATH_SZ];
int fd2, file2pos;
struct stat fdstat;
- int status;
filestr2[0] = 0;
file2pos = -1;
@@ -407,7 +565,7 @@
}
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;
@@ -417,25 +575,33 @@
* filestr directory name of directory entry
* de directory entry
*/
-int rosh_ls_de_size_mode(struct dirent *de, mode_t * st_mode)
+int rosh_ls_de_size_mode(const char *filestr, struct dirent *de, mode_t * st_mode)
{
int de_size;
-// char filestr2[ROSH_PATH_SZ];
-// int file2pos;
+ char filestr2[ROSH_PATH_SZ];
+ int file2pos;
struct stat fdstat;
int status;
-/* filestr2[0] = 0;
- file2pos = -1;*/
- fdstat.st_size = 0;
- fdstat.st_mode = 0;
-/* if (filestr) {
+ filestr2[0] = 0;
+ file2pos = -1;
+ memset(&fdstat, 0, sizeof fdstat);
+ ROSH_DEBUG2("ls:dsm(%s, %s) ", filestr, de->d_name);
+ if (filestr) {
+ /* FIXME: prevent string overflow */
file2pos = strlen(filestr);
memcpy(filestr2, filestr, file2pos);
- filestr2[file2pos] = '/';
+ if (( filestr2[file2pos - 1] == SEP )) {
+ file2pos--;
+ } else {
+ filestr2[file2pos] = SEP;
+ }
}
- strcpy(filestr2 + file2pos + 1, de->d_name);*/
- status = stat(de->d_name, &fdstat);
+ strcpy(filestr2 + file2pos + 1, de->d_name);
+ 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);
@@ -594,16 +760,17 @@
* de directory entry
* optarr Array of options
*/
-void rosh_ls_arg_dir_de(struct dirent *de, const int *optarr)
+void rosh_ls_arg_dir_de(const char *filestr, struct dirent *de, const int *optarr)
{
int de_size;
mode_t st_mode;
char st_mode_str[11];
st_mode = 0;
+ ROSH_DEBUG2("+");
if (optarr[2] > -1)
- printf("%10d ", (int)de->d_ino);
+ printf("%10d ", (int)(de->d_ino));
if (optarr[0] > -1) {
- de_size = rosh_ls_de_size_mode(de, &st_mode);
+ de_size = rosh_ls_de_size_mode(filestr, de, &st_mode);
rosh_st_mode2str(st_mode, st_mode_str);
ROSH_DEBUG2("%04X ", st_mode);
printf("%s %10d ", st_mode_str, de_size);
@@ -628,14 +795,17 @@
int filepos;
filepos = 0;
+ errno = 0;
while ((de = readdir(d))) {
filepos++;
- rosh_ls_arg_dir_de(de, optarr);
+ rosh_ls_arg_dir_de(filestr, de, optarr);
}
- if (errno)
+ if (errno) {
rosh_error(errno, "ls:arg_dir", filestr);
- else if (filepos == 0)
+ errno = 0;
+ } else { if (filepos == 0)
ROSH_DEBUG("0 files found");
+ }
} /* rosh_ls_arg_dir */
/* Simple directory listing for one argument (file/directory) based on
@@ -667,9 +837,13 @@
if (status == 0) {
if (S_ISDIR(fdstat.st_mode)) {
ROSH_DEBUG("PATH '%s' is a directory\n", filestr);
- d = opendir(filestr);
- rosh_ls_arg_dir(filestr, d, optarr);
- closedir(d);
+ if ((d = opendir(filestr))) {
+ rosh_ls_arg_dir(filestr, d, optarr);
+ closedir(d);
+ } else {
+ rosh_error(errno, "ls", filestr);
+ errno = 0;
+ }
} else {
de.d_ino = rosh_ls_d_ino(&fdstat);
de.d_type = (IFTODT(fdstat.st_mode));
@@ -679,7 +853,7 @@
} else {
ROSH_DEBUG("PATH '%s' is some other file\n", filestr);
}
- rosh_ls_arg_dir_de(&de, optarr);
+ rosh_ls_arg_dir_de(NULL, &de, optarr);
/* if (ifilstr[0] == SEP)
rosh_ls_arg_dir_de(NULL, &de, optarr);
else
@@ -712,71 +886,37 @@
return ret;
} /* rosh_ls_parse_opt */
-/* List Directory based on cmdstr and pwdstr
- * cmdstr command string to process
- * pwdstr Present Working Directory string
+/* List Directory
+ * argc Argument count
+ * argv Argument values
*/
-void rosh_ls(const char *cmdstr)
+void rosh_ls(int argc, char *argv[])
{
- char filestr[ROSH_PATH_SZ];
- char optstr[ROSH_OPT_SZ]; /* Options string */
- int cmdpos, tpos; /* Position within cmdstr, temp position */
- int numargs; /* number of non-option arguments */
- int argpos; /* number of non-option arguments processed */
int optarr[3];
+ int i;
- ROSH_DEBUG("CMD: '%s'\n", cmdstr);
- /* Initialization */
- filestr[0] = 0;
- optstr[0] = 0;
- cmdpos = 0;
- numargs = 0;
- argpos = 0;
- /* skip the first word */
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- tpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- /* If there are no real arguments, substitute PWD */
- if (strlen(filestr) == 0) {
- strcpy(filestr, ".");
- cmdpos = tpos;
- } else { /* Parse for command line options */
- while (strlen(filestr) > 0) {
- numargs += rosh_ls_parse_opt(filestr, optstr);
- tpos = rosh_parse_sp_1(filestr, cmdstr, tpos);
- }
- if (numargs == 0) {
- strcpy(filestr, ".");
- cmdpos = tpos;
- } else {
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- }
- }
+ rosh_ls_arg_opt(argc, argv, optarr);
+ ROSH_DEBUG2("In ls()\n");
+ ROSH_DEBUG2_ARGV_V(argc, argv);
#ifdef DO_DEBUG
- if (!strchr(optstr, 'l'))
- strcat(optstr, "l");
+ optarr[0] = 2;
#endif /* DO_DEBUG */
- rosh_ls_arg_opt(optstr, optarr);
- ROSH_DEBUG("\tfopt: '%s'\n", optstr);
- while (strlen(filestr) > 0) {
- if (rosh_ls_parse_opt(filestr, NULL)) {
- rosh_ls_arg(filestr, optarr);
- argpos++;
- }
- if (argpos < numargs)
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- else
- break;
+ ROSH_DEBUG2(" argc=%d; optind=%d\n", argc, optind);
+ if (optind >= argc)
+ rosh_ls_arg(".", optarr);
+ for (i = optind; i < argc; i++) {
+ rosh_ls_arg(argv[i], optarr);
}
} /* rosh_ls */
/* Simple directory listing; calls rosh_ls()
- * cmdstr command string to process
- * pwdstr Present Working Directory string
+ * argc Argument count
+ * argv Argument values
*/
-void rosh_dir(const char *cmdstr)
+void rosh_dir(int argc, char *argv[])
{
ROSH_DEBUG(" dir implemented as ls\n");
- rosh_ls(cmdstr);
+ rosh_ls(argc, argv);
} /* rosh_dir */
/* Page through a buffer string
@@ -847,13 +987,12 @@
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) {
@@ -874,22 +1013,19 @@
} /* rosh_more_fd */
/* Page through a file like the more command
- * cmdstr command string to process
- * ipwdstr Initial PWD
+ * argc Argument Count
+ * argv Argument Values
*/
-void rosh_more(const char *cmdstr)
+void rosh_more(int argc, char *argv[])
{
- int fd;
- char filestr[ROSH_PATH_SZ];
- int cmdpos;
+ int fd, i;
+/* char filestr[ROSH_PATH_SZ];
+ int cmdpos;*/
int rows, cols;
char *scrbuf;
int ret;
- ROSH_DEBUG("CMD: '%s'\n", cmdstr);
- /* Initialization */
- filestr[0] = 0;
- cmdpos = 0;
+ ROSH_DEBUG_ARGV_V(argc, argv);
ret = getscreensize(1, &rows, &cols);
if (ret) {
ROSH_DEBUG("getscreensize() fail(%d); fall back\n", ret);
@@ -906,24 +1042,21 @@
if (!scrbuf)
return;
- /* skip the first word */
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
- if (strlen(filestr) > 0) {
+ if (argc) {
/* There is no need to mess up the console if we don't have a
file */
rosh_console_raw();
- while (strlen(filestr) > 0) {
- printf("--File = '%s'\n", filestr);
- fd = open(filestr, O_RDONLY);
+ for (i = 0; i < argc; i++) {
+ printf("--File = '%s'\n", argv[i]);
+ errno = 0;
+ fd = open(argv[i], O_RDONLY);
if (fd != -1) {
rosh_more_fd(fd, rows, cols, scrbuf);
close(fd);
} else {
- rosh_error(errno, "more", filestr);
+ rosh_error(errno, "more", argv[i]);
errno = 0;
}
- cmdpos = rosh_parse_sp_1(filestr, cmdstr, cmdpos);
}
rosh_console_std();
}
@@ -931,26 +1064,20 @@
} /* rosh_more */
/* Page a file with rewind
- * cmdstr command string to process
- * pwdstr Present Working Directory string
- * ipwdstr Initial PWD
+ * argc Argument Count
+ * argv Argument Values
*/
-void rosh_less(const char *cmdstr)
+void rosh_less(int argc, char *argv[])
{
printf(" less implemented as more (for now)\n");
- rosh_more(cmdstr);
+ rosh_more(argc, argv);
} /* rosh_less */
/* Show PWD
- * cmdstr command string to process
*/
-void rosh_pwd(const char *cmdstr)
+void rosh_pwd(void)
{
- int istr;
char pwdstr[ROSH_PATH_SZ];
- if (cmdstr)
- istr = 0;
- ROSH_DEBUG("CMD: '%s'\n", cmdstr);
errno = 0;
if (getcwd(pwdstr, ROSH_PATH_SZ)) {
printf("%s\n", pwdstr);
@@ -958,190 +1085,223 @@
rosh_error(errno, "pwd", "");
errno = 0;
}
- istr = htonl(*(int *)pwdstr);
- ROSH_DEBUG2(" --%08X\n", istr);
} /* rosh_pwd */
-/* Reboot
- */
-void rosh_reboot(void)
-{
-// char cmdstr[ROSH_CMD_SZ];
-// printf
- syslinux_reboot(0);
+/* Reboot; use warm reboot if one of certain options set
+ * argc Argument count
+ * argv Argument values
+ */
+void rosh_reboot(int argc, char *argv[])
+{
+ int rtype = 0;
+ if (argc) {
+ /* For now, just use the first */
+ switch (argv[0][0]) {
+ case '1':
+ case 's':
+ case 'w':
+ rtype = 1;
+ break;
+ case '-':
+ switch (argv[0][1]) {
+ case '1':
+ case 's':
+ case 'w':
+ rtype = 1;
+ break;
+ }
+ break;
+ }
+ }
+ syslinux_reboot(rtype);
} /* rosh_reboot */
/* Run a boot string, calling syslinux_run_command
- * cmdstr command string to process
+ * argc Argument count
+ * argv Argument values
*/
-void rosh_run(const char *cmdstr)
+void rosh_run(int argc, char *argv[])
{
- int cmdpos;
- char *cmdptr;
+ char cmdstr[ROSH_CMD_SZ];
+ int len;
- cmdpos = 0;
- ROSH_DEBUG("CMD: '%s'\n", cmdstr);
- /* skip the first word */
- cmdpos = rosh_search_sp(cmdstr, cmdpos);
- /* skip spaces */
- cmdpos = rosh_search_nonsp(cmdstr, cmdpos);
- cmdptr = (char *)(cmdstr + cmdpos);
- printf("--run: '%s'\n", cmdptr);
- syslinux_run_command(cmdptr);
+ len = rosh_argcat(cmdstr, ROSH_CMD_SZ, argc, argv, 0);
+ if (len) {
+ printf("--run: '%s'\n", cmdstr);
+ syslinux_run_command(cmdstr);
+ } else {
+ printf(APP_NAME ":run: No arguments\n");
+ }
} /* rosh_run */
-/* Process a single command string and call handling function
- * cmdstr command string to process
+/* Process an argc/argv pair and call handling function
+ * argc Argument count
+ * argv Argument values
* ipwdstr Initial Present Working Directory string
* returns Whether to exit prompt
*/
-char rosh_command(const char *cmdstr, const char *ipwdstr)
+char rosh_command(int argc, char *argv[], const char *ipwdstr)
{
- char do_exit;
- char tstr[ROSH_CMD_SZ];
+ char do_exit = false;
int tlen;
- do_exit = false;
- ROSH_DEBUG("--cmd:'%s'\n", cmdstr);
- tlen = rosh_parse_sp_1(tstr, cmdstr, 0);
- switch (cmdstr[0]) {
+ tlen = strlen(argv[0]);
+ ROSH_DEBUG_ARGV_V(argc, argv);
+ switch (argv[0][0]) {
case 'e':
case 'E':
case 'q':
case 'Q':
- if ((strncasecmp("exit", tstr, tlen) == 0) ||
- (strncasecmp("quit", tstr, tlen) == 0))
- do_exit = true;
- else
- rosh_help(1, NULL);
+ switch (argv[0][1]) {
+ case 0:
+ case 'x':
+ case 'X':
+ case 'u':
+ case 'U':
+ if ((strncasecmp("exit", argv[0], tlen) == 0) ||
+ (strncasecmp("quit", argv[0], tlen) == 0))
+ do_exit = true;
+ else
+ rosh_help(1, argv[0]);
+ break;
+ case 'c':
+ case 'C':
+ if (strncasecmp("echo", argv[0], tlen) == 0)
+ rosh_pr_argv(argc - 1, &argv[1]);
+ else
+ rosh_help(1, argv[0]);
+ break;
+ default:
+ rosh_help(1, argv[0]);
+ }
break;
case 'c':
case 'C': /* run 'cd' 'cat' 'cfg' */
- switch (cmdstr[1]) {
+ switch (argv[0][1]) {
case 'a':
case 'A':
- if (strncasecmp("cat", tstr, tlen) == 0)
- rosh_cat(cmdstr);
+ if (strncasecmp("cat", argv[0], tlen) == 0)
+ rosh_cat(argc - 1, &argv[1]);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
case 'd':
case 'D':
- if (strncasecmp("cd", tstr, tlen) == 0)
- rosh_cd(cmdstr, ipwdstr);
+ if (strncasecmp("cd", argv[0], tlen) == 0)
+ rosh_cd(argc, argv, ipwdstr);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
case 'f':
case 'F':
- if (strncasecmp("cfg", tstr, tlen) == 0)
+ if (strncasecmp("cfg", argv[0], tlen) == 0)
rosh_cfg();
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
default:
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
}
break;
case 'd':
case 'D': /* run 'dir' */
- if (strncasecmp("dir", tstr, tlen) == 0)
- rosh_dir(cmdstr);
+ if (strncasecmp("dir", argv[0], tlen) == 0)
+ rosh_dir(argc - 1, &argv[1]);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
case 'h':
case 'H':
case '?':
- if ((strncasecmp("help", tstr, tlen) == 0) || (tlen == 1))
- rosh_help(2, cmdstr);
+ if ((strncasecmp("help", argv[0], tlen) == 0) || (tlen == 1))
+ rosh_help(2, argv[1]);
else
rosh_help(1, NULL);
break;
case 'l':
case 'L': /* run 'ls' 'less' */
- switch (cmdstr[1]) {
+ switch (argv[0][1]) {
case 0:
- case ' ':
case 's':
case 'S':
- if (strncasecmp("ls", tstr, tlen) == 0)
- rosh_ls(cmdstr);
+ if (strncasecmp("ls", argv[0], tlen) == 0)
+ rosh_ls(argc, argv);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
case 'e':
case 'E':
- if (strncasecmp("less", tstr, tlen) == 0)
- rosh_less(cmdstr);
+ if (strncasecmp("less", argv[0], tlen) == 0)
+ rosh_less(argc - 1, &argv[1]);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
default:
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
}
break;
case 'm':
case 'M':
- switch (cmdstr[1]) {
+ switch (argv[0][1]) {
case 'a':
case 'A':
- if (strncasecmp("man", tstr, tlen) == 0)
- rosh_help(2, cmdstr);
+ if (strncasecmp("man", argv[0], tlen) == 0)
+ rosh_help(2, argv[1]);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
case 'o':
case 'O':
- if (strncasecmp("more", tstr, tlen) == 0)
- rosh_more(cmdstr);
+ if (strncasecmp("more", argv[0], tlen) == 0)
+ rosh_more(argc - 1, &argv[1]);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
default:
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
}
break;
case 'p':
case 'P': /* run 'pwd' */
- if (strncasecmp("pwd", tstr, tlen) == 0)
- rosh_pwd(cmdstr);
+ if (strncasecmp("pwd", argv[0], tlen) == 0)
+ rosh_pwd();
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
case 'r':
case 'R': /* run 'run' */
- switch (cmdstr[1]) {
+ switch (argv[0][1]) {
case 0:
- case ' ':
case 'e':
case 'E':
- if (strncasecmp("reboot", tstr, tlen) == 0)
- rosh_reboot();
+ if (strncasecmp("reboot", argv[0], tlen) == 0)
+ rosh_reboot(argc - 1, &argv[1]);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
case 'u':
case 'U':
- if (strncasecmp("run", tstr, tlen) == 0)
- rosh_run(cmdstr);
+ if (strncasecmp("run", argv[0], tlen) == 0)
+ rosh_run(argc - 1, &argv[1]);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
+ default:
+ rosh_help(1, argv[0]);
}
break;
case 'v':
case 'V':
- if (strncasecmp("version", tstr, tlen) == 0)
+ if (strncasecmp("version", argv[0], tlen) == 0)
rosh_version(1);
else
- rosh_help(1, NULL);
+ rosh_help(1, argv[0]);
break;
case 0:
case '\n':
break;
default:
- rosh_help(1, NULL);
- } /* switch(cmdstr[0]) */
+ rosh_help(1, argv[0]);
+ } /* switch(argv[0][0]) */
return do_exit;
} /* rosh_command */
@@ -1150,29 +1310,29 @@
* icmdstr Initial command line string
* returns Exit status
*/
-int rosh_prompt(const char *icmdstr)
+int rosh_prompt(int iargc, char *iargv[])
{
int rv;
char cmdstr[ROSH_CMD_SZ];
char ipwdstr[ROSH_PATH_SZ];
char do_exit;
- char *c;
+ char **argv;
+ int argc;
rv = 0;
do_exit = false;
if (!getcwd(ipwdstr, ROSH_PATH_SZ))
strcpy(ipwdstr, "./");
- if (icmdstr[0] != '\0')
- do_exit = rosh_command(icmdstr, ipwdstr);
+ if (iargc > 1)
+ do_exit = rosh_command(iargc - 1, &iargv[1], ipwdstr);
while (!(do_exit)) {
/* Extra preceeding newline */
printf("\nrosh: ");
/* Read a line from console */
if (fgets(cmdstr, ROSH_CMD_SZ, stdin)) {
- /* remove newline from input string */
- c = strchr(cmdstr, '\n');
- *c = 0;
- do_exit = rosh_command(cmdstr, ipwdstr);
+ argc = rosh_str2argv(&argv, cmdstr);
+ do_exit = rosh_command(argc, argv, ipwdstr);
+ rosh_free_argv(&argv);
} else {
do_exit = false;
}
@@ -1183,19 +1343,21 @@
int main(int argc, char *argv[])
{
int rv;
- char cmdstr[ROSH_CMD_SZ];
/* Initialization */
rv = 0;
rosh_console_std();
- if (argc != 1) {
- rv = rosh_argcat(cmdstr, argc, argv, 1);
- } else {
+ if (argc == 1) {
rosh_version(0);
print_beta();
- cmdstr[0] = '\0';
+ } else {
+#ifdef DO_DEBUG
+ char cmdstr[ROSH_CMD_SZ];
+ rosh_argcat(cmdstr, ROSH_CMD_SZ, argc, argv, 1);
+ ROSH_DEBUG("arg='%s'\n", cmdstr);
+#endif
}
- rv = rosh_prompt(cmdstr);
- printf("--Exiting '%s'\n", APP_NAME);
+ rv = rosh_prompt(argc, argv);
+ printf("--Exiting '" APP_NAME "'\n");
return rv;
}
|
|
Changed |
syslinux-4.04.tar.bz2/com32/rosh/rosh.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/rosh/rosh.h
^
|
@@ -36,27 +36,35 @@
#include <sys/stat.h> /* fstat() */
#include <fcntl.h> /* open(); open mode macros */
#include <dirent.h> /* fdopendir() opendir() readdir() closedir() DIR */
-#include <unistd.h> /* getcwd() */
+#include <unistd.h> /* getcwd() getopt() */
#include <errno.h> /* errno; error macros */
#include <netinet/in.h> /* For htonl/ntohl/htons/ntohs */
#include <ctype.h> /* isspace() */
#include <getkey.h>
#include <consoles.h> /* console_ansi_raw() console_ansi_std() */
+// #include <getopt.h> /* getopt_long() */
#ifdef DO_DEBUG
# define ROSH_DEBUG printf
+# define ROSH_DEBUG_ARGV_V rosh_pr_argv_v
/* define ROSH_DEBUG(f, ...) printf (f, ## __VA_ARGS__) */
# ifdef DO_DEBUG2
# define ROSH_DEBUG2 printf
+# define ROSH_DEBUG2_ARGV_V rosh_pr_argv_v
# else /* DO_DEBUG2 */
/* This forces a format argument into the function call */
# define ROSH_DEBUG2(f, ...) ((void)0)
+# define ROSH_DEBUG2_ARGV_V(argc, argv) ((void)0)
# endif /* DO_DEBUG2 */
#else /* DO_DEBUG */
# define ROSH_DEBUG(f, ...) ((void)0)
+# define ROSH_DEBUG_ARGV_V(argc, argv) ((void)0)
# define ROSH_DEBUG2(f, ...) ((void)0)
+# define ROSH_DEBUG2_ARGV_V(argc, argv) ((void)0)
#endif /* DO_DEBUG */
+#define ROSH_DEBUG2_STAT(f, ...) ((void)0)
+// #define ROSH_DEBUG2_STAT ROSH_DEBUG2
#ifdef __COM32__
#define ROSH_IS_COM32 1
@@ -73,16 +81,22 @@
int fd, status, ret = -1;
DIR *d;
+ ROSH_DEBUG2_STAT("stat:opendir(%s) ", pathname);
d = opendir(pathname);
if (d != NULL) {
+ ROSH_DEBUG2_STAT("stat:closedir() ");
closedir(d);
ret = 0;
buf->st_mode = S_IFDIR | 0555;
buf->st_size = 0;
} else if ((errno == 0) || (errno == ENOENT) || (errno == ENOTDIR)) {
+ ROSH_DEBUG2_STAT("(%d)stat:open() ", errno);
fd = open(pathname, O_RDONLY);
- if (fd != 1) {
+ 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;
}
@@ -135,10 +149,10 @@
str = NULL;
if (fd == 1) {
ioctl(0, TIOCGWINSZ, &ws);
-/* if (rows)
+ if (rows)
*rows = ws.ws_row;
if (cols)
- *cols = ws.ws_col;*/
+ *cols = ws.ws_col;
if (rows && !*rows) {
str = getenv("LINES");
if (str)
@@ -235,6 +249,10 @@
const char rosh_cd_norun_str[] =
" -- cd (Change Directory) not implemented for use with run and exit.\n";
+const char rosh_help_cd_str[] = "cd Change directory\n\
+ with no argument, return to original directory from entry to rosh\n\
+ with one argument, change to that directory";
+
const char rosh_help_ls_str[] = "ls List contents of current directory\n\
-l Long format\n\
-i Inode; print Inode of file\n\
@@ -259,4 +277,6 @@
const char rosh_help_str_adv[] = "No additional help available for '%s'";
+const char rosh_ls_opt_str[] = "lFi";
+
#endif /* Not ROSH_H */
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/advdump.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/entrydump.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/fancyhello.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/fancyhello.lnx
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/hello.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/keytest.c
^
|
@@ -37,13 +37,13 @@
if (key == 0x03) {
printf("[done]\n");
exit(0);
- } else if (key == '?')
+ } else if (key == '!')
return;
if (key >= 0x20 && key < 0x100) {
putchar(key);
} else {
- printf("[%04x]", key);
+ printf("[%s,%04x]", key_code_to_name(key), key);
}
}
}
@@ -63,7 +63,8 @@
} else if (key == '!')
return;
- printf("<%02x>", key);
+ if (key != EOF)
+ printf("<%02x>", key);
}
}
@@ -72,7 +73,7 @@
console_ansi_raw();
printf("CLK_TCK = %d\n", (int)CLK_TCK);
- printf("Press keys, end with Ctrl-C...\n");
+ printf("Press keys, end with Ctrl-C, ! changes from cooked to raw\n");
for (;;) {
cooked_keys();
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/keytest.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/keytest.lnx
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/localboot.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/resolv.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/samples/serialinfo.c32
^
|
|
Changed |
syslinux-4.04.tar.bz2/com32/sysdump/sysdump.c32
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/com32/tools/relocs.c
^
|
@@ -403,13 +403,11 @@
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;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/Makefile
^
|
@@ -79,6 +79,9 @@
%.raw: %.elf
$(OBJCOPY) -O binary $< $(@:.bin=.raw)
+# GNU make 3.82 gets confused by the first form
+.PRECIOUS: %.raw
+
%.bin: %.raw $(PREPCORE)
$(PREPCORE) $< $@
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/bcopy32.inc
^
|
@@ -65,6 +65,8 @@
; If len == 0: this marks the end of the list; dst indicates
; the entry point and src the mode (0 = pm, 1 = rm)
;
+; (*) dst, src, and len are four bytes each
+;
shuffle_and_boot_raw:
mov bx,pm_shuffle
jmp enter_pm
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/bcopyxx.inc
^
|
@@ -205,6 +205,8 @@
; If len == 0: this marks the end of the list; dst indicates
; the entry point and src the mode (0 = pm, 1 = rm)
;
+; (*) dst, src, and len are four bytes each
+;
pm_shuffle:
cli ; End interrupt service (for good)
mov ebx,edi ; EBX <- descriptor list
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/bootsect.inc
^
|
@@ -169,7 +169,7 @@
mov [es:di+8],ax ; New DI
mov [es:di+4],bx ; New ES
%endif
- pop ax ; List length
+ pop ax ; descriptor list entries count
push di
push es
@@ -179,8 +179,8 @@
mov ebx,trackbuf
imul di,ax,12
+ push di ; length of list
add di,bx ; DI <- end of list
- push di
; Terminating entry...
lea eax,[replace_stub] ; Entrypoint
@@ -196,8 +196,10 @@
mov cx,__replacestub_dwords
rep movsd
+ ; ECX <- final list length
xor ecx,ecx
- pop cx ; ECX <- length of list
+ pop cx ; original length in bytes
+ add cx, 12 ; + termination entry size
pop word [replace_stub.ss]
pop word [replace_stub.esp]
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/comboot.inc
^
|
@@ -723,13 +723,9 @@
;
; INT 22h AX=0014h Local boot
;
-%if HAS_LOCALBOOT
comapi_localboot:
mov ax,P_DX
jmp local_boot
-%else
-comapi_localboot equ comapi_err
-%endif ; HAS_LOCALBOOT
;
; INT 22h AX=0015h Feature flags
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/config.inc
^
|
@@ -27,11 +27,6 @@
MAX_FKEYS equ 12 ; Number of F-key help files
;
-; Local boot supported
-;
-%assign HAS_LOCALBOOT 1
-
-;
; log2(Max filename size Including final null)
;
FILENAME_MAX_LG2 equ 8
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/core/diskboot.inc
^
|
@@ -0,0 +1,439 @@
+; -----------------------------------------------------------------------
+;
+; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
+; Copyright 2009-2011 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.
+;
+; -----------------------------------------------------------------------
+
+;
+; diskboot.inc
+;
+; Common boot sector code for harddisk-based Syslinux derivatives.
+;
+; Requires macros z[bwd], labels ldlinux_ent, ldlinux_magic, ldlinux_sys
+; and constants BS_MAGIC_VER, LDLINUX_MAGIC, retry_count, Sect1Ptr[01]_VAL,
+; STACK_TOP
+;
+
+ section .init
+;
+; Some of the things that have to be saved very early are saved
+; "close" to the initial stack pointer offset, in order to
+; reduce the code size...
+;
+
+StackBuf equ STACK_TOP-44-92 ; Start the stack here (grow down - 4K)
+PartInfo equ StackBuf
+.mbr equ PartInfo
+.gptlen equ PartInfo+16
+.gpt equ PartInfo+20
+FloppyTable equ PartInfo+76
+; Total size of PartInfo + FloppyTable == 76+16 = 92 bytes
+Hidden equ StackBuf-24 ; Partition offset (qword)
+OrigFDCTabPtr equ StackBuf-16 ; Original FDC table
+OrigDSSI equ StackBuf-12 ; DS:SI -> partinfo
+OrigESDI equ StackBuf-8 ; ES:DI -> $PnP structure
+DriveNumber equ StackBuf-4 ; Drive number
+StackHome equ Hidden ; The start of the canonical stack
+
+;
+; Primary entry point. Tempting as though it may be, we can't put the
+; initial "cli" here; the jmp opcode in the first byte is part of the
+; "magic number" (using the term very loosely) for the DOS superblock.
+;
+bootsec equ $
+_start: jmp short start ; 2 bytes
+ nop ; 1 byte
+;
+; "Superblock" follows -- it's in the boot sector, so it's already
+; loaded and ready for us
+;
+bsOemName db MY_NAME ; The SYS command sets this, so...
+ zb 8-($-bsOemName)
+
+;
+; These are the fields we actually care about. We end up expanding them
+; all to dword size early in the code, so generate labels for both
+; the expanded and unexpanded versions.
+;
+%macro superb 1
+bx %+ %1 equ SuperInfo+($-superblock)*8+4
+bs %+ %1 equ $
+ zb 1
+%endmacro
+%macro superw 1
+bx %+ %1 equ SuperInfo+($-superblock)*8
+bs %+ %1 equ $
+ zw 1
+%endmacro
+%macro superd 1
+bx %+ %1 equ $ ; no expansion for dwords
+bs %+ %1 equ $
+ zd 1
+%endmacro
+superblock equ $
+ superw BytesPerSec
+ superb SecPerClust
+ superw ResSectors
+ superb FATs
+ superw RootDirEnts
+ superw Sectors
+ superb Media
+ superw FATsecs
+ superw SecPerTrack
+ superw Heads
+superinfo_size equ ($-superblock)-1 ; How much to expand
+ superd Hidden
+ superd HugeSectors
+ ;
+ ; This is as far as FAT12/16 and FAT32 are consistent
+ ;
+ ; FAT12/16 need 26 more bytes,
+ ; FAT32 need 54 more bytes
+ ;
+superblock_len_fat16 equ $-superblock+26
+superblock_len_fat32 equ $-superblock+54
+ zb 54 ; Maximum needed size
+superblock_max equ $-superblock
+
+ global SecPerClust
+SecPerClust equ bxSecPerClust
+
+;
+; Note we don't check the constraints above now; we did that at install
+; time (we hope!)
+;
+start:
+ cli ; No interrupts yet, please
+ cld ; Copy upwards
+;
+; Set up the stack
+;
+ xor cx,cx
+ mov ss,cx
+ mov sp,StackBuf-2 ; Just below BSS (-2 for alignment)
+ push dx ; Save drive number (in DL)
+ push es ; Save initial ES:DI -> $PnP pointer
+ push di
+ push ds ; Save original DS:SI -> partinfo
+ push si
+ mov es,cx
+
+;
+; DS:SI may contain a partition table entry and possibly a GPT entry.
+; Preserve it for us. This saves 56 bytes of the GPT entry, which is
+; currently the maximum we care about. Total is 76 bytes.
+;
+ mov cl,(16+4+56)/2 ; Save partition info
+ mov di,PartInfo
+ rep movsw ; This puts CX back to zero
+
+ mov ds,cx ; Now we can initialize DS...
+
+;
+; Now sautee the BIOS floppy info block to that it will support decent-
+; size transfers; the floppy block is 11 bytes and is stored in the
+; INT 1Eh vector (brilliant waste of resources, eh?)
+;
+; Of course, if BIOSes had been properly programmed, we wouldn't have
+; had to waste precious space with this code.
+;
+ mov bx,fdctab
+ lfs si,[bx] ; FS:SI -> original fdctab
+ push fs ; Save on stack in case we need to bail
+ push si
+
+ ; Save the old fdctab even if hard disk so the stack layout
+ ; is the same. The instructions above do not change the flags
+ and dl,dl ; If floppy disk (00-7F), assume no
+ ; partition table
+ js harddisk
+
+floppy:
+ xor ax,ax
+ mov cl,6 ; 12 bytes (CX == 0)
+ ; es:di -> FloppyTable already
+ ; This should be safe to do now, interrupts are off...
+ mov [bx],di ; FloppyTable
+ mov [bx+2],ax ; Segment 0
+ fs rep movsw ; Faster to move words
+ mov cl,[bsSecPerTrack] ; Patch the sector count
+ mov [di-12+4],cl
+
+ push ax ; Partition offset == 0
+ push ax
+ push ax
+ push ax
+
+ int 13h ; Some BIOSes need this
+ ; Using xint13 costs +1B
+ jmp short not_harddisk
+;
+; The drive number and possibly partition information was passed to us
+; by the BIOS or previous boot loader (MBR). Current "best practice" is to
+; trust that rather than what the superblock contains.
+;
+; Note: di points to beyond the end of PartInfo
+; Note: false negatives might slip through the handover area's sanity checks,
+; if the region is very close (less than a paragraph) to
+; PartInfo ; no false positives are possible though
+;
+harddisk:
+ mov dx,[di-76-10] ; Original DS
+ mov si,[di-76-12] ; Original SI
+ shr si,4
+ add dx,si
+ cmp dx,4fh ; DS:SI < 50h:0 (BDA or IVT) ?
+ jbe .no_partition
+ cmp dx,(PartInfo-75)>>4 ; DS:SI in overwritten memory?
+ jae .no_partition
+ test byte [di-76],7Fh ; Sanity check: "active flag" should
+ jnz .no_partition ; be 00 or 80
+ cmp [di-76+4],cl ; Sanity check: partition type != 0
+ je .no_partition
+ cmp eax,'!GPT' ; !GPT signature?
+ jne .mbr
+ cmp byte [di-76+4],0EDh ; Synthetic GPT partition entry?
+ jne .mbr
+.gpt: ; GPT-style partition info
+ push dword [di-76+20+36]
+ push dword [di-76+20+32]
+ jmp .gotoffs
+.mbr: ; MBR-style partition info
+ push cx ; Upper half partition offset == 0
+ push cx
+ push dword [di-76+8] ; Partition offset (dword)
+ jmp .gotoffs
+.no_partition:
+;
+; No partition table given... assume that the Hidden field in the boot sector
+; tells the truth (in particular, is zero if this is an unpartitioned disk.)
+;
+ push cx
+ push cx
+ push dword [bsHidden]
+.gotoffs:
+;
+; Get disk drive parameters (don't trust the superblock.) Don't do this for
+; floppy drives -- INT 13:08 on floppy drives will (may?) return info about
+; what the *drive* supports, not about the *media*. Fortunately floppy disks
+; tend to have a fixed, well-defined geometry which is stored in the superblock.
+;
+ ; DL == drive # still
+ mov ah,08h
+ call xint13
+ jc no_driveparm
+ and ah,ah
+ jnz no_driveparm
+ shr dx,8
+ inc dx ; Contains # of heads - 1
+ mov [bsHeads],dx
+ and cx,3fh
+ mov [bsSecPerTrack],cx
+no_driveparm:
+not_harddisk:
+;
+; Ready to enable interrupts, captain
+;
+ sti
+
+;
+; Do we have EBIOS (EDD)?
+;
+eddcheck:
+ 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 byte [getonesec.jmp+1],(getonesec_ebios-(getonesec.jmp+2))
+.noedd:
+
+;
+; Load the first sector of LDLINUX.SYS; this used to be all proper
+; with parsing the superblock and root directory; it doesn't fit
+; together with EBIOS support, unfortunately.
+;
+Sect1Load:
+ mov eax,strict dword Sect1Ptr0_VAL ; 0xdeadbeef
+Sect1Ptr0 equ $-4
+ mov edx,strict dword Sect1Ptr1_VAL ; 0xfeedface
+Sect1Ptr1 equ $-4
+ mov bx,ldlinux_sys ; Where to load it
+ call getonesec
+
+ ; Some modicum of integrity checking
+ cmp dword [ldlinux_magic+4],LDLINUX_MAGIC^HEXDATE
+ jne kaboom
+
+ ; Go for it! This also normalizes CS:IP.
+ jmp ldlinux_ent
+
+;
+; getonesec: load a single disk linear sector EDX:EAX into the buffer
+; at ES:BX.
+;
+; This routine assumes CS == DS == SS, and trashes most registers.
+;
+; Stylistic note: use "xchg" instead of "mov" when the source is a register
+; that is dead from that point; this saves space. However, please keep
+; the order to dst,src to keep things sane.
+;
+getonesec:
+ add eax,[Hidden] ; Add partition offset
+ adc edx,[Hidden+4]
+ mov cx,retry_count
+.jmp: jmp strict short getonesec_cbios
+
+;
+; getonesec_ebios:
+;
+; getonesec implementation for EBIOS (EDD)
+;
+getonesec_ebios:
+.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. Try falling back to CBIOS.
+ mov byte [getonesec.jmp+1],(getonesec_cbios-(getonesec.jmp+2))
+
+;
+; getonesec_cbios:
+;
+; getlinsec implementation for legacy CBIOS
+;
+getonesec_cbios:
+.retry:
+ pushad
+
+ movzx esi,word [bsSecPerTrack]
+ movzx edi,word [bsHeads]
+ ;
+ ; Dividing by sectors to get (track,sector): we may have
+ ; up to 2^18 tracks, so we need to use 32-bit arithmetric.
+ ;
+ div esi
+ xor cx,cx
+ xchg cx,dx ; CX <- sector index (0-based)
+ ; EDX <- 0
+ ; eax = track #
+ div edi ; Convert track to head/cyl
+
+ cmp eax,1023 ; Outside the CHS range?
+ ja kaboom
+
+ ;
+ ; Now we have AX = cyl, DX = head, CX = sector (0-based),
+ ; SI = bsSecPerTrack, ES:BX = data target
+ ;
+ shl ah,6 ; Because IBM was STOOPID
+ ; and thought 8 bits were enough
+ ; then thought 10 bits were enough...
+ inc cx ; Sector numbers are 1-based, sigh
+ or cl,ah
+ mov ch,al
+ mov dh,dl
+ 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:
+ xor si,si
+ mov ss,si
+ mov sp,OrigFDCTabPtr ; Reset stack
+ mov ds,si ; Reset data segment
+ pop dword [fdctab] ; Restore FDC table
+.patch: ; When we have full code, intercept here
+ mov si,bailmsg
+.loop: lodsb
+ and al,al
+ jz .done
+ mov ah,0Eh ; Write to screen as TTY
+ mov bx,0007h ; Attribute
+ int 10h
+ jmp short .loop
+
+.done:
+ xor ax,ax
+.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]
+ push es ; ES destroyed by INT 13h AH 08h
+ int 13h
+ pop es
+ ret
+
+;
+; Error message on failure
+;
+bailmsg: db 'Boot error', 0Dh, 0Ah, 0
+
+ ; This fails if the boot sector overflowsg
+ zb 1F8h-($-$$)
+
+bs_magic dd LDLINUX_MAGIC
+bs_link dw (Sect1Load - bootsec) | BS_MAGIC_VER
+bootsignature dw 0xAA55
+
+;
+; ===========================================================================
+; End of boot sector
+; ===========================================================================
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/diskfs.inc
^
|
@@ -2,7 +2,7 @@
; -----------------------------------------------------------------------
;
; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
-; Copyright 2009 Intel Corporation; author: H. Peter Anvin
+; Copyright 2009-2011 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
@@ -27,6 +27,9 @@
%assign HIGHMEM_SLOP 0 ; Avoid this much memory near the top
LDLINUX_MAGIC equ 0x3eb202fe ; A random number to identify ourselves with
+; This indicates the general format of the last few bytes in the boot sector
+BS_MAGIC_VER equ 0x1b << 9
+
SECTOR_SHIFT equ 9
SECTOR_SIZE equ (1 << SECTOR_SHIFT)
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/diskstart.inc
^
|
@@ -1,7 +1,7 @@
; -----------------------------------------------------------------------
;
; Copyright 1994-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
;
; 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
@@ -17,423 +17,11 @@
; Common early-bootstrap code for harddisk-based Syslinux derivatives.
;
- section .init
-;
-; Some of the things that have to be saved very early are saved
-; "close" to the initial stack pointer offset, in order to
-; reduce the code size...
-;
-
-StackBuf equ STACK_TOP-44-92 ; Start the stack here (grow down - 4K)
-PartInfo equ StackBuf
-.mbr equ PartInfo
-.gptlen equ PartInfo+16
-.gpt equ PartInfo+20
-FloppyTable equ PartInfo+76
-; Total size of PartInfo + FloppyTable == 76+16 = 92 bytes
-Hidden equ StackBuf-24 ; Partition offset (qword)
-OrigFDCTabPtr equ StackBuf-16 ; Original FDC table
-OrigDSSI equ StackBuf-12 ; DS:SI -> partinfo
-OrigESDI equ StackBuf-8 ; ES:DI -> $PnP structure
-DriveNumber equ StackBuf-4 ; Drive number
-StackHome equ Hidden ; The start of the canonical stack
-
-;
-; Primary entry point. Tempting as though it may be, we can't put the
-; initial "cli" here; the jmp opcode in the first byte is part of the
-; "magic number" (using the term very loosely) for the DOS superblock.
-;
-bootsec equ $
-_start: jmp short start ; 2 bytes
- nop ; 1 byte
-;
-; "Superblock" follows -- it's in the boot sector, so it's already
-; loaded and ready for us
-;
-bsOemName db MY_NAME ; The SYS command sets this, so...
- zb 8-($-bsOemName)
-
-;
-; These are the fields we actually care about. We end up expanding them
-; all to dword size early in the code, so generate labels for both
-; the expanded and unexpanded versions.
-;
-%macro superb 1
-bx %+ %1 equ SuperInfo+($-superblock)*8+4
-bs %+ %1 equ $
- zb 1
-%endmacro
-%macro superw 1
-bx %+ %1 equ SuperInfo+($-superblock)*8
-bs %+ %1 equ $
- zw 1
-%endmacro
-%macro superd 1
-bx %+ %1 equ $ ; no expansion for dwords
-bs %+ %1 equ $
- zd 1
-%endmacro
-superblock equ $
- superw BytesPerSec
- superb SecPerClust
- superw ResSectors
- superb FATs
- superw RootDirEnts
- superw Sectors
- superb Media
- superw FATsecs
- superw SecPerTrack
- superw Heads
-superinfo_size equ ($-superblock)-1 ; How much to expand
- superd Hidden
- superd HugeSectors
- ;
- ; This is as far as FAT12/16 and FAT32 are consistent
- ;
- ; FAT12/16 need 26 more bytes,
- ; FAT32 need 54 more bytes
- ;
-superblock_len_fat16 equ $-superblock+26
-superblock_len_fat32 equ $-superblock+54
- zb 54 ; Maximum needed size
-superblock_max equ $-superblock
-
- global SecPerClust
-SecPerClust equ bxSecPerClust
-
-;
-; Note we don't check the constraints above now; we did that at install
-; time (we hope!)
-;
-start:
- cli ; No interrupts yet, please
- cld ; Copy upwards
-;
-; Set up the stack
-;
- xor cx,cx
- mov ss,cx
- mov sp,StackBuf-2 ; Just below BSS (-2 for alignment)
- push dx ; Save drive number (in DL)
- push es ; Save initial ES:DI -> $PnP pointer
- push di
- push ds ; Save original DS:SI -> partinfo
- push si
- mov es,cx
-
-;
-; DS:SI may contain a partition table entry and possibly a GPT entry.
-; Preserve it for us. This saves 56 bytes of the GPT entry, which is
-; currently the maximum we care about. Total is 76 bytes.
-;
- mov cl,(16+4+56)/2 ; Save partition info
- mov di,PartInfo
- rep movsw ; This puts CX back to zero
-
- mov ds,cx ; Now we can initialize DS...
-
-;
-; Now sautee the BIOS floppy info block to that it will support decent-
-; size transfers; the floppy block is 11 bytes and is stored in the
-; INT 1Eh vector (brilliant waste of resources, eh?)
-;
-; Of course, if BIOSes had been properly programmed, we wouldn't have
-; had to waste precious space with this code.
-;
- mov bx,fdctab
- lfs si,[bx] ; FS:SI -> original fdctab
- push fs ; Save on stack in case we need to bail
- push si
-
- ; Save the old fdctab even if hard disk so the stack layout
- ; is the same. The instructions above do not change the flags
- and dl,dl ; If floppy disk (00-7F), assume no
- ; partition table
- js harddisk
-
-floppy:
- xor ax,ax
- mov cl,6 ; 12 bytes (CX == 0)
- ; es:di -> FloppyTable already
- ; This should be safe to do now, interrupts are off...
- mov [bx],di ; FloppyTable
- mov [bx+2],ax ; Segment 0
- fs rep movsw ; Faster to move words
- mov cl,[bsSecPerTrack] ; Patch the sector count
- mov [di-76+8],cl
-
- push ax ; Partition offset == 0
- push ax
- push ax
- push ax
-
- int 13h ; Some BIOSes need this
- jmp short not_harddisk
-;
-; The drive number and possibly partition information was passed to us
-; by the BIOS or previous boot loader (MBR). Current "best practice" is to
-; trust that rather than what the superblock contains.
-;
-; Note: di points to beyond the end of PartInfo
-;
-harddisk:
- mov dx,[di-76-10] ; Original DS
- mov si,[di-76-12] ; Original SI
- shr si,4
- add dx,si
- cmp dx,PartInfo >> 4
- jae .no_partition
- test byte [di-76],7Fh ; Sanity check: "active flag" should
- jnz .no_partition ; be 00 or 80
- cmp [di-76+4],cl ; Sanity check: partition type != 0
- je .no_partition
- cmp eax,'!GPT' ; !GPT signature?
- jne .mbr
- cmp byte [di-76+4],0EDh ; Synthetic GPT partition entry?
- jne .mbr
-.gpt: ; GPT-style partition info
- push dword [di-76+20+36]
- push dword [di-76+20+32]
- jmp .gotoffs
-.mbr: ; MBR-style partition info
- push cx ; Upper half partition offset == 0
- push cx
- push dword [di-76+8] ; Partition offset (dword)
- jmp .gotoffs
-.no_partition:
-;
-; No partition table given... assume that the Hidden field in the boot sector
-; tells the truth (in particular, is zero if this is an unpartitioned disk.)
-;
- push cx
- push cx
- push dword [bsHidden]
-.gotoffs:
-;
-; Get disk drive parameters (don't trust the superblock.) Don't do this for
-; floppy drives -- INT 13:08 on floppy drives will (may?) return info about
-; what the *drive* supports, not about the *media*. Fortunately floppy disks
-; tend to have a fixed, well-defined geometry which is stored in the superblock.
-;
- ; DL == drive # still
- mov ah,08h
- int 13h
- jc no_driveparm
- and ah,ah
- jnz no_driveparm
- shr dx,8
- inc dx ; Contains # of heads - 1
- mov [bsHeads],dx
- and cx,3fh
- mov [bsSecPerTrack],cx
-no_driveparm:
-not_harddisk:
-;
-; Ready to enable interrupts, captain
-;
- sti
-
-;
-; Do we have EBIOS (EDD)?
-;
-eddcheck:
- 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 byte [getonesec.jmp+1],(getonesec_ebios-(getonesec.jmp+2))
-.noedd:
-
-;
-; Load the first sector of LDLINUX.SYS; this used to be all proper
-; with parsing the superblock and root directory; it doesn't fit
-; together with EBIOS support, unfortunately.
-;
- mov eax,strict dword 0xdeadbeef
-Sect1Ptr0 equ $-4
- mov edx,strict dword 0xfeedface
-Sect1Ptr1 equ $-4
- mov bx,ldlinux_sys ; Where to load it
- call getonesec
-
- ; Some modicum of integrity checking
- cmp dword [ldlinux_magic+4],LDLINUX_MAGIC^HEXDATE
- jne kaboom
-
- ; Go for it...
- jmp 0:ldlinux_ent
-
-
-;
-; getonesec: load a single disk linear sector EDX:EAX into the buffer
-; at ES:BX.
-;
-; This routine assumes CS == DS == SS, and trashes most registers.
-;
-; Stylistic note: use "xchg" instead of "mov" when the source is a register
-; that is dead from that point; this saves space. However, please keep
-; the order to dst,src to keep things sane.
-;
-getonesec:
- add eax,[Hidden] ; Add partition offset
- adc edx,[Hidden+4]
- mov cx,retry_count
-.jmp: jmp strict short getonesec_cbios
-
-;
-; getonesec_ebios:
-;
-; getonesec implementation for EBIOS (EDD)
-;
-getonesec_ebios:
-.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. Try falling back to CBIOS.
- mov byte [getonesec.jmp+1],(getonesec_cbios-(getonesec.jmp+2))
-
-;
-; getonesec_cbios:
-;
-; getlinsec implementation for legacy CBIOS
-;
-getonesec_cbios:
-.retry:
- pushad
-
- movzx esi,word [bsSecPerTrack]
- movzx edi,word [bsHeads]
- ;
- ; Dividing by sectors to get (track,sector): we may have
- ; up to 2^18 tracks, so we need to use 32-bit arithmetric.
- ;
- div esi
- xor cx,cx
- xchg cx,dx ; CX <- sector index (0-based)
- ; EDX <- 0
- ; eax = track #
- div edi ; Convert track to head/cyl
-
- cmp eax,1023 ; Outside the CHS range?
- ja kaboom
-
- ;
- ; Now we have AX = cyl, DX = head, CX = sector (0-based),
- ; SI = bsSecPerTrack, ES:BX = data target
- ;
- shl ah,6 ; Because IBM was STOOPID
- ; and thought 8 bits were enough
- ; then thought 10 bits were enough...
- inc cx ; Sector numbers are 1-based, sigh
- or cl,ah
- mov ch,al
- mov dh,dl
- 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:
- xor si,si
- mov ss,si
- mov sp,OrigFDCTabPtr ; Reset stack
- mov ds,si ; Reset data segment
- pop dword [fdctab] ; Restore FDC table
-.patch: ; When we have full code, intercept here
- mov si,bailmsg
- call writestr_early
-
- xor ax,ax
-.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
-
-;
-;
-; 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
-
-;
-; INT 13h wrapper function
-;
-xint13:
- mov dl,[DriveNumber]
- int 13h
- ret
-
-;
-; Error message on failure
-;
-bailmsg: db 'Boot error', 0Dh, 0Ah, 0
-
- ; This fails if the boot sector overflowsg
- zb 1FEh-($-$$)
+Sect1Ptr0_VAL equ 0xdeadbeef
+Sect1Ptr1_VAL equ 0xfeedface
-bootsignature dw 0xAA55
+%include "diskboot.inc"
-;
-; ===========================================================================
-; End of boot sector
; ===========================================================================
; Start of LDLINUX.SYS
; ===========================================================================
@@ -441,7 +29,7 @@
LDLINUX_SYS equ ($-$$)+TEXT_START
ldlinux_sys:
-syslinux_banner db CR, LF, MY_NAME, ' ', VERSION_STR, ' ', DATE_STR, ' ', 0
+early_banner db CR, LF, MY_NAME, ' ', VERSION_STR, ' ', 0
db CR, LF, 1Ah ; EOF if we "type" this in DOS
alignz 8
@@ -488,6 +76,11 @@
RAIDPatchPtr dw kaboom.again - bootsec ; Patch to INT 18h in RAID mode
;
+; Pointer to the Syslinux banner
+;
+BannerPtr dw syslinux_banner - LDLINUX_SYS
+
+;
; Base directory name and subvolume, if applicable.
;
%define HAVE_CURRENTDIRNAME
@@ -504,12 +97,13 @@
; value in CS, but we don't want to deal with that anymore from now
; on.
;
- sti ; In case of broken INT 13h BIOSes
+ jmp 0:.next ; Normalize CS:IP
+.next: sti ; In case of broken INT 13h BIOSes
;
; Tell the user we got this far
;
- mov si,syslinux_banner
+ mov si,early_banner
call writestr_early
;
@@ -592,6 +186,8 @@
dec ecx
jnz .checksum
+ mov ds,cx
+
and eax,eax ; Should be zero
jz all_read ; We're cool, go for it!
@@ -680,8 +276,7 @@
pushad ; Try resetting the device
xor ax,ax
- mov dl,[DriveNumber]
- int 13h
+ call xint13
popad
loop .retry ; CX-- and jump if not zero
@@ -783,6 +378,24 @@
.ok: 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
+ mov ah,0Eh ; Write to screen as TTY
+ mov bx,0007h ; Attribute
+ int 10h
+ jmp short .loop
+.return: popad
+ ret
+
+;
; Checksum error message
;
checksumerr_msg db ' Load error - ', 0 ; Boot failed appended
@@ -831,14 +444,16 @@
section .text16
all_read:
- ; We enter here with both DS and ES scrambled...
+ ; We enter here with ES scrambled...
xor ax,ax
- mov ds,ax
mov es,ax
;
; Let the user (and programmer!) know we got this far. This used to be
; in Sector 1, but makes a lot more sense here.
;
+ mov si,late_banner
+ call writestr_early
+
mov si,copyright_str
call writestr_early
@@ -880,4 +495,11 @@
section .bss16
SuperInfo resq 16 ; The first 16 bytes expanded 8 times
+;
+; Banner information not needed in sector 1
+;
+ section .data16
+syslinux_banner db CR, LF, MY_NAME, ' ', VERSION_STR
+late_banner db ' ', DATE_STR, 0
+
section .text16
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/fs/diskio.c
^
|
@@ -280,9 +280,9 @@
char bus_type[4];
char if_type[8];
uint8_t if_path[8];
- uint8_t dev_path[8];
+ uint8_t dev_path[16];
uint8_t _pad2;
- uint8_t devpath_csum;
+ uint8_t devpath_csum; /* Depends on devpath_len! */
} __attribute__((packed));
static inline bool is_power_of_2(uint32_t x)
@@ -354,6 +354,9 @@
hard_max_transfer = 127;
/* Query EBIOS parameters */
+ /* The memset() is needed once this function can be called
+ more than once */
+ /* memset(&edd_params, 0, sizeof edd_params); */
edd_params.len = sizeof edd_params;
ireg.eax.b[1] = 0x48;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/fs/fat/fat.c
^
|
@@ -254,8 +254,10 @@
while (1) {
if (dst == p)
break;
- if (*(dst-1) == '/' && dst-1 == p) /* it's the '/' case */
- break;
+ if (*(dst-1) == '/' && dst-1 == p) /* it's the '/' case */
+ break;
+ if (dst-2 == p && *(dst-2) == '.' && *(dst-1) == '.' ) /* the '..' case */
+ break;
if ((*(dst-1) != '/') && (*(dst-1) != '.'))
break;
@@ -592,7 +594,7 @@
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 +621,12 @@
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 {
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/fs/iso9660/iso9660.c
^
|
@@ -27,54 +27,6 @@
return fs->fs_info;
}
-/*
- * Mangle a filename pointed to by src into a buffer pointed
- * to by dst; ends on encountering any whitespace.
- * dst is preserved.
- *
- * This verifies that a filename is < FilENAME_MAX characters,
- * doesn't contain whitespace, zero-pads the output buffer,
- * and removes trailing dots and redumndant slashes, so "repe
- * cmpsb" can do a compare, and the path-searching routine gets
- * a bit of an easier job.
- *
- */
-static void iso_mangle_name(char *dst, const char *src)
-{
- char *p = dst;
- int i = FILENAME_MAX - 1;
-
- while (not_whitespace(*src)) {
- if ( *src == '/' ) {
- if ( *(src+1) == '/' ) {
- i--;
- src++;
- continue;
- }
- }
-
- *dst++ = *src ++;
- i--;
- }
-
- while ( 1 ) {
- if ( dst == p )
- break;
-
- if ( (*(dst-1) != '.') && (*(dst-1) != '/') )
- break;
- if ((dst[-1] == '/') && ((dst - 1) == p))
- break;
-
- dst --;
- i ++;
- }
-
- i ++;
- for (; i > 0; i -- )
- *dst++ = '\0';
-}
-
static size_t iso_convert_name(char *dst, const char *src, int len)
{
char *p = dst;
@@ -118,9 +70,10 @@
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);
@@ -339,7 +292,7 @@
.searchdir = NULL,
.getfssec = generic_getfssec,
.close_file = generic_close_file,
- .mangle_name = iso_mangle_name,
+ .mangle_name = generic_mangle_name,
.load_config = iso_load_config,
.iget_root = iso_iget_root,
.iget = iso_iget,
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/fs/pxe/dnsresolv.c
^
|
@@ -215,7 +215,7 @@
if (!dots) {
p--; /* Remove final null */
/* Uncompressed DNS label set so it ends in null */
- strcpy(p, LocalDomain);
+ p = stpcpy(p, LocalDomain);
}
/* Fill the DNS query packet */
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/fs/pxe/pxe.c
^
|
@@ -332,6 +332,7 @@
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
@@ -753,9 +754,6 @@
break;
}
- if (!ip)
- return; /* No server */
-
buf++; /* Point *past* the final NULL */
memcpy(buf, rrq_tail, sizeof rrq_tail);
buf += sizeof rrq_tail;
@@ -791,6 +789,9 @@
}
#endif /* GPXE */
+ if (!ip)
+ goto done; /* No server */
+
timeout_ptr = TimeoutTable; /* Reset timeout */
sendreq:
@@ -1575,6 +1576,11 @@
* This manipulates the real-mode InitStack directly. It relies on this
* *not* being a currently active stack, i.e. the former
* USE_PXE_PROVIDED_STACK no longer works.
+ *
+ * XXX: Disable this until we can find a better way to discriminate
+ * between BIOSes that are broken on BEV return and BIOSes which are
+ * broken on INT 18h. Keying on the EFI CSM turns out to cause more
+ * problems than it solves.
*/
extern far_ptr_t InitStack;
@@ -1594,9 +1600,10 @@
return (efi->magic == EFI_MAGIC) && (efi->len >= 83);
}
-static void install_efi_csm_hack(void)
+static void install_int18_hack(void)
{
- static const uint8_t efi_csm_hack[] =
+#if 0
+ static const uint8_t int18_hack[] =
{
0xcd, 0x18, /* int $0x18 */
0xea, 0xf0, 0xff, 0x00, 0xf0, /* ljmpw $0xf000,$0xfff0 */
@@ -1620,17 +1627,18 @@
if (efi) {
uint8_t *src = GET_PTR(InitStack);
- uint8_t *dst = src - sizeof efi_csm_hack;
+ uint8_t *dst = src - sizeof int18_hack;
memmove(dst, src, 52);
- memcpy(dst+52, efi_csm_hack, sizeof efi_csm_hack);
- InitStack.offs -= sizeof efi_csm_hack;
+ memcpy(dst+52, int18_hack, sizeof int18_hack);
+ InitStack.offs -= sizeof int18_hack;
/* Clobber the return address */
*(uint16_t *)(dst+44) = OFFS_WRT(dst+52, InitStack.seg);
*(uint16_t *)(dst+46) = InitStack.seg;
}
}
+#endif
}
int reset_pxe(void)
@@ -1651,7 +1659,7 @@
err = pxe_init(true);
}
- install_efi_csm_hack();
+ install_int18_hack();
return err;
}
|
|
Changed |
syslinux-4.04.tar.bz2/core/isolinux-debug.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/core/isolinux.bin
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/keywords.inc
^
|
@@ -95,8 +95,6 @@
%if IS_PXELINUX
keyword ipappend, pc_ipappend
%endif
-%if HAS_LOCALBOOT
keyword localboot, pc_localboot
-%endif
keywd_count equ ($-keywd_table)/keywd_size
|
|
Changed |
syslinux-4.04.tar.bz2/core/ldlinux.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/core/ldlinux.bss
^
|
|
Changed |
syslinux-4.04.tar.bz2/core/ldlinux.sys
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/localboot.inc
^
|
@@ -16,8 +16,6 @@
; Boot from a local disk, or invoke INT 18h.
;
-%if HAS_LOCALBOOT
-
;
; Boot a specified local disk. AX specifies the BIOS disk number; or
; -1 in case we should execute INT 18h ("next device.")
@@ -73,4 +71,3 @@
section .text16
-%endif ; HAS_LOCALBOOT
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/parseconfig.inc
^
|
@@ -85,8 +85,6 @@
;
; "localboot" command
;
-%if HAS_LOCALBOOT
-
pc_localboot: call getint
cmp byte [VKernel],0 ; ("label" section only)
je .err
@@ -94,8 +92,6 @@
mov byte [VKernelBuf+vk_type],VK_LOCALBOOT
.err: ret
-%endif ; HAS_LOCALBOOT
-
;
; "kernel", "config", ... command
;
|
|
Changed |
syslinux-4.04.tar.bz2/core/pxelinux.0
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/pxelinux.asm
^
|
@@ -365,6 +365,16 @@
pushfd
pushad
+ ; We may be removing ourselves from memory
+ cmp bx,0073h ; PXENV_RESTART_TFTP
+ jz .disable_timer
+ cmp bx,00E5h ; gPXE PXENV_FILE_EXEC
+ jnz .store_stack
+
+.disable_timer:
+ call timer_cleanup
+
+.store_stack:
mov [cs:PXEStack],sp
mov [cs:PXEStack+2],ss
lss sp,[cs:InitStack]
@@ -391,6 +401,17 @@
; This clobbers the AX return, but we already saved it into
; the PXEStatus variable.
popad
+
+ ; If the call failed, it could return.
+ cmp bx,0073h
+ jz .enable_timer
+ cmp bx,00E5h
+ jnz .pop_flags
+
+.enable_timer:
+ call timer_init
+
+.pop_flags:
popfd ; Restore flags (incl. IF, DF)
ret
|
|
Changed |
syslinux-4.04.tar.bz2/core/pxelinux.bin
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/runkernel.inc
^
|
@@ -453,7 +453,7 @@
.no_initrd:
push dword run_linux_kernel
- push cx ; Length of descriptor list
+ push cx ; descriptor list entries count
; BX points to the final real mode segment, and will be loaded
; into DS.
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/syslinux.ld
^
|
@@ -31,21 +31,21 @@
/* "Early" sections (before the load) */
. = 0x1000;
- .earlybss : {
+ .earlybss (NOLOAD) : {
__earlybss_start = .;
*(.earlybss)
__earlybss_end = .;
}
- __earlybss_len = __earlybss_end - __earlybss_start;
+ __earlybss_len = ABSOLUTE(__earlybss_end) - ABSOLUTE(__earlybss_start);
__earlybss_dwords = (__earlybss_len + 3) >> 2;
. = ALIGN(4);
- .bss16 : {
+ .bss16 (NOLOAD) : {
__bss16_start = .;
*(.bss16)
__bss16_end = .;
}
- __bss16_len = __bss16_end - __bss16_start;
+ __bss16_len = ABSOLUTE(__bss16_end) - ABSOLUTE(__bss16_start);
__bss16_dwords = (__bss16_len + 3) >> 2;
. = ALIGN(4);
@@ -54,7 +54,7 @@
*(.config)
__config_end = .;
}
- __config_len = __config_end - __config_start;
+ __config_len = ABSOLUTE(__config_end) - ABSOLUTE(__config_start);
__config_dwords = (__config_len + 3) >> 2;
/* Generated and/or copied code */
@@ -65,7 +65,7 @@
*(.replacestub)
__replacestub_end = .;
}
- __replacestub_len = __replacestub_end - __replacestub_start;
+ __replacestub_len = ABSOLUTE(__replacestub_end) - ABSOLUTE(__replacestub_start);
__replacestub_dwords = (__replacestub_len + 3) >> 2;
. = ALIGN(16);
@@ -75,7 +75,7 @@
*(.gentextnr)
__gentextnr_end = .;
}
- __gentextnr_len = __gentextnr_end - __gentextnr_start;
+ __gentextnr_len = ABSOLUTE(__gentextnr_end) - ABSOLUTE(__gentextnr_start);
__gentextnr_dwords = (__gentextnr_len + 3) >> 2;
. = STACK_BASE;
@@ -84,7 +84,7 @@
. += STACK_LEN;
__stack16_end = .;
}
- __stack16_len = __stack16_end - __stack16_start;
+ __stack16_len = ABSOLUTE(__stack16_end) - ABSOLUTE(__stack16_start);
__stack16_dwords = (__stack16_len + 3) >> 2;
/* Initialized sections */
@@ -96,7 +96,7 @@
*(.init)
__init_end = .;
}
- __init_len = __init_end - __init_start;
+ __init_len = ABSOLUTE(__init_end) - ABSOLUTE(__init_start);
__init_dwords = (__init_len + 3) >> 2;
.text16 : {
@@ -105,7 +105,7 @@
*(.text16)
__text16_end = .;
}
- __text16_len = __text16_end - __text16_start;
+ __text16_len = ABSOLUTE(__text16_end) - ABSOLUTE(__text16_start);
__text16_dwords = (__text16_len + 3) >> 2;
/*
@@ -119,7 +119,7 @@
*(.textnr)
__textnr_end = .;
}
- __textnr_len = __textnr_end - __textnr_start;
+ __textnr_len = ABSOLUTE(__textnr_end) - ABSOLUTE(__textnr_start);
__textnr_dwords = (__textnr_len + 3) >> 2;
. = ALIGN(16);
@@ -131,7 +131,7 @@
*(.bcopyxx.text)
__bcopyxx_text_end = .;
}
- __bcopyxx_text_len = __bcopyxx_text_end - __bcopyxx_text_start;
+ __bcopyxx_text_len = ABSOLUTE(__bcopyxx_text_end) - ABSOLUTE(__bcopyxx_text_start);
__bcopyxx_text_dwords = (__bcopyxx_text_len + 3) >> 2;
.bcopyxx.data : {
@@ -139,11 +139,11 @@
*(.bcopyxx.text)
__bcopyxx_data_end = .;
}
- __bcopyxx_data_len = __bcopyxx_data_end - __bcopyxx_data_start;
+ __bcopyxx_data_len = ABSOLUTE(__bcopyxx_data_end) - ABSOLUTE(__bcopyxx_data_start);
__bcopyxx_data_dwords = (__bcopyxx_data_len + 3) >> 2;
__bcopyxx_end = .;
- __bcopyxx_len = __bcopyxx_end - __bcopyxx_start;
+ __bcopyxx_len = ABSOLUTE(__bcopyxx_end) - ABSOLUTE(__bcopyxx_start);
__bcopyxx_dwords = (__bcopyxx_len + 3) >> 2;
. = ALIGN(4);
@@ -152,7 +152,7 @@
*(.data16)
__data16_end = .;
}
- __data16_len = __data16_end - __data16_start;
+ __data16_len = ABSOLUTE(__data16_end) - ABSOLUTE(__data16_start);
__data16_dwords = (__data16_len + 3) >> 2;
. = ALIGN(4);
@@ -176,7 +176,7 @@
*(.adv)
__adv_end = .;
}
- __adv_len = __adv_end - __adv_start;
+ __adv_len = ABSOLUTE(__adv_end) - ABSOLUTE(__adv_start);
__adv_dwords = (__adv_len + 3) >> 2;
/* Late uninitialized sections */
@@ -187,7 +187,7 @@
*(.uibss)
__uibss_end = .;
}
- __uibss_len = __uibss_end - __uibss_start;
+ __uibss_len = ABSOLUTE(__uibss_end) - ABSOLUTE(__uibss_start);
__uibss_dwords = (__uibss_len + 3) >> 2;
_end16 = .;
@@ -220,7 +220,7 @@
*(.auxseg)
__auxseg_end = .;
}
- __auxseg_len = __auxseg_end - __auxseg_start;
+ __auxseg_len = ABSOLUTE(__auxseg_end) - ABSOLUTE(__auxseg_start);
__auxseg_dwords = (__auxseg_len + 3) >> 2;
aux_seg = __auxseg_start >> 4;
@@ -232,12 +232,12 @@
*(.lowmem)
__lowmem_end = .;
}
- __lowmem_len = __lowmem_end - __lowmem_start;
+ __lowmem_len = ABSOLUTE(__lowmem_end) - ABSOLUTE(__lowmem_start);
__lowmem_dwords = (__lowmem_len + 3) >> 2;
__high_clear_end = .;
- __high_clear_len = __high_clear_end - __high_clear_start;
+ __high_clear_len = ABSOLUTE(__high_clear_end) - ABSOLUTE(__high_clear_start);
__high_clear_dwords = (__high_clear_len + 3) >> 2;
/* Start of the lowmem heap */
@@ -325,7 +325,7 @@
}
__pm_code_end = .;
- __pm_code_len = __pm_code_end - __pm_code_start;
+ __pm_code_len = ABSOLUTE(__pm_code_end) - ABSOLUTE(__pm_code_start);
__pm_code_dwords = (__pm_code_len + 3) >> 2;
. = ALIGN(128);
@@ -339,7 +339,7 @@
*(COMMON)
__bss_end = .;
}
- __bss_len = __bss_end - __bss_start;
+ __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
__bss_dwords = (__bss_len + 3) >> 2;
/* Very large objects which don't need to be zeroed */
@@ -352,7 +352,7 @@
*(.hugebss.*)
__hugebss_end = .;
}
- __hugebss_len = __hugebss_end - __hugebss_start;
+ __hugebss_len = ABSOLUTE(__hugebss_end) - ABSOLUTE(__hugebss_start);
__hugebss_dwords = (__hugebss_len + 3) >> 2;
@@ -364,7 +364,7 @@
*(.stack)
__stack_end = .;
}
- __stack_len = __stack_end - __stack_start;
+ __stack_len = ABSOLUTE(__stack_end) - ABSOLUTE(__stack_start);
__stack_dwords = (__stack_len + 3) >> 2;
_end = .;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/ui.inc
^
|
@@ -415,12 +415,10 @@
mov al,[VKernelBuf+vk_type]
mov [KernelType],al
-%if HAS_LOCALBOOT
; Is this a "localboot" pseudo-kernel?
cmp al,VK_LOCALBOOT ; al == KernelType
mov ax,[VKernelBuf+vk_rname] ; Possible localboot type
je local_boot
-%endif
jmp get_kernel
.not_vk:
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/core/writedec.inc
^
|
@@ -37,6 +37,7 @@
xor cx,cx ; Number of digits
.cloop:
+ mov edx,0
div ebx
inc cx
push dx
@@ -53,5 +54,5 @@
popad
ret
-writechr:
- ret
+; writechr:
+; ret
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag
^
|
+(directory)
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/Makefile
^
|
@@ -0,0 +1,4 @@
+SUBDIRS = mbr geodsp
+
+all tidy dist clean spotless install:
+ set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/README
^
|
@@ -0,0 +1,4 @@
+Diagnostic tools and images to assist with troubleshooting Syslinux-related issues. See README in each directory for more details.
+
+geodsp/ Display geometry/LBA translation as the BIOS detects it.
+mbr/ Diagnostic MBRs
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp
^
|
+(directory)
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp/Makefile
^
|
@@ -0,0 +1,64 @@
+## -----------------------------------------------------------------------
+##
+## 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 *.lst *.bin *_bin.c
+
+spotless: clean
+ rm -f $(BTARGET)
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp/README
^
|
@@ -0,0 +1,11 @@
+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).
+
+GeoDspMS can also be used to attempt to make the boot sector look like a normal file system's boot sector (ie FAT12/FAT16/FAT32). In order to do this, you must first save a portion the existing boot sector (the majority of the BIOS parameter block).
+ dd bs=1 skip=3 count=87 if=/dev/sda of=sda.bpb
+ dd conv=notrunc if=geodspms.img of=/dev/sda
+ dd conv=notrunc bs=1 seek=3 count=87 if=sda.bpb of=/dev/sda
+
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/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:
|
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp/geodsp1s.bin
^
|
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp/geodsp1s.img.xz
^
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp/geodsp1s.lst
^
|
@@ -0,0 +1,539 @@
+ 1 ; -----------------------------------------------------------------------
+ 2 ;
+ 3 ; Copyright 2010 Gene Cumm
+ 4 ;
+ 5 ; Portions from diskstart.inc:
+ 6 ; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
+ 7 ; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+ 8 ;
+ 9 ; This program is free software; you can redistribute it and/or modify
+ 10 ; it under the terms of the GNU General Public License as published by
+ 11 ; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ 12 ; Boston MA 02110-1301, USA; either version 2 of the License, or
+ 13 ; (at your option) any later version; incorporated herein by reference.
+ 14 ;
+ 15 ; -----------------------------------------------------------------------
+ 16
+ 17 ;
+ 18 ; geodsp1s.asm
+ 19 ;
+ 20 ; Display geometry translation info for diagnosing misconceptions
+ 21 ; 1 sector variant
+ 22 ;
+ 23 ; nasm -Ox -f bin -o geodsp.bin -l geodsp.lst geodsp.asm
+ 24 ;
+ 25 ; nasm -Ox -f elf -o geodsp.o -l geodsp.lst geodsp.asm
+ 26 ; ld -m elf_i386 -T syslinux.ld -M -o geodsp.elf geodsp.o > geodsp.map
+ 27 ; objcopy -O binary geodsp.elf geodsp.raw
+ 28 ;
+ 29 ; # OF=/dev/sdb
+ 30 ; # dd if=core/geodsp.bin of=$OF
+ 31 ; # dd skip=1 seek=1 if=../dbg/lba-img/lba-img.bin of=$OF
+ 32 ; # eject $OF
+ 33 ; # dd count=$() if=/dev/zero of=$OF
+ 34 ;
+ 35 ; # OF=geo-2.255.63.i
+ 36 ; # (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
+ 37 ; # OF=geo-20.16.63.i
+ 38 ; # (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
+ 39 ;
+ 40
+ 41 %include "macros.inc"
+ 42 <1> ;; -----------------------------------------------------------------------
+ 43 <1> ;;
+ 44 <1> ;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
+ 45 <1> ;; Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ 46 <1> ;;
+ 47 <1> ;; This program is free software; you can redistribute it and/or modify
+ 48 <1> ;; it under the terms of the GNU General Public License as published by
+ 49 <1> ;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ 50 <1> ;; Boston MA 02111-1307, USA; either version 2 of the License, or
+ 51 <1> ;; (at your option) any later version; incorporated herein by reference.
+ 52 <1> ;;
+ 53 <1> ;; -----------------------------------------------------------------------
+ 54 <1>
+ 55 <1> ;;
+ 56 <1> ;; macros.inc
+ 57 <1> ;;
+ 58 <1> ;; Convenient macros
+ 59 <1> ;;
+ 60 <1>
+ 61 <1> %ifndef _MACROS_INC
+ 62 <1> %define _MACROS_INC
+ 63 <1>
+ 64 <1> ;
+ 65 <1> ; Identify the module we're compiling; the "correct" should be defined
+ 66 <1> ; in the module itself to 1
+ 67 <1> ;
+ 68 <1> %ifdef IS_SYSLINUX
+ 69 <1> %define MY_NAME 'SYSLINUX'
+ 70 <1> %else
+ 71 <1> %define IS_SYSLINUX 0
+ 72 <1> %endif
+ 73 <1> %ifdef IS_PXELINUX
+ 74 <1> %define MY_NAME 'PXELINUX'
+ 75 <1> %else
+ 76 <1> %define IS_PXELINUX 0
+ 77 <1> %endif
+ 78 <1> %ifdef IS_ISOLINUX
+ 79 <1> %define MY_NAME 'ISOLINUX'
+ 80 <1> %else
+ 81 <1> %define IS_ISOLINUX 0
+ 82 <1> %endif
+ 83 <1> %ifdef IS_EXTLINUX
+ 84 <1> %define MY_NAME 'EXTLINUX'
+ 85 <1> %else
+ 86 <1> %define IS_EXTLINUX 0
+ 87 <1> %endif
+ 88 <1>
+ 89 <1> ;
+ 90 <1> ; Macros similar to res[bwd], but which works in the code segment (after
+ 91 <1> ; section .text16) or the data segment (section .data16)
+ 92 <1> ;
+ 93 <1> %macro zb 1.nolist
+ 94 <1> times %1 db 0
+ 95 <1> %endmacro
+ 96 <1>
+ 97 <1> %macro zw 1.nolist
+ 98 <1> times %1 dw 0
+ 99 <1> %endmacro
+ 100 <1>
+ 101 <1> %macro zd 1.nolist
+ 102 <1> times %1 dd 0
+ 103 <1> %endmacro
+ 104 <1>
+ 105 <1> ;
+ 106 <1> ; Align with zero bytes in a progbits segment
+ 107 <1> ;
+ 108 <1> %macro alignz 1.nolist
+ 109 <1> times (((%1) - (($-$$) % (%1))) % (%1)) db 0
+ 110 <1> %endmacro
+ 111 <1>
+ 112 <1> ;
+ 113 <1> ; Macro to emit an unsigned decimal number as a string
+ 114 <1> ;
+ 115 <1> %macro asciidec 1.nolist
+ 116 <1> %ifndef DEPEND ; Not safe for "depend"
+ 117 <1> %push asciidec
+ 118 <1> %assign %$v %1
+ 119 <1> %if %$v == 0
+ 120 <1> db '0'
+ 121 <1> %else
+ 122 <1> %assign %$dcount 0
+ 123 <1> %assign %$n %$v
+ 124 <1> %assign %$d 1
+ 125 <1> %rep 20
+ 126 <1> %if %$n != 0
+ 127 <1> %assign %$dcount %$dcount + 1
+ 128 <1> %assign %$n %$n / 10
+ 129 <1> %assign %$d %$d * 10
+ 130 <1> %endif
+ 131 <1> %endrep
+ 132 <1> %rep %$dcount
+ 133 <1> %assign %$d %$d / 10
+ 134 <1> db ((%$v / %$d) % 10) + '0'
+ 135 <1> %endrep
+ 136 <1> %endif
+ 137 <1> %pop
+ 138 <1> %endif
+ 139 <1> %endmacro
+ 140 <1>
+ 141 <1> ;
+ 142 <1> ; Macros for network byte order of constants
+ 143 <1> ;
+ 144 <1> %define htons(x) ( ( ((x) & 0FFh) << 8 ) + ( ((x) & 0FF00h) >> 8 ) )
+ 145 <1> %define ntohs(x) htons(x)
+ 146 <1> %define htonl(x) ( ( ((x) & 0FFh) << 24) + ( ((x) & 0FF00h) << 8 ) + ( ((x) & 0FF0000h) >> 8 ) + ( ((x) & 0FF000000h) >> 24) )
+ 147 <1> %define ntohl(x) htonl(x)
+ 148 <1>
+ 149 <1> ;
+ 150 <1> ; ASCII
+ 151 <1> ;
+ 152 <1> CR equ 13 ; Carriage Return
+ 153 <1> LF equ 10 ; Line Feed
+ 154 <1> FF equ 12 ; Form Feed
+ 155 <1> BS equ 8 ; Backspace
+ 156 <1>
+ 157 <1> %endif ; _MACROS_INC
+ 158 ; %include "layout.inc"
+ 159
+ 160 ; global STACK_LEN, STACK_TOP, STACK_BASE
+ 161 ; STACK_LEN equ 4096
+ 162 STACK_TOP equ 7c00h
+ 163 ; STACK_BASE equ STACK_TOP - STACK_LEN
+ 164
+ 165 StackBuf equ STACK_TOP-44-92 ; Start the stack here (grow down - 4K)
+ 166 DriveNumber equ StackBuf-4 ; Drive number
+ 167 m_CHS0 equ 00534843h ;'CHS',0
+ 168 m_EDD0 equ 00444445h ;'EDD',0
+ 169 m_EDD_SP equ 20444445h ;'EDD '
+ 170 retry_count equ 16
+ 171 dbuf equ 8000h
+ 172 int13_ret equ 7e00h
+ 173
+ 174
+ 175
+ 176 ; extern real_mode_seg
+ 177 ; section .real_mode write nobits align=65536
+ 178 ; global core_real_mode
+ 179 ; core_real_mode resb 65536
+ 180 ; extern xfer_buf_seg
+ 181 ; section .xfer_buf write nobits align=65536
+ 182 ; global core_xfer_buf
+ 183 ; core_xfer_buf resb 65536
+ 184
+ 185 section .text
+ 186 org STACK_TOP
+ 187
+ 188
+ 189 global _start
+ 190 bootsec equ $
+ 191 _start:
+ 192 ; In case we want to pull more of the standard diskstart stuff in
+ 193 ; jmp short start ; 2 bytes
+ 194 ; nop ; 1 byte
+ 195 start:
+ 196 00000000 FA cli
+ 197 00000001 FC cld
+ 198 00000002 31C9 xor cx,cx
+ 199 00000004 8ED1 mov ss,cx
+ 200 00000006 BC767B mov sp,StackBuf-2 ; Just below BSS (-2 for alignment)
+ 201 00000009 52 push dx ; Save drive number (in DL)
+ 202 ; Kill everything else and let the BIOS sort it out later
+ 203 0000000A 8EC1 mov es,cx
+ 204 0000000C 8ED9 mov ds,cx
+ 205 0000000E FB sti
+ 206
+ 207 get_geo: ; DL and ES ready
+ 208 0000000F B408 mov ah,08h
+ 209 00000011 BF0000 mov di,0
+ 210 00000014 CD13 int 13h
+ 211 write_geo:
+ 212 00000016 720E jc .bad_geo
+ 213 00000018 BE[A801] mov si,s_chs
+ 214 0000001B E8C700 call writestr_early
+ 215 0000001E E8F000 call write_chs
+ 216 00000021 E82F01 call crlf
+ 217 00000024 EB00 jmp short .done
+ 218 .bad_geo:
+ 219 .done:
+ 220
+ 221 00000026 BB0080 mov bx,dbuf
+ 222 get_h1c: ; 0,1,1
+ 223 00000029 B90100 mov cx,0001h
+ 224 0000002C B601 mov dh,01h
+ 225 0000002E E88D00 call getonesec_chs
+ 226 00000031 E8C000 call write_chs_lba
+ 227 get_c1c: ; 1,0,1
+ 228 00000034 B90101 mov cx,0101h
+ 229 00000037 B600 mov dh,00h
+ 230 00000039 E88200 call getonesec_chs
+ 231 0000003C E8B500 call write_chs_lba
+ 232
+ 233 ;
+ 234 ; Do we have EBIOS (EDD)?
+ 235 ;
+ 236 edd:
+ 237 .check:
+ 238 0000003F BBAA55 mov bx,55AAh
+ 239 00000042 B441 mov ah,41h ; EDD existence query
+ 240 00000044 8A16747B mov dl,[DriveNumber]
+ 241 00000048 CD13 int 13h
+ 242 0000004A 723F jc .noedd
+ 243 0000004C 81FB55AA cmp bx,0AA55h
+ 244 00000050 7539 jne .noedd
+ 245 00000052 F6C101 test cl,1 ; Extended disk access functionality set
+ 246 00000055 7434 jz .noedd
+ 247 ;
+ 248 ; We have EDD support...
+ 249 ;
+ 250 00000057 BB0080 mov bx,dbuf
+ 251 0000005A 6631D2 xor edx,edx
+ 252 0000005D 66C706[A801]454444- mov dword [s_chs],m_EDD_SP
+ 253 00000065 20
+ 254 .get_lba63:
+ 255 00000066 66B83F000000 mov eax,63 ; Same length as mov al,64; movzx eax,al
+ 256 0000006C E82400 call getonesec_ebios
+ 257 0000006F 721A jc .bad_edd ;read error
+ 258 00000071 E8C200 call write_edd_lba
+ 259 .get_lba16065:
+ 260 00000074 66B8C13E0000 mov eax,16065
+ 261 0000007A E81600 call getonesec_ebios
+ 262 0000007D 720C jc .bad_edd ;read error
+ 263 0000007F E8B400 call write_edd_lba
+ 264 .good_edd:
+ 265 00000082 66C706[AF01]454444- mov dword [s_type],m_EDD0
+ 266 0000008A 00
+ 267 .bad_edd:
+ 268 .noedd:
+ 269 .end:
+ 270
+ 271 write_final_type:
+ 272 0000008B BE[AD01] mov si,s_typespec
+ 273 0000008E E85400 call writestr_early
+ 274
+ 275 00000091 EB38 jmp short kaboom
+ 276
+ 277 ;
+ 278 ; getonesec_ebios:
+ 279 ;
+ 280 ; getonesec implementation for EBIOS (EDD)
+ 281 ;
+ 282 getonesec_ebios:
+ 283 00000093 B91000 mov cx,retry_count
+ 284 .retry:
+ 285 ; Form DAPA on stack
+ 286 00000096 6652 push edx
+ 287 00000098 6650 push eax
+ 288 0000009A 06 push es
+ 289 0000009B 53 push bx
+ 290 0000009C 6A01 push word 1
+ 291 0000009E 6A10 push word 16
+ 292 000000A0 89E6 mov si,sp
+ 293 000000A2 6660 pushad
+ 294 000000A4 B442 mov ah,42h ; Extended Read
+ 295 000000A6 E83200 call xint13
+ 296 000000A9 6661 popad
+ 297 000000AB 8D6410 lea sp,[si+16] ; Remove DAPA
+ 298 000000AE 7201 jc .error
+ 299 000000B0 C3 ret
+ 300
+ 301 .error:
+ 302 ; Some systems seem to get "stuck" in an error state when
+ 303 ; using EBIOS. Doesn't happen when using CBIOS, which is
+ 304 ; good, since some other systems get timeout failures
+ 305 ; waiting for the floppy disk to spin up.
+ 306
+ 307 000000B1 6660 pushad ; Try resetting the device
+ 308 000000B3 31C0 xor ax,ax
+ 309 000000B5 E82300 call xint13
+ 310 000000B8 6661 popad
+ 311 000000BA E2DA loop .retry ; CX-- and jump if not zero
+ 312
+ 313 ; Total failure.
+ 314 000000BC F9 stc
+ 315 000000BD C3 ret
+ 316
+ 317 ;
+ 318 ; getonesec_chs:
+ 319 ;
+ 320 ; CX,DH specifies CHS address
+ 321 ;
+ 322 getonesec_chs: ; We could use an xchg and get a loop
+ 323 ; mov cx,retry_count
+ 324 .retry:
+ 325 000000BE 6660 pushad
+ 326 000000C0 B80102 mov ax,0201h ; Read one sector
+ 327 000000C3 E81500 call xint13
+ 328 000000C6 6661 popad
+ 329 000000C8 7201 jc .error
+ 330 000000CA C3 ret
+ 331
+ 332 .error:
+ 333 ; loop .retry
+ 334 ; Fall through to disk_error
+ 335 ;
+ 336 ; kaboom: write a message and bail out.
+ 337 ;
+ 338 global kaboom
+ 339 disk_error:
+ 340 kaboom:
+ 341 .patch:
+ 342 000000CB BE[B301] mov si,bailmsg
+ 343 000000CE E81400 call writestr_early
+ 344 000000D1 6631C0 xor eax,eax
+ 345 000000D4 CD16 .again: int 16h ; Wait for keypress
+ 346 ; NB: replaced by int 18h if
+ 347 ; chosen at install time..
+ 348 000000D6 CD19 int 19h ; And try once more to boot...
+ 349 000000D8 F4 .norge: hlt ; If int 19h returned; this is the end
+ 350 000000D9 EBFD jmp short .norge
+ 351
+ 352 ;
+ 353 ; INT 13h wrapper function
+ 354 ;
+ 355 xint13:
+ 356 000000DB 8A16747B mov dl,[DriveNumber]
+ 357 000000DF CD13 int 13h
+ 358 000000E1 A3007E mov [int13_ret],ax
+ 359 000000E4 C3 ret
+ 360
+ 361 ;
+ 362 ;
+ 363 ; writestr_early: write a null-terminated string to the console
+ 364 ; This assumes we're on page 0. This is only used for early
+ 365 ; messages, so it should be OK.
+ 366 ;
+ 367 writestr_early:
+ 368 000000E5 6660 pushad
+ 369 000000E7 AC .loop: lodsb
+ 370 000000E8 20C0 and al,al
+ 371 000000EA 7405 jz .return
+ 372 000000EC E86D00 call writechr
+ 373 000000EF EBF6 jmp short .loop
+ 374 000000F1 6661 .return: popad
+ 375 000000F3 C3 ret
+ 376
+ 377 %include "geodsplib.inc"
+ 378 <1> ; -----------------------------------------------------------------------
+ 379 <1> ;
+ 380 <1> ; Copyright 2010 Gene Cumm
+ 381 <1> ;
+ 382 <1> ; Portions from diskstart.inc:
+ 383 <1> ; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
+ 384 <1> ; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+ 385 <1> ;
+ 386 <1> ; This program is free software; you can redistribute it and/or modify
+ 387 <1> ; it under the terms of the GNU General Public License as published by
+ 388 <1> ; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ 389 <1> ; Boston MA 02110-1301, USA; either version 2 of the License, or
+ 390 <1> ; (at your option) any later version; incorporated herein by reference.
+ 391 <1> ;
+ 392 <1> ; -----------------------------------------------------------------------
+ 393 <1>
+ 394 <1> ;
+ 395 <1> ; geodsplib.inc
+ 396 <1> ;
+ 397 <1> ; Library file for geodsp*.asm
+ 398 <1> ;
+ 399 <1>
+ 400 <1> ; ES:BX points to the buffer with address
+ 401 <1> ; DX,CX as they should be for INT13h,AH=02
+ 402 <1> ; For now assume C<256
+ 403 <1> write_chs_lba:
+ 404 000000F4 6660 <1> pushad
+ 405 000000F6 BE[A701] <1> mov si,s_atchs
+ 406 000000F9 E8E9FF <1> call writestr_early
+ 407 000000FC E81200 <1> call write_chs
+ 408 000000FF B03A <1> mov al,':'
+ 409 00000101 E85800 <1> call writechr
+ 410 00000104 26668B07 <1> mov eax,[es:bx]
+ 411 00000108 E87700 <1> call writehex8
+ 412 0000010B E84500 <1> call crlf
+ 413 0000010E 6661 <1> popad
+ 414 00000110 C3 <1> ret
+ 415 <1>
+ 416 <1> ; DX,CX as they should be for INT13h,AH=02
+ 417 <1> ; For now assume C<256
+ 418 <1> write_chs:
+ 419 00000111 6660 <1> pushad
+ 420 00000113 88E8 <1> mov al,ch
+ 421 00000115 88CC <1> mov ah,cl
+ 422 00000117 C0EC06 <1> shr ah,6
+ 423 0000011A E85800 <1> call writehex4
+ 424 0000011D B02C <1> mov al,','
+ 425 0000011F E83A00 <1> call writechr
+ 426 00000122 88F0 <1> mov al,dh
+ 427 00000124 E84100 <1> call writehex2
+ 428 00000127 B02C <1> mov al,','
+ 429 00000129 E83000 <1> call writechr
+ 430 0000012C 88C8 <1> mov al,cl
+ 431 0000012E 243F <1> and al,3Fh
+ 432 00000130 E83500 <1> call writehex2
+ 433 00000133 6661 <1> popad
+ 434 00000135 C3 <1> ret
+ 435 <1>
+ 436 <1> write_edd_lba:
+ 437 00000136 6660 <1> pushad
+ 438 00000138 BE[A701] <1> mov si,s_atchs
+ 439 0000013B E8A7FF <1> call writestr_early
+ 440 0000013E E84100 <1> call writehex8
+ 441 00000141 B03A <1> mov al,':'
+ 442 00000143 E81600 <1> call writechr
+ 443 00000146 26668B07 <1> mov eax,[es:bx]
+ 444 0000014A E83500 <1> call writehex8
+ 445 0000014D E80300 <1> call crlf
+ 446 00000150 6661 <1> popad
+ 447 00000152 C3 <1> ret
+ 448 <1>
+ 449 <1>
+ 450 <1> crlf:
+ 451 00000153 56 <1> push si
+ 452 00000154 BE[B801] <1> mov si,s_crlf
+ 453 00000157 E88BFF <1> call writestr_early
+ 454 0000015A 5E <1> pop si
+ 455 0000015B C3 <1> ret
+ 456 <1>
+ 457 <1> writechr:
+ 458 <1> writechr_early:
+ 459 0000015C 6660 <1> pushad
+ 460 0000015E B40E <1> mov ah,0Eh ; Write to screen as TTY
+ 461 00000160 BB0700 <1> mov bx,0007h ; Attribute
+ 462 00000163 CD10 <1> int 10h
+ 463 00000165 6661 <1> popad
+ 464 00000167 C3 <1> ret
+ 465 <1>
+ 466 <1> %include "writehex.inc"
+ 467 <2> ;; -----------------------------------------------------------------------
+ 468 <2> ;;
+ 469 <2> ;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
+ 470 <2> ;;
+ 471 <2> ;; This program is free software; you can redistribute it and/or modify
+ 472 <2> ;; it under the terms of the GNU General Public License as published by
+ 473 <2> ;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ 474 <2> ;; Boston MA 02111-1307, USA; either version 2 of the License, or
+ 475 <2> ;; (at your option) any later version; incorporated herein by reference.
+ 476 <2> ;;
+ 477 <2> ;; -----------------------------------------------------------------------
+ 478 <2>
+ 479 <2> ;;
+ 480 <2> ;; writehex.inc
+ 481 <2> ;;
+ 482 <2> ;; Write hexadecimal numbers to the console
+ 483 <2> ;;
+ 484 <2>
+ 485 <2> ;
+ 486 <2> ; writehex[248]: Write a hex number in (AL, AX, EAX) to the console
+ 487 <2> ;
+ 488 <2> writehex2:
+ 489 00000168 669C <2> pushfd
+ 490 0000016A 6660 <2> pushad
+ 491 0000016C 66C1C018 <2> rol eax,24
+ 492 00000170 B90200 <2> mov cx,2
+ 493 00000173 EB14 <2> jmp short writehex_common
+ 494 <2> writehex4:
+ 495 00000175 669C <2> pushfd
+ 496 00000177 6660 <2> pushad
+ 497 00000179 66C1C010 <2> rol eax,16
+ 498 0000017D B90400 <2> mov cx,4
+ 499 00000180 EB07 <2> jmp short writehex_common
+ 500 <2> writehex8:
+ 501 00000182 669C <2> pushfd
+ 502 00000184 6660 <2> pushad
+ 503 00000186 B90800 <2> mov cx,8
+ 504 <2> writehex_common:
+ 505 00000189 66C1C004 <2> .loop: rol eax,4
+ 506 0000018D 6650 <2> push eax
+ 507 0000018F 240F <2> and al,0Fh
+ 508 00000191 3C0A <2> cmp al,10
+ 509 00000193 7304 <2> jae .high
+ 510 00000195 0430 <2> .low: add al,'0'
+ 511 00000197 EB02 <2> jmp short .ischar
+ 512 00000199 0437 <2> .high: add al,'A'-10
+ 513 0000019B E8BEFF <2> .ischar: call writechr
+ 514 0000019E 6658 <2> pop eax
+ 515 000001A0 E2E7 <2> loop .loop
+ 516 000001A2 6661 <2> popad
+ 517 000001A4 669D <2> popfd
+ 518 000001A6 C3 <2> ret
+ 519 <1>
+ 520 000001A7 40 <1> s_atchs: db '@'
+ 521 000001A8 434853 <1> s_chs: db 'CHS'
+ 522 000001AB 2000 <1> s_space: db ' ', 0
+ 523 000001AD 443D <1> s_typespec: db 'D='
+ 524 000001AF 43485300 <1> s_type: db 'CHS', 0
+ 525 000001B3 0D0A656E64 <1> s_end: db 0Dh, 0Ah, 'end'
+ 526 000001B8 0D0A00 <1> s_crlf: db 0Dh, 0Ah, 0
+ 527 <1>
+ 528 <1> ; This indicates the general format of the last few bytes in the boot sector
+ 529 <1> BS_MAGIC_VER equ 0x1b << 9
+ 530 bailmsg equ s_end
+ 531
+ 532 ; This fails if the boot sector overflowsg
+ 533 000001BB 00<rept> zb 1BEh-($-$$)
+ 534
+ 535 000001BE 00<rept> ptable zb 40h ; Partition table
+ 536
+ 537 000001FE 55AA bootsignature dw 0xAA55
+ 538
+ 539 sector_2:
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/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
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/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
|
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp/geodspms.bin
^
|
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp/geodspms.img.xz
^
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp/geodspms.lst
^
|
@@ -0,0 +1,943 @@
+ 1 ; -----------------------------------------------------------------------
+ 2 ;
+ 3 ; Copyright 2010 Gene Cumm
+ 4 ;
+ 5 ; Portions from diskstart.inc:
+ 6 ; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
+ 7 ; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+ 8 ;
+ 9 ; This program is free software; you can redistribute it and/or modify
+ 10 ; it under the terms of the GNU General Public License as published by
+ 11 ; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ 12 ; Boston MA 02110-1301, USA; either version 2 of the License, or
+ 13 ; (at your option) any later version; incorporated herein by reference.
+ 14 ;
+ 15 ; -----------------------------------------------------------------------
+ 16
+ 17 ;
+ 18 ; geodspms.asm
+ 19 ;
+ 20 ; Display geometry translation info for diagnosing misconceptions
+ 21 ; multi-sector variant
+ 22 ;
+ 23 ; nasm -Ox -f bin -o geodsp.bin -l geodsp.lst geodsp.asm
+ 24 ;
+ 25 ; nasm -Ox -f elf -o geodsp.o -l geodsp.lst geodsp.asm
+ 26 ; ld -m elf_i386 -T syslinux.ld -M -o geodsp.elf geodsp.o > geodsp.map
+ 27 ; objcopy -O binary geodsp.elf geodsp.raw
+ 28 ;
+ 29 ; # OF=/dev/sdb
+ 30 ; # dd if=core/geodsp.bin of=$OF
+ 31 ; # dd skip=1 seek=1 if=../dbg/lba-img/lba-img.bin of=$OF
+ 32 ; # eject $OF
+ 33 ; # dd count=$() if=/dev/zero of=$OF
+ 34 ;
+ 35 ; # OF=geo-2.255.63.i
+ 36 ; # (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
+ 37 ; # OF=geo-20.16.63.i
+ 38 ; # (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
+ 39 ;
+ 40
+ 41 ; Just to define it to look like SYSLINUX
+ 42 %define IS_SYSLINUX 1
+ 43
+ 44 %include "macros.inc"
+ 45 <1> ;; -----------------------------------------------------------------------
+ 46 <1> ;;
+ 47 <1> ;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
+ 48 <1> ;; Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ 49 <1> ;;
+ 50 <1> ;; This program is free software; you can redistribute it and/or modify
+ 51 <1> ;; it under the terms of the GNU General Public License as published by
+ 52 <1> ;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ 53 <1> ;; Boston MA 02111-1307, USA; either version 2 of the License, or
+ 54 <1> ;; (at your option) any later version; incorporated herein by reference.
+ 55 <1> ;;
+ 56 <1> ;; -----------------------------------------------------------------------
+ 57 <1>
+ 58 <1> ;;
+ 59 <1> ;; macros.inc
+ 60 <1> ;;
+ 61 <1> ;; Convenient macros
+ 62 <1> ;;
+ 63 <1>
+ 64 <1> %ifndef _MACROS_INC
+ 65 <1> %define _MACROS_INC
+ 66 <1>
+ 67 <1> ;
+ 68 <1> ; Identify the module we're compiling; the "correct" should be defined
+ 69 <1> ; in the module itself to 1
+ 70 <1> ;
+ 71 <1> %ifdef IS_SYSLINUX
+ 72 <1> %define MY_NAME 'SYSLINUX'
+ 73 <1> %else
+ 74 <1> %define IS_SYSLINUX 0
+ 75 <1> %endif
+ 76 <1> %ifdef IS_PXELINUX
+ 77 <1> %define MY_NAME 'PXELINUX'
+ 78 <1> %else
+ 79 <1> %define IS_PXELINUX 0
+ 80 <1> %endif
+ 81 <1> %ifdef IS_ISOLINUX
+ 82 <1> %define MY_NAME 'ISOLINUX'
+ 83 <1> %else
+ 84 <1> %define IS_ISOLINUX 0
+ 85 <1> %endif
+ 86 <1> %ifdef IS_EXTLINUX
+ 87 <1> %define MY_NAME 'EXTLINUX'
+ 88 <1> %else
+ 89 <1> %define IS_EXTLINUX 0
+ 90 <1> %endif
+ 91 <1>
+ 92 <1> ;
+ 93 <1> ; Macros similar to res[bwd], but which works in the code segment (after
+ 94 <1> ; section .text16) or the data segment (section .data16)
+ 95 <1> ;
+ 96 <1> %macro zb 1.nolist
+ 97 <1> times %1 db 0
+ 98 <1> %endmacro
+ 99 <1>
+ 100 <1> %macro zw 1.nolist
+ 101 <1> times %1 dw 0
+ 102 <1> %endmacro
+ 103 <1>
+ 104 <1> %macro zd 1.nolist
+ 105 <1> times %1 dd 0
+ 106 <1> %endmacro
+ 107 <1>
+ 108 <1> ;
+ 109 <1> ; Align with zero bytes in a progbits segment
+ 110 <1> ;
+ 111 <1> %macro alignz 1.nolist
+ 112 <1> times (((%1) - (($-$$) % (%1))) % (%1)) db 0
+ 113 <1> %endmacro
+ 114 <1>
+ 115 <1> ;
+ 116 <1> ; Macro to emit an unsigned decimal number as a string
+ 117 <1> ;
+ 118 <1> %macro asciidec 1.nolist
+ 119 <1> %ifndef DEPEND ; Not safe for "depend"
+ 120 <1> %push asciidec
+ 121 <1> %assign %$v %1
+ 122 <1> %if %$v == 0
+ 123 <1> db '0'
+ 124 <1> %else
+ 125 <1> %assign %$dcount 0
+ 126 <1> %assign %$n %$v
+ 127 <1> %assign %$d 1
+ 128 <1> %rep 20
+ 129 <1> %if %$n != 0
+ 130 <1> %assign %$dcount %$dcount + 1
+ 131 <1> %assign %$n %$n / 10
+ 132 <1> %assign %$d %$d * 10
+ 133 <1> %endif
+ 134 <1> %endrep
+ 135 <1> %rep %$dcount
+ 136 <1> %assign %$d %$d / 10
+ 137 <1> db ((%$v / %$d) % 10) + '0'
+ 138 <1> %endrep
+ 139 <1> %endif
+ 140 <1> %pop
+ 141 <1> %endif
+ 142 <1> %endmacro
+ 143 <1>
+ 144 <1> ;
+ 145 <1> ; Macros for network byte order of constants
+ 146 <1> ;
+ 147 <1> %define htons(x) ( ( ((x) & 0FFh) << 8 ) + ( ((x) & 0FF00h) >> 8 ) )
+ 148 <1> %define ntohs(x) htons(x)
+ 149 <1> %define htonl(x) ( ( ((x) & 0FFh) << 24) + ( ((x) & 0FF00h) << 8 ) + ( ((x) & 0FF0000h) >> 8 ) + ( ((x) & 0FF000000h) >> 24) )
+ 150 <1> %define ntohl(x) htonl(x)
+ 151 <1>
+ 152 <1> ;
+ 153 <1> ; ASCII
+ 154 <1> ;
+ 155 <1> CR equ 13 ; Carriage Return
+ 156 <1> LF equ 10 ; Line Feed
+ 157 <1> FF equ 12 ; Form Feed
+ 158 <1> BS equ 8 ; Backspace
+ 159 <1>
+ 160 <1> %endif ; _MACROS_INC
+ 161 ; %include "layout.inc"
+ 162
+ 163 m_CHS0 equ 00534843h ;'CHS',0
+ 164 m_EDD0 equ 00444445h ;'EDD',0
+ 165 m_EDD_SP equ 20444445h ;'EDD '
+ 166 retry_count equ 16
+ 167 dbuf equ 8000h
+ 168 ; int13_ret equ 7e00h
+ 169 LDLINUX_MAGIC equ 0x3eb202fe ; A random number to identify ourselves with
+ 170
+ 171 Sect1Ptr0_VAL equ 1
+ 172 Sect1Ptr1_VAL equ 0
+ 173
+ 174 ; global STACK_LEN, STACK_TOP, STACK_BASE
+ 175 ; STACK_LEN equ 4096
+ 176 STACK_TOP equ 7c00h
+ 177 ; STACK_BASE equ STACK_TOP - STACK_LEN
+ 178 section .init
+ 179 org STACK_TOP
+ 180 geodsp_start:
+ 181
+ 182 %include "diskboot.inc"
+ 183 <1> ; -----------------------------------------------------------------------
+ 184 <1> ;
+ 185 <1> ; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
+ 186 <1> ; Copyright 2009-2011 Intel Corporation; author: H. Peter Anvin
+ 187 <1> ;
+ 188 <1> ; This program is free software; you can redistribute it and/or modify
+ 189 <1> ; it under the terms of the GNU General Public License as published by
+ 190 <1> ; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ 191 <1> ; Boston MA 02110-1301, USA; either version 2 of the License, or
+ 192 <1> ; (at your option) any later version; incorporated herein by reference.
+ 193 <1> ;
+ 194 <1> ; -----------------------------------------------------------------------
+ 195 <1>
+ 196 <1> ;
+ 197 <1> ; diskboot.inc
+ 198 <1> ;
+ 199 <1> ; Common boot sector code for harddisk-based Syslinux derivatives.
+ 200 <1> ;
+ 201 <1> ; Requires macros z[bwd], labels ldlinux_ent, ldlinux_magic, ldlinux_sys
+ 202 <1> ; and constants BS_MAGIC_VER, LDLINUX_MAGIC, retry_count, Sect1Ptr[01]_VAL,
+ 203 <1> ; STACK_TOP
+ 204 <1> ;
+ 205 <1>
+ 206 <1> section .init
+ 207 <1> ;
+ 208 <1> ; Some of the things that have to be saved very early are saved
+ 209 <1> ; "close" to the initial stack pointer offset, in order to
+ 210 <1> ; reduce the code size...
+ 211 <1> ;
+ 212 <1>
+ 213 <1> StackBuf equ STACK_TOP-44-92 ; Start the stack here (grow down - 4K)
+ 214 <1> PartInfo equ StackBuf
+ 215 <1> .mbr equ PartInfo
+ 216 <1> .gptlen equ PartInfo+16
+ 217 <1> .gpt equ PartInfo+20
+ 218 <1> FloppyTable equ PartInfo+76
+ 219 <1> ; Total size of PartInfo + FloppyTable == 76+16 = 92 bytes
+ 220 <1> Hidden equ StackBuf-24 ; Partition offset (qword)
+ 221 <1> OrigFDCTabPtr equ StackBuf-16 ; Original FDC table
+ 222 <1> OrigDSSI equ StackBuf-12 ; DS:SI -> partinfo
+ 223 <1> OrigESDI equ StackBuf-8 ; ES:DI -> $PnP structure
+ 224 <1> DriveNumber equ StackBuf-4 ; Drive number
+ 225 <1> StackHome equ Hidden ; The start of the canonical stack
+ 226 <1>
+ 227 <1> ;
+ 228 <1> ; Primary entry point. Tempting as though it may be, we can't put the
+ 229 <1> ; initial "cli" here; the jmp opcode in the first byte is part of the
+ 230 <1> ; "magic number" (using the term very loosely) for the DOS superblock.
+ 231 <1> ;
+ 232 <1> bootsec equ $
+ 233 00000000 EB58 <1> _start: jmp short start ; 2 bytes
+ 234 00000002 90 <1> nop ; 1 byte
+ 235 <1> ;
+ 236 <1> ; "Superblock" follows -- it's in the boot sector, so it's already
+ 237 <1> ; loaded and ready for us
+ 238 <1> ;
+ 239 00000003 5359534C494E5558 <1> bsOemName db MY_NAME ; The SYS command sets this, so...
+ 240 <1> zb 8-($-bsOemName)
+ 241 <1>
+ 242 <1> ;
+ 243 <1> ; These are the fields we actually care about. We end up expanding them
+ 244 <1> ; all to dword size early in the code, so generate labels for both
+ 245 <1> ; the expanded and unexpanded versions.
+ 246 <1> ;
+ 247 <1> %macro superb 1
+ 248 <1> bx %+ %1 equ SuperInfo+($-superblock)*8+4
+ 249 <1> bs %+ %1 equ $
+ 250 <1> zb 1
+ 251 <1> %endmacro
+ 252 <1> %macro superw 1
+ 253 <1> bx %+ %1 equ SuperInfo+($-superblock)*8
+ 254 <1> bs %+ %1 equ $
+ 255 <1> zw 1
+ 256 <1> %endmacro
+ 257 <1> %macro superd 1
+ 258 <1> bx %+ %1 equ $ ; no expansion for dwords
+ 259 <1> bs %+ %1 equ $
+ 260 <1> zd 1
+ 261 <1> %endmacro
+ 262 <1> superblock equ $
+ 263 <1> superw BytesPerSec
+ 264 <2> bx %+ %1 equ SuperInfo+($-superblock)*8
+ 265 <2> bs %+ %1 equ $
+ 266 0000000B 0000 <2> zw 1
+ 267 <1> superb SecPerClust
+ 268 <2> bx %+ %1 equ SuperInfo+($-superblock)*8+4
+ 269 <2> bs %+ %1 equ $
+ 270 0000000D 00 <2> zb 1
+ 271 <1> superw ResSectors
+ 272 <2> bx %+ %1 equ SuperInfo+($-superblock)*8
+ 273 <2> bs %+ %1 equ $
+ 274 0000000E 0000 <2> zw 1
+ 275 <1> superb FATs
+ 276 <2> bx %+ %1 equ SuperInfo+($-superblock)*8+4
+ 277 <2> bs %+ %1 equ $
+ 278 00000010 00 <2> zb 1
+ 279 <1> superw RootDirEnts
+ 280 <2> bx %+ %1 equ SuperInfo+($-superblock)*8
+ 281 <2> bs %+ %1 equ $
+ 282 00000011 0000 <2> zw 1
+ 283 <1> superw Sectors
+ 284 <2> bx %+ %1 equ SuperInfo+($-superblock)*8
+ 285 <2> bs %+ %1 equ $
+ 286 00000013 0000 <2> zw 1
+ 287 <1> superb Media
+ 288 <2> bx %+ %1 equ SuperInfo+($-superblock)*8+4
+ 289 <2> bs %+ %1 equ $
+ 290 00000015 00 <2> zb 1
+ 291 <1> superw FATsecs
+ 292 <2> bx %+ %1 equ SuperInfo+($-superblock)*8
+ 293 <2> bs %+ %1 equ $
+ 294 00000016 0000 <2> zw 1
+ 295 <1> superw SecPerTrack
+ 296 <2> bx %+ %1 equ SuperInfo+($-superblock)*8
+ 297 <2> bs %+ %1 equ $
+ 298 00000018 0000 <2> zw 1
+ 299 <1> superw Heads
+ 300 <2> bx %+ %1 equ SuperInfo+($-superblock)*8
+ 301 <2> bs %+ %1 equ $
+ 302 0000001A 0000 <2> zw 1
+ 303 <1> superinfo_size equ ($-superblock)-1 ; How much to expand
+ 304 <1> superd Hidden
+ 305 <2> bx %+ %1 equ $
+ 306 <2> bs %+ %1 equ $
+ 307 0000001C 00000000 <2> zd 1
+ 308 <1> superd HugeSectors
+ 309 <2> bx %+ %1 equ $
+ 310 <2> bs %+ %1 equ $
+ 311 00000020 00000000 <2> zd 1
+ 312 <1> ;
+ 313 <1> ; This is as far as FAT12/16 and FAT32 are consistent
+ 314 <1> ;
+ 315 <1> ; FAT12/16 need 26 more bytes,
+ 316 <1> ; FAT32 need 54 more bytes
+ 317 <1> ;
+ 318 <1> superblock_len_fat16 equ $-superblock+26
+ 319 <1> superblock_len_fat32 equ $-superblock+54
+ 320 00000024 00<rept> <1> zb 54 ; Maximum needed size
+ 321 <1> superblock_max equ $-superblock
+ 322 <1>
+ 323 <1> global SecPerClust
+ 324 <1> SecPerClust equ bxSecPerClust
+ 325 <1>
+ 326 <1> ;
+ 327 <1> ; Note we don't check the constraints above now; we did that at install
+ 328 <1> ; time (we hope!)
+ 329 <1> ;
+ 330 <1> start:
+ 331 0000005A FA <1> cli ; No interrupts yet, please
+ 332 0000005B FC <1> cld ; Copy upwards
+ 333 <1> ;
+ 334 <1> ; Set up the stack
+ 335 <1> ;
+ 336 0000005C 31C9 <1> xor cx,cx
+ 337 0000005E 8ED1 <1> mov ss,cx
+ 338 00000060 BC767B <1> mov sp,StackBuf-2 ; Just below BSS (-2 for alignment)
+ 339 00000063 52 <1> push dx ; Save drive number (in DL)
+ 340 00000064 06 <1> push es ; Save initial ES:DI -> $PnP pointer
+ 341 00000065 57 <1> push di
+ 342 00000066 1E <1> push ds ; Save original DS:SI -> partinfo
+ 343 00000067 56 <1> push si
+ 344 00000068 8EC1 <1> mov es,cx
+ 345 <1>
+ 346 <1> ;
+ 347 <1> ; DS:SI may contain a partition table entry and possibly a GPT entry.
+ 348 <1> ; Preserve it for us. This saves 56 bytes of the GPT entry, which is
+ 349 <1> ; currently the maximum we care about. Total is 76 bytes.
+ 350 <1> ;
+ 351 0000006A B126 <1> mov cl,(16+4+56)/2 ; Save partition info
+ 352 0000006C BF787B <1> mov di,PartInfo
+ 353 0000006F F3A5 <1> rep movsw ; This puts CX back to zero
+ 354 <1>
+ 355 00000071 8ED9 <1> mov ds,cx ; Now we can initialize DS...
+ 356 <1>
+ 357 <1> ;
+ 358 <1> ; Now sautee the BIOS floppy info block to that it will support decent-
+ 359 <1> ; size transfers; the floppy block is 11 bytes and is stored in the
+ 360 <1> ; INT 1Eh vector (brilliant waste of resources, eh?)
+ 361 <1> ;
+ 362 <1> ; Of course, if BIOSes had been properly programmed, we wouldn't have
+ 363 <1> ; had to waste precious space with this code.
+ 364 <1> ;
+ 365 00000073 BB7800 <1> mov bx,fdctab
+ 366 00000076 0FB437 <1> lfs si,[bx] ; FS:SI -> original fdctab
+ 367 00000079 0FA0 <1> push fs ; Save on stack in case we need to bail
+ 368 0000007B 56 <1> push si
+ 369 <1>
+ 370 <1> ; Save the old fdctab even if hard disk so the stack layout
+ 371 <1> ; is the same. The instructions above do not change the flags
+ 372 0000007C 20D2 <1> and dl,dl ; If floppy disk (00-7F), assume no
+ 373 <1> ; partition table
+ 374 0000007E 781B <1> js harddisk
+ 375 <1>
+ 376 <1> floppy:
+ 377 00000080 31C0 <1> xor ax,ax
+ 378 00000082 B106 <1> mov cl,6 ; 12 bytes (CX == 0)
+ 379 <1> ; es:di -> FloppyTable already
+ 380 <1> ; This should be safe to do now, interrupts are off...
+ 381 00000084 893F <1> mov [bx],di ; FloppyTable
+ 382 00000086 894702 <1> mov [bx+2],ax ; Segment 0
+ 383 00000089 F364A5 <1> fs rep movsw ; Faster to move words
+ 384 0000008C 8A0E[1800] <1> mov cl,[bsSecPerTrack] ; Patch the sector count
+ 385 00000090 884DF8 <1> mov [di-12+4],cl
+ 386 <1>
+ 387 00000093 50 <1> push ax ; Partition offset == 0
+ 388 00000094 50 <1> push ax
+ 389 00000095 50 <1> push ax
+ 390 00000096 50 <1> push ax
+ 391 <1>
+ 392 00000097 CD13 <1> int 13h ; Some BIOSes need this
+ 393 <1> ; Using xint13 costs +1B
+ 394 00000099 EB62 <1> jmp short not_harddisk
+ 395 <1> ;
+ 396 <1> ; The drive number and possibly partition information was passed to us
+ 397 <1> ; by the BIOS or previous boot loader (MBR). Current "best practice" is to
+ 398 <1> ; trust that rather than what the superblock contains.
+ 399 <1> ;
+ 400 <1> ; Note: di points to beyond the end of PartInfo
+ 401 <1> ; Note: false negatives might slip through the handover area's sanity checks,
+ 402 <1> ; if the region is very close (less than a paragraph) to
+ 403 <1> ; PartInfo ; no false positives are possible though
+ 404 <1> ;
+ 405 <1> harddisk:
+ 406 0000009B 8B55AA <1> mov dx,[di-76-10] ; Original DS
+ 407 0000009E 8B75A8 <1> mov si,[di-76-12] ; Original SI
+ 408 000000A1 C1EE04 <1> shr si,4
+ 409 000000A4 01F2 <1> add dx,si
+ 410 000000A6 83FA4F <1> cmp dx,4fh ; DS:SI < 50h:0 (BDA or IVT) ?
+ 411 000000A9 7631 <1> jbe .no_partition
+ 412 000000AB 81FAB207 <1> cmp dx,(PartInfo-75)>>4 ; DS:SI in overwritten memory?
+ 413 000000AF 732B <1> jae .no_partition
+ 414 000000B1 F645B47F <1> test byte [di-76],7Fh ; Sanity check: "active flag" should
+ 415 000000B5 7525 <1> jnz .no_partition ; be 00 or 80
+ 416 000000B7 384DB8 <1> cmp [di-76+4],cl ; Sanity check: partition type != 0
+ 417 000000BA 7420 <1> je .no_partition
+ 418 000000BC 663D21475054 <1> cmp eax,'!GPT' ; !GPT signature?
+ 419 000000C2 7510 <1> jne .mbr
+ 420 000000C4 807DB8ED <1> cmp byte [di-76+4],0EDh ; Synthetic GPT partition entry?
+ 421 000000C8 750A <1> jne .mbr
+ 422 <1> .gpt: ; GPT-style partition info
+ 423 000000CA 66FF75EC <1> push dword [di-76+20+36]
+ 424 000000CE 66FF75E8 <1> push dword [di-76+20+32]
+ 425 000000D2 EB0F <1> jmp .gotoffs
+ 426 <1> .mbr: ; MBR-style partition info
+ 427 000000D4 51 <1> push cx ; Upper half partition offset == 0
+ 428 000000D5 51 <1> push cx
+ 429 000000D6 66FF75BC <1> push dword [di-76+8] ; Partition offset (dword)
+ 430 000000DA EB07 <1> jmp .gotoffs
+ 431 <1> .no_partition:
+ 432 <1> ;
+ 433 <1> ; No partition table given... assume that the Hidden field in the boot sector
+ 434 <1> ; tells the truth (in particular, is zero if this is an unpartitioned disk.)
+ 435 <1> ;
+ 436 000000DC 51 <1> push cx
+ 437 000000DD 51 <1> push cx
+ 438 000000DE 66FF36[1C00] <1> push dword [bsHidden]
+ 439 <1> .gotoffs:
+ 440 <1> ;
+ 441 <1> ; Get disk drive parameters (don't trust the superblock.) Don't do this for
+ 442 <1> ; floppy drives -- INT 13:08 on floppy drives will (may?) return info about
+ 443 <1> ; what the *drive* supports, not about the *media*. Fortunately floppy disks
+ 444 <1> ; tend to have a fixed, well-defined geometry which is stored in the superblock.
+ 445 <1> ;
+ 446 <1> ; DL == drive # still
+ 447 000000E3 B408 <1> mov ah,08h
+ 448 000000E5 E8E900 <1> call xint13
+ 449 000000E8 7213 <1> jc no_driveparm
+ 450 000000EA 20E4 <1> and ah,ah
+ 451 000000EC 750F <1> jnz no_driveparm
+ 452 000000EE C1EA08 <1> shr dx,8
+ 453 000000F1 42 <1> inc dx ; Contains # of heads - 1
+ 454 000000F2 8916[1A00] <1> mov [bsHeads],dx
+ 455 000000F6 83E13F <1> and cx,3fh
+ 456 000000F9 890E[1800] <1> mov [bsSecPerTrack],cx
+ 457 <1> no_driveparm:
+ 458 <1> not_harddisk:
+ 459 <1> ;
+ 460 <1> ; Ready to enable interrupts, captain
+ 461 <1> ;
+ 462 000000FD FB <1> sti
+ 463 <1>
+ 464 <1> ;
+ 465 <1> ; Do we have EBIOS (EDD)?
+ 466 <1> ;
+ 467 <1> eddcheck:
+ 468 000000FE BBAA55 <1> mov bx,55AAh
+ 469 00000101 B441 <1> mov ah,41h ; EDD existence query
+ 470 00000103 E8CB00 <1> call xint13
+ 471 00000106 7210 <1> jc .noedd
+ 472 00000108 81FB55AA <1> cmp bx,0AA55h
+ 473 0000010C 750A <1> jne .noedd
+ 474 0000010E F6C101 <1> test cl,1 ; Extended disk access functionality set
+ 475 00000111 7405 <1> jz .noedd
+ 476 <1> ;
+ 477 <1> ; We have EDD support...
+ 478 <1> ;
+ 479 00000113 C606[4601]00 <1> mov byte [getonesec.jmp+1],(getonesec_ebios-(getonesec.jmp+2))
+ 480 <1> .noedd:
+ 481 <1>
+ 482 <1> ;
+ 483 <1> ; Load the first sector of LDLINUX.SYS; this used to be all proper
+ 484 <1> ; with parsing the superblock and root directory; it doesn't fit
+ 485 <1> ; together with EBIOS support, unfortunately.
+ 486 <1> ;
+ 487 <1> Sect1Load:
+ 488 00000118 66B801000000 <1> mov eax,strict dword Sect1Ptr0_VAL ; 0xdeadbeef
+ 489 <1> Sect1Ptr0 equ $-4
+ 490 0000011E 66BA00000000 <1> mov edx,strict dword Sect1Ptr1_VAL ; 0xfeedface
+ 491 <1> Sect1Ptr1 equ $-4
+ 492 00000124 BB[0002] <1> mov bx,ldlinux_sys ; Where to load it
+ 493 00000127 E80E00 <1> call getonesec
+ 494 <1>
+ 495 <1> ; Some modicum of integrity checking
+ 496 0000012A 66813E[0402]FF02B2- <1> cmp dword [ldlinux_magic+4],LDLINUX_MAGIC^HEXDATE
+ 497 00000132 3E <1>
+ 498 00000133 7574 <1> jne kaboom
+ 499 <1>
+ 500 <1> ; Go for it! This also normalizes CS:IP.
+ 501 00000135 E9D000 <1> jmp ldlinux_ent
+ 502 <1>
+ 503 <1> ;
+ 504 <1> ; getonesec: load a single disk linear sector EDX:EAX into the buffer
+ 505 <1> ; at ES:BX.
+ 506 <1> ;
+ 507 <1> ; This routine assumes CS == DS == SS, and trashes most registers.
+ 508 <1> ;
+ 509 <1> ; Stylistic note: use "xchg" instead of "mov" when the source is a register
+ 510 <1> ; that is dead from that point; this saves space. However, please keep
+ 511 <1> ; the order to dst,src to keep things sane.
+ 512 <1> ;
+ 513 <1> getonesec:
+ 514 00000138 660306607B <1> add eax,[Hidden] ; Add partition offset
+ 515 0000013D 661316647B <1> adc edx,[Hidden+4]
+ 516 00000142 B91000 <1> mov cx,retry_count
+ 517 00000145 EB2B <1> .jmp: jmp strict short getonesec_cbios
+ 518 <1>
+ 519 <1> ;
+ 520 <1> ; getonesec_ebios:
+ 521 <1> ;
+ 522 <1> ; getonesec implementation for EBIOS (EDD)
+ 523 <1> ;
+ 524 <1> getonesec_ebios:
+ 525 <1> .retry:
+ 526 <1> ; Form DAPA on stack
+ 527 00000147 6652 <1> push edx
+ 528 00000149 6650 <1> push eax
+ 529 0000014B 06 <1> push es
+ 530 0000014C 53 <1> push bx
+ 531 0000014D 6A01 <1> push word 1
+ 532 0000014F 6A10 <1> push word 16
+ 533 00000151 89E6 <1> mov si,sp
+ 534 00000153 6660 <1> pushad
+ 535 00000155 B442 <1> mov ah,42h ; Extended Read
+ 536 00000157 E87700 <1> call xint13
+ 537 0000015A 6661 <1> popad
+ 538 0000015C 8D6410 <1> lea sp,[si+16] ; Remove DAPA
+ 539 0000015F 7201 <1> jc .error
+ 540 00000161 C3 <1> ret
+ 541 <1>
+ 542 <1> .error:
+ 543 <1> ; Some systems seem to get "stuck" in an error state when
+ 544 <1> ; using EBIOS. Doesn't happen when using CBIOS, which is
+ 545 <1> ; good, since some other systems get timeout failures
+ 546 <1> ; waiting for the floppy disk to spin up.
+ 547 <1>
+ 548 00000162 6660 <1> pushad ; Try resetting the device
+ 549 00000164 31C0 <1> xor ax,ax
+ 550 00000166 E86800 <1> call xint13
+ 551 00000169 6661 <1> popad
+ 552 0000016B E2DA <1> loop .retry ; CX-- and jump if not zero
+ 553 <1>
+ 554 <1> ; Total failure. Try falling back to CBIOS.
+ 555 0000016D C606[4601]2B <1> mov byte [getonesec.jmp+1],(getonesec_cbios-(getonesec.jmp+2))
+ 556 <1>
+ 557 <1> ;
+ 558 <1> ; getonesec_cbios:
+ 559 <1> ;
+ 560 <1> ; getlinsec implementation for legacy CBIOS
+ 561 <1> ;
+ 562 <1> getonesec_cbios:
+ 563 <1> .retry:
+ 564 00000172 6660 <1> pushad
+ 565 <1>
+ 566 00000174 660FB736[1800] <1> movzx esi,word [bsSecPerTrack]
+ 567 0000017A 660FB73E[1A00] <1> movzx edi,word [bsHeads]
+ 568 <1> ;
+ 569 <1> ; Dividing by sectors to get (track,sector): we may have
+ 570 <1> ; up to 2^18 tracks, so we need to use 32-bit arithmetric.
+ 571 <1> ;
+ 572 00000180 66F7F6 <1> div esi
+ 573 00000183 31C9 <1> xor cx,cx
+ 574 00000185 87CA <1> xchg cx,dx ; CX <- sector index (0-based)
+ 575 <1> ; EDX <- 0
+ 576 <1> ; eax = track #
+ 577 00000187 66F7F7 <1> div edi ; Convert track to head/cyl
+ 578 <1>
+ 579 0000018A 663DFF030000 <1> cmp eax,1023 ; Outside the CHS range?
+ 580 00000190 7717 <1> ja kaboom
+ 581 <1>
+ 582 <1> ;
+ 583 <1> ; Now we have AX = cyl, DX = head, CX = sector (0-based),
+ 584 <1> ; SI = bsSecPerTrack, ES:BX = data target
+ 585 <1> ;
+ 586 00000192 C0E406 <1> shl ah,6 ; Because IBM was STOOPID
+ 587 <1> ; and thought 8 bits were enough
+ 588 <1> ; then thought 10 bits were enough...
+ 589 00000195 41 <1> inc cx ; Sector numbers are 1-based, sigh
+ 590 00000196 08E1 <1> or cl,ah
+ 591 00000198 88C5 <1> mov ch,al
+ 592 0000019A 88D6 <1> mov dh,dl
+ 593 0000019C B80102 <1> mov ax,0201h ; Read one sector
+ 594 0000019F E82F00 <1> call xint13
+ 595 000001A2 6661 <1> popad
+ 596 000001A4 7201 <1> jc .error
+ 597 000001A6 C3 <1> ret
+ 598 <1>
+ 599 <1> .error:
+ 600 000001A7 E2C9 <1> loop .retry
+ 601 <1> ; Fall through to disk_error
+ 602 <1>
+ 603 <1> ;
+ 604 <1> ; kaboom: write a message and bail out.
+ 605 <1> ;
+ 606 <1> global kaboom
+ 607 <1> disk_error:
+ 608 <1> kaboom:
+ 609 000001A9 31F6 <1> xor si,si
+ 610 000001AB 8ED6 <1> mov ss,si
+ 611 000001AD BC687B <1> mov sp,OrigFDCTabPtr ; Reset stack
+ 612 000001B0 8EDE <1> mov ds,si ; Reset data segment
+ 613 000001B2 668F067800 <1> pop dword [fdctab] ; Restore FDC table
+ 614 <1> .patch: ; When we have full code, intercept here
+ 615 000001B7 BE[DA01] <1> mov si,bailmsg
+ 616 000001BA AC <1> .loop: lodsb
+ 617 000001BB 20C0 <1> and al,al
+ 618 000001BD 7409 <1> jz .done
+ 619 000001BF B40E <1> mov ah,0Eh ; Write to screen as TTY
+ 620 000001C1 BB0700 <1> mov bx,0007h ; Attribute
+ 621 000001C4 CD10 <1> int 10h
+ 622 000001C6 EBF2 <1> jmp short .loop
+ 623 <1>
+ 624 <1> .done:
+ 625 000001C8 31C0 <1> xor ax,ax
+ 626 000001CA CD16 <1> .again: int 16h ; Wait for keypress
+ 627 <1> ; NB: replaced by int 18h if
+ 628 <1> ; chosen at install time..
+ 629 000001CC CD19 <1> int 19h ; And try once more to boot...
+ 630 000001CE F4 <1> .norge: hlt ; If int 19h returned; this is the end
+ 631 000001CF EBFD <1> jmp short .norge
+ 632 <1>
+ 633 <1> ;
+ 634 <1> ; INT 13h wrapper function
+ 635 <1> ;
+ 636 <1> xint13:
+ 637 000001D1 8A16747B <1> mov dl,[DriveNumber]
+ 638 000001D5 06 <1> push es ; ES destroyed by INT 13h AH 08h
+ 639 000001D6 CD13 <1> int 13h
+ 640 000001D8 07 <1> pop es
+ 641 000001D9 C3 <1> ret
+ 642 <1>
+ 643 <1> ;
+ 644 <1> ; Error message on failure
+ 645 <1> ;
+ 646 000001DA 426F6F74206572726F- <1> bailmsg: db 'Boot error', 0Dh, 0Ah, 0
+ 647 000001E3 720D0A00 <1>
+ 648 <1>
+ 649 <1> ; This fails if the boot sector overflowsg
+ 650 000001E7 00<rept> <1> zb 1F8h-($-$$)
+ 651 <1>
+ 652 000001F8 FE02B23E <1> bs_magic dd LDLINUX_MAGIC
+ 653 000001FC 1837 <1> bs_link dw (Sect1Load - bootsec) | BS_MAGIC_VER
+ 654 000001FE 55AA <1> bootsignature dw 0xAA55
+ 655 <1>
+ 656 <1> ;
+ 657 <1> ; ===========================================================================
+ 658 <1> ; End of boot sector
+ 659 <1> ; ===========================================================================
+ 660
+ 661 HEXDATE equ 1
+ 662
+ 663 section .init
+ 664 sector_1:
+ 665 ldlinux_sys:
+ 666 alignz 8
+ 667 00000200 FE02B23E ldlinux_magic dd LDLINUX_MAGIC
+ 668 00000204 FF02B23E dd LDLINUX_MAGIC^HEXDATE
+ 669
+ 670
+ 671 ldlinux_ent:
+ 672
+ 673 get_geo: ; DL and ES ready
+ 674 00000208 B408 mov ah,08h
+ 675 0000020A BF0000 mov di,0
+ 676 0000020D E8C1FF call xint13
+ 677 write_geo:
+ 678 00000210 720E jc .bad_geo
+ 679 00000212 BE[4F03] mov si,s_chs
+ 680 00000215 E84A01 call writestr_early
+ 681 00000218 E89D00 call write_chs
+ 682 0000021B E8DC00 call crlf
+ 683 0000021E EB00 jmp short .done
+ 684 .bad_geo:
+ 685 .done:
+ 686
+ 687 00000220 BB0080 mov bx,dbuf
+ 688 get_h1c: ; 0,1,1
+ 689 00000223 B90100 mov cx,0001h
+ 690 00000226 B601 mov dh,01h
+ 691 00000228 E86000 call getonesec_chs
+ 692 0000022B E86D00 call write_chs_lba
+ 693 get_c1c: ; 1,0,1
+ 694 0000022E B90101 mov cx,0101h
+ 695 00000231 B600 mov dh,00h
+ 696 00000233 E85500 call getonesec_chs
+ 697 00000236 E86200 call write_chs_lba
+ 698
+ 699
+ 700
+ 701 ; Do we have EBIOS (EDD)?
+ 702 ;
+ 703 edd:
+ 704 .check:
+ 705 00000239 BBAA55 mov bx,55AAh
+ 706 0000023C B441 mov ah,41h ; EDD existence query
+ 707 0000023E E890FF call xint13
+ 708 00000241 723F jc .noedd
+ 709 00000243 81FB55AA cmp bx,0AA55h
+ 710 00000247 7539 jne .noedd
+ 711 00000249 F6C101 test cl,1 ; Extended disk access functionality set
+ 712 0000024C 7434 jz .noedd
+ 713 ;
+ 714 ; We have EDD support...
+ 715 ;
+ 716 0000024E BB0080 mov bx,dbuf ; ES should still be safe.
+ 717 00000251 6631D2 xor edx,edx
+ 718 00000254 66C706[4F03]454444- mov dword [s_chs],m_EDD_SP
+ 719 0000025C 20
+ 720 .get_lba63:
+ 721 0000025D 66B83F000000 mov eax,63 ; Same length as mov al,64; movzx eax,al
+ 722 00000263 E8E1FE call getonesec_ebios
+ 723 00000266 721A jc .bad_edd ;read error
+ 724 00000268 E87200 call write_edd_lba
+ 725 .get_lba16065:
+ 726 0000026B 66B8C13E0000 mov eax,16065
+ 727 00000271 E8D3FE call getonesec_ebios
+ 728 00000274 720C jc .bad_edd ;read error
+ 729 00000276 E86400 call write_edd_lba
+ 730 .good_edd:
+ 731 00000279 66C706[5603]454444- mov dword [s_type],m_EDD0
+ 732 00000281 00
+ 733 .bad_edd:
+ 734 .noedd:
+ 735 .end:
+ 736
+ 737 write_final_type:
+ 738 00000282 BE[5403] mov si,s_typespec
+ 739 00000285 E8DA00 call writestr_early
+ 740 00000288 E91EFF jmp kaboom
+ 741
+ 742 ;
+ 743 ; getonesec_chs:
+ 744 ;
+ 745 ; CX,DH specifies CHS address
+ 746 ;
+ 747 getonesec_chs: ; We could use an xchg and get a loop
+ 748 ; mov cx,retry_count
+ 749 .retry:
+ 750 0000028B 6660 pushad
+ 751 0000028D B80102 mov ax,0201h ; Read one sector
+ 752 00000290 E83EFF call xint13
+ 753 00000293 6661 popad
+ 754 00000295 7201 jc .error
+ 755 00000297 C3 ret
+ 756
+ 757 .error:
+ 758 ; loop .retry
+ 759 ; Fall through to disk_error
+ 760 00000298 E90EFF jmp disk_error
+ 761
+ 762 %include "geodsplib.inc"
+ 763 <1> ; -----------------------------------------------------------------------
+ 764 <1> ;
+ 765 <1> ; Copyright 2010 Gene Cumm
+ 766 <1> ;
+ 767 <1> ; Portions from diskstart.inc:
+ 768 <1> ; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
+ 769 <1> ; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+ 770 <1> ;
+ 771 <1> ; This program is free software; you can redistribute it and/or modify
+ 772 <1> ; it under the terms of the GNU General Public License as published by
+ 773 <1> ; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ 774 <1> ; Boston MA 02110-1301, USA; either version 2 of the License, or
+ 775 <1> ; (at your option) any later version; incorporated herein by reference.
+ 776 <1> ;
+ 777 <1> ; -----------------------------------------------------------------------
+ 778 <1>
+ 779 <1> ;
+ 780 <1> ; geodsplib.inc
+ 781 <1> ;
+ 782 <1> ; Library file for geodsp*.asm
+ 783 <1> ;
+ 784 <1>
+ 785 <1> ; ES:BX points to the buffer with address
+ 786 <1> ; DX,CX as they should be for INT13h,AH=02
+ 787 <1> ; For now assume C<256
+ 788 <1> write_chs_lba:
+ 789 0000029B 6660 <1> pushad
+ 790 0000029D BE[4E03] <1> mov si,s_atchs
+ 791 000002A0 E8BF00 <1> call writestr_early
+ 792 000002A3 E81200 <1> call write_chs
+ 793 000002A6 B03A <1> mov al,':'
+ 794 000002A8 E85800 <1> call writechr
+ 795 000002AB 26668B07 <1> mov eax,[es:bx]
+ 796 000002AF E87700 <1> call writehex8
+ 797 000002B2 E84500 <1> call crlf
+ 798 000002B5 6661 <1> popad
+ 799 000002B7 C3 <1> ret
+ 800 <1>
+ 801 <1> ; DX,CX as they should be for INT13h,AH=02
+ 802 <1> ; For now assume C<256
+ 803 <1> write_chs:
+ 804 000002B8 6660 <1> pushad
+ 805 000002BA 88E8 <1> mov al,ch
+ 806 000002BC 88CC <1> mov ah,cl
+ 807 000002BE C0EC06 <1> shr ah,6
+ 808 000002C1 E85800 <1> call writehex4
+ 809 000002C4 B02C <1> mov al,','
+ 810 000002C6 E83A00 <1> call writechr
+ 811 000002C9 88F0 <1> mov al,dh
+ 812 000002CB E84100 <1> call writehex2
+ 813 000002CE B02C <1> mov al,','
+ 814 000002D0 E83000 <1> call writechr
+ 815 000002D3 88C8 <1> mov al,cl
+ 816 000002D5 243F <1> and al,3Fh
+ 817 000002D7 E83500 <1> call writehex2
+ 818 000002DA 6661 <1> popad
+ 819 000002DC C3 <1> ret
+ 820 <1>
+ 821 <1> write_edd_lba:
+ 822 000002DD 6660 <1> pushad
+ 823 000002DF BE[4E03] <1> mov si,s_atchs
+ 824 000002E2 E87D00 <1> call writestr_early
+ 825 000002E5 E84100 <1> call writehex8
+ 826 000002E8 B03A <1> mov al,':'
+ 827 000002EA E81600 <1> call writechr
+ 828 000002ED 26668B07 <1> mov eax,[es:bx]
+ 829 000002F1 E83500 <1> call writehex8
+ 830 000002F4 E80300 <1> call crlf
+ 831 000002F7 6661 <1> popad
+ 832 000002F9 C3 <1> ret
+ 833 <1>
+ 834 <1>
+ 835 <1> crlf:
+ 836 000002FA 56 <1> push si
+ 837 000002FB BE[5F03] <1> mov si,s_crlf
+ 838 000002FE E86100 <1> call writestr_early
+ 839 00000301 5E <1> pop si
+ 840 00000302 C3 <1> ret
+ 841 <1>
+ 842 <1> writechr:
+ 843 <1> writechr_early:
+ 844 00000303 6660 <1> pushad
+ 845 00000305 B40E <1> mov ah,0Eh ; Write to screen as TTY
+ 846 00000307 BB0700 <1> mov bx,0007h ; Attribute
+ 847 0000030A CD10 <1> int 10h
+ 848 0000030C 6661 <1> popad
+ 849 0000030E C3 <1> ret
+ 850 <1>
+ 851 <1> %include "writehex.inc"
+ 852 <2> ;; -----------------------------------------------------------------------
+ 853 <2> ;;
+ 854 <2> ;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
+ 855 <2> ;;
+ 856 <2> ;; This program is free software; you can redistribute it and/or modify
+ 857 <2> ;; it under the terms of the GNU General Public License as published by
+ 858 <2> ;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ 859 <2> ;; Boston MA 02111-1307, USA; either version 2 of the License, or
+ 860 <2> ;; (at your option) any later version; incorporated herein by reference.
+ 861 <2> ;;
+ 862 <2> ;; -----------------------------------------------------------------------
+ 863 <2>
+ 864 <2> ;;
+ 865 <2> ;; writehex.inc
+ 866 <2> ;;
+ 867 <2> ;; Write hexadecimal numbers to the console
+ 868 <2> ;;
+ 869 <2>
+ 870 <2> ;
+ 871 <2> ; writehex[248]: Write a hex number in (AL, AX, EAX) to the console
+ 872 <2> ;
+ 873 <2> writehex2:
+ 874 0000030F 669C <2> pushfd
+ 875 00000311 6660 <2> pushad
+ 876 00000313 66C1C018 <2> rol eax,24
+ 877 00000317 B90200 <2> mov cx,2
+ 878 0000031A EB14 <2> jmp short writehex_common
+ 879 <2> writehex4:
+ 880 0000031C 669C <2> pushfd
+ 881 0000031E 6660 <2> pushad
+ 882 00000320 66C1C010 <2> rol eax,16
+ 883 00000324 B90400 <2> mov cx,4
+ 884 00000327 EB07 <2> jmp short writehex_common
+ 885 <2> writehex8:
+ 886 00000329 669C <2> pushfd
+ 887 0000032B 6660 <2> pushad
+ 888 0000032D B90800 <2> mov cx,8
+ 889 <2> writehex_common:
+ 890 00000330 66C1C004 <2> .loop: rol eax,4
+ 891 00000334 6650 <2> push eax
+ 892 00000336 240F <2> and al,0Fh
+ 893 00000338 3C0A <2> cmp al,10
+ 894 0000033A 7304 <2> jae .high
+ 895 0000033C 0430 <2> .low: add al,'0'
+ 896 0000033E EB02 <2> jmp short .ischar
+ 897 00000340 0437 <2> .high: add al,'A'-10
+ 898 00000342 E8BEFF <2> .ischar: call writechr
+ 899 00000345 6658 <2> pop eax
+ 900 00000347 E2E7 <2> loop .loop
+ 901 00000349 6661 <2> popad
+ 902 0000034B 669D <2> popfd
+ 903 0000034D C3 <2> ret
+ 904 <1>
+ 905 0000034E 40 <1> s_atchs: db '@'
+ 906 0000034F 434853 <1> s_chs: db 'CHS'
+ 907 00000352 2000 <1> s_space: db ' ', 0
+ 908 00000354 443D <1> s_typespec: db 'D='
+ 909 00000356 43485300 <1> s_type: db 'CHS', 0
+ 910 0000035A 0D0A656E64 <1> s_end: db 0Dh, 0Ah, 'end'
+ 911 0000035F 0D0A00 <1> s_crlf: db 0Dh, 0Ah, 0
+ 912 <1>
+ 913 <1> ; This indicates the general format of the last few bytes in the boot sector
+ 914 <1> BS_MAGIC_VER equ 0x1b << 9
+ 915
+ 916 ;
+ 917 ;
+ 918 ; writestr_early: write a null-terminated string to the console
+ 919 ; This assumes we're on page 0. This is only used for early
+ 920 ; messages, so it should be OK.
+ 921 ;
+ 922 writestr_early:
+ 923 00000362 6660 pushad
+ 924 00000364 AC .loop: lodsb
+ 925 00000365 20C0 and al,al
+ 926 00000367 7409 jz .return
+ 927 00000369 B40E mov ah,0Eh ; Write to screen as TTY
+ 928 0000036B BB0700 mov bx,0007h ; Attribute
+ 929 0000036E CD10 int 10h
+ 930 00000370 EBF2 jmp short .loop
+ 931 00000372 6661 .return: popad
+ 932 00000374 C3 ret
+ 933
+ 934 00000375 00000000<rept> SuperInfo: zd 32 ; The first 16 bytes expanded 8 times
+ 935
+ 936 ; This fails if the sector overflowsg
+ 937 000003F5 00<rept> zb 400h-($-$$)
+ 938 end:
+ 939
+ 940 absolute 4*1Eh
+ 941 fdctab equ $
+ 942 00000078 <res 00000002> fdctab1 resw 1
+ 943 0000007A <res 00000002> fdctab2 resw 1
|
|
Added |
syslinux-4.04.tar.bz2/diag/geodsp/mk-lba-img
^
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/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;
+}
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/mbr
^
|
+(directory)
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/mbr/Makefile
^
|
@@ -0,0 +1,51 @@
+## -----------------------------------------------------------------------
+##
+## Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
+## Copyright 2009 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 MBR
+#
+
+topdir = ../..
+mbrdir = $(topdir)/mbr
+include $(topdir)/MCONFIG.embedded
+
+all: handoff.bin
+
+%.o: %.S
+ $(CC) $(MAKEDEPS) $(SFLAGS) -Wa,-a=$*.lst -c -o $@ $<
+
+.PRECIOUS: %.elf
+%.elf: %.o $(mbrdir)/mbr.ld
+ $(LD) $(LDFLAGS) -T $(mbrdir)/mbr.ld -e _start -o $@ $<
+
+%.bin: %.elf $(mbrdir)/checksize.pl
+ $(OBJCOPY) -O binary $< $@
+ $(PERL) checksize.pl $@
+ $(CHMOD) -x $@
+
+handoff.bin: handoff.elf $(mbrdir)/checksize.pl
+ $(OBJCOPY) -O binary $< $@
+ $(PERL) $(mbrdir)/checksize.pl $@ 420
+ $(CHMOD) -x $@
+
+mbr_bin.c: mbr.bin
+
+tidy dist:
+ rm -f *.o *.elf *.lst .*.d
+
+clean: tidy
+
+spotless: clean
+ rm -f *.bin
+
+-include .*.d
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/mbr/README
^
|
@@ -0,0 +1,15 @@
+Diagnostic MBR/VBR files
+
+handoff.bin Show the data that the BIOS/MBR hands off to an MBR/VBR.
+
+
+ +++ USAGE +++
+
+Writing out an MBR is straight forward (it is assumed below that /dev/hda is the target raw device and /dev/hda1 is the target partition):
+
+ dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/hda
+
+Writing a VBR to match Syslinux requires more work as it must have a jump and be offset into the partition:
+
+ echo -en "\0353\0130\0220" |dd conv=notrunc bs=1 count=3 of=/dev/hda1
+ dd conv=notrunc bs=2 count=210 seek=45 if=mbr.bin of=/dev/hda1
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/diag/mbr/handoff.S
^
|
@@ -0,0 +1,365 @@
+/* -----------------------------------------------------------------------
+ *
+ * Copyright 2010-2011 Gene Cumm
+ *
+ * Portions from mbr.S:
+ * Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
+ * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall
+ * be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * handoff.S: MBR/VBR-like codeblock to display handoff data
+ *
+ * Displays the values of DL, DS, SI, the contents of [DS:SI] (16 bytes),
+ * the values of ES, DI, the contents of [ES:DI] (4 bytes), scans memory for
+ * $PnP then reports a boot failure.
+ *
+ * This should (hopefully) be only 8086 code
+ */
+
+/*
+ * Install instructions (assuming your target is /dev/dev; file or block device):
+ *
+ * MBR:
+ * dd conv=notrunc bs=440 count=1 if=mbr_ho.bin of=/dev/dev
+ *
+ * VBR/PBR (should work for FAT12/16/32, ext[234]fs, btrfs):
+ * echo -en "\0353\0130\0220" |dd conv=notrunc bs=1 count=3 of=/dev/dev
+ * dd conv=notrunc bs=2 count=210 seek=45 if=mbr_ho.bin of=/dev/dev
+ */
+
+// #define DEBUG_MARKER1 /* Insert markers in binary */
+// #define DEBUG_START /* Print entry addresses at start */
+// #define DEBUG_LOADE /* movw versus pop */
+#define DEBUG_PNP /* Scan for $PnP and show address */
+#define DEBUG_PAK /* Press Any Key before boot fail */
+// #define DEBUG_ENTRY_REG /* Store (manually as pusha is 80186) registers */
+// #define DEBUG_FDT /* Print the floppy descriptor table; INT 1Eh*/
+
+#ifdef DEBUG_MARKER1
+ .macro ASCII_MARKER1 s:vararg
+ .ascii \s
+ .endm
+#else /* DEBUG_MARKER1 */
+ .macro ASCII_MARKER1 s:vararg
+ .endm
+#endif /* DEBUG_MARKER1 */
+
+#ifdef DEBUG_LOADE
+ .macro LOADE r:req, t:req
+ movw (es_\r), %\t
+ .endm
+#else /* DEBUG_LOADE */
+ .macro LOADE r:req, t:req
+ popw %\t
+ .endm
+#endif /* DEBUG_LOADE */
+
+ .code16
+ .text
+
+entry = 0x7c00
+stack = (entry)
+e_start = (stack)
+e_ax = (e_start-2)
+e_ss = (e_ax-2)
+e_sp = (e_ss-2)
+e_bot = (e_ss)
+/* Doubtful this will be used */
+e0_beg = (e_bot)
+e0_ax = (e0_beg-2)
+e0_cx = (e0_ax-2)
+e0_dx = (e0_cx-2)
+e0_bx = (e0_dx-2)
+e0_sp = (e0_bx-2)
+e0_bp = (e0_sp-2)
+e0_si = (e0_bp-2)
+e0_di = (e0_si-2)
+e0_ds = (e0_di-2)
+e0_es = (e0_ds-2)
+e0_bot = (e0_es)
+es_beg = (e0_bot) /* Original register values from entry point */
+es_di = (es_beg-2)
+es_es = (es_di-2)
+es_si = (es_es-2)
+es_ds = (es_si-2)
+es_bot = (es_ds)
+
+BIOS_page = 0x462
+
+int_1e = (4*0x1e)
+int_1e_seg = (int_1e)
+int_1e_off = (int_1e+2)
+
+ .globl _start
+_start:
+ cli
+#ifdef DEBUG_ENTRY_REG
+ movw %ax, e_ax
+ movw %ss, e_ss
+ movw %sp, e_sp
+#endif /* DEBUG_ENTRY_REG */
+ xorw %ax, %ax
+ movw %ax, %ss
+#ifdef DEBUG_ENTRY_REG
+ movw $e0_beg, %sp
+ /* pushaw */ /* 80186 */
+ pushw %ax
+ pushw %cx
+ pushw %dx
+ pushw %bx
+ pushw %sp
+ pushw %bp
+ pushw %si
+ pushw %di
+ pushw %ds
+ pushw %es
+#else /* DEBUG_ENTRY_REG */
+ movw $es_beg, %sp
+#endif /* DEBUG_ENTRY_REG */
+ pushw %di /* es:di -> $PnP header */
+ pushw %es
+ pushw %si
+ pushw %ds
+ sti
+ cld
+ pushw %cs
+ popw %ds
+
+#ifdef DEBUG_START
+ pushw %dx
+ call crlf
+ movw $(_start),%dx /* 0x0600 mbr.ld .text address */
+ call wrhexw
+ call crlf
+ call caddr
+caddr:
+ popw %dx
+ subw $(caddr - _start), %dx
+ call wrhexw
+ call crlf
+ popw %dx
+#endif /* DEBUG_START */
+
+ /* write DL */
+pr_dl: call wrstr
+ .ascii "DL: \0"
+ call wrhexb
+ /* DS */
+pr_ds: call wrstr
+ .ascii " DS: \0"
+ LOADE ds, dx
+ pushw %dx
+ popw %es
+ call wrhexw
+ /* SI */
+pr_si: call wrstr
+ .ascii " SI: \0"
+ LOADE si, dx
+ pushw %dx
+ popw %di
+ call wrhexw
+ call crlf
+ /* DS:SI */
+ movw $16, %cx
+ call wrhexbses
+ call crlf
+
+ /* ES */
+pr_es: call wrstr
+ .ascii "ES: \0"
+ LOADE es, dx
+ pushw %dx
+ popw %es
+ call wrhexw
+pr_di: call wrstr
+ .ascii " DI: \0"
+ LOADE di, dx
+ pushw %dx
+ popw %di
+ call wrhexw
+ call crlf
+ /* ES:DI */ /* %es:0(%di) */
+ movw $4, %cx
+ call wrhexbses
+
+#ifdef DEBUG_PNP
+ subw $4, %si
+ es lodsw
+ cmpw $0x5024, %ax
+ jne scn_pnp
+ es lodsw
+ cmpw $0x506E, %ax
+ jne scn_pnp
+ call wrstr
+ .ascii " =$PnP\0"
+scn_pnp:
+ call crlf
+ /* $PnP Scan */
+ movw $0xf000, %dx
+ pushw %dx
+ popw %es
+ movw $0, %si
+ movw $0x1000, %cx
+ /* 0x506E5024 */
+ movw $0x5024, %dx
+ movw $0x506E, %bx
+ch_pnp: es lodsw /* Check for $PnP */
+ cmpw %dx, %ax
+ jne ch_pnp_l
+ es lodsw
+ cmpw %bx, %ax
+ je pr_pnp
+ch_pnp_l: /* Check $PnP failed; loop to next address */
+ addw $14, %si
+ andw $0xFFF0, %si
+ loopw ch_pnp
+ jmp pnp_end
+pr_pnp:
+ pushw %si
+ call wrstr
+ .ascii "$PnP-\0"
+ movw %es, %dx
+ call wrhexw
+ movb $':, %al
+ call wrchr
+ popw %dx
+ andw $0xFFF0, %dx
+ call wrhexw
+#endif /* DEBUG_PNP */
+ call crlf
+pnp_end:
+
+#ifdef DEBUG_FDT
+ /* INT 1Eh: Floppy Parameter Table Pointer */
+pr_1e: call wrstr
+ .ascii "INT 1Eh: \0"
+ mov $int_1e,%bx
+ les (%bx),%di
+ pushw %es
+ popw %dx
+ call wrhexw
+ movb $':, %al
+ call wrchr
+ pushw %di
+ popw %dx
+ call wrhexw
+ call crlf
+ /* [INT 1Eh] */
+ movw $14, %cx
+ call wrhexbses
+ call crlf
+#endif /* DEBUG_FDT */
+
+end:
+ jmp bootfail
+
+ ASCII_MARKER1 "wc"
+wrchr:
+ movb $0x0e, %ah
+ movb (BIOS_page), %bh
+ movb $0x07, %bl
+ int $0x10 /* May destroy %bp */
+ ret
+
+ ASCII_MARKER1 "ws"
+wrstr:
+ pop %si
+wrstr_l:
+ lodsb
+ cmpb $0, %al
+ je wrstr_d
+ call wrchr
+ jmp wrstr_l
+wrstr_d:
+ push %si
+ ret
+
+crlf:
+ call wrstr
+ .ascii "\r\n\0"
+ ret
+
+ ASCII_MARKER1 "hx"
+wrhexn:
+ and $0x0F, %al
+ cmpb $10, %al
+ jae .alph
+ addb $'0, %al
+ jmp .wc
+.alph:
+ addb $('A - 10), %al
+.wc:
+ call wrchr
+ ret
+
+wrhexb:
+ pushw %cx
+ movb %dl, %al
+ pushw %ax
+ movb $4, %cl
+ rorw %cl, %ax
+ call wrhexn
+ popw %ax
+ call wrhexn
+ popw %cx
+ ret
+
+wrhexw:
+ pushw %cx
+ movb $8, %cl
+ rorw %cl, %dx
+ call wrhexb
+ rorw %cl, %dx
+ call wrhexb
+ popw %cx
+ ret
+
+ ASCII_MARKER1 "HE"
+wrhexbses:
+ pushw %di
+ popw %si
+wrhexbses_l:
+ movb $' , %al
+ call wrchr
+ es lodsb
+ movw %ax, %dx
+ call wrhexb
+ loop wrhexbses_l
+ ret
+
+data:
+ ASCII_MARKER1 "bf"
+bootfail:
+#ifdef DEBUG_PAK
+ call wrstr
+ .ascii "\r\n\r\nPress any key\r\n\0"
+ xor %ax, %ax
+ int $0x16
+#endif
+ int $0x18 /* Boot failure */
+die:
+ hlt
+ jmp die
|
|
Added |
syslinux-4.04.tar.bz2/diag/mbr/handoff.bin
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/doc/comboot.txt
^
|
@@ -986,27 +986,27 @@
++++ 32-BIT ONLY API CALLS ++++
-void *pm_cs->lmalloc(size_t bytes)
+void *cs_pm->lmalloc(size_t bytes)
Allocate a buffer in low memory (below 1 MB).
-void pm_cs->lfree(void *ptr)
+void cs_pm->lfree(void *ptr)
- Free a buffer allocated with pm_cs->lmalloc().
+ Free a buffer allocated with cs_pm->lmalloc().
-DIR *pm_cs->opendir(const char *pathname)
+DIR *cs_pm->opendir(const char *pathname)
Open a directory.
-struct dirent *pm_cs->readdir(DIR *dir)
+struct dirent *cs_pm->readdir(DIR *dir)
Read an entry from a directory. The entry is returned in a
static buffer.
-int pm_cs->closedir(DIR *dir)
+int cs_pm->closedir(DIR *dir)
Close a directory.
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/doc/memdisk.txt
^
|
@@ -141,6 +141,12 @@
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:
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/doc/pxelinux.txt
^
|
@@ -99,6 +99,20 @@
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
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/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 @@
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 @@
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
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/dos/dosexe.ld
^
|
@@ -32,16 +32,17 @@
*(.payload)
__payload_end = .;
}
- __payload_len = __payload_end - __payload_start;
+ __payload_len = ABSOLUTE(__payload_end) - ABSOLUTE(__payload_start);
__payload_dwords = __payload_len >> 2;
__text_lma = __payload_lma + syslinux_ldlinux_size;
__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.*)
|
|
Changed |
syslinux-4.04.tar.bz2/dos/syslinux.com
^
|
|
Changed |
syslinux-4.04.tar.bz2/extlinux/extlinux
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/extlinux/main.c
^
|
@@ -216,7 +216,7 @@
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 @@
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) {
@@ -505,19 +503,6 @@
return 1;
}
-/*
- * SYSLINUX installs the string 'SYSLINUX' at offset 3 in the boot
- * sector; this is consistent with FAT filesystems. Earlier versions
- * would install the string "EXTLINUX" instead, handle both.
- */
-int already_installed(int devfd)
-{
- char buffer[8];
-
- xpread(devfd, buffer, 8, 3);
- return !memcmp(buffer, "SYSLINUX", 8) || !memcmp(buffer, "EXTLINUX", 8);
-}
-
#ifdef __KLIBC__
static char devname_buf[64];
@@ -768,7 +753,7 @@
if (devfd < 0)
return 1;
- if (update_only && !already_installed(devfd)) {
+ if (update_only && !syslinux_already_installed(devfd)) {
fprintf(stderr, "%s: no previous syslinux boot sector found\n",
program);
close(devfd);
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/gpxe/Makefile
^
|
@@ -1,7 +1,7 @@
## -----------------------------------------------------------------------
##
## Copyright 2008-2009 H. Peter Anvin - All Rights Reserved
-## Copyright 2009 Intel Corporation; author: H. Peter Anvin
+## Copyright 2009-2011 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
@@ -17,7 +17,9 @@
# Very simple, really...
#
-TARGETS = gpxelinux.0
+TARGETS = gpxelinux.0 gpxelinuxk.0
+
+PXEMAKE = $(MAKE) -C src NO_WERROR=1
all: $(TARGETS)
@@ -33,9 +35,19 @@
installer:
-src/bin/undionly.kkpxe: pxelinux.gpxe ../core/pxelinux.0
- $(MAKE) -C src bin/undionly.kkpxe NO_WERROR=1 \
- EMBEDDED_IMAGE=../pxelinux.gpxe,../../core/pxelinux.0
+.NOTPARALLEL:
+
+src/bin/blib.a:
+ $(PXEMAKE) bin/blib.a
+
+src/bin/undionly.kkpxe: src/bin/blib.a pxelinux.gpxe ../core/pxelinux.0
+ $(PXEMAKE) bin/undionly.kkpxe EMBEDDED_IMAGE=../pxelinux.gpxe,../../core/pxelinux.0
gpxelinux.0: src/bin/undionly.kkpxe
cp -f $< $@
+
+src/bin/undionly.kpxe: src/bin/blib.a pxelinuxk.gpxe ../core/pxelinux.0
+ $(PXEMAKE) bin/undionly.kpxe EMBEDDED_IMAGE=../pxelinuxk.gpxe,../../core/pxelinux.0
+
+gpxelinuxk.0: src/bin/undionly.kpxe
+ cp -f $< $@
|
|
Changed |
syslinux-4.04.tar.bz2/gpxe/gpxelinux.0
^
|
|
Added |
syslinux-4.04.tar.bz2/gpxe/gpxelinuxk.0
^
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/gpxe/pxelinuxk.gpxe
^
|
@@ -0,0 +1,5 @@
+#!gpxe
+set use-cached 0
+dhcp net0
+imgload pxelinux.0
+boot pxelinux.0
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/libinstaller/fat.c
^
|
@@ -42,15 +42,12 @@
*/
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(§buf->bsMedia) != 0xF0 && get_8(§buf->bsMedia) < 0xF8)
return "invalid media signature (not a FAT filesystem?)";
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/libinstaller/syslxcom.c
^
|
@@ -284,3 +284,16 @@
return sectmap_fib(fd, sectors, nsectors);
}
+
+/*
+ * SYSLINUX installs the string 'SYSLINUX' at offset 3 in the boot
+ * sector; this is consistent with FAT filesystems. Earlier versions
+ * would install the string "EXTLINUX" instead, handle both.
+ */
+int syslinux_already_installed(int dev_fd)
+{
+ char buffer[8];
+
+ xpread(dev_fd, buffer, 8, 3);
+ return !memcmp(buffer, "SYSLINUX", 8) || !memcmp(buffer, "EXTLINUX", 8);
+}
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/libinstaller/syslxcom.h
^
|
@@ -18,5 +18,6 @@
void clear_attributes(int fd);
void set_attributes(int fd);
int sectmap(int fd, sector_t *sectors, int nsectors);
+int syslinux_already_installed(int dev_fd);
#endif
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/libinstaller/syslxint.h
^
|
@@ -1,6 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
+ * Copyright 2009-2011 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
@@ -156,6 +157,7 @@
#endif
#define LDLINUX_MAGIC 0x3eb202fe
+#define BS_MAGIC_VER (0x1b << 9)
/* Patch area for disk-based installers */
struct patch_area {
@@ -214,7 +216,7 @@
uint32_t VolumeID;
char VolumeLabel[11];
char FileSysType[8];
- uint8_t Code[448];
+ uint8_t Code[442];
} __attribute__ ((packed)) bs16;
struct {
uint32_t FATSz32;
@@ -230,10 +232,12 @@
uint32_t VolumeID;
char VolumeLabel[11];
char FileSysType[8];
- uint8_t Code[420];
+ uint8_t Code[414];
} __attribute__ ((packed)) bs32;
} __attribute__ ((packed));
+ uint32_t bsMagic;
+ uint16_t bsForwardPtr;
uint16_t bsSignature;
} __attribute__ ((packed));
|
|
Changed |
syslinux-4.04.tar.bz2/linux/syslinux-nomtools
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/linux/syslinux.c
^
|
@@ -382,6 +382,10 @@
sync();
rmdir(mntpath);
exit(0);
+ } else if (opt.update_only && !syslinux_already_installed(dev_fd)) {
+ fprintf(stderr, "%s: no previous syslinux boot sector found\n",
+ argv[0]);
+ exit(1);
} else {
fprintf(stderr, "%s: please specify --install or --update for the future\n", argv[0]);
opt.update_only = 0;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/man/syslinux.1
^
|
@@ -140,11 +140,6 @@
and if no "append" is given the default is to use the global entry (if any).
Use "append -" to use no options at all. Up to 128 "label" entries are
permitted.
-.TP
-.B Notes:
-Labels are mangled as if they were DOS filenames, and must be unique after
-mangling. For example, two labels "v2.1.30" and "v2.1.31" will not be
-distinguishable.
.IP
The "image" doesn't have to be a Linux kernel; it can be a boot sector or a
COMBOOT file (see below.)
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/mbr/altmbr.S
^
|
@@ -49,8 +49,8 @@
.text
.globl _start
_start:
+ .byte 0x33, 0xc0 /* xorw %ax, %ax */
cli
- xorw %ax, %ax
movw %ax, %ds
movw %ax, %ss
movw $stack, %sp
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/altmbr.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/altmbr_c.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/altmbr_f.bin
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/mbr/gptmbr.S
^
|
@@ -55,8 +55,8 @@
.text
.globl _start
_start:
+ .byte 0x33, 0xc0 /* xorw %ax, %ax */
cli
- xorw %ax, %ax
movw %ax, %ds
movw %ax, %ss
movw $stack, %sp
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/gptmbr.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/gptmbr_c.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/gptmbr_f.bin
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/mbr/isohdpfx.S
^
|
@@ -65,9 +65,8 @@
.text
.globl _start
_start:
-
+ .byte 0x33, 0xed /* xorw %bp, %bp */
cli
- xorw %bp, %bp
movw %bp, %ss
movw $stack, %sp
sti
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/isohdpfx.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/isohdpfx_c.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/isohdpfx_f.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/isohdppx.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/isohdppx_c.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/isohdppx_f.bin
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/mbr/mbr.S
^
|
@@ -49,8 +49,8 @@
.text
.globl _start
_start:
+ .byte 0x33, 0xc0 /* xorw %ax, %ax */
cli
- xorw %ax, %ax
movw %ax, %ds
movw %ax, %ss
movw $stack, %sp
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/mbr.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/mbr_c.bin
^
|
|
Changed |
syslinux-4.04.tar.bz2/mbr/mbr_f.bin
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/memdisk/Makefile
^
|
@@ -39,10 +39,12 @@
OBJS16 = init.o16 init32.o
OBJS32 = start32.o setup.o msetup.o e820func.o conio.o memcpy.o memset.o \
memmove.o unzip.o dskprobe.o eltorito.o \
+ ctypes.o strntoumax.o strtoull.o suffix_number.o \
memdisk_chs_512.o memdisk_edd_512.o \
memdisk_iso_512.o memdisk_iso_2048.o
-CSRC = setup.c msetup.c e820func.c conio.c unzip.c dskprobe.c eltorito.c
+CSRC = setup.c msetup.c e820func.c conio.c unzip.c dskprobe.c eltorito.c \
+ ctypes.c strntoumax.c strtoull.c suffix_number.c
SSRC = start32.S memcpy.S memset.S memmove.S
NASMSRC = memdisk_chs_512.asm memdisk_edd_512.asm \
memdisk_iso_512.asm memdisk_iso_2048.asm \
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/memdisk/ctypes.c
^
|
@@ -0,0 +1 @@
+#include "../com32/lib/ctypes.c"
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/memdisk/dskprobe.c
^
|
@@ -16,37 +16,129 @@
* Routines for probing BIOS disk drives
*/
-/*
- * Uncomment for debugging
- *
- * #define DBG_DSKPROBE 1
- */
+/* Change to 1 for debugging */
+#define DBG_DSKPROBE 0
#include <stdint.h>
#include "memdisk.h"
#include "bda.h"
#include "conio.h"
-/*
- * We will probe a BIOS drive numer using INT 13h, AH=probe
- * and will pass along that call's success or failure
+/* Function type for printf() */
+typedef int (f_printf) (const char *, ...);
+
+/* Dummy printf() that does nothing */
+static f_printf no_printf;
+static f_printf *dskprobe_printfs[] = { no_printf, printf };
+
+#define dskprobe_printf (dskprobe_printfs[DBG_DSKPROBE])
+
+static void dskprobe_pause(com32sys_t *);
+
+/* Probe routine function type */
+typedef int (f_probe) (uint8_t, com32sys_t *);
+static f_probe probe_int13h_08h, probe_int13h_15h, probe_int13h_41h;
+
+/* We will probe a BIOS drive number using INT 0x13, AH == func */
+static void probe_any(uint8_t func, uint8_t drive, com32sys_t * regs)
+{
+ regs->eax.b[1] = func; /* AH == sub-function for probe */
+ regs->edx.b[0] = drive; /* DL == drive number to probe */
+ intcall(0x13, regs, regs);
+ return;
+}
+
+/**
+ * Determine if the return from probe_int13h_01h indicates a failure; a
+ * return of zero indicates no known failure.
*/
-int probe_int13_ah(uint8_t drive, uint8_t probe)
+static int probe_int13h_01h_fail(int istatus)
{
- int err;
+ int status = 0;
+
+ if (istatus >= 256)
+ status = istatus;
+ else
+ switch (istatus) {
+ case 1: status = istatus;
+ }
+ return status;
+}
+
+/**
+ * INT 0x13, AH == 0x01: Get status of last command.
+ */
+static int probe_int13h_01h(uint8_t drive)
+{
+ int status;
com32sys_t regs;
memset(®s, 0, sizeof regs);
+ probe_any(0x01, drive, ®s);
+ status = (regs.eflags.l & 1) * 256 + regs.eax.b[1];
+ dskprobe_printf(" AH01: CF%d AH%02x", regs.eflags.l & 1, regs.eax.b[1]);
+ return status;
+}
- regs.eax.b[1] = probe; /* AH = probe */
- regs.edx.b[0] = drive; /* DL = drive number to probe */
- intcall(0x13, ®s, ®s);
-
- err = !(regs.eflags.l & 1);
-#ifdef DBG_DSKPROBE
- printf("probe_int13_ah(0x%02x, 0x%02x) == %d\n", drive, probe, err);
-#endif
- return err;
+/**
+ * INT 0x13, AH == 0x08: Get drive parameters.
+ */
+static int probe_int13h_08h(uint8_t drive, com32sys_t * regs)
+{
+ int present;
+ int status;
+
+ memset(regs, 0, sizeof *regs);
+ probe_any(0x08, drive, regs);
+ dskprobe_printf(" AH08: CF%d AH%02x AL%02x BL%02x DL%02x ",
+ regs->eflags.l & 1, regs->eax.b[1], regs->eax.b[0],
+ regs->ebx.b[0], regs->edx.b[0]);
+ present = !(regs->eflags.l & 1) && !regs->eax.b[1];
+ status = probe_int13h_01h(drive);
+ present = present && !(probe_int13h_01h_fail(status));
+ dskprobe_printf(" P%d\n", present);
+ return present;
+}
+
+/**
+ * INT 0x13, AH == 0x15: Get disk type.
+ */
+static int probe_int13h_15h(uint8_t drive, com32sys_t * regs)
+{
+ int present;
+ int status;
+
+ memset(regs, 0, sizeof *regs);
+ probe_any(0x15, drive, regs);
+ dskprobe_printf(" AH15: CF%d AH%02x AL%02x CX%04x DX%04x",
+ regs->eflags.l & 1, regs->eax.b[1], regs->eax.b[0],
+ regs->ecx.w[0], regs->edx.w[0]);
+ present = !(regs->eflags.l & 1) && regs->eax.b[1];
+ status = probe_int13h_01h(drive);
+ present = present && !(probe_int13h_01h_fail(status));
+ dskprobe_printf(" P%d\n", present);
+ return present;
+}
+
+/**
+ * INT 0x13, AH == 0x41: INT 0x13 extensions installation check.
+ */
+static int probe_int13h_41h(uint8_t drive, com32sys_t * regs)
+{
+ int present;
+ int status;
+
+ memset(regs, 0, sizeof *regs);
+ regs->ebx.w[0] = 0x55AA; /* BX == 0x55AA */
+ probe_any(0x41, drive, regs);
+ dskprobe_printf(" AH41: CF%d AH%02x BX%04x CX%04x DH%02x",
+ regs->eflags.l & 1, regs->eax.b[1], regs->ebx.w[0],
+ regs->ecx.w[0], regs->edx.b[1]);
+ present = !(regs->eflags.l & 1) && (regs->ebx.w[0] == 0xAA55);
+ status = probe_int13h_01h(drive);
+ present = present && !(probe_int13h_01h_fail(status));
+ dskprobe_printf(" P%d\n", present);
+ return present;
}
/*
@@ -72,10 +164,8 @@
bios_drives = 0;
}
err = (drive - (drive & 0x80)) >= bios_drives ? 0 : 1;
-#ifdef DBG_DSKPROBE
- printf("probe_bda_drive(0x%02x) == %d, count: %d\n",
- drive, err, bios_drives);
-#endif
+ dskprobe_printf("BDA drive %02x? %d, total count: %d\n", drive, err,
+ bios_drives);
return err;
}
@@ -83,16 +173,21 @@
* We will probe a drive with a few different methods, returning
* the count of succesful probes
*/
-int probe_drive(uint8_t drive)
+int multi_probe_drive(uint8_t drive)
{
int c = 0;
+ com32sys_t regs;
+
+ dskprobe_printf("INT 13 DL%02x:\n", drive);
/* Only probe the BDA for floppies */
if (drive & 0x80) {
- c += probe_int13_ah(drive, 0x08);
- c += probe_int13_ah(drive, 0x15);
- c += probe_int13_ah(drive, 0x41);
+
+ c += probe_int13h_08h(drive, ®s);
+ c += probe_int13h_15h(drive, ®s);
+ c += probe_int13h_41h(drive, ®s);
}
c += probe_bda_drive(drive);
+ dskprobe_pause(®s);
return c;
}
@@ -104,7 +199,7 @@
uint8_t probe_drive_range(uint8_t start)
{
uint8_t drive = start;
- while (probe_drive(drive)) {
+ while (multi_probe_drive(drive)) {
drive++;
/* Check for passing the floppy/HDD boundary */
if ((drive & 0x7F) == 0)
@@ -112,3 +207,22 @@
}
return drive;
}
+
+/* Dummy printf() that does nothing */
+static int no_printf(const char *ignored, ...)
+{
+ (void)ignored;
+ return 0;
+}
+
+/* Pause if we are in debug-mode */
+static void dskprobe_pause(com32sys_t * regs)
+{
+ if (!DBG_DSKPROBE)
+ return;
+ dskprobe_printf("Press a key to continue...\n");
+ memset(regs, 0, sizeof *regs);
+ regs->eax.w[0] = 0;
+ intcall(0x16, regs, NULL);
+ return;
+}
|
|
Changed |
syslinux-4.04.tar.bz2/memdisk/memdisk
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/memdisk/setup.c
^
|
@@ -14,6 +14,8 @@
* ----------------------------------------------------------------------- */
#include <stdint.h>
+#include <minmax.h>
+#include <suffix_number.h>
#include "bda.h"
#include "dskprobe.h"
#include "e820.h"
@@ -119,7 +121,7 @@
*/
#define UNZIP_ALIGN 512
-extern void _end; /* Symbol signalling end of data */
+extern const char _end[]; /* Symbol signalling end of data */
void unzip_if_needed(uint32_t * where_p, uint32_t * size_p)
{
@@ -171,8 +173,8 @@
? 0xFFFFFFFF : (uint32_t) ranges[i + 1].start);
/* Make sure we don't overwrite ourselves */
- if (startrange < (uint32_t) & _end)
- startrange = (uint32_t) & _end;
+ if (startrange < (uint32_t) _end)
+ startrange = (uint32_t) _end;
/* Allow for alignment */
startrange =
@@ -521,6 +523,8 @@
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 */
@@ -556,6 +560,8 @@
}
}
}
+
+ hd_geometry.type = 0;
}
}
@@ -564,8 +570,8 @@
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)
@@ -705,6 +711,36 @@
return v;
}
+/*
+ * Set max memory by reservation
+ * Adds reservations to data in INT15h to prevent access to the top of RAM
+ * if there's any above the point specified.
+ */
+void setmaxmem(unsigned long long restop_ull)
+{
+ uint32_t restop;
+ struct e820range *ep;
+ const int int15restype = 2;
+
+ /* insertrange() works on uint32_t */
+ restop = min(restop_ull, UINT32_MAX);
+ /* printf(" setmaxmem '%08x%08x' => %08x\n",
+ (unsigned int)(restop_ull>>32), (unsigned int)restop_ull, restop); */
+
+ for (ep = ranges; ep->type != -1U; ep++) {
+ if (ep->type == 1) { /* Only if available */
+ if (ep->start >= restop) {
+ /* printf(" %08x -> 2\n", ep->start); */
+ ep->type = int15restype;
+ } else if (ep[1].start > restop) {
+ /* printf(" +%08x =2; cut %08x\n", restop, ep->start); */
+ insertrange(restop, (ep[1].start - restop), int15restype);
+ }
+ }
+ }
+ parse_mem();
+}
+
struct real_mode_args rm_args;
/*
@@ -737,6 +773,7 @@
int no_bpt; /* No valid BPT presented */
uint32_t boot_seg = 0; /* Meaning 0000:7C00 */
uint32_t boot_len = 512; /* One sector */
+ const char *p;
/* We need to copy the rm_args into their proper place */
memcpy(&rm_args, rm_args_ptr, sizeof rm_args);
@@ -942,6 +979,10 @@
pptr->cd_pkt.geom3 = (uint8_t)(pptr->heads);
}
+ if ((p = getcmditem("mem")) != CMD_NOTFOUND) {
+ setmaxmem(suffix_number(p));
+ }
+
/* The size is given by hptr->total_size plus the size of the E820
map -- 12 bytes per range; we may need as many as 2 additional
ranges (each insertrange() can worst-case turn 1 area into 3)
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/memdisk/strntoumax.c
^
|
@@ -0,0 +1 @@
+#include "../com32/lib/strntoumax.c"
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/memdisk/strtoull.c
^
|
@@ -0,0 +1 @@
+#include "../com32/lib/strtoull.c"
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/memdisk/strtox.c
^
|
@@ -0,0 +1 @@
+#include "../com32/lib/strtox.c"
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/memdisk/suffix_number.c
^
|
@@ -0,0 +1 @@
+#include "../com32/lib/suffix_number.c"
|
|
Changed |
syslinux-4.04.tar.bz2/memdump/memdump.com
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/modules/Makefile
^
|
@@ -19,7 +19,7 @@
INCLUDES = -I$(com32)/include
-BINS = pxechain.com poweroff.com int18.com
+BINS = pxechain.com poweroff.com int18.com ver.com
all: $(BINS)
|
[-]
[+]
|
Added |
syslinux-4.04.tar.bz2/modules/ver.asm
^
|
@@ -0,0 +1,606 @@
+; ****************************************************************************
+;
+; ver.asm
+;
+; A COMBOOT/DOS COM program to display the version of the system
+; (Syslinux, DOS, or DRMK)
+;
+; Copyright (C) 2009-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.
+;
+; ****************************************************************************
+
+; %define DEBUG
+
+ section .text
+ org 0x100
+
+_start:
+ call crlf
+ mov si,info_str
+ call writestr
+ call getdosver
+ call chkprn_dosver
+ jnz .end
+ call chkprn_syslinux
+ call crlf
+.end:
+; pop ds
+ ret
+
+
+; chkprn_syslinux
+chkprn_syslinux:
+%ifdef DEBUG
+ mov si,may_sysl_str
+ call writestr
+%endif
+ cmp eax,59530000h
+ jne .end
+ cmp ebx,4C530000h
+ jne .end
+ cmp ecx,4E490000h
+ jne .end
+ cmp edx,58550000h
+ jne .end
+.is_syslinux:
+ pushad
+%ifdef DEBUG
+ mov si,is_sysl_str
+ call writestr
+%endif
+.get_sysl_ver:
+ mov ax,0001h
+ int 22h
+; AX=0001h [2.00] Get Version
+;
+; Input: AX 0001h
+; Output: AX number of INT 22h API functions available
+; CH Syslinux major version number
+; CL Syslinux minor version number
+; DL Syslinux derivative ID (e.g. 32h = PXELINUX)
+; ES:SI Syslinux version string
+; ES:DI Syslinux copyright string
+%ifdef DEBUG
+ push si
+ push cs
+ pop ds
+ mov si,gotver_str
+ call writestr
+ pop si
+%endif
+
+.prn_ver_str:
+ mov si,syslban_str
+ call writestr
+ push ds
+ push es
+ pop ds
+ call writestr
+ call crlf
+ pop ds
+.prn_var:
+ cmp dl,31h
+ je .var_sysl
+ cmp dl,32h
+ je .var_pxel
+ cmp dl,33h
+ je .var_isol
+ cmp dl,34h
+ je .var_extl
+ jmp .var_unk
+.var_sysl:
+ mov si,sysl_str
+ call writestr
+ jmp .prn_lnxsp
+.var_pxel:
+ mov si,pxel_str
+ call writestr
+ jmp .prn_lnxsp
+.var_isol:
+ mov si,isol_str
+ call writestr
+ jmp .prn_lnxsp
+.var_extl:
+ mov si,extl_str
+ call writestr
+; jmp .prn_lnxsp
+.prn_lnxsp:
+ mov si,linsp_str
+ call writestr
+ jmp .prn_ver
+.var_unk:
+ mov si,unkvar_str
+ call writestr
+.prn_ver:
+%ifdef DEBUG
+ push si
+ push cs
+ pop ds
+ mov si,prn_ver_str
+ call writestr
+ pop si
+%endif
+.prn_ver_maj:
+ mov al,ch
+ call writedecb
+ mov dl,'.'
+ call writechr_dl
+.prn_ver_min:
+ mov al,cl
+; cmp al,10
+; jae .min_wri
+; mov al,'0'
+; call writechr
+; mov al,cl
+; .min_wri:
+; call writedecb
+ call writedecb2
+
+.end_prn:
+ popad
+.end:
+ ret
+
+; chkprn_dosver Check and print DOS version;
+; Input Data from INT21 AH=30h
+; AH Major version of DOS or 0
+; AL Minor Version
+; BH DOS type
+; BL:CX 24-bit OEM serial number
+; Return
+; ZF Unset if DOS, Set if not DOS (AX=0)
+chkprn_dosver:
+ and ax,ax ; cmp ax,0
+ jz .end
+.is_dos:
+ push eax
+ push edx
+ push si
+%ifdef DEBUG
+ mov si,is_dos_str
+ call writestr
+ call crlf
+ call prnreg_gp_l
+ call crlf
+%endif
+.var_prn:
+ cmp bh,0
+ je .var_pcdos
+ cmp bh,0FFh
+ je .var_msdos
+ cmp bh,0FDh
+ je .var_freedos
+ cmp bh,0DEh
+ je .var_drmk
+ jmp .var_unk
+.var_pcdos:
+ mov si,pcdos_str
+ call writestr
+ jmp .var_end
+.var_msdos:
+ mov si,msdos_str
+ call writestr
+ jmp .var_end
+.var_freedos:
+ mov si,freedos_str
+ call writestr
+ jmp .var_end
+.var_drmk:
+ mov si,drmk_str
+ call writestr
+ jmp .var_end
+.var_unk:
+ mov si,unkdos_str
+ call writestr
+ mov si,spparen_str
+ call writestr
+ push eax
+ mov al,bh
+ call writehex2
+ pop eax
+ mov si,parensp_str
+ call writestr
+; jmp .var_end
+.var_end:
+ call prn_dosver_num
+ call crlf
+.subver:
+ pop si
+ pop edx
+ pop eax
+ cmp bh,0FFh
+ je .msdos_ver
+ cmp bh,0DEh
+ jne .end_ver
+.drmk_ver:
+ call getprn_drmkver
+; jmp .end_ver ; DRMK returns Extended/True DOS
+.msdos_ver:
+ cmp al,5
+ jb .end_ver
+ call getprn_msdosver
+.end_ver:
+ and ax,ax ; Unset ZF
+.end:
+ ret
+
+; prn_dosver_num Print the numerical DOS version
+; Input Data from INT21 AH=30h
+; AH Major version of DOS or 0
+; AL Minor Version
+; BH DOS type
+; BL:CX 24-bit OEM serial number
+prn_dosver_num:
+ push eax
+ push edx
+ push si
+ pushfd
+.vmaj_prn:
+ call writedecb
+; call writehex2
+ mov dl,'.'
+ call writechr_dl
+.vmin_prn:
+ mov al,ah
+ call writedecb
+; call writehex2
+.serial: ; Skip if 0
+ cmp bl,0
+ jne .ser_start
+ cmp cx,0
+ je .end
+.ser_start:
+ mov si,spparen_str
+ call writestr
+ mov si,zerox_str
+ call writestr
+.ser_bl:
+ mov al,bl
+ call writehex2
+.ser_cx:
+ mov ax,cx
+ call writehex4
+.serial_end:
+ mov si,parensp_str
+ call writestr
+.end:
+ popfd
+ pop si
+ pop edx
+ pop eax
+ ret
+
+; getdosver Get the DOS version
+; Return Version or 0 + SYSLINUX message
+; EAX Part 1
+; EBX Part 2
+; ECX Part 3
+; EDX Part 4
+getdosver:
+ mov ecx,0
+ mov edx,0
+ mov ebx,0
+ mov eax,3000h
+ int 21h
+ ret
+
+; getmsdosver Get the Extended MS-DOS version
+; Returns Version
+; EAX Part 1
+; EBX Part 2
+; ECX Part 3
+; EDX Part 4
+getmsdosver:
+ mov ecx,0
+ mov edx,0
+ mov ebx,0
+ mov eax,3306h
+ int 21h
+ ret
+
+; getprn_msdosver
+getprn_msdosver:
+ pushad
+ pushfd
+ call getmsdosver
+%ifdef DEBUG
+ call prnreg_gp_l
+ call crlf
+%endif
+ mov si,dosext_str
+ call writestr
+ mov eax,ebx
+ mov ebx,0
+ mov ecx,edx
+ call prn_dosver_num
+.end:
+ popfd
+ popad
+ ret
+
+; getdrmkver: Get the DRMK-specifc OS version
+; Returns Version
+; AX OS Version
+; DX Patch Version
+getdrmkver:
+ mov ax,4452h
+ int 21h
+ ret
+
+; getdrmkver: Get the DRMK-specifc Kernel build info
+; Returns Kernel build info
+; AX Kernel build date in DOS 16-bit format
+; [ES:BX] Kernel private data
+getdrmkbld:
+ mov ax,4458h
+ int 21h
+ ret
+
+; getprn_drmkver: Get/Print DRMK-specific Version info
+getprn_drmkver:
+ pushad
+ pushfd
+.getver:
+ call getdrmkver
+.prnosver: ; "OS Version"
+ mov si,osver_str
+ call writestr
+ mov si,zerox_str
+ call writestr
+; mov ax,0
+ call writehex4
+ call crlf
+.prnpatchver: ; "Patch Version"
+ mov si,patchver_str
+ call writestr
+ mov si,zerox_str
+ call writestr
+ mov ax,dx
+ call writehex4
+ call crlf
+.getbld:
+ call getdrmkbld
+.prnkernbld: ; "Kernel Build Date"
+ mov si,kernbld_str
+ call writestr
+ call writedate_ax
+ call crlf
+.prnkernprvaddr:
+ mov si,prvdat_str
+ call writestr
+ mov ax,es
+ call writehex4
+ mov dl,':'
+ call writechr_dl
+ mov ax,bx
+ call writehex4
+ call crlf
+%ifdef DEBUG
+.prnkernprv:
+ mov di,[es:bx]
+ mov ax,di
+ call writehex4
+ call crlf
+ mov si,2
+ mov cx,8
+.prnkernprv2:
+ push cx
+ mov cx,8
+.prnkernprv1:
+ mov eax,[es:bx+si]
+ call writehex8
+ cmp cx,1
+ jbe .prnkern0dash
+ mov ax,'-'
+ call writechr
+.prnkern0dash:
+ add si,4
+ sub di,4
+ cmp di,0
+ jbe .prnkernprvend
+ loop .prnkernprv1
+ call crlf
+ pop cx
+ loop .prnkernprv2
+ jmp .end
+.prnkernprvend:
+ pop cx
+%endif
+.end:
+ popfd
+ popad
+ ret
+
+;writedate_ax Write a date in AX in ISO8601 big endian format
+; Input
+; AX Date in 16-bit DOS format
+; 2006-01-11
+; 0011010 0001 01011
+writedate_ax:
+ pushad
+ pushfd
+ mov dx,ax
+%ifdef DEBUG
+ call writehex4
+ call crlf
+%endif
+.year:
+ shr ax,9
+ add ax,1980
+ call writedecw
+ mov al,'-'
+ call writechr
+ mov ax,dx
+.month:
+ shr ax,5
+ and ax,0Fh
+; cmp ax,10
+; jae .month_wri
+; mov cx,ax
+; mov ax,'0'
+; call writechr
+; mov ax,cx
+; .month_wri:
+; call writedecb
+ call writedecb2
+ mov al,'-'
+ call writechr
+ mov ax,dx
+.day:
+ and ax,1Fh
+; cmp ax,10
+; jae .day_wri
+; mov cx,ax
+; mov ax,'0'
+; call writechr
+; mov ax,cx
+; .day_wri:
+; call writedecb
+ call writedecb2
+.end:
+ popfd
+ popad
+ ret
+
+; writechr_dl Write a character to the console saving AX
+; Input
+; DL character to write
+writechr_dl:
+ push ax
+ mov ah,02h
+ int 21h
+.end:
+ pop ax
+ ret
+
+; writechr_al Write a character to the console saving AX
+; Input
+; AL character to write
+writechr:
+writechr_al:
+ push dx
+ mov dl,al
+ call writechr_dl
+.end: pop dx
+ ret
+
+; writedecb[23] Print byte as fixed width
+; Input
+; AL number to write
+writedecb3:
+ pushfd
+ cmp al,100
+ jae .skip
+ push ax
+ mov ax,'0'
+ call writechr
+ pop ax
+.skip: popfd
+writedecb2:
+ pushfd
+ cmp al,10
+ jae .skip
+ push ax
+ mov ax,'0'
+ call writechr
+ pop ax
+.skip: popfd
+ call writedecb
+ ret
+
+
+; prnreg_gp_l Dump GP registers (Long)
+prnreg_gp_l:
+ push eax
+ push si
+ call crlf
+ mov si,sp2_str
+ call writestr
+ mov si,eax_str
+ call writestr
+ call writehex8
+ mov si,sp2_str
+ call writestr
+ mov si,ecx_str
+ call writestr
+ mov eax,ecx
+ call writehex8
+ mov si,sp2_str
+ call writestr
+ mov si,edx_str
+ call writestr
+ mov eax,edx
+ call writehex8
+ mov si,sp2_str
+ call writestr
+ mov si,ebx_str
+ call writestr
+ mov eax,ebx
+ call writehex8
+ call crlf
+ pop si
+ pop eax
+.end:
+ ret
+
+; is_zf
+is_zf:
+ push si
+ jz .true
+.false:
+ mov si,zero_not_str
+ call writestr
+ jmp .end
+.true:
+ mov si,zero_is_str
+ call writestr
+.end:
+ pop si
+ ret
+
+%include "../core/macros.inc" ; CR/LF
+%include "../core/writestr.inc" ; String output
+%include "../core/writehex.inc" ; Hexadecimal output
+%include "../core/writedec.inc" ; Decimal output
+
+ section .data
+info_str db 'Ver.com b026', CR, LF, 0
+is_dos_str db 'Found DOS', CR, LF, 0
+is_sysl_str db 'Found a Syslinux variant', CR, LF, 0
+is_drmk_str db 'Found DRMK', CR, LF, 0
+may_sysl_str db 'Maybe Syslinux variant', CR, LF, 0
+gotver_str db 'Got the version back', CR, LF, 0
+prn_ver_str db 'Printing version number', CR, LF, 0
+syslban_str db 'Syslinux banner: ',0
+sysl_str db 'SYS', 0
+pxel_str db 'PXE', 0
+isol_str db 'ISO', 0
+extl_str db 'EXT', 0
+linsp_str db 'LINUX ', 0
+unkvar_str db 'Unkown-Variant ', 0
+pcdos_str db 'PC-DOS ', 0
+msdos_str db 'MS-DOS ', 0
+freedos_str db 'FreeDOS ', 0
+unkdos_str db 'Unknown-DOS ', 0
+drmk_str db 'DRMK ', 0
+dosext_str db ' Extended DOS version: ', 0
+osver_str db ' OS Version: ', 0
+patchver_str db ' Patch Version: ', 0
+kernbld_str db ' Kernel Build Date: ', 0
+prvdat_str db ' Private Data Ptr: ', 0
+spparen_str db ' (', 0
+zerox_str db '0x', 0
+parensp_str db ') ', 0
+eax_str db 'EAX=', 0
+ebx_str db 'EBX=', 0
+ecx_str db 'ECX=', 0
+edx_str db 'EDX=', 0
+sp2_str db ' ', 0
+zero_not_str db ' NOT_Zero ',0
+zero_is_str db ' IS_Zero ',0
|
|
Added |
syslinux-4.04.tar.bz2/modules/ver.com
^
|
|
Changed |
syslinux-4.04.tar.bz2/mtools/syslinux
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/sample/Makefile
^
|
@@ -15,6 +15,7 @@
##
topdir = ..
+include $(topdir)/MCONFIG.embedded
PPMTOLSS16 = $(topdir)/utils/ppmtolss16
|
|
Added |
syslinux-4.04.tar.bz2/sample/syslogo.lss
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/syslinux.spec
^
|
@@ -1,6 +1,6 @@
# -*- rpm -*-
-%define RPMVERSION 4.03
-%define VERSION 4.03
+%define RPMVERSION 4.04
+%define VERSION 4.04
Summary: Kernel loader which uses a FAT, ext2/3 or iso9660 filesystem or a PXE network
Name: syslinux
Version: %{RPMVERSION}
@@ -11,7 +11,7 @@
ExclusiveArch: i386 i486 i586 i686 athlon pentium4 x86_64
Packager: H. Peter Anvin <hpa@zytor.com>
Buildroot: %{_tmppath}/%{name}-%{VERSION}-root
-BuildPrereq: nasm >= 2.03, perl
+BuildRequires: nasm >= 2.03, perl
Autoreq: 0
%ifarch x86_64
Requires: mtools, libc.so.6()(64bit)
@@ -94,6 +94,7 @@
%{_datadir}/syslinux/*.0
%{_datadir}/syslinux/memdisk
%{_datadir}/syslinux/dosutil/*
+%{_datadir}/syslinux/diag/*
%files devel
%{_datadir}/syslinux/com32
|
|
Changed |
syslinux-4.04.tar.bz2/utils/gethostip
^
|
|
Changed |
syslinux-4.04.tar.bz2/utils/isohybrid
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/utils/isohybrid.pl
^
|
@@ -256,7 +256,7 @@
exit 0;
__END__
-fa 31 ed 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 66 53 66 51 6 57 8e dd 8e c5
+33 ed fa 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 66 53 66 51 6 57 8e dd 8e c5
52 be 0 7c bf 0 6 b9 0 1 f3 a5 ea 2b 6 0 0 52 b4 41 bb aa 55 31 c9 30 f6 f9
cd 13 72 16 81 fb 55 aa 75 10 83 e1 1 74 b 66 c7 6 d1 6 b4 42 eb 15 eb 0 5a
51 b4 8 cd 13 83 e1 3f 5b 51 f b6 c6 40 50 f7 e1 53 52 50 bb 0 7c b9 4 0 66
@@ -272,7 +272,7 @@
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
*
-fa 31 ed 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 66 53 66 51 6 57 8e dd 8e c5
+33 ed fa 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 66 53 66 51 6 57 8e dd 8e c5
b2 80 52 be 0 7c bf 0 6 b9 0 1 f3 a5 ea 2d 6 0 0 52 b4 41 bb aa 55 31 c9 30
f6 f9 cd 13 72 16 81 fb 55 aa 75 10 83 e1 1 74 b 66 c7 6 d3 6 b4 42 eb 15
eb 0 5a 51 b4 8 cd 13 83 e1 3f 5b 51 f b6 c6 40 50 f7 e1 53 52 50 bb 0 7c
@@ -289,7 +289,7 @@
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0
*
-fa 31 ed 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 66 53 66 51 6 57 8e dd 8e c5
+33 ed fa 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 66 53 66 51 6 57 8e dd 8e c5
f6 6 17 4 4 74 2 b2 80 52 be 0 7c bf 0 6 b9 0 1 f3 a5 ea 34 6 0 0 52 b4 41
bb aa 55 31 c9 30 f6 f9 cd 13 72 16 81 fb 55 aa 75 10 83 e1 1 74 b 66 c7 6
da 6 b4 42 eb 15 eb 0 5a 51 b4 8 cd 13 83 e1 3f 5b 51 f b6 c6 40 50 f7 e1
@@ -305,7 +305,7 @@
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
*
-fa 31 ed 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 21 f6 74 26 f6 4 7f 75 21 38
+33 ed fa 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 21 f6 74 26 f6 4 7f 75 21 38
4c 4 74 1c 66 3d 21 47 50 58 75 10 80 7c 4 ed 75 a 66 8b 4c 34 66 8b 5c 38
eb 4 66 8b 4c 8 66 53 66 51 6 57 8e dd 8e c5 52 be 0 7c bf 0 6 b9 0 1 f3 a5
ea 55 6 0 0 52 b4 41 bb aa 55 31 c9 30 f6 f9 cd 13 72 16 81 fb 55 aa 75 10
@@ -322,7 +322,7 @@
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
*
-fa 31 ed 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 21 f6 74 26 f6 4 7f 75 21 38
+33 ed fa 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 21 f6 74 26 f6 4 7f 75 21 38
4c 4 74 1c 66 3d 21 47 50 58 75 10 80 7c 4 ed 75 a 66 8b 4c 34 66 8b 5c 38
eb 4 66 8b 4c 8 66 53 66 51 6 57 8e dd 8e c5 b2 80 52 be 0 7c bf 0 6 b9 0
1 f3 a5 ea 57 6 0 0 52 b4 41 bb aa 55 31 c9 30 f6 f9 cd 13 72 16 81 fb 55
@@ -339,7 +339,7 @@
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
*
-fa 31 ed 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 21 f6 74 26 f6 4 7f 75 21 38
+33 ed fa 8e d5 bc 0 7c fb fc 66 31 db 66 31 c9 21 f6 74 26 f6 4 7f 75 21 38
4c 4 74 1c 66 3d 21 47 50 58 75 10 80 7c 4 ed 75 a 66 8b 4c 34 66 8b 5c 38
eb 4 66 8b 4c 8 66 53 66 51 6 57 8e dd 8e c5 f6 6 17 4 4 74 2 b2 80 52 be
0 7c bf 0 6 b9 0 1 f3 a5 ea 5e 6 0 0 52 b4 41 bb aa 55 31 c9 30 f6 f9 cd 13
|
|
Changed |
syslinux-4.04.tar.bz2/utils/memdiskfind
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/utils/memdiskfind.c
^
|
@@ -94,13 +94,23 @@
return maxram;
}
+static inline size_t get_page_size(void)
+{
+#ifdef _SC_PAGESIZE
+ return sysconf(_SC_PAGESIZE);
+#else
+ /* klibc, for one, doesn't have sysconf() due to excessive multiplex */
+ return getpagesize();
+#endif
+}
+
int main(int argc, char *argv[])
{
const char *map;
int memfd;
size_t fbm;
const char *ptr, *end;
- size_t page = sysconf(_SC_PAGESIZE);
+ size_t page = get_page_size();
size_t mapbase, maplen;
int err = 1;
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/utils/mkdiskimage
^
|
@@ -319,7 +319,7 @@
exit 0;
__END__
-fa 31 c0 8e d8 8e d0 bc 0 7c 89 e6 6 57 8e c0 fb fc bf 0 6 b9 0 1 f3 a5 ea
+33 c0 fa 8e d8 8e d0 bc 0 7c 89 e6 6 57 8e c0 fb fc bf 0 6 b9 0 1 f3 a5 ea
1f 6 0 0 52 52 b4 41 bb aa 55 31 c9 30 f6 f9 cd 13 72 13 81 fb 55 aa 75 d
d1 e9 73 9 66 c7 6 8d 6 b4 42 eb 15 5a b4 8 cd 13 83 e1 3f 51 f b6 c6 40 f7
e1 52 50 66 31 c0 66 99 e8 66 0 e8 21 1 4d 69 73 73 69 6e 67 20 6f 70 65 72
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/version
^
|
@@ -1 +1 @@
-4.03 2010
+4.04 2011
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/version.gen
^
|
@@ -1,6 +1,6 @@
-%define VERSION 4.03
-%define VERSION_STR "4.03"
+%define VERSION 4.04
+%define VERSION_STR "4.04"
%define VERSION_MAJOR 4
-%define VERSION_MINOR 3
-%define YEAR 2010
-%define YEAR_STR "2010"
+%define VERSION_MINOR 4
+%define YEAR 2011
+%define YEAR_STR "2011"
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/version.h
^
|
@@ -1,6 +1,6 @@
-#define VERSION 4.03
-#define VERSION_STR "4.03"
+#define VERSION 4.04
+#define VERSION_STR "4.04"
#define VERSION_MAJOR 4
-#define VERSION_MINOR 3
-#define YEAR 2010
-#define YEAR_STR "2010"
+#define VERSION_MINOR 4
+#define YEAR 2011
+#define YEAR_STR "2011"
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/version.mk
^
|
@@ -1,6 +1,6 @@
-VERSION := 4.03
-VERSION_STR := "4.03"
+VERSION := 4.04
+VERSION_STR := "4.04"
VERSION_MAJOR := 4
-VERSION_MINOR := 3
-YEAR := 2010
-YEAR_STR := "2010"
+VERSION_MINOR := 4
+YEAR := 2011
+YEAR_STR := "2011"
|
|
Changed |
syslinux-4.04.tar.bz2/win32/syslinux.exe
^
|
[-]
[+]
|
Changed |
syslinux-4.04.tar.bz2/win64/find-mingw64.sh
^
|
@@ -12,6 +12,14 @@
x86_64-mingw64msvc- \
x86_64-mingw32- \
x86_64-mingw32msvc- \
+ amd64-pc-mingw64- \
+ amd64-pc-mingw64msvc- \
+ amd64-pc-mingw32- \
+ amd64-pc-mingw32msvc- \
+ amd64-mingw64- \
+ amd64-mingw64msvc- \
+ amd64-mingw32- \
+ amd64-mingw32msvc- \
; do
if "${prefix}${cc}" -v > /dev/null 2>&1; then
echo "$prefix"
|
|
Changed |
syslinux-4.04.tar.bz2/win64/syslinux64.exe
^
|