Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/README
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/README	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/README	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,1 @@
+Put header files for LGPL or GPL library functions in this directory.
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/acpi.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/acpi.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/acpi.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,99 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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);
+char *flags_to_string(char *buffer, uint16_t flags);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/boot.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/boot.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/boot.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/dsdt.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/dsdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/dsdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/ecdt.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/ecdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/ecdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/facs.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/facs.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/facs.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/fadt.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/fadt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/fadt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/hpet.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/hpet.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/hpet.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/madt.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/madt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/madt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/mcfg.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/mcfg.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/mcfg.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/rsdp.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/rsdp.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/rsdp.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/rsdt.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/rsdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/rsdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/sbst.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/sbst.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/sbst.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/slic.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/slic.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/slic.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/ssdt.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/ssdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/ssdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/structs.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/structs.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/structs.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/tcpa.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/tcpa.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/tcpa.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/xsdt.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/xsdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/acpi/xsdt.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -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
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/cpuid.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/cpuid.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/cpuid.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,317 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2006-2009 Erwan Velu - All Rights Reserved
+ *
+ *   Portions of this file taken from the Linux kernel,
+ *   Copyright 1991-2009 Linus Torvalds and contributors
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2
+ *   as published by the Free Software Foundation, Inc.,
+ *   51 Franklin St, Fifth Floor, Boston MA 02110-1301;
+ *   incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _CPUID_H
+#define _CPUID_H
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <cpufeature.h>
+#include <sys/bitops.h>
+#include <sys/cpu.h>
+#include <sys/io.h>
+#include <klibc/compiler.h>
+
+#define PAGE_SIZE 4096
+
+#define CPU_MODEL_SIZE  48
+#define CPU_VENDOR_SIZE 48
+
+#define CPU_FLAGS(m_) \
+m_(bool,  fpu, 			/* Onboard FPU */) \
+m_(bool,  vme, 			/* Virtual Mode Extensions */) \
+m_(bool,  de, 			/* Debugging Extensions */) \
+m_(bool,  pse,			/* Page Size Extensions */) \
+m_(bool,  tsc,			/* Time Stamp Counter */) \
+m_(bool,  msr,			/* Model-Specific Registers, RDMSR, WRMSR */) \
+m_(bool,  pae,			/* Physical Address Extensions */) \
+m_(bool,  mce,			/* Machine Check Architecture */) \
+m_(bool,  cx8,			/* CMPXCHG8 instruction */) \
+m_(bool,  apic,			/* Onboard APIC */) \
+m_(bool,  sep,			/* SYSENTER/SYSEXIT */) \
+m_(bool,  mtrr,			/* Memory Type Range Registers */) \
+m_(bool,  pge,			/* Page Global Enable */) \
+m_(bool,  mca,			/* Machine Check Architecture */) \
+m_(bool,  cmov,			/* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */) \
+m_(bool,  pat,			/* Page Attribute Table */) \
+m_(bool,  pse_36,		/* 36-bit PSEs */) \
+m_(bool,  psn,			/* Processor serial number */) \
+m_(bool,  clflsh,		/* Supports the CLFLUSH instruction */) \
+m_(bool,  dts,			/* Debug Trace Store */) \
+m_(bool,  acpi,			/* ACPI via MSR */) \
+m_(bool,  pbe,			/* Pending Break Enable */) \
+m_(bool,  mmx,			/* Multimedia Extensions */) \
+m_(bool,  fxsr,			/* FXSAVE and FXRSTOR instructions (fast save and restore of FPU context), and CR4.OSFXSR available */) \
+m_(bool,  sse,			/* Streaming SIMD Extensions */) \
+m_(bool,  sse2,			/* Streaming SIMD Extensions 2 */) \
+m_(bool,  ss,			/* CPU self snoop */) \
+m_(bool,  htt,			/* Hyper-Threading */) \
+m_(bool,  acc,			/* Automatic clock control */) \
+m_(bool,  syscall,		/* SYSCALL/SYSRET */) \
+m_(bool,  mp,			/* MP Capable. */) \
+m_(bool,  nx,			/* Execute Disable */) \
+m_(bool,  mmxext,		/* AMD MMX extensions */) \
+m_(bool,  fxsr_opt,		/* FXSAVE/FXRSTOR optimizations */) \
+m_(bool,  gbpages,		/* "pdpe1gb" GB pages */) \
+m_(bool,  rdtscp,		/* RDTSCP */) \
+m_(bool,  lm,			/* Long Mode (x86-64) */) \
+m_(bool,  nowext,		/* AMD 3DNow! extensions */) \
+m_(bool,  now,			/* 3DNow! */) \
+m_(bool,  smp,			/* A smp configuration has been found */) \
+m_(bool,  pni,			/* Streaming SIMD Extensions-3 */) \
+m_(bool,  pclmulqd,		/* PCLMULQDQ instruction */) \
+m_(bool,  dtes64,		/* 64-bit Debug Store */) \
+m_(bool,  vmx,			/* Hardware virtualization */) \
+m_(bool,  smx,			/* Safer Mode */) \
+m_(bool,  est,			/* Enhanced SpeedStep */) \
+m_(bool,  tm2,			/* Thermal Monitor 2  */) \
+m_(bool,  sse3,			/* Supplemental SSE-3 */) \
+m_(bool,  cid,			/* Context ID */) \
+m_(bool,  fma,			/* Fused multiply-add  */) \
+m_(bool,  cx16,			/* CMPXCHG16B */) \
+m_(bool,  xtpr,			/* Send Task Priority Messages */) \
+m_(bool,  pdcm,			/* Performance Capabilities  */) \
+m_(bool,  dca,			/* Direct Cache Access */) \
+m_(bool,  xmm4_1,		/* "sse4_1" SSE-4.1 */) \
+m_(bool,  xmm4_2,		/* "sse4_2" SSE-4.2 */) \
+m_(bool,  x2apic,		/* x2APIC */) \
+m_(bool,  movbe,			/* MOVBE instruction */) \
+m_(bool,  popcnt,		/* POPCNT instruction */) \
+m_(bool,  aes,			/* AES Instruction */) \
+m_(bool,  xsave,			/* XSAVE/XRSTOR/XSETBV/XGETBV */) \
+m_(bool,  osxsave,		/* XSAVE enabled in the OS */) \
+m_(bool,  avx,			/* Advanced Vector Extensions */) \
+m_(bool,  hypervisor,		/* Running on a hypervisor */) \
+m_(bool,  ace2,			/* Advanced Cryptography Engine v2 */) \
+m_(bool,  ace2_en,		/* ACE v2 enabled */) \
+m_(bool,  phe,			/* PadLock Hash Engine */) \
+m_(bool,  phe_en,		/* PadLock Hash Engine Enabled */) \
+m_(bool,  pmm,			/* PadLock Montgomery Multiplier */) \
+m_(bool,  pmm_en,		/* PadLock Montgomery Multiplier enabled */) \
+m_(bool,  svm,			/* Secure virtual machine */) \
+m_(bool,  extapic,		/* Extended APIC space */) \
+m_(bool,  cr8_legacy,		/* CR8 in 32-bit mode */) \
+m_(bool,  abm,			/* Advanced bit manipulation */) \
+m_(bool,  sse4a,			/* SSE4-A */) \
+m_(bool,  misalignsse,		/* Misaligned SSE mode */) \
+m_(bool,  nowprefetch,		/* 3DNow prefetch instructions */) \
+m_(bool,  osvw,			/* OS Visible Workaround */) \
+m_(bool,  ibs,			/*  Instruction Based Sampling */) \
+m_(bool,  sse5,			/* SSE5 */) \
+m_(bool,  skinit,		/* SKINIT/STGI instructions */) \
+m_(bool,  wdt,			/* Watchdog Timer */) \
+m_(bool,  ida,			/* Intel Dynamic Acceleration */) \
+m_(bool,  arat,			/* Always Running APIC Timer */) \
+m_(bool,  tpr_shadow,		/* Intel TPR Shadow */) \
+m_(bool,  vnmi,			/* Intel Virtual NMI */) \
+m_(bool,  flexpriority,		/* Intel FlexPriority */) \
+m_(bool,  ept,			/* Intel Extended Page Table */) \
+m_(bool,  vpid,			/* Intel Virtual Processor ID */)
+
+#define STRUCT_MEMBERS(type_, name_, comment_) type_ name_;
+
+#define STRUCT_MEMBER_NAMES(type_, name_, comment_) #name_ , 
+
+#define STRUCTURE_MEMBER_OFFSETS(type_, name_, comment_) \
+	  offsetof(s_cpu_flags, name_),
+
+typedef struct {
+    CPU_FLAGS(STRUCT_MEMBERS)
+} s_cpu_flags;
+
+extern size_t cpu_flags_offset[];
+extern const char *cpu_flags_names[];
+extern size_t cpu_flags_count;
+
+typedef struct {
+    char vendor[CPU_VENDOR_SIZE];
+    uint8_t vendor_id;
+    uint8_t family;
+    char model[CPU_MODEL_SIZE];
+    uint8_t model_id;
+    uint8_t stepping;
+    uint8_t num_cores;
+    uint16_t l1_data_cache_size;
+    uint16_t l1_instruction_cache_size;
+    uint16_t l2_cache_size;
+    s_cpu_flags flags;
+} s_cpu;
+
+extern bool get_cpu_flag_value_from_name(s_cpu *cpu, const char * flag);
+/**********************************************************************************/
+/**********************************************************************************/
+/* From this point this is some internal stuff mainly taken from the linux kernel */
+/**********************************************************************************/
+/**********************************************************************************/
+
+/*
+ * EFLAGS bits
+ */
+#define X86_EFLAGS_CF   0x00000001	/* Carry Flag */
+#define X86_EFLAGS_PF   0x00000004	/* Parity Flag */
+#define X86_EFLAGS_AF   0x00000010	/* Auxillary carry Flag */
+#define X86_EFLAGS_ZF   0x00000040	/* Zero Flag */
+#define X86_EFLAGS_SF   0x00000080	/* Sign Flag */
+#define X86_EFLAGS_TF   0x00000100	/* Trap Flag */
+#define X86_EFLAGS_IF   0x00000200	/* Interrupt Flag */
+#define X86_EFLAGS_DF   0x00000400	/* Direction Flag */
+#define X86_EFLAGS_OF   0x00000800	/* Overflow Flag */
+#define X86_EFLAGS_IOPL 0x00003000	/* IOPL mask */
+#define X86_EFLAGS_NT   0x00004000	/* Nested Task */
+#define X86_EFLAGS_RF   0x00010000	/* Resume Flag */
+#define X86_EFLAGS_VM   0x00020000	/* Virtual Mode */
+#define X86_EFLAGS_AC   0x00040000	/* Alignment Check */
+#define X86_EFLAGS_VIF  0x00080000	/* Virtual Interrupt Flag */
+#define X86_EFLAGS_VIP  0x00100000	/* Virtual Interrupt Pending */
+#define X86_EFLAGS_ID   0x00200000	/* CPUID detection flag */
+
+#define X86_VENDOR_INTEL 0
+#define X86_VENDOR_CYRIX 1
+#define X86_VENDOR_AMD 2
+#define X86_VENDOR_UMC 3
+#define X86_VENDOR_NEXGEN 4
+#define X86_VENDOR_CENTAUR 5
+#define X86_VENDOR_RISE 6
+#define X86_VENDOR_TRANSMETA 7
+#define X86_VENDOR_NSC 8
+#define X86_VENDOR_UNKNOWN 9 
+#define X86_VENDOR_NUM 10 
+
+#define cpu_has(c, bit)                test_bit(bit, (c)->x86_capability)
+
+// Taken from asm/processor-flags.h
+// NSC/Cyrix CPU configuration register indexes
+#define CX86_CCR2       0xc2
+#define CX86_CCR3	0xc3
+#define CX86_DIR0       0xfe
+#define CX86_DIR1       0xff
+
+static const char Cx86_model[][9] = {
+	"Cx486", "Cx486", "5x86 ", "6x86", "MediaGX ", "6x86MX ",
+	"M II ", "Unknown"
+};
+
+static const char Cx486_name[][5] = {
+	"SLC", "DLC", "SLC2", "DLC2", "SRx", "DRx",
+	"SRx2", "DRx2"
+};
+
+static const char Cx486S_name[][4] = {
+	"S", "S2", "Se", "S2e"
+};
+
+static const char Cx486D_name[][4] = {
+	"DX", "DX2", "?", "?", "?", "DX4"
+};
+
+
+/*
+ *  CPU type and hardware bug flags. Kept separately for each CPU.
+ *  Members of this structure are referenced in head.S, so think twice
+ *  before touching them. [mj]
+ */
+
+struct cpuinfo_x86 {
+    uint8_t x86;		/* CPU family */
+    uint8_t x86_vendor;		/* CPU vendor */
+    uint8_t x86_model;
+    uint8_t x86_mask;
+    char wp_works_ok;		/* It doesn't on 386's */
+    char hlt_works_ok;		/* Problems on some 486Dx4's and old 386's */
+    char hard_math;
+    char rfu;
+    int cpuid_level;		/* Maximum supported CPUID level, -1=no CPUID */
+    uint32_t x86_capability[NCAPINTS];
+    char x86_vendor_id[16];
+    char x86_model_id[64];
+    uint16_t x86_l1_data_cache_size;	/* in KB, if available */
+    uint16_t x86_l1_instruction_cache_size;	/* in KB, if available */
+    uint16_t x86_l2_cache_size;	/* in KB, if available */
+    int x86_cache_alignment;	/* in bytes */
+    char fdiv_bug;
+    char f00f_bug;
+    char coma_bug;
+    char pad0;
+    int x86_power;
+    unsigned long loops_per_jiffy;
+#ifdef CONFIG_SMP
+    cpumask_t llc_shared_map;	/* cpus sharing the last level cache */
+#endif
+    unsigned char x86_num_cores;	/* cpuid returned the number of cores */
+    unsigned char booted_cores;	/* number of cores as seen by OS */
+    unsigned char apicid;
+    unsigned char x86_clflush_size;
+
+} __attribute__ ((__packed__));
+
+struct cpu_model_info {
+    int vendor;
+    int family;
+    char *model_names[16];
+};
+
+/* attempt to consolidate cpu attributes */
+struct cpu_dev {
+    const char *c_vendor;
+
+    /* some have two possibilities for cpuid string */
+    const char *c_ident[2];
+
+    struct cpu_model_info c_models[4];
+
+    void (*c_init) (struct cpuinfo_x86 * c);
+    void (*c_identify) (struct cpuinfo_x86 * c);
+    unsigned int (*c_size_cache) (struct cpuinfo_x86 * c, unsigned int size);
+};
+
+/*
+ * Structure definitions for SMP machines following the
+ * Intel Multiprocessing Specification 1.1 and 1.4.
+ */
+
+/*
+ * This tag identifies where the SMP configuration
+ * information is.
+ */
+
+#define SMP_MAGIC_IDENT (('_'<<24)|('P'<<16)|('M'<<8)|'_')
+
+struct intel_mp_floating {
+    char mpf_signature[4];	/* "_MP_"                       */
+    uint32_t mpf_physptr;	/* Configuration table address  */
+    uint8_t mpf_length;		/* Our length (paragraphs)      */
+    uint8_t mpf_specification;	/* Specification version        */
+    uint8_t mpf_checksum;	/* Checksum (makes sum 0)       */
+    uint8_t mpf_feature1;	/* Standard or configuration ?  */
+    uint8_t mpf_feature2;	/* Bit7 set for IMCR|PIC        */
+    uint8_t mpf_feature3;	/* Unused (0)                   */
+    uint8_t mpf_feature4;	/* Unused (0)                   */
+    uint8_t mpf_feature5;	/* Unused (0)                   */
+};
+
+static inline uint8_t getCx86(uint8_t reg) {
+	outb(reg, 0x22);
+	return inb(0x23);
+}
+
+static inline void setCx86(uint8_t reg, uint8_t data) {
+	outb(reg, 0x22);
+	outb(data, 0x23);
+}
+
+extern void get_cpu_vendor(struct cpuinfo_x86 *c);
+extern void detect_cpu(s_cpu * cpu);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/bootloaders.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/bootloaders.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/bootloaders.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,19 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef __BOOTLOADERS_H_
+#define __BOOTLOADERS_H_
+
+#include <stdint.h>
+#include <disk/geom.h>
+#include <disk/partition.h>
+
+int get_bootloader_string(struct driveinfo *, const struct part_entry *,
+			  char *, const int);
+#endif /* __BOOTLOADERS_H_ */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/common.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/common.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/common.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,33 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   Some parts borrowed from chain.c32:
+ *
+ *   Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _COMMON_H_
+#define _COMMON_H_
+
+#include <stdint.h>
+
+/* For PAGE_SIZE */
+#include <cpuid.h>
+
+#define SECTOR 512		/* bytes/sector */
+
+struct ebios_dapa {
+    uint16_t len;
+    uint16_t count;
+    uint16_t off;
+    uint16_t seg;
+    uint64_t lba;
+};
+
+#endif /* _COMMON_H_ */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/errno_disk.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/errno_disk.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/errno_disk.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,50 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _ERRNO_DISK_H
+#define _ERRNO_DISK_H
+
+extern int errno_disk;
+
+/* Prefix with ED to avoid confusion with errno */
+#define	EDINV	0x01		/* Invalid function in AH or invalid parameter */
+#define	EDADDR	0x02		/* Address mark not found */
+#define	EDRO	0x03		/* Disk write-protected */
+#define	EDNOFND	0x04		/* Sector not found/read error */
+#define	EDRFAIL	0x05		/* Reset failed (hard disk) */
+#define	EDCHANG	0x06		/* Disk changed (floppy) */
+#define	EDFAIL	0x07		/* Drive parameter activity failed (hard disk) */
+#define	EDDMA	0x08		/* DMA overrun */
+#define	EDBOUND	0x09		/* Data boundary error (attempted DMA across 64K boundary or >80h sectors) */
+#define	EDBADS	0x0A		/* Bad sector detected (hard disk) */
+#define	EDBADT	0x0B		/* Bad track detected (hard disk) */
+#define	EDINVM	0x0C		/* Unsupported track or invalid media */
+#define	EDINVS	0x0D		/* Invalid number of sectors on format (PS/2 hard disk) */
+#define	EDADDRM	0x0E		/* Control data address mark detected (hard disk) */
+#define	EDDMARG	0x0F		/* DMA arbitration level out of range (hard disk) */
+#define	EDCRCF	0x10		/* Uncorrectable CRC or ECC error on read */
+#define	EDCRCV	0x11		/* Data ECC corrected (hard disk) */
+#define	EDCTRL	0x20		/* Controller failure */
+#define	EDMEDIA	0x31		/* No media in drive (IBM/MS INT 13 extensions) */
+#define	EDCMOS	0x32		/* Incorrect drive type stored in CMOS (Compaq) */
+#define	EDSEEKF	0x40		/* Seek failed */
+#define	EDTIME	0x80		/* Timeout (not ready) */
+#define	EDREADY	0xAA		/* Drive not ready (hard disk) */
+#define	EDNLOCK	0xB0		/* Volume not locked in drive (INT 13 extensions) */
+#define	EDLOCK	0xB1		/* Volume locked in drive (INT 13 extensions) */
+#define	EDREMOV	0xB2		/* Volume not removable (INT 13 extensions) */
+#define	EDUSED	0xB3		/* Volume in use (INT 13 extensions) */
+#define	EDCOUNT	0xB4		/* Lock count exceeded (INT 13 extensions) */
+#define	EDEJF	0xB5		/* Valid eject request failed (INT 13 extensions) */
+#define	EDUNKOWN	0xBB	/* Undefined error (hard disk) */
+#define	EDWF	0xCC		/* Write fault (hard disk) */
+#define	EDRF	0xE0		/* Status register error (hard disk) */
+#define	EDSF	0xFF		/* Sense operation failed (hard disk) */
+
+#endif /* _ERRNO_DISK_H */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/error.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/error.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/error.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,13 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _ERROR_H_
+#define _ERROR_H_
+void get_error(const char *);
+#endif /* _ERROR_H_ */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/geom.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/geom.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/geom.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,326 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   Some parts borrowed from chain.c32:
+ *
+ *   Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *
+ *   Some parts borrowed from Linux:
+ *
+ *   Copyright (C) 2002, 2003, 2004 Dell Inc.
+ *   by Matt Domsch <Matt_Domsch@dell.com>
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _GEOM_H_
+#define _GEOM_H_
+
+#include <stdint.h>
+
+/**
+ * INT 13 Extensions
+ *
+ * Note: if the size is less than 30 on call, the final DWORD will not be
+ *       returned by a v2.x implementation; similarly for the Device Path info
+ **/
+struct edd_device_parameters {
+    uint16_t len;		/* size of returned data */
+	/**
+	 * Bitfields for IBM/MS INT 13 Extensions information flags:
+	 * Bit(s)    Description    (Table 00274)
+	 * 0    DMA boundary errors handled transparently
+	 * 1    cylinder/head/sectors-per-track information is valid
+	 * 2    removable drive
+	 * 3    write with verify supported
+	 * 4    drive has change-line support (required if drive >= 80h is removable)
+	 * 5    drive can be locked (required if drive >= 80h is removable)
+	 * 6    CHS information set to maximum supported values, not current media
+	 * 15-7    reserved (0)
+	 **/
+    uint16_t info;		/* information flags */
+    uint32_t cylinders;		/* number of physical cylinders on drive */
+    uint32_t heads;		/* number of physical heads on drive */
+    uint32_t sectors_per_track;	/* number of physical sectors per track */
+    uint64_t sectors;		/* total number of sectors on drive */
+    uint16_t bytes_per_sector;	/* bytes per sector */
+    /* --- v2.0+ --- */
+    uint32_t dpte_pointer;	/* EDD configuration parameters, FFFFh:FFFFh if not available */
+    /* --- v3.0 --- */
+    uint16_t device_path_information;	/* signature BEDDh to indicate presence of Device Path info */
+    uint8_t device_path_length;	/* length of Device Path information, including signature and this byte (24h for v3.0) */
+    uint8_t device_path_reserved;	/* reserved (0) */
+    uint16_t device_path_reserved_2;	/* reserved (0) */
+    uint8_t host_bus_type[4];	/* ASCIZ name of host bus ("ISA" or "PCI") */
+    uint8_t interface_type[8];	/* ASCIZ name of interface type
+				 *         "ATA"
+				 *         "ATAPI"
+				 *         "SCSI"
+				 *         "USB"
+				 *         "1394" IEEE 1394 (FireWire)
+				 *         "FIBRE" Fibre Channel
+				 */
+	/**
+	 * Format of EDD v3.0 Interface Path:
+	 * Offset    Size    Description    (Table 00275)
+	 * ---ISA---
+	 * 00h    WORD    16-bit base address
+	 * 02h 6 BYTEs    reserved (0)
+	 * ---PCI---
+	 * 00h    BYTE    PCI bus number
+	 * 01h    BYTE    PCI device number
+	 * 02h    BYTE    PCI function number
+	 * 03h 5 BYTEs    reserved (0)
+	 **/
+    union {
+	struct {
+	    uint16_t base_address;
+	    uint16_t reserved1;
+	    uint32_t reserved2;
+	} __attribute__ ((packed)) isa;
+	struct {
+	    uint8_t bus;
+	    uint8_t slot;
+	    uint8_t function;
+	    uint8_t channel;
+	    uint32_t reserved;
+	} __attribute__ ((packed)) pci;
+	/* pcix is same as pci */
+	struct {
+	    uint64_t reserved;
+	} __attribute__ ((packed)) ibnd;
+	struct {
+	    uint64_t reserved;
+	} __attribute__ ((packed)) xprs;
+	struct {
+	    uint64_t reserved;
+	} __attribute__ ((packed)) htpt;
+	struct {
+	    uint64_t reserved;
+	} __attribute__ ((packed)) unknown;
+    } interface_path;
+	/**
+	 * Format of EDD v3.0 Device Path:
+	 * Offset    Size    Description    (Table 00276)
+	 * ---ATA---
+	 * 00h    BYTE    flag: 00h = master, 01h = slave
+	 * 01h 7 BYTEs    reserved (0)
+	 * ---ATAPI---
+	 * 00h    BYTE    flag: 00h = master, 01h = slave
+	 * 01h    BYTE    logical unit number
+	 * 02h 6 BYTEs    reserved (0)
+	 * ---SCSI---
+	 * 00h    BYTE    logical unit number
+	 * 01h 7 BYTEs    reserved (0)
+	 * ---USB---
+	 * 00h    BYTE    to be determined
+	 * 01h 7 BYTEs    reserved (0)
+	 * ---IEEE1394---
+	 * 00h    QWORD    64-bit FireWire General Unique Identifier (GUID)
+	 * ---FibreChannel---
+	 * 00h    QWORD    Word Wide Number (WWN)
+	 **/
+    union {
+	struct {
+	    uint8_t device;
+	    uint8_t reserved1;
+	    uint16_t reserved2;
+	    uint32_t reserved3;
+	    uint64_t reserved4;
+	} __attribute__ ((packed)) ata;
+	struct {
+	    uint8_t device;
+	    uint8_t lun;
+	    uint8_t reserved1;
+	    uint8_t reserved2;
+	    uint32_t reserved3;
+	    uint64_t reserved4;
+	} __attribute__ ((packed)) atapi;
+	struct {
+	    uint16_t id;
+	    uint64_t lun;
+	    uint16_t reserved1;
+	    uint32_t reserved2;
+	} __attribute__ ((packed)) scsi;
+	struct {
+	    uint64_t serial_number;
+	    uint64_t reserved;
+	} __attribute__ ((packed)) usb;
+	struct {
+	    uint64_t eui;
+	    uint64_t reserved;
+	} __attribute__ ((packed)) i1394;
+	struct {
+	    uint64_t wwid;
+	    uint64_t lun;
+	} __attribute__ ((packed)) fibre;
+	struct {
+	    uint64_t identity_tag;
+	    uint64_t reserved;
+	} __attribute__ ((packed)) i2o;
+	struct {
+	    uint32_t array_number;
+	    uint32_t reserved1;
+	    uint64_t reserved2;
+	} __attribute__ ((packed)) raid;
+	struct {
+	    uint8_t device;
+	    uint8_t reserved1;
+	    uint16_t reserved2;
+	    uint32_t reserved3;
+	    uint64_t reserved4;
+	} __attribute__ ((packed)) sata;
+	struct {
+	    uint64_t reserved1;
+	    uint64_t reserved2;
+	} __attribute__ ((packed)) unknown;
+    } device_path;
+    uint8_t reserved;		/* reserved (0) */
+    uint8_t checksum;		/* checksum of bytes 1Eh-40h (two's complement of sum, which makes
+				 * the 8-bit sum of bytes 1Eh-41h equal 00h) */
+} __attribute__ ((packed));
+
+/*
+ * Disk parameters
+ */
+struct driveinfo {
+    int disk;			/* Disk port (0x80 - 0xff) */
+    /* Legacy C/H/S */
+    int cbios;			/* CHS geometry is valid */
+    int legacy_max_head;
+    int legacy_max_cylinder;
+    int legacy_sectors_per_track;
+    int legacy_max_drive;
+    int legacy_type;		/* Drive type (AT/PS2 floppies only) */
+    /* EDD support */
+    int ebios;			/* EBIOS supported on this disk */
+    int edd_version;		/* EBIOS major version */
+    int edd_functionality_subset;
+    struct edd_device_parameters edd_params;	/* EDD parameters */
+};
+
+/**
+ * Format of Phoenix Enhanced Disk Drive Spec translated drive parameter table:
+ * Offset    Size    Description    (Table 00277)
+ * 00h    WORD    number of cylinders
+ * 02h    BYTE    number of heads
+ * 03h    BYTE    A0h (signature indicating translated table)
+ * 04h    BYTE    number of physical sectors per track
+ * 05h    WORD    starting write precompensation cylinder number
+ * 07h    BYTE    reserved
+ * 08h    BYTE    control byte (see #03198 at INT 41"DISK 0")
+ * 09h    WORD    number of physical cylinders
+ * 0Bh    BYTE    number of physical heads
+ * 0Ch    WORD    cylinder number of landing zone
+ * 0Eh    BYTE    number of logical sectors per track
+ * 0Fh    BYTE    checksum
+ * Program: the Phoenix Enhanced Disk Drive Specification is an addition to the
+ *     IBM/MS INT 13 extensions
+ *
+ * Format of Phoenix Enhanced Disk Drive Spec Fixed Disk Parameter Table:
+ * Offset    Size    Description    (Table 00278)
+ * 00h    WORD    physical I/O port base address
+ * 02h    WORD    disk-drive control port address
+ * 04h    BYTE    drive flags (see #00279)
+ * 05h    BYTE    proprietary information
+ *         bits 7-4 reserved (0)
+ *         bits 3-0: Phoenix proprietary (used by BIOS)
+ * 06h    BYTE    IRQ for drive (bits 3-0; bits 7-4 reserved and must be 0)
+ * 07h    BYTE    sector count for multi-sector transfers
+ * 08h    BYTE    DMA control
+ *         bits 7-4: DMA type (0-2) as per ATA-2 specification
+ *         bits 3-0: DMA channel
+ * 09h    BYTE    programmed I/O control
+ *         bits 7-4: reserved (0)
+ *         bits 3-0: PIO type (1-4) as per ATA-2 specification
+ * 0Ah    WORD    drive options (see #00280)
+ * 0Ch 2 BYTEs    reserved (0)
+ * 0Eh    BYTE    extension revision level (high nybble=major, low nybble=minor)
+ *         (currently 10h for v1.0 and 11h for v1.1-3.0)
+ * 0Fh    BYTE    2's complement checksum of bytes 00h-0Eh
+ *         8-bit sum of all bytes 00h-0Fh should equal 00h
+ * SeeAlso: #00277
+ *
+ * Bitfields for Phoenix Enhanced Disk Drive Spec drive flags:
+ * Bit(s)    Description    (Table 00279)
+ * 7    reserved (1)
+ * 6    LBA enabled
+ * 5    reserved (1)
+ * 4    drive is slave
+ * 3-0    reserved (0)
+ * SeeAlso: #00278,#00280
+ *
+ * Bitfields for Phoenix Enhanced Disk Drive Spec drive options:
+ * Bit(s)    Description    (Table 00280)
+ * 0    fast PIO enabled
+ * 1    fast DMA access enabled
+ * 2    block PIO (multi-sector transfers) enabled
+ * 3    CHS translation enabled
+ * 4    LBA translation enabled
+ * 5    removable media
+ * 6    ATAPI device (CD-ROM)
+ * 7    32-bit transfer mode
+ * ---v1.1+ ---
+ * 8    ATAPI device uses DRQ to signal readiness for packet command
+ *     (must be 0 if bit 6 is 0)
+ * 10-9    translation type (must be 00 if bit 3 is 0)
+ *     00 Phoenix bit-shifting translation
+ *     01 LBA-assisted translation
+ *     10 reserved
+ *     11 proprietary translation
+ * ---v3.0---
+ * 11    Ultra DMA access enabled
+ * 15-12    reserved
+ **/
+
+/*
+ * Values for diskette drive type:
+ *     01h    360K
+ *     02h    1.2M
+ *     03h    720K
+ *     04h    1.44M
+ *     05h    ???
+ *            reportedly an obscure drive type shipped on some IBM machines,
+ *            2.88M on some machines (at least AMI 486 BIOS)
+ *     06h    2.88M
+ *     10h    ATAPI Removable Media Device
+ */
+enum diskette_drive_types {
+    DISKETTE_360K = 1,
+    DISKETTE_1_2M = 2,
+    DISKETTE_720K = 3,
+    DISKETTE_1_44M = 4,
+    DISKETTE_2_88M = 6,
+    DISKETTE_ATAPI = 10,
+};
+
+/**
+ * chs_to_lba - compute lba value from cylinder, head and sector number
+ **/
+static inline int chs_to_lba(const struct driveinfo *drive_info,
+			     const unsigned int cylinder,
+			     const unsigned int head, const unsigned int sector)
+{
+    /* Use EDD, if valid */
+    if (drive_info->edd_params.sectors_per_track > 0 &&
+	drive_info->edd_params.heads > 0)
+	return (sector - 1) +
+	    (head * drive_info->edd_params.sectors_per_track) +
+	    (cylinder * (drive_info->edd_params.heads) *
+	     drive_info->edd_params.sectors_per_track);
+    else if (drive_info->cbios)
+	return (sector - 1) + (head * drive_info->legacy_sectors_per_track) +
+	    (cylinder * (drive_info->legacy_max_head + 1) *
+	     drive_info->legacy_sectors_per_track);
+}
+
+void lba_to_chs(const struct driveinfo *drive_info, const int lba,
+		unsigned int *cylinder, unsigned int *head,
+		unsigned int *sector);
+int get_drive_parameters(struct driveinfo *drive_info);
+
+#endif /* _GEOM_H */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/mbrs.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/mbrs.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/mbrs.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,18 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef __MBRS_H_
+#define __MBRS_H_
+
+#include <stdint.h>
+#include <disk/geom.h>
+
+void get_mbr_string(const uint32_t, void *, const int);
+uint32_t get_mbr_id(const struct driveinfo *);
+#endif /* __MBRS_H_ */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/msdos.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/msdos.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/msdos.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,19 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _MSDOS_H_
+#define _MSDOS_H_
+
+#include <disk/geom.h>
+#include <disk/partition.h>
+
+typedef void (*p_callback) (struct driveinfo *, struct part_entry *, int, int);
+int parse_partition_table(struct driveinfo *, p_callback);
+
+#endif /* _MSDOS_H_ */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/partition.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/partition.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/partition.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,37 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   Some parts borrowed from chain.c32:
+ *
+ *   Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _PARTITION_H_
+#define _PARTITION_H_
+
+#include <stdint.h>
+
+#define PARTITION_TABLES_OFFSET	0x1be
+
+/* A DOS partition table entry */
+struct part_entry {
+    uint8_t active_flag;	/* 0x80 if "active" */
+    uint8_t start_head;
+    uint8_t start_sect;
+    uint8_t start_cyl;
+    uint8_t ostype;
+    uint8_t end_head;
+    uint8_t end_sect;
+    uint8_t end_cyl;
+    uint32_t start_lba;
+    uint32_t length;
+} __attribute__ ((packed));
+
+void get_label(int label, char **buffer_label);
+#endif /* _PARTITION_H_ */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/read.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/read.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/read.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,18 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _READ_H_
+#define _READ_H_
+
+#include <disk/geom.h>
+
+int read_mbr(int, void *);
+int dev_read(int, void *, unsigned int, int);
+int read_sectors(struct driveinfo *, void *, const unsigned int, const int);
+#endif /* _READ_H */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/swsusp.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/swsusp.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/swsusp.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,19 @@
+#ifndef _SWSUSP_H_
+#define _SWSUSP_H_
+
+#include <disk/geom.h>
+#include <disk/common.h>
+#include <disk/partition.h>
+
+#define SWSUSP_SIG	"S1SUSPEND"
+
+struct swsusp_header {
+    char reserved[PAGE_SIZE - 20 - sizeof(unsigned long) - sizeof(int)];
+    unsigned long image;
+    unsigned int flags;		/* Flags to pass to the "boot" kernel */
+    char orig_sig[10];
+    char sig[10];
+} __attribute__ ((packed));
+
+int swsusp_check(struct driveinfo *, struct part_entry *);
+#endif /* _SWSUSP_H */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/util.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/util.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/util.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,21 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   Some parts borrowed from chain.c32:
+ *
+ *   Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _UTIL_H_
+#define _UTIL_H_
+
+#include <com32.h>
+
+int int13_retry(const com32sys_t * inreg, com32sys_t * outreg);
+#endif /* _UTIL_H_ */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/write.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/write.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/disk/write.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,26 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   Some parts borrowed from chain.c32:
+ *
+ *   Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _WRITE_H_
+#define _WRITE_H_
+
+#include <disk/geom.h>
+
+int write_sectors(const struct driveinfo *, const unsigned int,
+		  const void *, const int);
+int write_verify_sector(struct driveinfo *drive_info,
+			const unsigned int, const void *);
+int write_verify_sectors(struct driveinfo *,
+			 const unsigned int, const void *, const int);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,98 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2006 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 DMI_H
+#define DMI_H
+#include <inttypes.h>
+#define MAX_DMI_MEMORY_ITEMS 32
+#define MAX_DMI_CACHE_ITEMS 32
+#define OEM_STRINGS_SIZE 512
+#define HARDWARE_SECURITY_SIZE 16
+
+#define PAGE_SIZE 4096
+
+extern const char *out_of_spec;
+extern const char *bad_index;
+
+#define WORD(x) (uint16_t)(*(const uint16_t *)(x))
+#define DWORD(x) (uint32_t)(*(const uint32_t *)(x))
+#define QWORD(x) (*(const uint64_t *)(x))
+
+enum { DMI_TABLE_PRESENT = 100, ENODMITABLE };
+
+#include "dmi_bios.h"
+#include "dmi_system.h"
+#include "dmi_base_board.h"
+#include "dmi_chassis.h"
+#include "dmi_processor.h"
+#include "dmi_memory.h"
+#include "dmi_battery.h"
+#include "dmi_ipmi.h"
+#include "dmi_cache.h"
+
+extern char display_line;
+#define moreprintf(...) do { display_line++; if (display_line == 24) { char tempbuf[10]; display_line=0; printf("Press enter to continue"); fgets(tempbuf, sizeof tempbuf, stdin);}  printf ( __VA_ARGS__); } while (0);
+
+typedef struct {
+    uint16_t num;
+    uint16_t len;
+    uint16_t ver;
+    uint32_t base;
+    uint16_t major_version;
+    uint16_t minor_version;
+} dmi_table;
+
+struct dmi_header {
+    uint8_t type;
+    uint8_t length;
+    uint16_t handle;
+    uint8_t *data;
+};
+
+typedef struct {
+    s_bios bios;
+    s_system system;
+    s_base_board base_board;
+    s_chassis chassis;
+    s_processor processor;
+    s_battery battery;
+    s_memory_module memory_module[MAX_DMI_MEMORY_ITEMS];
+    s_memory memory[MAX_DMI_MEMORY_ITEMS];
+    s_ipmi ipmi;
+    s_cache cache[MAX_DMI_CACHE_ITEMS];
+    int memory_module_count;
+    int memory_count;
+    int cache_count;
+    dmi_table dmitable;
+    char oem_strings[OEM_STRINGS_SIZE];
+    struct {
+	char power_on_passwd_status[HARDWARE_SECURITY_SIZE];
+	char keyboard_passwd_status[HARDWARE_SECURITY_SIZE];
+	char administrator_passwd_status[HARDWARE_SECURITY_SIZE];
+	char front_panel_reset_status[HARDWARE_SECURITY_SIZE];
+	bool filled;
+    } hardware_security;
+} s_dmi;
+
+void to_dmi_header(struct dmi_header *h, uint8_t * data);
+void dmi_bios_runtime_size(uint32_t code, s_dmi * dmi);
+const char *dmi_string(struct dmi_header *dm, uint8_t s);
+int dmi_checksum(uint8_t * buf, int len);
+void parse_dmitable(s_dmi * dmi);
+void dmi_decode(struct dmi_header *h, uint16_t ver, s_dmi * dmi);
+int dmi_iterate(s_dmi * dmi);
+
+/* dmi_utils.c */
+void display_bios_characteristics(s_dmi * dmi);
+void display_base_board_features(s_dmi * dmi);
+void display_processor_flags(s_dmi * dmi);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_base_board.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_base_board.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_base_board.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,60 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2006 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 DMI_BASE_BOARD_H
+#define DMI_BASE_BOARD_H
+
+#include "stdbool.h"
+#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 */
+/* each bool is associated to the relevant message above */
+typedef struct {
+    bool hosting;
+    bool board_needs_daughter;
+    bool removable;
+    bool replaceable;
+    bool hot_swappable;
+} __attribute__ ((__packed__)) s_base_board_features;
+
+typedef struct {
+    char manufacturer[BASE_BOARD_MANUFACTURER_SIZE];
+    char product_name[BASE_BOARD_PRODUCT_NAME_SIZE];
+    char version[BASE_BOARD_VERSION_SIZE];
+    char serial[BASE_BOARD_SERIAL_SIZE];
+    char asset_tag[BASE_BOARD_ASSET_TAG_SIZE];
+    char location[BASE_BOARD_LOCATION_SIZE];
+    char type[BASE_BOARD_TYPE_SIZE];
+    s_base_board_features features;
+/* The filled field have to be set to true when the dmitable implement that item */
+    bool filled;
+    struct {
+	char type[16];
+	uint8_t status;
+	char description[BASE_BOARD_DEVICE_DESCRIPTION];
+    } devices_information[10];
+} s_base_board;
+
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_battery.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_battery.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_battery.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,57 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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 DMI_BATTERY_H
+#define DMI_BATTERY_H
+
+#include <stdbool.h>
+#include <inttypes.h>
+
+#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
+#define BATTERY_SBDS_SIZE		255
+#define BATTERY_MAXIMUM_ERROR_SIZE	32
+#define BATTERY_SBDS_SERIAL_SIZE	32
+#define BATTERY_SBDS_MANUFACTURE_DATE_SIZE	255
+#define BATTERY_SBDS_CHEMISTRY_SIZE	65
+#define BATTERY_OEM_INFO_SIZE		255
+
+typedef struct {
+    char location[BATTERY_LOCATION_SIZE];
+    char manufacturer[BATTERY_MANUFACTURER_SIZE];
+    char manufacture_date[BATTERY_MANUFACTURE_DATE_SIZE];
+    char serial[BATTERY_SERIAL_SIZE];
+    char name[BATTERY_DEVICE_NAME_SIZE];
+    char chemistry[BATTERY_CHEMISTRY_SIZE];
+    char design_capacity[BATTERY_CAPACITY_SIZE];
+    char design_voltage[BATTERY_DESIGN_VOLTAGE_SIZE];
+    char sbds[BATTERY_SBDS_SIZE];
+    char sbds_serial[BATTERY_SBDS_SERIAL_SIZE];
+    char maximum_error[BATTERY_MAXIMUM_ERROR_SIZE];
+    char sbds_manufacture_date[BATTERY_SBDS_MANUFACTURE_DATE_SIZE];
+    char sbds_chemistry[BATTERY_SBDS_CHEMISTRY_SIZE];
+    char oem_info[BATTERY_OEM_INFO_SIZE];
+/* The filled field have to be set to true when the dmitable implement that item */
+    bool filled;
+} s_battery;
+
+const char *dmi_battery_chemistry(uint8_t code);
+void dmi_battery_capacity(uint16_t code, uint8_t multiplier, char *capacity);
+void dmi_battery_voltage(uint16_t code, char *voltage);
+void dmi_battery_maximum_error(uint8_t code, char *error);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_bios.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_bios.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_bios.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,108 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2006 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 DMI_BIOS_H
+#define DMI_BIOS_H
+
+#include "stdbool.h"
+#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
+#define BIOS_FIRMWARE_REVISION_SIZE	16
+
+#define BIOS_CHAR_NB_ELEMENTS		29
+#define BIOS_CHAR_X1_NB_ELEMENTS	8
+#define BIOS_CHAR_X2_NB_ELEMENTS	3
+
+extern const char *bios_charac_strings[];
+
+/* this struct has BIOS_CHAR_NB_ELEMENTS */
+/* each bool is associated with the relevant message above */
+typedef struct {
+    bool bios_characteristics_not_supported;
+    bool isa;
+    bool mca;
+    bool eisa;
+    bool pci;
+    bool pc_card;
+    bool pnp;
+    bool apm;
+    bool bios_upgreadable;
+    bool bios_shadowing;
+    bool vlb;
+    bool escd;
+    bool boot_from_cd;
+    bool selectable_boot;
+    bool bios_rom_socketed;
+    bool boot_from_pcmcia;
+    bool edd;
+    bool japanese_floppy_nec_9800_1_2MB;
+    bool japanese_floppy_toshiba_1_2MB;
+    bool floppy_5_25_360KB;
+    bool floppy_5_25_1_2MB;
+    bool floppy_3_5_720KB;
+    bool floppy_3_5_2_88MB;
+    bool print_screen;
+    bool keyboard_8042_support;
+    bool serial_support;
+    bool printer_support;
+    bool cga_mono_support;
+    bool nec_pc_98;
+} __attribute__ ((__packed__)) s_characteristics;
+
+extern const char *bios_charac_x1_strings[];
+
+/* this struct has BIOS_CHAR_X1_NB_ELEMENTS */
+/* each bool is associated with the relevant message above */
+typedef struct {
+    bool acpi;
+    bool usb_legacy;
+    bool agp;
+    bool i2o_boot;
+    bool ls_120_boot;
+    bool zip_drive_boot;
+    bool ieee_1394_boot;
+    bool smart_battery;
+} __attribute__ ((__packed__)) s_characteristics_x1;
+
+extern const char *bios_charac_x2_strings[];
+
+/* this struct has BIOS_CHAR_X2_NB_ELEMENTS */
+/* each bool is associated with the relevant message above */
+typedef struct {
+    bool bios_boot_specification;
+    bool bios_network_boot_by_keypress;
+    bool target_content_distribution;
+} __attribute__ ((__packed__)) s_characteristics_x2;
+
+typedef struct {
+    char vendor[BIOS_VENDOR_SIZE];
+    char version[BIOS_VERSION_SIZE];
+    char release_date[BIOS_RELEASE_SIZE];
+    uint16_t address;
+    uint16_t runtime_size;
+    char runtime_size_unit[BIOS_RUNTIME_SIZE_UNIT_SIZE];
+    uint16_t rom_size;
+    char rom_size_unit[BIOS_ROM_UNIT_SIZE];
+    s_characteristics characteristics;
+    s_characteristics_x1 characteristics_x1;
+    s_characteristics_x2 characteristics_x2;
+    char bios_revision[BIOS_BIOS_REVISION_SIZE];
+    char firmware_revision[BIOS_FIRMWARE_REVISION_SIZE];
+/* The filled field have to be set to true when the dmitable implement that item */
+    bool filled;
+} s_bios;
+
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_cache.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_cache.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_cache.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,49 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer - All Rights Reserved
+ *
+ *   Some part borrowed from DMI Decode:
+ *
+ *   (C) 2000-2002 Alan Cox <alan@redhat.com>
+ *   (C) 2002-2007 Jean Delvare <khali@linux-fr.org>
+ *
+ *   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 DMI_CACHE_H
+#define DMI_CACHE_H
+
+#include <stdint.h>
+
+#include "stdbool.h"
+
+#define CACHE_SOCKET_DESIGNATION_SIZE  65
+
+typedef struct {
+    char socket_designation[CACHE_SOCKET_DESIGNATION_SIZE];
+    char configuration[32];
+    char mode[32];
+    char location[8];
+    uint16_t installed_size;
+    uint16_t max_size;
+    char supported_sram_types[32];
+    char installed_sram_types[32];
+    uint16_t speed;
+    char error_correction_type[32];
+    char system_type[16];
+    char associativity[32];
+} __attribute__ ((__packed__)) s_cache;
+
+const char *dmi_cache_mode(uint8_t code);
+const char *dmi_cache_location(uint8_t code);
+uint16_t dmi_cache_size(uint16_t code);
+void dmi_cache_types(uint16_t code, const char *sep, char *array);
+const char *dmi_cache_ec_type(uint8_t code);
+const char *dmi_cache_type(uint8_t code);
+const char *dmi_cache_associativity(uint8_t code);
+#endif /* DMI_CACHE_H */
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_chassis.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_chassis.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_chassis.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,50 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2006 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 DMI_CHASSIS_H
+#define DMI_CHASSIS_H
+
+#define CHASSIS_MANUFACTURER_SIZE	65
+#define CHASSIS_TYPE_SIZE		16
+#define CHASSIS_LOCK_SIZE		16
+#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
+#define CHASSIS_SECURITY_STATUS_SIZE	32
+#define CHASSIS_OEM_INFORMATION_SIZE	32
+
+typedef struct {
+    char manufacturer[CHASSIS_MANUFACTURER_SIZE];
+    char type[CHASSIS_TYPE_SIZE];
+    char lock[CHASSIS_LOCK_SIZE];
+    char version[CHASSIS_VERSION_SIZE];
+    char serial[CHASSIS_SERIAL_SIZE];
+    char asset_tag[CHASSIS_ASSET_TAG_SIZE];
+    char boot_up_state[CHASSIS_BOOT_UP_STATE_SIZE];
+    char power_supply_state[CHASSIS_POWER_SUPPLY_STATE_SIZE];
+    char thermal_state[CHASSIS_THERMAL_STATE_SIZE];
+    char security_status[CHASSIS_SECURITY_STATUS_SIZE];
+    char oem_information[CHASSIS_OEM_INFORMATION_SIZE];
+    uint16_t height;
+    uint16_t nb_power_cords;
+/* The filled field have to be set to true when the dmitable implement that item */
+    bool filled;
+} s_chassis;
+
+const char *dmi_chassis_type(uint8_t code);
+const char *dmi_chassis_lock(uint8_t code);
+const char *dmi_chassis_state(uint8_t code);
+const char *dmi_chassis_security_status(uint8_t code);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_ipmi.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_ipmi.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_ipmi.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,33 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2006-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 DMI_IPMI_H
+#define DMI_IPMI_H
+
+#define IPMI_INTERFACE_TYPE_SIZE	32
+#define IPMI_MEMORY_MODEL_SIZE		16
+
+typedef struct {
+    char interface_type[IPMI_INTERFACE_TYPE_SIZE];
+    uint8_t major_specification_version;
+    uint8_t minor_specification_version;
+    uint8_t I2C_slave_address;
+    uint16_t nv_address;
+    uint64_t base_address;
+
+    uint8_t irq;
+    bool filled;
+} s_ipmi;
+
+void dmi_ipmi_base_address(uint8_t type, const uint8_t * p, s_ipmi * ipmi);
+const char *dmi_ipmi_interface_type(uint8_t code);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_memory.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_memory.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_memory.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,78 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   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 DMI_MEMORY_H
+#define DMI_MEMORY_H
+
+#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	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		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];
+    char error[MEMORY_ERROR_SIZE];
+    char total_width[MEMORY_TOTAL_WIDTH_SIZE];
+    char data_width[MEMORY_DATA_WIDTH_SIZE];
+    char size[MEMORY_SIZE_SIZE];
+    char form_factor[MEMORY_FORM_FACTOR_SIZE];
+    char device_set[MEMORY_DEVICE_SET_SIZE];
+    char device_locator[MEMORY_DEVICE_LOCATOR_SIZE];
+    char bank_locator[MEMORY_BANK_LOCATOR_SIZE];
+    char type[MEMORY_TYPE_SIZE];
+    char type_detail[MEMORY_TYPE_DETAIL_SIZE];
+    char speed[MEMORY_SPEED_SIZE];
+    char serial[MEMORY_SERIAL_SIZE];
+    char asset_tag[MEMORY_ASSET_TAG_SIZE];
+    char part_number[MEMORY_PART_NUMBER_SIZE];
+/* The filled field have to be set to true when the dmitable implement that item */
+    bool filled;
+} s_memory;
+
+typedef struct {
+    char socket_designation[MEMORY_SOCKET_DESIGNATION_SIZE];
+    char bank_connections[8];
+    char speed[8];
+    char type[48];
+    char installed_size[48];
+    char enabled_size[48];
+    char error_status[8];
+    bool filled;
+} s_memory_module;
+
+void dmi_memory_array_error_handle(uint16_t code, char *array);
+void dmi_memory_device_width(uint16_t code, char *width);
+void dmi_memory_device_size(uint16_t code, char *size);
+const char *dmi_memory_device_form_factor(uint8_t code);
+void dmi_memory_device_set(uint8_t code, char *set);
+const char *dmi_memory_device_type(uint8_t code);
+void dmi_memory_device_type_detail(uint16_t code, char *type_detail, int sizeof_type_detail);
+void dmi_memory_device_speed(uint16_t code, char *speed);
+
+void dmi_memory_module_connections(uint8_t, char *, int);
+void dmi_memory_module_speed(uint8_t, char *);
+void dmi_memory_module_types(uint16_t, const char *, char *, int);
+void dmi_memory_module_size(uint8_t, char *, int);
+void dmi_memory_module_error(uint8_t, const char *, char *);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_processor.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_processor.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_processor.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,115 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2006 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 DMI_PROCESSOR_H
+#define DMI_PROCESSOR_H
+
+#include "stdbool.h"
+#include "string.h"
+#define PROCESSOR_SOCKET_DESIGNATION_SIZE		65
+#define PROCESSOR_TYPE_SIZE		32
+#define PROCESSOR_FAMILY_SIZE		32
+#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		65
+#define PROCESSOR_ASSET_TAG_SIZE	65
+#define PROCESSOR_PART_NUMBER_SIZE	65
+#define PROCESSOR_ID_SIZE		32
+
+#define PROCESSOR_FLAGS_ELEMENTS	32
+/* Intel AP-485 revision 28, table 5 */
+extern const char *cpu_flags_strings[PROCESSOR_FLAGS_ELEMENTS];
+
+/* this struct have PROCESSOR_FLAGS_ELEMENTS */
+/* each bool is associated to the relevant message above */
+typedef struct {
+    bool fpu;
+    bool vme;
+    bool de;
+    bool pse;
+    bool tsc;
+    bool msr;
+    bool pae;
+    bool mce;
+    bool cx8;
+    bool apic;
+    bool null_10;
+    bool sep;
+    bool mtrr;
+    bool pge;
+    bool mca;
+    bool cmov;
+    bool pat;
+    bool pse_36;
+    bool psn;
+    bool clfsh;
+    bool null_20;
+    bool ds;
+    bool acpi;
+    bool mmx;
+    bool fxsr;
+    bool sse;
+    bool sse2;
+    bool ss;
+    bool htt;
+    bool tm;
+    bool null_30;
+    bool pbe;
+} __attribute__ ((__packed__)) s_dmi_cpu_flags;
+
+typedef struct {
+    uint8_t type;
+    uint8_t family;
+    uint8_t model;
+    uint8_t stepping;
+    uint8_t minor_stepping;
+} __attribute__ ((__packed__)) s_signature;
+
+typedef struct {
+    char socket_designation[PROCESSOR_SOCKET_DESIGNATION_SIZE];
+    char type[PROCESSOR_TYPE_SIZE];
+    char family[PROCESSOR_FAMILY_SIZE];
+    char manufacturer[PROCESSOR_MANUFACTURER_SIZE];
+    char version[PROCESSOR_VERSION_SIZE];
+    uint16_t voltage_mv;
+    uint16_t external_clock;
+    uint16_t max_speed;
+    uint16_t current_speed;
+    char status[PROCESSOR_STATUS_SIZE];
+    char upgrade[PROCESSOR_UPGRADE_SIZE];
+    char cache1[PROCESSOR_CACHE_SIZE];
+    char cache2[PROCESSOR_CACHE_SIZE];
+    char cache3[PROCESSOR_CACHE_SIZE];
+    char serial[PROCESSOR_SERIAL_SIZE];
+    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 */
+    bool filled;
+} s_processor;
+
+const char *dmi_processor_type(uint8_t code);
+const char *dmi_processor_family(uint8_t code, char *manufacturer);
+const char *dmi_processor_status(uint8_t code);
+const char *dmi_processor_upgrade(uint8_t code);
+void dmi_processor_cache(uint16_t code, const char *level, uint16_t ver,
+			 char *cache);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_system.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_system.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/dmi/dmi_system.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,53 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2006 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 DMI_SYSTEM_H
+#define DMI_SYSTEM_H
+
+#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		65
+#define SYSTEM_FAMILY_SIZE		65
+
+#define SYSTEM_BOOT_STATUS_SIZE		50
+#define SYSTEM_CONFIGURATION_OPTIONS_SIZE	50
+
+typedef struct {
+    char manufacturer[SYSTEM_MANUFACTURER_SIZE];
+    char product_name[SYSTEM_PRODUCT_NAME_SIZE];
+    char version[SYSTEM_VERSION_SIZE];
+    char serial[SYSTEM_SERIAL_SIZE];
+    char uuid[SYSTEM_UUID_SIZE];
+    char wakeup_type[SYSTEM_WAKEUP_TYPE_SIZE];
+    char sku_number[SYSTEM_SKU_NUMBER_SIZE];
+    char family[SYSTEM_FAMILY_SIZE];
+/* The filled field have to be set to true when the dmitable implement that item */
+    bool filled;
+    char system_boot_status[SYSTEM_BOOT_STATUS_SIZE];
+    char configuration_options[SYSTEM_CONFIGURATION_OPTIONS_SIZE];
+    struct {
+	bool filled;
+	uint8_t status;
+	uint8_t watchdog;
+	char boot_option[17];
+	char boot_option_on_limit[17];
+	char reset_count[8];
+	char reset_limit[8];
+	char timer_interval[8];
+	char timeout[8];
+    } system_reset;
+} s_system;
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/memory.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/memory.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/memory.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,53 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Pierre-Alexandre Meyer
+ *
+ *   Some parts borrowed from meminfo.c32:
+ *
+ *   Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
+ *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *
+ *   Some parts borrowed from Linux:
+ *
+ *   Copyright (C) 1991, 1992 Linus Torvalds
+ *   Copyright 2007 rPath, Inc. - All Rights Reserved
+ *   Copyright 2009 Intel Corporation; author H. Peter Anvin
+ *
+ *   This file is part of Syslinux, and is made available under
+ *   the terms of the GNU General Public License version 2.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef _MEMORY_H_
+#define _MEMORY_H_
+#include <stdint.h>
+
+#define E820MAX 128
+#define E820_RAM        1
+#define E820_RESERVED   2
+#define E820_ACPI       3	/* usable as RAM once ACPI tables have been read */
+#define E820_NVS        4
+
+#define RES_START       0xa0000
+#define RES_END         0x100000
+
+struct e820entry {
+    uint64_t addr;		/* start of memory segment */
+    uint64_t size;		/* size of memory segment */
+    uint64_t type;		/* type of memory segment */
+} __attribute__ ((packed));
+
+const char *const e820_types[5];
+
+void get_type(int, char *, int);
+void detect_memory_e820(struct e820entry *desc, int size_map, int *size_found);
+int detect_memory_e801(int *, int *);
+int detect_memory_88(int *);
+
+/* The following stuff could be merge once the addr_t will be set to 64bits.
+ * syslinux_scan_memory can be used for that purpose */
+unsigned long memsize_e820(struct e820entry *e820, int e820_nr);
+int sanitize_e820_map(struct e820entry *orig_map, struct e820entry *new_bios,
+		      short old_nr);
+unsigned long detect_memsize(void);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/vpd/vpd.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/vpd/vpd.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/vpd/vpd.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,33 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2006 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 VPD_H
+#define VPD_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+enum { VPD_TABLE_PRESENT = 100, ENOVPDTABLE };
+
+typedef struct {
+    char bios_build_id[10];
+    char box_serial_number[8];
+    char motherboard_serial_number[12];
+    char machine_type_model[8];
+    char bios_release_date[9];
+    char default_flash_filename[13];
+    char bios_version[255];
+    char base_address[16];
+    bool filled;
+} s_vpd;
+
+int vpd_decode(s_vpd * vpd);
+#endif
Index: bootcd/isolinux/syslinux-6.03/com32/gplinclude/zzjson/zzjson.h
===================================================================
--- bootcd/isolinux/syslinux-6.03/com32/gplinclude/zzjson/zzjson.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
+++ bootcd/isolinux/syslinux-6.03/com32/gplinclude/zzjson/zzjson.h	(revision e16e8f2a41938d263af54a9fd6b4020d6c0d69fa)
@@ -0,0 +1,116 @@
+/* ZZJSON - Copyright (C) 2008 by Ivo van Poorten
+ * License: GNU Lesser General Public License version 2.1
+ */
+#ifndef ZZJSON_H
+#define ZZJSON_H
+
+#include <stdlib.h>
+
+/* Version: */
+
+#define ZZJSON_VERSION_MAJOR    1
+#define ZZJSON_VERSION_MINOR    1
+#define ZZJSON_VERSION_MICRO    0
+#define ZZJSON_VERSION_INT      ( 1<<16 | 1<<8 | 0 )
+#define ZZJSON_IDENT            "zzjson 1.1.0"
+
+/* Defines: */
+
+#define ZZJSON_ALLOW_EXTRA_COMMA        1
+#define ZZJSON_ALLOW_ILLEGAL_ESCAPE     2
+#define ZZJSON_ALLOW_CONTROL_CHARS      4
+#define ZZJSON_ALLOW_GARBAGE_AT_END     8
+#define ZZJSON_ALLOW_COMMENTS           16
+
+#define ZZJSON_VERY_LOOSE               (-1)
+#define ZZJSON_VERY_STRICT              0
+
+/* Types: */
+
+/* needed by: pa = parser, pr = printer, f = free, q = query, c = create */
+typedef struct ZZJSON_CONFIG {
+    int strictness;                                        // pa
+    void *ihandle;                                         // pa
+    int (*getchar)(void *ihandle);                         // pa
+    int (*ungetchar)(int c, void *ihandle);                // pa
+    void *(*malloc)(size_t size);                          // pa      c
+    void *(*calloc)(size_t nmemb, size_t size);            // pa      c
+    void (*free)(void *ptr);                               // pa    f c
+    void *(*realloc)(void *ptr, size_t size);              // pa
+    void *ehandle;                                         // pa pr   c
+    void (*error)(void *ehandle, const char *format, ...); // pa pr   c
+    void *ohandle;                                         //    pr
+    int (*print)(void *ohandle, const char *format, ...);  //    pr
+    int (*putchar)(int c, void *handle);                   //    pr
+} ZZJSON_CONFIG;
+
+typedef enum ZZJSON_TYPE {
+    ZZJSON_NONE = 0,
+    ZZJSON_OBJECT,
+    ZZJSON_ARRAY,
+    ZZJSON_STRING,
+    ZZJSON_NUMBER_NEGINT,
+    ZZJSON_NUMBER_POSINT,
+    ZZJSON_NUMBER_DOUBLE,
+    ZZJSON_NULL,
+    ZZJSON_TRUE,
+    ZZJSON_FALSE
+} ZZJSON_TYPE;
+
+typedef struct ZZJSON {
+    ZZJSON_TYPE type;
+    union {
+        struct {
+            char *label;
+            struct ZZJSON *val;
+        } object;
+        struct {
+            struct ZZJSON *val;
+        } array;
+        struct {
+            char *string;
+        } string;
+        struct {
+            union {
+                unsigned long long ival;
+                double             dval;
+            } val;
+        } number;
+    } value;
+    struct ZZJSON *next;
+} ZZJSON;
+
+/* Functions: */
+
+ZZJSON *zzjson_parse(ZZJSON_CONFIG *config);
+void zzjson_free(ZZJSON_CONFIG *config, ZZJSON *zzjson);
+int zzjson_print(ZZJSON_CONFIG *config, ZZJSON *zzjson);
+
+ZZJSON *zzjson_object_find_label(ZZJSON *zzjson, char *label);
+ZZJSON *zzjson_object_find_labels(ZZJSON *zzjson, ...); // end with , NULL
+unsigned int zzjson_object_count(ZZJSON *zzjson);
+unsigned int zzjson_array_count(ZZJSON *zzjson);
+
+ZZJSON *zzjson_create_true(ZZJSON_CONFIG *config);
+ZZJSON *zzjson_create_false(ZZJSON_CONFIG *config);
+ZZJSON *zzjson_create_null(ZZJSON_CONFIG *config);
+ZZJSON *zzjson_create_number_d(ZZJSON_CONFIG *config, double d);
+ZZJSON *zzjson_create_number_i(ZZJSON_CONFIG *config, long long i);
+ZZJSON *zzjson_create_string(ZZJSON_CONFIG *config, char *s);
+
+/* list of ZZJSON *'s and end with , NULL */
+ZZJSON *zzjson_create_array(ZZJSON_CONFIG *config, ...);
+
+/* list of char*,ZZJSON* pairs, end with , NULL */
+ZZJSON *zzjson_create_object(ZZJSON_CONFIG *config, ...);
+
+ZZJSON *zzjson_array_prepend(ZZJSON_CONFIG *config, ZZJSON *array,
+                                                    ZZJSON *val);
+ZZJSON *zzjson_array_append (ZZJSON_CONFIG *config, ZZJSON *array,
+                                                    ZZJSON *val);
+
+ZZJSON *zzjson_object_prepend(ZZJSON_CONFIG *config, ZZJSON *object,
+                                        char *label, ZZJSON *val);
+ZZJSON *zzjson_object_append (ZZJSON_CONFIG *config, ZZJSON *object,
+                                        char *label, ZZJSON *val);
+#endif
