aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-17 14:55:12 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-17 14:55:12 -0700
commita9d9adb8b91ea55007cbf5873ec322bca9c1d012 (patch)
treec2878654e22107c1551a0b886fb2b6c42f07efba
parentcb41ba728891e20af42d436526fbcd8a4a33ab5a (diff)
parentad9889e2309786738006c6c898fe52a395777836 (diff)
downloadhdt-a9d9adb8b91ea55007cbf5873ec322bca9c1d012.tar.gz
hdt-a9d9adb8b91ea55007cbf5873ec322bca9c1d012.tar.xz
hdt-a9d9adb8b91ea55007cbf5873ec322bca9c1d012.zip
Merge commit 'erwan/master' into for-erwan
Conflicts: com32/hdt/hdt-cli-hdt.c com32/hdt/hdt-cli.c
-rw-r--r--Makefile4
-rw-r--r--NEWS12
-rw-r--r--com32/hdt/hdt-cli-cpu.c2
-rw-r--r--com32/hdt/hdt-cli-dmi.c168
-rw-r--r--com32/hdt/hdt-cli-hdt.c26
-rw-r--r--com32/hdt/hdt-cli-kernel.c8
-rw-r--r--com32/hdt/hdt-cli-pci.c61
-rw-r--r--com32/hdt/hdt-cli-pxe.c16
-rw-r--r--com32/hdt/hdt-cli-syslinux.c12
-rw-r--r--com32/hdt/hdt-cli-vesa.c30
-rw-r--r--com32/hdt/hdt-cli.c60
-rw-r--r--com32/hdt/hdt-common.c25
-rw-r--r--com32/hdt/hdt-common.h1
-rw-r--r--com32/hdt/hdt-menu-dmi.c4
-rw-r--r--com32/hdt/hdt-menu-pci.c2
-rw-r--r--com32/hdt/hdt-menu.c2
-rw-r--r--com32/hdt/hdt.c9
-rw-r--r--com32/hdt/hdt.h2
-rw-r--r--com32/include/sys/pci.h10
-rw-r--r--com32/include/syslinux/bootrm.h4
-rw-r--r--com32/include/syslinux/movebits.h3
-rw-r--r--com32/lib/pci/scan.c30
-rw-r--r--com32/lib/syslinux/shuffle_pm.c2
-rw-r--r--com32/lib/syslinux/shuffle_rm.c75
-rw-r--r--com32/lib/syslinux/zonelist.c22
-rw-r--r--com32/menu/menu.h6
-rw-r--r--com32/menu/menumain.c2
-rw-r--r--com32/menu/readconfig.c18
-rw-r--r--com32/rosh/Makefile2
-rw-r--r--core/adv.inc2
-rw-r--r--core/bcopyxx.inc55
-rw-r--r--core/bootsect.inc47
-rw-r--r--core/cmdline.inc2
-rw-r--r--core/com32.inc4
-rw-r--r--core/comboot.inc23
-rw-r--r--core/dnsresolv.inc15
-rw-r--r--core/extlinux.asm18
-rw-r--r--core/font.inc25
-rw-r--r--core/isolinux.asm16
-rw-r--r--core/keywords.inc2
-rw-r--r--core/layout.inc41
-rw-r--r--core/ldlinux.asm18
-rw-r--r--core/macros.inc61
-rw-r--r--core/parseconfig.inc2
-rw-r--r--core/pxeidle.inc2
-rw-r--r--core/pxelinux.asm91
-rw-r--r--core/rawcon.inc4
-rw-r--r--core/runkernel.inc8
-rw-r--r--core/syslinux.ld15
-rw-r--r--core/ui.inc21
-rw-r--r--doc/comboot.txt21
-rw-r--r--doc/extlinux.txt2
-rw-r--r--doc/menu.txt8
-rw-r--r--doc/syslinux.txt4
-rw-r--r--gpxe/src/arch/i386/firmware/pcbios/e820mangler.S27
-rw-r--r--gpxe/src/arch/i386/firmware/pcbios/fakee820.c5
-rw-r--r--gpxe/src/arch/i386/interface/pxe/pxe_entry.S7
-rw-r--r--man/extlinux.159
-rw-r--r--memdisk/setup.c35
59 files changed, 714 insertions, 544 deletions
diff --git a/Makefile b/Makefile
index 4520c35a..5628917c 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,9 @@ MODULES = memdisk/memdisk memdump/memdump.com modules/*.com \
# mingw suite installed
BTARGET = version.gen version.h version.mk
BOBJECTS = $(BTARGET) \
- mbr/mbr.bin mbr/gptmbr.bin \
+ mbr/mbr.bin mbr/altmbr.bin mbr/gptmbr.bin \
+ mbr/mbr_c.bin mbr/altmbr_c.bin mbr/gptmbr_c.bin \
+ mbr/mbr_f.bin mbr/altmbr_f.bin mbr/gptmbr_f.bin \
core/pxelinux.0 core/isolinux.bin core/isolinux-debug.bin \
gpxe/gpxelinux.0 dos/syslinux.com win32/syslinux.exe \
$(MODULES)
diff --git a/NEWS b/NEWS
index 50986eb0..df290471 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,17 @@ Starting with 1.47, changes marked with SYSLINUX, PXELINUX, ISOLINUX
or EXTLINUX apply to that specific program only; other changes apply
to all derivatives.
+Changes in 3.75:
+ * PXELINUX: fix the "keeppxe" option, which was broken in
+ 3.74.
+ * MEMDISK: correct the extraction of geometry information from
+ the MBR of a hard disk image, again broken in 3.74.
+ * extlinux(1) man page from Brian Pellin.
+ * Simple menu: MENU SAVE is now controllable on a menu-by-menu
+ or entry-by-entry basis.
+ * gPXELINUX: fix interrupt-disabling bug.
+ * HDT: fix lockup on machines with certain PCI configurations.
+
Changes in 3.74:
* New UI directive, which allows a more natural way to specify
a menu system (or not.) With the UI directive specifying
@@ -44,7 +55,6 @@ Changes in 3.74:
Winterfeldt's "gfxboot" graphical front end
(http://gfxboot.sourceforge.net/). Module by Sebastian Herbszt.
-
Changes in 3.73:
* Upgrade gPXE to release version 0.9.5.
* Fix a number of build errors on various platforms.
diff --git a/com32/hdt/hdt-cli-cpu.c b/com32/hdt/hdt-cli-cpu.c
index a21d217f..388abc07 100644
--- a/com32/hdt/hdt-cli-cpu.c
+++ b/com32/hdt/hdt-cli-cpu.c
@@ -65,7 +65,7 @@ static void show_cpu(int argc __unused, char **argv __unused,
{
char buffer[81];
char buffer1[81];
- clear_screen();
+ reset_more_printf();
more_printf("CPU\n");
more_printf("Vendor : %s\n", hardware->cpu.vendor);
more_printf("Model : %s\n", hardware->cpu.model);
diff --git a/com32/hdt/hdt-cli-dmi.c b/com32/hdt/hdt-cli-dmi.c
index acf6ff8c..fb929050 100644
--- a/com32/hdt/hdt-cli-dmi.c
+++ b/com32/hdt/hdt-cli-dmi.c
@@ -40,38 +40,38 @@ static void show_dmi_modules(int argc __unused, char** argv __unused,
char available_dmi_commands[1024];
memset(available_dmi_commands, 0, sizeof(available_dmi_commands));
- more_printf("Available DMI modules on your system:\n");
+ printf("Available DMI modules on your system:\n");
if (hardware->dmi.base_board.filled == true)
- more_printf("\t%s\n", CLI_DMI_BASE_BOARD);
+ printf("\t%s\n", CLI_DMI_BASE_BOARD);
if (hardware->dmi.battery.filled == true)
- more_printf("\t%s\n", CLI_DMI_BATTERY);
+ printf("\t%s\n", CLI_DMI_BATTERY);
if (hardware->dmi.bios.filled == true)
- more_printf("\t%s\n", CLI_DMI_BIOS);
+ printf("\t%s\n", CLI_DMI_BIOS);
if (hardware->dmi.chassis.filled == true)
- more_printf("\t%s\n", CLI_DMI_CHASSIS);
+ printf("\t%s\n", CLI_DMI_CHASSIS);
for (int i = 0; i < hardware->dmi.memory_count; i++) {
if (hardware->dmi.memory[i].filled == true) {
- more_printf("\tbank <number>\n", CLI_DMI_MEMORY);
+ printf("\tbank <number>\n");
break;
}
}
if (hardware->dmi.processor.filled == true)
- more_printf("\t%s\n", CLI_DMI_PROCESSOR);
+ printf("\t%s\n", CLI_DMI_PROCESSOR);
if (hardware->dmi.system.filled == true)
- more_printf("\t%s\n", CLI_DMI_SYSTEM);
+ printf("\t%s\n", CLI_DMI_SYSTEM);
if (hardware->dmi.ipmi.filled == true)
- more_printf("\t%s\n", CLI_DMI_IPMI);
+ printf("\t%s\n", CLI_DMI_IPMI);
}
static void show_dmi_base_board(int argc __unused, char** argv __unused,
struct s_hardware *hardware)
{
if (hardware->dmi.base_board.filled == false) {
- more_printf("base_board information not found on your system, see "
+ printf("base_board information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
+ reset_more_printf();
more_printf("Base board\n");
more_printf(" Manufacturer : %s\n",
hardware->dmi.base_board.manufacturer);
@@ -93,31 +93,30 @@ static void show_dmi_system(int argc __unused, char** argv __unused,
struct s_hardware *hardware)
{
if (hardware->dmi.system.filled == false) {
- more_printf("system information not found on your system, see "
+ printf("system information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
- more_printf("System\n");
- more_printf(" Manufacturer : %s\n", hardware->dmi.system.manufacturer);
- more_printf(" Product Name : %s\n", hardware->dmi.system.product_name);
- more_printf(" Version : %s\n", hardware->dmi.system.version);
- more_printf(" Serial : %s\n", hardware->dmi.system.serial);
- more_printf(" UUID : %s\n", hardware->dmi.system.uuid);
- more_printf(" Wakeup Type : %s\n", hardware->dmi.system.wakeup_type);
- more_printf(" SKU Number : %s\n", hardware->dmi.system.sku_number);
- more_printf(" Family : %s\n", hardware->dmi.system.family);
+ printf("System\n");
+ printf(" Manufacturer : %s\n", hardware->dmi.system.manufacturer);
+ printf(" Product Name : %s\n", hardware->dmi.system.product_name);
+ printf(" Version : %s\n", hardware->dmi.system.version);
+ printf(" Serial : %s\n", hardware->dmi.system.serial);
+ printf(" UUID : %s\n", hardware->dmi.system.uuid);
+ printf(" Wakeup Type : %s\n", hardware->dmi.system.wakeup_type);
+ printf(" SKU Number : %s\n", hardware->dmi.system.sku_number);
+ printf(" Family : %s\n", hardware->dmi.system.family);
}
static void show_dmi_bios(int argc __unused, char** argv __unused,
struct s_hardware *hardware)
{
if (hardware->dmi.bios.filled == false) {
- more_printf("bios information not found on your system, see "
+ printf("bios information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
+ reset_more_printf();
more_printf("BIOS\n");
more_printf(" Vendor : %s\n", hardware->dmi.bios.vendor);
more_printf(" Version : %s\n", hardware->dmi.bios.version);
@@ -164,29 +163,28 @@ static void show_dmi_chassis(int argc __unused, char** argv __unused,
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
- more_printf("Chassis\n");
- more_printf(" Manufacturer : %s\n",
+ printf("Chassis\n");
+ printf(" Manufacturer : %s\n",
hardware->dmi.chassis.manufacturer);
- more_printf(" Type : %s\n", hardware->dmi.chassis.type);
- more_printf(" Lock : %s\n", hardware->dmi.chassis.lock);
- more_printf(" Version : %s\n",
+ printf(" Type : %s\n", hardware->dmi.chassis.type);
+ printf(" Lock : %s\n", hardware->dmi.chassis.lock);
+ printf(" Version : %s\n",
hardware->dmi.chassis.version);
- more_printf(" Serial : %s\n", hardware->dmi.chassis.serial);
- more_printf(" Asset Tag : %s\n",
+ printf(" Serial : %s\n", hardware->dmi.chassis.serial);
+ printf(" Asset Tag : %s\n",
hardware->dmi.chassis.asset_tag);
- more_printf(" Boot up state : %s\n",
+ printf(" Boot up state : %s\n",
hardware->dmi.chassis.boot_up_state);
- more_printf(" Power supply state : %s\n",
+ printf(" Power supply state : %s\n",
hardware->dmi.chassis.power_supply_state);
- more_printf(" Thermal state : %s\n",
+ printf(" Thermal state : %s\n",
hardware->dmi.chassis.thermal_state);
- more_printf(" Security Status : %s\n",
+ printf(" Security Status : %s\n",
hardware->dmi.chassis.security_status);
- more_printf(" OEM Information : %s\n",
+ printf(" OEM Information : %s\n",
hardware->dmi.chassis.oem_information);
- more_printf(" Height : %u\n", hardware->dmi.chassis.height);
- more_printf(" NB Power Cords : %u\n",
+ printf(" Height : %u\n", hardware->dmi.chassis.height);
+ printf(" NB Power Cords : %u\n",
hardware->dmi.chassis.nb_power_cords);
}
@@ -197,22 +195,21 @@ static void show_dmi_ipmi(int argc __unused, char **argv __unused,
more_printf("IPMI module not available\n");
return;
}
- clear_screen();
- more_printf("IPMI\n");
- more_printf(" Interface Type : %s\n",
+ printf("IPMI\n");
+ printf(" Interface Type : %s\n",
hardware->dmi.ipmi.interface_type);
- more_printf(" Specification Ver. : %u.%u\n",
+ printf(" Specification Ver. : %u.%u\n",
hardware->dmi.ipmi.major_specification_version,
hardware->dmi.ipmi.minor_specification_version);
- more_printf(" I2C Slave Address : 0x%02x\n",
+ printf(" I2C Slave Address : 0x%02x\n",
hardware->dmi.ipmi.I2C_slave_address);
- more_printf(" Nv Storage Address : %u\n",
+ printf(" Nv Storage Address : %u\n",
hardware->dmi.ipmi.nv_address);
uint32_t high = hardware->dmi.ipmi.base_address >> 32;
uint32_t low = hardware->dmi.ipmi.base_address & 0xFFFF;
- more_printf(" Base Address : %08X%08X\n",
+ printf(" Base Address : %08X%08X\n",
high,(low & ~1));
- more_printf(" IRQ : %d\n",
+ printf(" IRQ : %d\n",
hardware->dmi.ipmi.irq);
}
@@ -220,32 +217,31 @@ static void show_dmi_battery(int argc __unused, char** argv __unused,
struct s_hardware *hardware)
{
if (hardware->dmi.battery.filled == false) {
- more_printf("battery information not found on your system, see "
+ printf("battery information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
- more_printf("Battery \n");
- more_printf(" Vendor : %s\n",
+ printf("Battery \n");
+ printf(" Vendor : %s\n",
hardware->dmi.battery.manufacturer);
- more_printf(" Manufacture Date : %s\n",
+ printf(" Manufacture Date : %s\n",
hardware->dmi.battery.manufacture_date);
- more_printf(" Serial : %s\n", hardware->dmi.battery.serial);
- more_printf(" Name : %s\n", hardware->dmi.battery.name);
- more_printf(" Chemistry : %s\n",
+ printf(" Serial : %s\n", hardware->dmi.battery.serial);
+ printf(" Name : %s\n", hardware->dmi.battery.name);
+ printf(" Chemistry : %s\n",
hardware->dmi.battery.chemistry);
- more_printf(" Design Capacity : %s\n",
+ printf(" Design Capacity : %s\n",
hardware->dmi.battery.design_capacity);
- more_printf(" Design Voltage : %s\n",
+ printf(" Design Voltage : %s\n",
hardware->dmi.battery.design_voltage);
- more_printf(" SBDS : %s\n", hardware->dmi.battery.sbds);
- more_printf(" SBDS Manuf. Date : %s\n",
+ printf(" SBDS : %s\n", hardware->dmi.battery.sbds);
+ printf(" SBDS Manuf. Date : %s\n",
hardware->dmi.battery.sbds_manufacture_date);
- more_printf(" SBDS Chemistry : %s\n",
+ printf(" SBDS Chemistry : %s\n",
hardware->dmi.battery.sbds_chemistry);
- more_printf(" Maximum Error : %s\n",
+ printf(" Maximum Error : %s\n",
hardware->dmi.battery.maximum_error);
- more_printf(" OEM Info : %s\n",
+ printf(" OEM Info : %s\n",
hardware->dmi.battery.oem_info);
}
@@ -253,11 +249,11 @@ static void show_dmi_cpu(int argc __unused, char** argv __unused,
struct s_hardware *hardware)
{
if (hardware->dmi.processor.filled == false) {
- more_printf("processor information not found on your system, see "
+ printf("processor information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
+ reset_more_printf();
more_printf("CPU\n");
more_printf(" Socket Designation : %s\n",
hardware->dmi.processor.socket_designation);
@@ -310,51 +306,51 @@ static void show_dmi_cpu(int argc __unused, char** argv __unused,
static void show_dmi_memory_bank(int argc, char** argv,
struct s_hardware *hardware)
{
- long bank = -1;
+ int bank = -1;
/* Sanitize arguments */
if (argc > 0)
bank = strtol(argv[0], (char **)NULL, 10);
if (errno == ERANGE || bank < 0) {
- more_printf("This bank number is incorrect\n");
+ printf("This bank number is incorrect\n");
return;
}
if ((bank >= hardware->dmi.memory_count) || (bank < 0)) {
- more_printf("Bank %d number doesn't exists\n", bank);
+ printf("Bank %d number doesn't exists\n", bank);
return;
}
if (hardware->dmi.memory[bank].filled == false) {
- more_printf("Bank %d doesn't contain any information\n", bank);
+ printf("Bank %d doesn't contain any information\n", bank);
return;
}
- more_printf("Memory Bank %d\n", bank);
- more_printf(" Form Factor : %s\n",
+ printf("Memory Bank %d\n", bank);
+ printf(" Form Factor : %s\n",
hardware->dmi.memory[bank].form_factor);
- more_printf(" Type : %s\n", hardware->dmi.memory[bank].type);
- more_printf(" Type Detail : %s\n",
+ printf(" Type : %s\n", hardware->dmi.memory[bank].type);
+ printf(" Type Detail : %s\n",
hardware->dmi.memory[bank].type_detail);
- more_printf(" Speed : %s\n", hardware->dmi.memory[bank].speed);
- more_printf(" Size : %s\n", hardware->dmi.memory[bank].size);
- more_printf(" Device Set : %s\n",
+ printf(" Speed : %s\n", hardware->dmi.memory[bank].speed);
+ printf(" Size : %s\n", hardware->dmi.memory[bank].size);
+ printf(" Device Set : %s\n",
hardware->dmi.memory[bank].device_set);
- more_printf(" Device Loc. : %s\n",
+ printf(" Device Loc. : %s\n",
hardware->dmi.memory[bank].device_locator);
- more_printf(" Bank Locator : %s\n",
+ printf(" Bank Locator : %s\n",
hardware->dmi.memory[bank].bank_locator);
- more_printf(" Total Width : %s\n",
+ printf(" Total Width : %s\n",
hardware->dmi.memory[bank].total_width);
- more_printf(" Data Width : %s\n",
+ printf(" Data Width : %s\n",
hardware->dmi.memory[bank].data_width);
- more_printf(" Error : %s\n", hardware->dmi.memory[bank].error);
- more_printf(" Vendor : %s\n",
+ printf(" Error : %s\n", hardware->dmi.memory[bank].error);
+ printf(" Vendor : %s\n",
hardware->dmi.memory[bank].manufacturer);
- more_printf(" Serial : %s\n", hardware->dmi.memory[bank].serial);
- more_printf(" Asset Tag : %s\n",
+ printf(" Serial : %s\n", hardware->dmi.memory[bank].serial);
+ printf(" Asset Tag : %s\n",
hardware->dmi.memory[bank].asset_tag);
- more_printf(" Part Number : %s\n",
+ printf(" Part Number : %s\n",
hardware->dmi.memory[bank].part_number);
}
@@ -365,10 +361,10 @@ void main_show_dmi(int argc __unused, char **argv __unused,
detect_dmi(hardware);
if (hardware->is_dmi_valid == false) {
- more_printf("No valid DMI table found, exiting.\n");
+ printf("No valid DMI table found, exiting.\n");
return;
}
- more_printf("DMI Table version %d.%d found\n",
+ printf("DMI Table version %d.%d found\n",
hardware->dmi.dmitable.major_version,
hardware->dmi.dmitable.minor_version);
diff --git a/com32/hdt/hdt-cli-hdt.c b/com32/hdt/hdt-cli-hdt.c
index 8859b338..b8c36ba1 100644
--- a/com32/hdt/hdt-cli-hdt.c
+++ b/com32/hdt/hdt-cli-hdt.c
@@ -52,7 +52,7 @@ static void main_show_modes(int argc __unused, char** argv __unused,
{
int i = 0;
- more_printf("Available modes:\n");
+ printf("Available modes:\n");
while (list_modes[i]) {
more_printf("\t%s\n", list_modes[i]->name);
i++;
@@ -70,7 +70,7 @@ static void cli_set_mode(int argc, char **argv,
cli_mode_t new_mode;
if (argc <= 0) {
- more_printf("Which mode?\n");
+ printf("Which mode?\n");
return;
}
@@ -116,7 +116,7 @@ static void show_cli_help(int argc __unused, char** argv __unused,
find_cli_mode_descr(hdt_cli.mode, &current_mode);
- more_printf("Available commands are:\n");
+ printf("Available commands are:\n");
/* List first default modules of the mode */
if (current_mode->default_modules &&
@@ -132,7 +132,7 @@ static void show_cli_help(int argc __unused, char** argv __unused,
/* List secondly the show modules of the mode */
if (current_mode->show_modules &&
current_mode->show_modules->modules) {
- more_printf("show commands:\n");
+ printf("show commands:\n");
j = 0;
while (current_mode->show_modules->modules[j].name) {
more_printf("\t%s\n",
@@ -144,7 +144,7 @@ static void show_cli_help(int argc __unused, char** argv __unused,
/* List thirdly the set modules of the mode */
if (current_mode->set_modules &&
current_mode->set_modules->modules) {
- more_printf("set commands:\n");
+ printf("set commands:\n");
j = 0;
while (current_mode->set_modules->modules[j].name) {
more_printf("\t%s\n",
@@ -170,11 +170,11 @@ static void show_cli_help(int argc __unused, char** argv __unused,
current_mode->default_modules,
&associated_module);
if (associated_module == NULL)
- more_printf("%s ",
+ printf("%s ",
hdt_mode.default_modules->modules[j].name);
j++;
}
- more_printf("\n");
+ printf("\n");
}
main_show_modes(argc, argv, hardware);
@@ -232,14 +232,14 @@ void main_show_summary(int argc __unused, char **argv __unused,
void main_show_hdt(int argc __unused, char **argv __unused,
struct s_hardware *hardware __unused)
{
- more_printf("HDT\n");
- more_printf(" Product : %s\n", PRODUCT_NAME);
- more_printf(" Version : %s\n", VERSION);
- more_printf(" Author : %s\n", AUTHOR);
- more_printf(" Contact : %s\n", CONTACT);
+ printf("HDT\n");
+ printf(" Product : %s\n", PRODUCT_NAME);
+ printf(" Version : %s\n", VERSION);
+ printf(" Author : %s\n", AUTHOR);
+ printf(" Contact : %s\n", CONTACT);
char *contributors[NB_CONTRIBUTORS] = CONTRIBUTORS;
for (int c = 0; c < NB_CONTRIBUTORS; c++) {
- more_printf(" Contributor : %s\n", contributors[c]);
+ printf(" Contributor : %s\n", contributors[c]);
}
}
diff --git a/com32/hdt/hdt-cli-kernel.c b/com32/hdt/hdt-cli-kernel.c
index 5efcecf5..d9ba27f8 100644
--- a/com32/hdt/hdt-cli-kernel.c
+++ b/com32/hdt/hdt-cli-kernel.c
@@ -104,19 +104,17 @@ static void show_kernel_modules(int argc __unused, char **argv __unused,
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
nopciids = true;
- more_printf(" Missing pci.ids, we can't compute the list\n");
+ printf(" Missing pci.ids, we can't compute the list\n");
return;
}
if (hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) {
nomodulespcimap = true;
- more_printf
+ printf
(" Missing modules.pcimap, we can't compute the list\n");
return;
}
- clear_screen();
-
for_each_pci_func(pci_device, hardware->pci_domain) {
memset(kernel_modules, 0, sizeof kernel_modules);
@@ -141,7 +139,7 @@ static void show_kernel_modules(int argc __unused, char **argv __unused,
/* Print the found items */
for (int i = 0; i < MAX_PCI_CLASSES; i++) {
if (strlen(category_name[i]) > 1) {
- more_printf("%s : %s\n", category_name[i], modules[i]);
+ printf("%s : %s\n", category_name[i], modules[i]);
}
}
}
diff --git a/com32/hdt/hdt-cli-pci.c b/com32/hdt/hdt-cli-pci.c
index d59d8610..389e750f 100644
--- a/com32/hdt/hdt-cli-pci.c
+++ b/com32/hdt/hdt-cli-pci.c
@@ -47,7 +47,7 @@ static void show_pci_device(int argc, char **argv,
{
int i = 0;
struct pci_device *pci_device = NULL, *temp_pci_device;
- long pcidev = -1;
+ int pcidev = -1;
bool nopciids = false;
bool nomodulespcimap = false;
char kernel_modules[LINUX_KERNEL_MODULE_SIZE *
@@ -56,17 +56,17 @@ static void show_pci_device(int argc, char **argv,
/* Sanitize arguments */
if (argc <= 0) {
- more_printf("show device <number>\n");
+ printf("show device <number>\n");
return;
} else
pcidev = strtol(argv[0], (char **)NULL, 10);
if (errno == ERANGE) {
- more_printf("This PCI device number is incorrect\n");
+ printf("This PCI device number is incorrect\n");
return;
}
if ((pcidev > hardware->nb_pci_devices) || (pcidev <= 0)) {
- more_printf("PCI device %d doesn't exists\n", pcidev);
+ printf("PCI device %d doesn't exists\n", pcidev);
return;
}
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
@@ -87,7 +87,7 @@ static void show_pci_device(int argc, char **argv,
}
if (pci_device == NULL) {
- more_printf("We were enabled to find PCI device %d\n", pcidev);
+ printf("We were enabled to find PCI device %d\n", pcidev);
return;
}
@@ -104,43 +104,41 @@ static void show_pci_device(int argc, char **argv,
if (pci_device->dev_info->linux_kernel_module_count == 0)
strlcpy(kernel_modules, "unknown", 7);
- clear_screen();
- more_printf("PCI Device %d\n", pcidev);
+ printf("PCI Device %d\n", pcidev);
if (nopciids == false) {
- more_printf("Vendor Name : %s\n",
+ printf("Vendor Name : %s\n",
pci_device->dev_info->vendor_name);
- more_printf("Product Name : %s\n",
+ printf("Product Name : %s\n",
pci_device->dev_info->product_name);
- more_printf("Class Name : %s\n",
+ printf("Class Name : %s\n",
pci_device->dev_info->class_name);
}
if (nomodulespcimap == false) {
- more_printf("Kernel module : %s\n", kernel_modules);
+ printf("Kernel module : %s\n", kernel_modules);
}
- more_printf("Vendor ID : %04x\n", pci_device->vendor);
- more_printf("Product ID : %04x\n", pci_device->product);
- more_printf("SubVendor ID : %04x\n", pci_device->sub_vendor);
- more_printf("SubProduct ID : %04x\n", pci_device->sub_product);
- more_printf("Class ID : %02x.%02x.%02x\n", pci_device->class[2],
+ printf("Vendor ID : %04x\n", pci_device->vendor);
+ printf("Product ID : %04x\n", pci_device->product);
+ printf("SubVendor ID : %04x\n", pci_device->sub_vendor);
+ printf("SubProduct ID : %04x\n", pci_device->sub_product);
+ printf("Class ID : %02x.%02x.%02x\n", pci_device->class[2],
pci_device->class[1], pci_device->class[0]);
- more_printf("Revision : %02x\n", pci_device->revision);
+ printf("Revision : %02x\n", pci_device->revision);
if ((pci_device->dev_info->irq > 0)
&& (pci_device->dev_info->irq < 255))
more_printf("IRQ : %0d\n", pci_device->dev_info->irq);
- more_printf("Latency : %0d\n", pci_device->dev_info->latency);
- more_printf("PCI Bus : %02d\n", bus);
- more_printf("PCI Slot : %02d\n", slot);
- more_printf("PCI Func : %02d\n", func);
+ printf("Latency : %0d\n", pci_device->dev_info->latency);
+ printf("PCI Bus : %02d\n", bus);
+ printf("PCI Slot : %02d\n", slot);
+ printf("PCI Func : %02d\n", func);
if (hardware->is_pxe_valid == true) {
- more_printf("Mac Address : %s\n", hardware->pxe.mac_addr);
+ printf("Mac Address : %s\n", hardware->pxe.mac_addr);
if ((hardware->pxe.pci_device != NULL)
&& (hardware->pxe.pci_device == pci_device))
- more_printf("PXE : Current boot device\n",
- func);
+ printf("PXE : Current boot device\n");
}
}
@@ -156,7 +154,7 @@ static void show_pci_devices(int argc __unused, char **argv __unused,
char first_line[81];
char second_line[81];
- clear_screen();
+ reset_more_printf();
more_printf("%d PCI devices detected\n", hardware->nb_pci_devices);
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
@@ -216,7 +214,6 @@ static void show_pci_devices(int argc __unused, char **argv __unused,
("%02d: %04x:%04x [%04x:%04x] Kmod:%s\n", i,
pci_device->vendor, pci_device->product,
pci_device->sub_vendor,
- pci_device->sub_product, kernel_modules,
pci_device->sub_product, kernel_modules);
}
}
@@ -231,7 +228,7 @@ static void show_pci_irq(int argc __unused, char **argv __unused,
struct pci_device *pci_device;
bool nopciids = false;
- clear_screen();
+ reset_more_printf();
more_printf("%d PCI devices detected\n", hardware->nb_pci_devices);
more_printf("IRQ : product\n");
more_printf("-------------\n");
@@ -296,20 +293,20 @@ void cli_detect_pci(struct s_hardware *hardware)
if (hardware->pci_detection == false) {
detect_pci(hardware);
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
- more_printf
+ printf
("The pci.ids file is missing, device names can't be computed.\n");
- more_printf("Please put one in same dir as hdt\n");
+ printf("Please put one in same dir as hdt\n");
error = true;
}
if (hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) {
- more_printf
+ printf
("The modules.pcimap file is missing, device names can't be computed.\n");
- more_printf("Please put one in same dir as hdt\n");
+ printf("Please put one in same dir as hdt\n");
error = true;
}
if (error == true) {
char tempbuf[10];
- more_printf("Press enter to continue\n");
+ printf("Press enter to continue\n");
fgets(tempbuf, sizeof(tempbuf), stdin);
}
}
diff --git a/com32/hdt/hdt-cli-pxe.c b/com32/hdt/hdt-cli-pxe.c
index 1c0971dc..1d00cae5 100644
--- a/com32/hdt/hdt-cli-pxe.c
+++ b/com32/hdt/hdt-cli-pxe.c
@@ -42,19 +42,19 @@ void main_show_pxe(int argc __unused, char **argv __unused,
char buffer[81];
memset(buffer, 0, sizeof(81));
if (hardware->sv->filesystem != SYSLINUX_FS_PXELINUX) {
- more_printf("You are not currently using PXELINUX\n");
+ printf("You are not currently using PXELINUX\n");
return;
}
detect_pxe(hardware);
- more_printf("PXE\n");
+ printf("PXE\n");
if (hardware->is_pxe_valid == false) {
- more_printf(" No valid PXE ROM found\n");
+ printf(" No valid PXE ROM found\n");
return;
}
struct s_pxe *p = &hardware->pxe;
- more_printf(" PCI device no: %d \n", p->pci_device_pos);
+ printf(" PCI device no: %d \n", p->pci_device_pos);
if (hardware->pci_ids_return_code == -ENOPCIIDS ||
(p->pci_device == NULL)) {
@@ -65,16 +65,16 @@ void main_show_pxe(int argc __unused, char **argv __unused,
snprintf(buffer, sizeof(buffer),
" PCI Bus pos. : %02x:%02x.%02x\n", p->pci_bus,
p->pci_dev, p->pci_func);
- more_printf(buffer);
+ printf(buffer);
} else {
snprintf(buffer, sizeof(buffer), " Manufacturer : %s \n",
p->pci_device->dev_info->vendor_name);
- more_printf(buffer);
+ printf(buffer);
snprintf(buffer, sizeof(buffer), " Product : %s \n",
p->pci_device->dev_info->product_name);
- more_printf(buffer);
+ printf(buffer);
}
- more_printf(" Addresses : %d.%d.%d.%d @ %s\n", p->ip_addr[0],
+ printf(" Addresses : %d.%d.%d.%d @ %s\n", p->ip_addr[0],
p->ip_addr[1], p->ip_addr[2], p->ip_addr[3], p->mac_addr);
}
diff --git a/com32/hdt/hdt-cli-syslinux.c b/com32/hdt/hdt-cli-syslinux.c
index c760b1e5..0d78bc66 100644
--- a/com32/hdt/hdt-cli-syslinux.c
+++ b/com32/hdt/hdt-cli-syslinux.c
@@ -39,12 +39,12 @@
void main_show_syslinux(int argc __unused, char **argv __unused,
struct s_hardware *hardware)
{
- more_printf("SYSLINUX\n");
- more_printf(" Bootloader : %s\n", hardware->syslinux_fs);
- more_printf(" Version : %s\n", hardware->sv->version_string + 2);
- more_printf(" Version : %u\n", hardware->sv->version);
- more_printf(" Max API : %u\n", hardware->sv->max_api);
- more_printf(" Copyright : %s\n", hardware->sv->copyright_string + 1);
+ printf("SYSLINUX\n");
+ printf(" Bootloader : %s\n", hardware->syslinux_fs);
+ printf(" Version : %s\n", hardware->sv->version_string + 2);
+ printf(" Version : %u\n", hardware->sv->version);
+ printf(" Max API : %u\n", hardware->sv->max_api);
+ printf(" Copyright : %s\n", hardware->sv->copyright_string + 1);
}
struct cli_module_descr syslinux_show_modules = {
diff --git a/com32/hdt/hdt-cli-vesa.c b/com32/hdt/hdt-cli-vesa.c
index 5c550167..70d1dc61 100644
--- a/com32/hdt/hdt-cli-vesa.c
+++ b/com32/hdt/hdt-cli-vesa.c
@@ -38,18 +38,18 @@ void main_show_vesa(int argc __unused, char **argv __unused,
{
detect_vesa(hardware);
if (hardware->is_vesa_valid == false) {
- more_printf("No VESA BIOS detected\n");
+ printf("No VESA BIOS detected\n");
return;
}
- more_printf("VESA\n");
- more_printf(" Vesa version : %d.%d\n", hardware->vesa.major_version,
+ printf("VESA\n");
+ printf(" Vesa version : %d.%d\n", hardware->vesa.major_version,
hardware->vesa.minor_version);
- more_printf(" Vendor : %s\n", hardware->vesa.vendor);
- more_printf(" Product : %s\n", hardware->vesa.product);
- more_printf(" Product rev. : %s\n", hardware->vesa.product_revision);
- more_printf(" Software rev.: %s\n", hardware->vesa.software_rev);
- more_printf(" Memory (KB) : %d\n", hardware->vesa.total_memory * 64);
- more_printf(" Modes : %d\n", hardware->vesa.vmi_count);
+ printf(" Vendor : %s\n", hardware->vesa.vendor);
+ printf(" Product : %s\n", hardware->vesa.product);
+ printf(" Product rev. : %s\n", hardware->vesa.product_revision);
+ printf(" Software rev.: %d\n", hardware->vesa.software_rev);
+ printf(" Memory (KB) : %d\n", hardware->vesa.total_memory * 64);
+ printf(" Modes : %d\n", hardware->vesa.vmi_count);
}
static void show_vesa_modes(int argc __unused, char **argv __unused,
@@ -57,14 +57,12 @@ static void show_vesa_modes(int argc __unused, char **argv __unused,
{
detect_vesa(hardware);
if (hardware->is_vesa_valid == false) {
- more_printf("No VESA BIOS detected\n");
+ printf("No VESA BIOS detected\n");
return;
}
- clear_screen();
- more_printf(" ResH. x ResV x Bits : vga= : Vesa Mode\n",
- hardware->vesa.vmi_count);
- more_printf("----------------------------------------\n",
- hardware->vesa.vmi_count);
+ reset_more_printf();
+ printf(" ResH. x ResV x Bits : vga= : Vesa Mode\n");
+ printf("----------------------------------------\n");
for (int i = 0; i < hardware->vesa.vmi_count; i++) {
struct vesa_mode_info *mi = &hardware->vesa.vmi[i].mi;
@@ -73,7 +71,7 @@ static void show_vesa_modes(int argc __unused, char **argv __unused,
* We don't need to display that ones.
*/
if ((mi->h_res == 0) || (mi->v_res == 0)) continue;
- more_printf("%5u %5u %3u %3d 0x%04x\n",
+ printf("%5u %5u %3u %3d 0x%04x\n",
mi->h_res, mi->v_res, mi->bpp,
hardware->vesa.vmi[i].mode + 0x200,
hardware->vesa.vmi[i].mode);
diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c
index 1711ff58..1e13759e 100644
--- a/com32/hdt/hdt-cli.c
+++ b/com32/hdt/hdt-cli.c
@@ -129,7 +129,7 @@ void set_mode(cli_mode_t mode, struct s_hardware* hardware)
break;
case PXE_MODE:
if (hardware->sv->filesystem != SYSLINUX_FS_PXELINUX) {
- more_printf("You are not currently using PXELINUX\n");
+ printf("You are not currently using PXELINUX\n");
break;
}
hdt_cli.mode = mode;
@@ -171,7 +171,7 @@ void set_mode(cli_mode_t mode, struct s_hardware* hardware)
case DMI_MODE:
detect_dmi(hardware);
if (!hardware->is_dmi_valid) {
- more_printf("No valid DMI table found, exiting.\n");
+ printf("No valid DMI table found, exiting.\n");
break;
}
hdt_cli.mode = mode;
@@ -180,9 +180,9 @@ void set_mode(cli_mode_t mode, struct s_hardware* hardware)
break;
default:
/* Invalid mode */
- more_printf("Unknown mode, please choose among:\n");
+ printf("Unknown mode, please choose among:\n");
while (list_modes[i]) {
- more_printf("\t%s\n", list_modes[i]->name);
+ printf("\t%s\n", list_modes[i]->name);
i++;
}
}
@@ -191,7 +191,7 @@ void set_mode(cli_mode_t mode, struct s_hardware* hardware)
/* There is not cli_mode_descr struct for the exit mode */
if (current_mode == NULL && hdt_cli.mode != EXIT_MODE) {
/* Shouldn't get here... */
- more_printf("!!! BUG: Mode '%d' unknown.\n", hdt_cli.mode);
+ printf("!!! BUG: Mode '%d' unknown.\n", hdt_cli.mode);
}
}
@@ -450,11 +450,11 @@ static void autocomplete_command(char *command)
/* First take care of the two special commands: 'show' and 'set' */
if (strncmp(CLI_SHOW, command, strlen(command)) == 0) {
- more_printf("%s\n", CLI_SHOW);
+ printf("%s\n", CLI_SHOW);
autocomplete_add_token_to_list(CLI_SHOW);
}
if (strncmp(CLI_SET, command, strlen(command)) == 0) {
- more_printf("%s\n", CLI_SET);
+ printf("%s\n", CLI_SET);
autocomplete_add_token_to_list(CLI_SET);
}
@@ -464,7 +464,7 @@ static void autocomplete_command(char *command)
*/
while (list_modes[j]) {
if (strncmp(list_modes[j]->name, command, strlen(command)) == 0) {
- more_printf("%s\n", list_modes[j]->name);
+ printf("%s\n", list_modes[j]->name);
autocomplete_add_token_to_list(list_modes[j]->name);
}
j++;
@@ -479,7 +479,7 @@ static void autocomplete_command(char *command)
if (strncmp(current_mode->default_modules->modules[j].name,
command,
strlen(command)) == 0) {
- more_printf("%s\n",
+ printf("%s\n",
current_mode->default_modules->modules[j].name);
autocomplete_add_token_to_list(current_mode->default_modules->modules[j].name);
}
@@ -509,7 +509,7 @@ static void autocomplete_command(char *command)
strncmp(command,
hdt_mode.default_modules->modules[j].name,
strlen(command)) == 0) {
- more_printf("%s\n",
+ printf("%s\n",
hdt_mode.default_modules->modules[j].name);
autocomplete_add_token_to_list(hdt_mode.default_modules->modules[j].name);
}
@@ -537,7 +537,7 @@ static void autocomplete_module(char *command, char* module)
if (strncmp(current_mode->show_modules->modules[j].name,
module,
strlen(module)) == 0) {
- more_printf("%s\n",
+ printf("%s\n",
current_mode->show_modules->modules[j].name);
sprintf(autocomplete_full_line, "%s %s",
CLI_SHOW, current_mode->show_modules->modules[j].name);
@@ -551,7 +551,7 @@ static void autocomplete_module(char *command, char* module)
if (strncmp(current_mode->set_modules->modules[j].name,
module,
strlen(module)) == 0) {
- more_printf("%s\n",
+ printf("%s\n",
current_mode->set_modules->modules[j].name);
sprintf(autocomplete_full_line, "%s %s",
CLI_SET, current_mode->set_modules->modules[j].name);
@@ -655,7 +655,7 @@ static void exec_command(char *line,
return current_module->exec(argc, argv, hardware);
}
- more_printf("unknown command: '%s'\n", command);
+ printf("unknown command: '%s'\n", command);
return;
}
@@ -685,7 +685,7 @@ static void exec_command(char *line,
return current_module->exec(argc, argv, hardware);
}
- more_printf("unknown module: '%s'\n", module);
+ printf("unknown module: '%s'\n", module);
return;
} else if (!strncmp(command, CLI_SET, sizeof(CLI_SET) - 1)) {
@@ -702,12 +702,12 @@ static void exec_command(char *line,
return current_module->exec(argc, argv, hardware);
}
- more_printf("unknown module: '%s'\n", module);
+ printf("unknown module: '%s'\n", module);
return;
}
- more_printf("I don't understand: '%s'. Try 'help'.\n", line);
+ printf("I don't understand: '%s'. Try 'help'.\n", line);
/* Let's not forget to clean ourselves */
free(command);
@@ -721,7 +721,7 @@ static void reset_prompt()
{
/* No need to display the prompt if we exit */
if (hdt_cli.mode != EXIT_MODE) {
- more_printf("%s", hdt_cli.prompt);
+ printf("%s", hdt_cli.prompt);
/* Reset the line */
memset(hdt_cli.input, '\0', MAX_LINE_SIZE);
hdt_cli.cursor_pos = 0;
@@ -747,11 +747,11 @@ void start_cli_mode(struct s_hardware *hardware)
find_cli_mode_descr(hdt_cli.mode, &current_mode);
if (current_mode == NULL) {
/* Shouldn't get here... */
- more_printf("!!! BUG: Mode '%d' unknown.\n", hdt_cli.mode);
+ printf("!!! BUG: Mode '%d' unknown.\n", hdt_cli.mode);
return;
}
- more_printf("Entering CLI mode\n");
+ printf("Entering CLI mode\n");
/* Display the cursor */
display_cursor(true);
@@ -777,7 +777,7 @@ void start_cli_mode(struct s_hardware *hardware)
break;
case KEY_CTRL('c'):
- more_printf("\n");
+ printf("\n");
reset_prompt();
break;
@@ -890,16 +890,16 @@ void start_cli_mode(struct s_hardware *hardware)
if (autocomplete_last_seen == NULL)
autocomplete_last_seen = autocomplete_head;
} else {
- more_printf("\n");
+ printf("\n");
autocomplete(skip_spaces(hdt_cli.input));
autocomplete_last_seen = autocomplete_head;
- more_printf("%s%s", hdt_cli.prompt, hdt_cli.input);
+ printf("%s%s", hdt_cli.prompt, hdt_cli.input);
}
break;
case KEY_ENTER:
- more_printf("\n");
+ printf("\n");
if (strlen(remove_spaces(hdt_cli.input)) < 1) {
reset_prompt();
break;
@@ -912,12 +912,12 @@ void start_cli_mode(struct s_hardware *hardware)
reset_prompt();
break;
- case KEY_CTRL('d'):
- case KEY_DELETE:
- /* No need to delete when input is empty */
- if (strlen(hdt_cli.input)==0) break;
- /* Don't delete when cursor is at the end of the line */
- if (hdt_cli.cursor_pos>=strlen(hdt_cli.input)) break;
+ case KEY_CTRL('d'):
+ case KEY_DELETE:
+ /* No need to delete when input is empty */
+ if (strlen(hdt_cli.input)==0) break;
+ /* Don't delete when cursor is at the end of the line */
+ if (hdt_cli.cursor_pos>=strlen(hdt_cli.input)) break;
for (int c = hdt_cli.cursor_pos;
c < (int)strlen(hdt_cli.input) - 1; c++)
@@ -966,7 +966,7 @@ void start_cli_mode(struct s_hardware *hardware)
break;
case KEY_F1:
- more_printf("\n");
+ printf("\n");
exec_command(CLI_HELP, hardware);
reset_prompt();
break;
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index d02533ce..cb53f9e7 100644
--- a/com32/hdt/hdt-common.c
+++ b/com32/hdt/hdt-common.c
@@ -35,6 +35,22 @@
#include "hdt-common.h"
#include "lib-ansi.h"
+/* ISOlinux requires a 8.3 format */
+void convert_isolinux_filename(char *filename, struct s_hardware *hardware) {
+ /* Exit if we are not running ISOLINUX */
+ if (hardware->sv->filesystem != SYSLINUX_FS_ISOLINUX) return;
+ /* Searching the dot */
+ char *dot=strchr(filename,'.');
+ /* Exiting if not dot exists in that string */
+ if (dot==NULL) return;
+ /* Exiting if the extension is 3 char or less */
+ if (strlen(dot)<=4) return;
+
+ /* We have an extension bigger than .blah
+ * so we have to shorten it to 3*/
+ dot[4]='\0';
+}
+
void detect_parameters(const int argc, const char *argv[],
struct s_hardware *hardware)
{
@@ -42,12 +58,15 @@ void detect_parameters(const int argc, const char *argv[],
if (!strncmp(argv[i], "modules=", 8)) {
strncpy(hardware->modules_pcimap_path, argv[i] + 8,
sizeof(hardware->modules_pcimap_path));
+ convert_isolinux_filename(hardware->modules_pcimap_path,hardware);
} else if (!strncmp(argv[i], "pciids=", 7)) {
strncpy(hardware->pciids_path, argv[i] + 7,
sizeof(hardware->pciids_path));
+ convert_isolinux_filename(hardware->pciids_path,hardware);
} else if (!strncmp(argv[i], "memtest=", 8)) {
strncpy(hardware->memtest_label, argv[i] + 8,
sizeof(hardware->memtest_label));
+ convert_isolinux_filename(hardware->memtest_label,hardware);
}
}
}
@@ -434,7 +453,7 @@ void clear_screen(void)
set_us_g0_charset();
display_cursor(false);
clear_entire_screen();
- display_line_nb = 0;
+ reset_more_printf();
}
/* remove begining spaces */
@@ -464,3 +483,7 @@ char *remove_spaces(char *p)
return p;
}
+/* Reset the more_printf counter */
+void reset_more_printf() {
+ display_line_nb=0;
+}
diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h
index 43347b4a..11e14669 100644
--- a/com32/hdt/hdt-common.h
+++ b/com32/hdt/hdt-common.h
@@ -121,6 +121,7 @@ struct s_hardware {
char memtest_label[255];
};
+void reset_more_printf();
const char *find_argument(const char **argv, const char *argument);
char *remove_spaces(char *p);
char *skip_spaces(char *p);
diff --git a/com32/hdt/hdt-menu-dmi.c b/com32/hdt/hdt-menu-dmi.c
index 3915f2bf..fc353eb9 100644
--- a/com32/hdt/hdt-menu-dmi.c
+++ b/com32/hdt/hdt-menu-dmi.c
@@ -405,7 +405,7 @@ void compute_ipmi(struct s_my_menu *menu, s_dmi * dmi)
snprintf(buffer, sizeof buffer, "Spec. Version : %u.%u",
dmi->ipmi.major_specification_version,
dmi->ipmi.minor_specification_version);
- snprintf(statbuffer, sizeof statbuffer, "Specification Version: %u.u",
+ snprintf(statbuffer, sizeof statbuffer, "Specification Version: %u.%u",
dmi->ipmi.major_specification_version,
dmi->ipmi.minor_specification_version);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
@@ -524,7 +524,7 @@ void compute_battery(struct s_my_menu *menu, s_dmi * dmi)
snprintf(buffer, sizeof buffer, "Maximum Error : %s",
dmi->battery.maximum_error);
- snprintf(statbuffer, sizeof statbuffer, "Maximum Error (%) : %s",
+ snprintf(statbuffer, sizeof statbuffer, "Maximum Error (percent) : %s",
dmi->battery.maximum_error);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu->items_count++;
diff --git a/com32/hdt/hdt-menu-pci.c b/com32/hdt/hdt-menu-pci.c
index 496d5ac1..74c07107 100644
--- a/com32/hdt/hdt-menu-pci.c
+++ b/com32/hdt/hdt-menu-pci.c
@@ -89,7 +89,7 @@ static void compute_pci_device(struct s_my_menu *menu,
menu->items_count++;
}
- snprintf(buffer,sizeof buffer,"Latency : %d",pci_device->dev_info->latency);
+ snprintf(buffer, sizeof buffer, "Latency : %d",pci_device->dev_info->latency);
snprintf(statbuffer,sizeof statbuffer,"Latency : %d",pci_device->dev_info->latency);
add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
menu->items_count++;
diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c
index b531bc78..be0b4723 100644
--- a/com32/hdt/hdt-menu.c
+++ b/com32/hdt/hdt-menu.c
@@ -112,7 +112,7 @@ void setup_menu(char *version)
{
/* Creating the menu */
init_menusystem(version);
- set_window_size(0, 0, 24, 80);
+ set_window_size(0, 0, 25, 80);
/* Register the menusystem handler */
// reg_handler(HDLR_SCREEN,&msys_handler);
diff --git a/com32/hdt/hdt.c b/com32/hdt/hdt.c
index 467fe1ca..a2b9b538 100644
--- a/com32/hdt/hdt.c
+++ b/com32/hdt/hdt.c
@@ -51,16 +51,17 @@ int main(const int argc, const char *argv[])
snprintf(version_string, sizeof version_string, "%s %s by %s",
PRODUCT_NAME,VERSION,AUTHOR);
+ console_ansi_raw();
+
/* Cleaning structures */
init_hardware(&hardware);
- /* Detecting parameters */
- detect_parameters(argc, argv, &hardware);
-
/* Detecting Syslinux version */
detect_syslinux(&hardware);
- console_ansi_raw();
+ /* Detecting parameters */
+ detect_parameters(argc, argv, &hardware);
+
/* Opening the Syslinux console */
// openconsole(&dev_stdcon_r, &dev_ansicon_w);
diff --git a/com32/hdt/hdt.h b/com32/hdt/hdt.h
index 14c94b36..f05f7a5e 100644
--- a/com32/hdt/hdt.h
+++ b/com32/hdt/hdt.h
@@ -32,7 +32,7 @@
#define PRODUCT_NAME "Hardware Detection Tool"
#define AUTHOR "Erwan Velu"
#define CONTACT "erwan(dot)velu(point)free(dot)fr"
-#define VERSION "0.2.7"
+#define VERSION "0.3.0"
#define NB_CONTRIBUTORS 2
#define CONTRIBUTORS {"Pierre-Alexandre Meyer", "Sebastien Gonzalve"}
diff --git a/com32/include/sys/pci.h b/com32/include/sys/pci.h
index 2e1871ed..b44db62f 100644
--- a/com32/include/sys/pci.h
+++ b/com32/include/sys/pci.h
@@ -80,6 +80,16 @@ struct pci_domain {
if (((funcp) = (domain)->bus[__pci_bus]->slot[__pci_slot]-> \
func[__pci_func]))
+#define for_each_pci_func3(funcp, domain, addr) \
+ for (int __pci_bus = 0; __pci_bus < MAX_PCI_BUSES; __pci_bus++) \
+ if ((domain)->bus[__pci_bus]) \
+ for (int __pci_slot = 0; __pci_slot < MAX_PCI_DEVICES; __pci_slot++) \
+ if ((domain)->bus[__pci_bus]->slot[__pci_slot]) \
+ for (int __pci_func = 0; __pci_func < MAX_PCI_FUNC; __pci_func++) \
+ if (((addr) = pci_mkaddr(__pci_bus, __pci_slot, __pci_func, 0)), \
+ ((funcp) = (domain)->bus[__pci_bus]->slot[__pci_slot]-> \
+ func[__pci_func]))
+
struct match {
struct match *next;
uint32_t did;
diff --git a/com32/include/syslinux/bootrm.h b/com32/include/syslinux/bootrm.h
index 66bdbbd1..304c0819 100644
--- a/com32/include/syslinux/bootrm.h
+++ b/com32/include/syslinux/bootrm.h
@@ -1,6 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
+ * Copyright 2009 Intel Corporation; author: H. Peter Anvin
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -35,6 +36,7 @@
#define _SYSLINUX_BOOTRM_H
#include <stdint.h>
+#include <stdbool.h>
#include <com32.h>
#include <syslinux/movebits.h>
@@ -60,6 +62,8 @@ struct syslinux_rm_regs {
uint16_t ip; /* Offset 44 */
uint16_t cs; /* Offset 46 */
+
+ bool sti; /* Offset 48 */
};
int syslinux_shuffle_boot_rm(struct syslinux_movelist *fraglist,
diff --git a/com32/include/syslinux/movebits.h b/com32/include/syslinux/movebits.h
index ff3711ee..f0cb2774 100644
--- a/com32/include/syslinux/movebits.h
+++ b/com32/include/syslinux/movebits.h
@@ -79,6 +79,9 @@ int syslinux_memmap_largest(struct syslinux_memmap *list,
addr_t *start, addr_t *len);
void syslinux_free_memmap(struct syslinux_memmap *list);
struct syslinux_memmap *syslinux_dup_memmap(struct syslinux_memmap *list);
+int syslinux_memmap_find(struct syslinux_memmap *list,
+ enum syslinux_memmap_types type,
+ addr_t *start, addr_t *len, addr_t align);
/* Debugging functions */
void syslinux_dump_movelist(FILE *file, struct syslinux_movelist *ml);
diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c
index 39f743b5..07794102 100644
--- a/com32/lib/pci/scan.c
+++ b/com32/lib/pci/scan.c
@@ -518,36 +518,24 @@ struct pci_domain *pci_scan(void)
/* gathering additional configuration*/
void gather_additional_pci_config(struct pci_domain *domain)
{
- struct pci_bus *bus = NULL;
- struct pci_slot *slot = NULL;
- unsigned int nbus, ndev, nfunc, maxfunc;
- pciaddr_t a;
+ struct pci_device *dev;
+ pciaddr_t pci_addr;
int cfgtype;
cfgtype = pci_set_config_type(PCI_CFG_AUTO);
if (cfgtype == PCI_CFG_NONE)
return;
- for (nbus = 0; nbus < MAX_PCI_BUSES; nbus++) {
- bus = NULL;
-
- for (ndev = 0; ndev < MAX_PCI_DEVICES; ndev++) {
- maxfunc = 1; /* Assume a single-function device */
- slot = NULL;
-
- for (nfunc = 0; nfunc < maxfunc; nfunc++) {
- a = pci_mkaddr(nbus, ndev, nfunc, 0);
- struct pci_device *dev = domain->bus[nbus]->slot[ndev]->func[nfunc];
- if (! dev->dev_info) {
+ for_each_pci_func3(dev, domain,pci_addr) {
+ if (! dev->dev_info) {
dev->dev_info = zalloc(sizeof *dev->dev_info);
- if (!dev->dev_info)
+ if (!dev->dev_info) {
return;
+ }
}
- dev->dev_info->irq = pci_readb(a + 0x3c);
- dev->dev_info->latency = pci_readb(a + 0x0d);
- }
- }
- }
+ dev->dev_info->irq = pci_readb(pci_addr + 0x3c);
+ dev->dev_info->latency = pci_readb(pci_addr + 0x0d);
+ }
}
diff --git a/com32/lib/syslinux/shuffle_pm.c b/com32/lib/syslinux/shuffle_pm.c
index c9bc0407..69847639 100644
--- a/com32/lib/syslinux/shuffle_pm.c
+++ b/com32/lib/syslinux/shuffle_pm.c
@@ -59,7 +59,7 @@ int syslinux_shuffle_boot_pm(struct syslinux_movelist *fraglist,
regstub = 0x800; /* Locate anywhere above this point */
stublen = sizeof handoff_code;
- rv = syslinux_memmap_find(tmap, SMT_FREE, &regstub, &stublen);
+ rv = syslinux_memmap_find(tmap, SMT_FREE, &regstub, &stublen, 1);
syslinux_free_memmap(tmap);
if (rv)
return -1;
diff --git a/com32/lib/syslinux/shuffle_rm.c b/com32/lib/syslinux/shuffle_rm.c
index 4f424f3f..7eb3585d 100644
--- a/com32/lib/syslinux/shuffle_rm.c
+++ b/com32/lib/syslinux/shuffle_rm.c
@@ -44,66 +44,76 @@ int syslinux_shuffle_boot_rm(struct syslinux_movelist *fraglist,
uint16_t bootflags,
struct syslinux_rm_regs *regs)
{
- int nd;
- com32sys_t ireg;
- char *regbuf;
const struct syslinux_rm_regs_alt {
uint16_t seg[6];
uint32_t gpr[8];
uint32_t csip;
+ bool sti;
} *rp;
int i, rv;
- uint8_t handoff_code[5*5+8*6+5], *p;
- struct syslinux_memmap *tmap, *tp;
- addr_t regstub;
+ uint8_t handoff_code[8+5*5+8*6+1+5], *p;
+ struct syslinux_memmap *tmap;
+ addr_t regstub, stublen;
tmap = syslinux_target_memmap(fraglist, memmap);
if (!tmap)
return -1;
- /* Search for a good place to put the real-mode register stub.
- We prefer to put it as high as possible in the low 640K. */
- regstub = 0;
- for (tp = tmap; tp->type != SMT_END; tp = tp->next) {
- addr_t xend, xlen;
- if (tp->start >= 640*1024)
- continue;
- if (tp->type != SMT_FREE)
- continue;
- xend = tp->next->start;
- if (xend > 640*1024)
- xend = 640*1024;
- xlen = xend - tp->start;
- if (xlen < sizeof handoff_code)
- continue;
- regstub = xend - sizeof handoff_code; /* Best alternative so far */
+ /*
+ * Search for a good place to put the real-mode register stub.
+ * We prefer it as low as possible above 0x800. KVM barfs horribly
+ * if we're not aligned to a paragraph boundary, so set the alignment
+ * appropriately.
+ */
+ regstub = 0x800;
+ stublen = sizeof handoff_code;
+ rv = syslinux_memmap_find(tmap, SMT_FREE, &regstub, &stublen, 16);
+
+ if (rv || (regstub > 0x100000 - sizeof handoff_code)) {
+ /*
+ * Uh-oh. This isn't real-mode accessible memory.
+ * It might be possible to do something insane here like
+ * putting the stub in the IRQ vectors, or in the 0x5xx segment.
+ * This code tries the 0x510-0x7ff range and hopes for the best.
+ */
+ regstub = 0x510; /* Try the 0x5xx segment... */
+ stublen = sizeof handoff_code;
+ rv = syslinux_memmap_find(tmap, SMT_FREE, &regstub, &stublen, 16);
+
+ if (!rv && (regstub > 0x100000 - sizeof handoff_code))
+ rv = -1; /* No acceptable memory found */
}
syslinux_free_memmap(tmap);
-
- /* XXX: it might be possible to do something insane here like
- putting the stub in the IRQ vectors... */
- if (!regstub)
- return -1; /* No space at all */
+ if (rv)
+ return -1;
/* Build register-setting stub */
p = handoff_code;
rp = (const struct syslinux_rm_regs_alt *)regs;
+
+ *(uint32_t *)p = 0xeac0220f; /* MOV CR0,EAX; JMP FAR */
+ *(uint16_t *)(p+4) = 8; /* Offset */
+ *(uint16_t *)(p+6) = regstub >> 4; /* Segment */
+ p += 8;
+
for (i = 0; i < 6; i++) {
- if (i != 1) { /* Skip CS */
- p[0] = 0xb8; /* MOV AX,imm16 */
+ if (i != 1) { /* Skip CS */
+ p[0] = 0xb8; /* MOV AX,imm16 */
*(uint16_t *)(p+1) = rp->seg[i];
*(uint16_t *)(p+3) = 0xc08e + (i << 11); /* MOV seg,AX */
p += 5;
}
}
for (i = 0; i < 8; i++) {
- p[0] = 0x66; /* MOV exx,imm32 */
+ p[0] = 0x66; /* MOV exx,imm32 */
p[1] = 0xb8 + i;
*(uint32_t *)(p+2) = rp->gpr[i];
p += 6;
}
- *p++ = 0xea; /* JMP FAR */
+ *p++ = rp->sti ? 0xfb : 0xfa; /* STI/CLI */
+
+ *p++ = 0xea; /* JMP FAR */
*(uint32_t *)p = rp->csip;
/* Add register-setting stub to shuffle list */
@@ -111,8 +121,5 @@ int syslinux_shuffle_boot_rm(struct syslinux_movelist *fraglist,
sizeof handoff_code))
return -1;
- /* Convert regstub to a CS:IP entrypoint pair */
- regstub = (SEG((void *)regstub) << 16) + OFFS((void *)regstub);
-
return syslinux_do_shuffle(fraglist, memmap, regstub, 0, bootflags);
}
diff --git a/com32/lib/syslinux/zonelist.c b/com32/lib/syslinux/zonelist.c
index e3036b1a..d65d274f 100644
--- a/com32/lib/syslinux/zonelist.c
+++ b/com32/lib/syslinux/zonelist.c
@@ -37,6 +37,7 @@
*/
#include <stdlib.h>
+#include <syslinux/align.h>
#include <syslinux/movebits.h>
/*
@@ -208,19 +209,24 @@ int syslinux_memmap_largest(struct syslinux_memmap *list,
*/
int syslinux_memmap_find(struct syslinux_memmap *list,
enum syslinux_memmap_types type,
- addr_t *start, addr_t *len)
+ addr_t *start, addr_t *len, addr_t align)
{
addr_t min_start = *start;
addr_t min_len = *len;
while (list->type != SMT_END) {
- if (list->type == type && list->next->start > min_start) {
- addr_t xstart = min_start > list->start ? min_start : list->start;
- addr_t xlen = list->next->start - xstart;
- if (xlen >= min_len) {
- *start = xstart;
- *len = xlen;
- return 0;
+ if (list->type == type) {
+ addr_t xstart, xlen;
+ xstart = min_start > list->start ? min_start : list->start;
+ xstart = ALIGN_UP(xstart, align);
+
+ if (xstart < list->next->start) {
+ xlen = list->next->start - xstart;
+ if (xlen >= min_len) {
+ *start = xstart;
+ *len = xlen;
+ return 0;
+ }
}
}
list = list->next;
diff --git a/com32/menu/menu.h b/com32/menu/menu.h
index 43f65947..98b6fa9b 100644
--- a/com32/menu/menu.h
+++ b/com32/menu/menu.h
@@ -60,6 +60,7 @@ struct menu_entry {
int entry; /* Entry number inside menu */
enum menu_action action;
unsigned char hotkey;
+ bool save; /* Save this entry if selected */
};
static inline bool is_disabled(struct menu_entry *me)
@@ -149,9 +150,11 @@ struct menu {
int nentries;
int nentries_space;
int defentry;
- int allowedit;
int timeout;
+ bool allowedit;
+ bool save; /* MENU SAVE default for this menu */
+
int curentry;
int curtop;
@@ -174,7 +177,6 @@ extern struct menu *root_menu, *start_menu, *hide_menu, *menu_list;
/* These are global parameters regardless of which menu we're displaying */
extern int shiftkey;
extern int hiddenmenu;
-extern bool menusave;
extern long long totaltimeout;
void parse_configs(char **argv);
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index c3da97e4..b3131faf 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -879,7 +879,7 @@ run_menu(void)
}
if (done && !me->passwd) {
/* Only save a new default if we don't have a password... */
- if (menusave && me->label) {
+ if (me->save && me->label) {
syslinux_setadv(ADV_MENUSAVE, strlen(me->label), me->label);
syslinux_adv_write();
}
diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index 768591d9..376d8181 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -35,11 +35,11 @@ struct menu *root_menu, *start_menu, *hide_menu, *menu_list;
int shiftkey = 0; /* Only display menu if shift key pressed */
int hiddenmenu = 0;
long long totaltimeout = 0;
-bool menusave = false;
/* Keep track of global default */
static int has_ui = 0; /* DEFAULT only counts if UI is found */
static const char *globaldefault = NULL;
+static bool menusave = false; /* True if there is any "menu save" */
/* Linked list of all entires, hidden or not; used by unlabel() */
static struct menu_entry *all_entries;
@@ -174,6 +174,7 @@ static struct menu * new_menu(struct menu *parent,
m->allowedit = parent->allowedit;
m->timeout = parent->timeout;
+ m->save = parent->save;
m->ontimeout = refstr_get(parent->ontimeout);
m->onerror = refstr_get(parent->onerror);
@@ -193,7 +194,7 @@ static struct menu * new_menu(struct menu *parent,
for (i = 0; i < NPARAMS; i++)
m->mparm[i] = mparm[i].value;
- m->allowedit = 1; /* Allow edits of the command line */
+ m->allowedit = true; /* Allow edits of the command line */
m->color_table = default_color_table();
}
@@ -219,6 +220,7 @@ struct labeldata {
unsigned int menudisabled;
unsigned int menuindent;
enum menu_action action;
+ int save;
struct menu *submenu;
};
@@ -305,6 +307,7 @@ record(struct menu *m, struct labeldata *ld, const char *append)
me->helptext = ld->helptext;
me->hotkey = 0;
me->action = ld->action ? ld->action : MA_CMD;
+ me->save = ld->save ? (ld->save > 0) : m->save;
if ( ld->menuindent ) {
const char *dn;
@@ -673,6 +676,15 @@ static void parse_config_file(FILE *f)
shiftkey = 1;
} else if ( looking_at(p, "save") ) {
menusave = true;
+ if (ld.label)
+ ld.save = 1;
+ else
+ m->save = true;
+ } else if ( looking_at(p, "nosave") ) {
+ if (ld.label)
+ ld.save = -1;
+ else
+ m->save = false;
} else if ( looking_at(p, "onerror") ) {
refstr_put(m->onerror);
m->onerror = refstrdup(skipspace(p+7));
@@ -938,7 +950,7 @@ static void parse_config_file(FILE *f)
} else if ( looking_at(p, "ontimeout") ) {
m->ontimeout = refstrdup(skipspace(p+9));
} else if ( looking_at(p, "allowoptions") ) {
- m->allowedit = atoi(skipspace(p+12));
+ m->allowedit = !!atoi(skipspace(p+12));
} else if ( looking_at(p, "ipappend") ) {
if (ld.label)
ld.ipappend = atoi(skipspace(p+8));
diff --git a/com32/rosh/Makefile b/com32/rosh/Makefile
index 3895cd89..7bf5059c 100644
--- a/com32/rosh/Makefile
+++ b/com32/rosh/Makefile
@@ -21,7 +21,7 @@ rosh.o: rosh.h
rosh.lo: rosh.h
-all: rosh.lnx rosh.c32
+all: rosh.c32
tidy dist:
rm -f *.o *.lo *.a *.lst *.elf .*.d *.tmp
diff --git a/core/adv.inc b/core/adv.inc
index 1fe5aca2..03bb25d8 100644
--- a/core/adv.inc
+++ b/core/adv.inc
@@ -493,7 +493,7 @@ adv_read_write:
jmp .cb_done
section .data
- align 4, db 0
+ alignz 4
ADVSec0 dd 0 ; Not specified
ADVSec1 dd 0 ; Not specified
ADVDrive db -1 ; No ADV defined
diff --git a/core/bcopyxx.inc b/core/bcopyxx.inc
index 4c75fa6a..60f81723 100644
--- a/core/bcopyxx.inc
+++ b/core/bcopyxx.inc
@@ -239,30 +239,22 @@ pm_shuffle:
; to real mode...
pm_shuffle_real_mode:
call .here
-.here: pop eax
- mov ebx,eax
- add eax,.next-.here
- mov [ebx-.here+.rm_entry],edi
- mov [ebx-.here+bcopy_gdt.CS16+2],ax
+.here: pop ebx
+ mov eax,edi
+ add ebx,bcopy_gdt.CS16-.here
+ mov [ebx+2],ax
shr eax,16
- mov [ebx-.here+bcopy_gdt.CS16+4],al
- mov [ebx-.here+bcopy_gdt.CS16+7],ah
+ mov [ebx+4],al
+ mov [ebx+7],ah
mov eax,PM_DS16_RM
mov ds,eax
mov es,eax
mov fs,eax
mov gs,eax
mov ss,eax
- jmp PM_CS16:0
- bits 16
-.next:
mov eax,cr0
and al,~1
- mov cr0,eax
- jmp 0:0
-.rm_entry equ $-4
-
- bits 32
+ jmp PM_CS16:0
align 16
; GDT descriptor entry
@@ -276,12 +268,16 @@ bcopy_gdt:
dd bcopy_gdt ; pointer for LGDT instruction
dw 0
+ ; TSS segment to keep Intel VT happy. Intel VT is
+ ; unhappy about anything that doesn't smell like a
+ ; full-blown 32-bit OS.
+ desc TSS
+ dw 104-1, DummyTSS ; 08h 32-bit task state segment
+ dd 00008900h ; present, dpl 0, 104 bytes @DummyTSS
+
desc CS16
- dd 0000ffffh ; 08h Code segment, use16, readable,
+ dd 0000ffffh ; 10h Code segment, use16, readable,
dd 00009b00h ; present, dpl 0, cover 64K
- desc DS16_4G
- dd 0000ffffh ; 10h Data segment, use16, read/write,
- dd 008f9300h ; present, dpl 0, cover all 4G
desc DS16_RM
dd 0000ffffh ; 18h Data segment, use16, read/write,
dd 00009300h ; present, dpl 0, cover 64K
@@ -291,23 +287,10 @@ bcopy_gdt:
desc DS32
dd 0000ffffh ; 28h Data segment, use32, read/write,
dd 00cf9300h ; present, dpl 0, cover all 4G
-
- ; TSS segment to keep Intel VT happy. Intel VT is
- ; unhappy about anything that doesn't smell like a
- ; full-blown 32-bit OS.
- desc TSS
- dw 104-1, DummyTSS ; 30h 32-bit task state segment
- dd 00008900h ; present, dpl 0, 104 bytes @DummyTSS
-
- ; 16-bit stack segment, which may have a different
- ; base from DS16 (e.g. if we're booted from PXELINUX)
- desc SS16
- dd 0000ffffh ; 38h Data segment, use16, read/write,
- dd 00009300h ; present, dpl 0, cover 64K
bcopy_gdt_size: equ $-bcopy_gdt
- align 4, db 0
+ alignz 4
bcopyxx_end equ $ ; *Must* be dword-aligned!
bcopyxx_len equ $-bcopyxx_start
bcopyxx_dwords equ bcopyxx_len >> 2
@@ -317,10 +300,10 @@ bcopyxx_safe equ bcopyxx_len + bcopyxx_stack
;
; Space for a dummy task state segment. It should never be actually
-; accessed, but just in case it is, point to a chunk of memory not used
-; for anything real.
+; accessed, but just in case it is, point to a chunk of memory that
+; has a chance to not be used for anything real...
;
-DummyTSS equ 0x800
+DummyTSS equ 0x580
bits 16
section .text
diff --git a/core/bootsect.inc b/core/bootsect.inc
index c7d82a49..373c649d 100644
--- a/core/bootsect.inc
+++ b/core/bootsect.inc
@@ -116,8 +116,8 @@ replace_bootstrap:
mov es,ax
%if IS_PXELINUX
- test byte [KeepPXE],02h ; Bit 1 = chainloading PXE
- jz .stdstack
+ cmp byte [KeepPXE],0
+ je .stdstack
les di,[InitStack] ; Reset stack to PXE original
jmp .stackok
%endif
@@ -160,42 +160,48 @@ replace_bootstrap:
push di
; Terminating entry...
- lea eax,[di+12]
+ lea eax,[replace_stub] ; Entrypoint
+ push ax
stosd
xor ax,ax ; EAX[31:16] == 0 already
- stosd ; Real mode
+ stosd ; 16-bit mode
stosd ; End of list
- ; Copy the stub
- mov si,replace_stub
- mov cx,replace_stub.len >> 2
+ ; Copy the stub
+ pop di
+ mov si,__replacestub_lma
+ mov cx,__replacestub_dwords
rep movsd
xor ecx,ecx
pop cx ; ECX <- length of list
- pop word [di+replace_stub.ss]
- pop word [di+replace_stub.esp]
- pop dword [di+replace_stub.csip]
+ pop word [replace_stub.ss]
+ pop word [replace_stub.esp]
+ pop dword [replace_stub.csip]
cli
- mov ss,[di+replace_stub.ss]
- mov esp,[di+replace_stub.esp]
+ mov ss,[replace_stub.ss]
+ mov esp,[replace_stub.esp]
mov edi,trackbuf
mov esi,edi
jmp shuffle_and_boot_raw
- ; This stub gets run after the shuffle, but not in-place.
- ; THE ALIGNS ARE CRITICAL.
- align 4
+ ; This stub gets run after the shuffle. It is copied
+ ; below 0x7c00 in order to properly handle the case
+ ; of bootstrap replacement.
+ section .replacestub
replace_stub:
+ mov cr0,eax
+ jmp 0:.next
+.next:
mov ax,strict word 0
-.ss equ $-2-.end
+.ss equ $-2
mov ss,ax
mov esp,strict dword 0
-.esp: equ $-4-.end
+.esp equ $-4
pop gs
pop fs
pop es
@@ -203,7 +209,6 @@ replace_stub:
popad
popfd
jmp 0:0
-.csip equ $-4-.end
- align 4
-.end:
-.len equ $-replace_stub
+.csip equ $-4
+
+ section .text
diff --git a/core/cmdline.inc b/core/cmdline.inc
index 9d908dcc..642e5e14 100644
--- a/core/cmdline.inc
+++ b/core/cmdline.inc
@@ -46,7 +46,7 @@ make_plain_cmdline:
;
%if IS_PXELINUX
section .data
- alignb 2, db 0
+ alignz 2
IPAppends dw IPOption
dw BOOTIFStr
numIPAppends equ ($-IPAppends)/2
diff --git a/core/com32.inc b/core/com32.inc
index 28e8d528..3a762a6b 100644
--- a/core/com32.inc
+++ b/core/com32.inc
@@ -40,7 +40,7 @@ pm_entry: ; Needs to not be...
bits 16
section .data
- align 2, db 0
+ alignz 2
com32_pmidt:
dw 8*256 ; Limit
dd pm_idt ; Address
@@ -176,7 +176,7 @@ com32_call_start:
push dword com32_cfarcall ; Cfarcall entry point
push dword com32_farcall ; Farcall entry point
push dword (1 << 16) ; 64K bounce buffer
- push dword (comboot_seg << 4) ; Bounce buffer address
+ push dword (xfer_buf_seg << 4) ; Bounce buffer address
push dword com32_intcall ; Intcall entry point
push dword command_line ; Command line pointer
push dword 7 ; Argument count
diff --git a/core/comboot.inc b/core/comboot.inc
index 0cce67ab..c169414f 100644
--- a/core/comboot.inc
+++ b/core/comboot.inc
@@ -777,17 +777,14 @@ comapi_runkernel:
mov [Kernel_EAX],eax
; It's not just possible, but quite likely, that ES:BX
- ; points into real_mode_seg, so we need to exercise some
- ; special care here... use xfer_buf_seg as an intermediary
+ ; points into real_mode_seg or xfer_buf_seg, so we
+ ; need to exercise some special care here... use
+ ; trackbuf as an intermediary
push ds
- push es
- mov ax,xfer_buf_seg
mov ds,P_ES
mov si,P_BX
- mov es,ax
- xor di,di
+ mov di,trackbuf
call strcpy
- pop es
pop ds
%if IS_PXELINUX
@@ -799,18 +796,14 @@ comapi_runkernel:
.finish:
; Copy the command line into its proper place
- push ds
push es
- mov ax,xfer_buf_seg
mov dx,real_mode_seg
- mov ds,ax
mov es,dx
- xor si,si
+ mov si,trackbuf
mov di,cmd_line_here
call strcpy
mov byte [es:di-1],' ' ; Simulate APPEND
pop es
- pop ds
mov [CmdLinePtr],di
mov word [CmdOptPtr],zero_string
jmp kernel_good_saved
@@ -847,8 +840,8 @@ comapi_userfont:
and al,al
jz .done
mov al,[VGAFontSize]
- mov P_ES,ds
- mov P_BX,vgafontbuf
+ mov P_ES,aux_seg
+ mov P_BX,aux.fontbuf
.done: ; CF=0 here
mov P_AL,al
@@ -1015,7 +1008,7 @@ int21_table:
int21 -1, comboot_bad_int21
int21_count equ ($-int21_table)/3
- align 2, db 0
+ alignz 2
int22_table:
dw comapi_err ; 0000 unimplemented syscall
dw comapi_get_version ; 0001 get SYSLINUX version
diff --git a/core/dnsresolv.inc b/core/dnsresolv.inc
index f867c273..9b0eb0a0 100644
--- a/core/dnsresolv.inc
+++ b/core/dnsresolv.inc
@@ -190,6 +190,7 @@ dns_resolv:
push ds
push es
push di
+ push bx
push cx
push dx
@@ -237,23 +238,25 @@ dns_resolv:
; Outer loop: exponential backoff
; Inner loop: scan the various DNS servers
- mov dx,PKT_TIMEOUT
- mov cx,PKT_RETRY
+ mov bx,TimeoutTable
.backoff:
+ movzx dx,byte [bx]
mov si,DNSServers
.servers:
cmp si,[LastDNSServer]
jb .moreservers
.nomoreservers:
- add dx,dx ; Exponential backoff
- loop .backoff
+ inc bx
+ cmp bx,TimeoutTableEnd
+ jb .backoff
xor eax,eax ; Nothing...
.done:
pop si
pop dx
pop cx
+ pop bx
pop di
pop es
pop ds
@@ -262,6 +265,7 @@ dns_resolv:
.moreservers:
lodsd ; EAX <- next server
push si
+ push bx
push cx
push dx
@@ -348,7 +352,7 @@ dns_resolv:
;
mov eax,[si+10]
.gotresult:
- add sp,6 ; Drop timeout information
+ add sp,8 ; Drop timeout information
jmp .done
.notsame:
@@ -380,5 +384,6 @@ dns_resolv:
.timeout:
pop dx
pop cx
+ pop bx
pop si
jmp .servers
diff --git a/core/extlinux.asm b/core/extlinux.asm
index 833cb2b0..a9e51d57 100644
--- a/core/extlinux.asm
+++ b/core/extlinux.asm
@@ -74,18 +74,6 @@ vk_end: equ $ ; Should be <= vk_size
endstruc
;
-; Segment assignments in the bottom 640K
-; Stick to the low 512K in case we're using something like M-systems flash
-; which load a driver into low RAM (evil!!)
-;
-; 0000h - main code/data segment (and BIOS segment)
-;
-real_mode_seg equ 3000h
-cache_seg equ 2000h ; 64K area for metadata cache
-xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem
-comboot_seg equ real_mode_seg ; COMBOOT image loading zone
-
-;
; File structure. This holds the information for each currently open file.
;
struc open_file_t
@@ -572,7 +560,7 @@ syslinux_banner db 0Dh, 0Ah
db VERSION_STR, ' ', DATE_STR, ' ', 0
db 0Dh, 0Ah, 1Ah ; EOF if we "type" this in DOS
- align 8, db 0
+ alignz 8
ldlinux_magic dd LDLINUX_MAGIC
dd LDLINUX_MAGIC^HEXDATE
@@ -1567,7 +1555,7 @@ config_name db 'extlinux.conf',0 ; Unmangled form
;
; Extensions to search for (in *forward* order).
;
- align 4, db 0
+ alignz 4
exten_table: db '.cbt' ; COMBOOT (specific)
db '.img' ; Disk image
db '.bs', 0 ; Boot sector
@@ -1583,7 +1571,7 @@ exten_table_end:
debug_magic dw 0D00Dh ; Debug code sentinel
%endif
- alignb 4, db 0
+ alignz 4
BufSafe dw trackbufsize/SECTOR_SIZE ; Clusters we can load into trackbuf
BufSafeBytes dw trackbufsize ; = how many bytes?
%ifndef DEPEND
diff --git a/core/font.inc b/core/font.inc
index a553f042..4090e5af 100644
--- a/core/font.inc
+++ b/core/font.inc
@@ -57,9 +57,14 @@ loadfont:
; Copy to font buffer
mov si,trackbuf ; Start of font data
mov [VGAFontSize],bh
- mov di,vgafontbuf
+ push es
+ mov cx,aux_seg
+ mov es,cx
+ mov di,aux.fontbuf
mov cx,bx
- rep movsb
+ shr cx,2
+ rep movsd
+ pop es
mov [UserFont], byte 1 ; Set font flag
@@ -67,7 +72,7 @@ loadfont:
; use_font:
; This routine activates whatever font happens to be in the
; vgafontbuf, and updates the adjust_screen data.
-; Must be called with CS = DS = ES
+; Must be called with CS = DS
;
use_font:
test byte [UsingVGA], ~03h ; Nonstandard mode?
@@ -78,9 +83,12 @@ use_font:
test [UserFont], byte 1 ; Are we using a user-specified font?
jz adjust_screen ; If not, just do the normal stuff
- mov bp,vgafontbuf
- mov bh,[VGAFontSize]
+ push es
+ mov bp,aux_seg
+ mov es,bp
+ mov bp,aux.fontbuf ; ES:BP -> font
+ mov bh,[VGAFontSize]
xor bl,bl ; Needed by both INT 10h calls
test byte [UsingVGA], 01h ; Are we in graphics mode?
@@ -100,6 +108,7 @@ use_font:
shr ax,3 ; 8 pixels/character
dec ax
mov [VidCols],al
+ pop es
ret ; No need to call adjust_screen
.text:
@@ -107,6 +116,7 @@ use_font:
xor dx,dx
mov ax,1110h
int 10h ; Load into VGA RAM
+ pop es
xor bl,bl
mov ax,1103h ; Select page 0
@@ -131,11 +141,8 @@ vidrows_ok: mov [VidRows],al
popa
ret
- section .bss
-vgafontbuf resb 8192
-
section .data
- align 2, db 0
+ alignz 2
VGAFontSize dw 16 ; Defaults to 16 byte font
UserFont db 0 ; Using a user-specified font
diff --git a/core/isolinux.asm b/core/isolinux.asm
index e3599d9c..68c601be 100644
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -67,14 +67,6 @@ vk_end: equ $ ; Should be <= vk_size
endstruc
;
-; Segment assignments in the bottom 640K
-; 0000h - main code/data segment (and BIOS segment)
-;
-real_mode_seg equ 2000h
-xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem
-comboot_seg equ real_mode_seg ; COMBOOT image loading zone
-
-;
; File structure. This holds the information for each currently open file.
;
struc open_file_t
@@ -1066,7 +1058,7 @@ bios_cbios_str db 'CHDD', 0
bios_ebios_str db 'EHDD' ,0
%endif
- alignb 4, db 0
+ alignz 4
bios_cdrom: dw getlinsec_cdrom, bios_cdrom_str
%ifndef DEBUG_MESSAGES
bios_cbios: dw getlinsec_cbios, bios_cbios_str
@@ -1744,7 +1736,7 @@ dbg_configok_msg db 'Configuration file opened...', CR, LF, 0
;
; Extensions to search for (in *forward* order).
;
- align 4, db 0
+ alignz 4
exten_table: db '.cbt' ; COMBOOT (specific)
db '.img' ; Disk image
db '.bin' ; CD boot sector
@@ -1756,7 +1748,7 @@ exten_table_end:
;
; Floppy image table
;
- align 4, db 0
+ alignz 4
img_table_count equ 3
img_table:
dd 1200*1024 ; 1200K floppy
@@ -1787,7 +1779,7 @@ img_table:
; **** ISOLINUX:: We may have to make this flexible, based on what the
; **** BIOS expects our "sector size" to be.
;
- alignb 4, db 0
+ alignz 4
BufSafe dw trackbufsize/SECTOR_SIZE ; Clusters we can load into trackbuf
BufSafeBytes dw trackbufsize ; = how many bytes?
%ifndef DEPEND
diff --git a/core/keywords.inc b/core/keywords.inc
index f2940e8a..4923441f 100644
--- a/core/keywords.inc
+++ b/core/keywords.inc
@@ -40,7 +40,7 @@
keywd_size equ 8 ; Bytes per keyword
- align 4, db 0
+ alignz 4
%define FKeyN(n) (FKeyName+(((n)-1) << FILENAME_MAX_LG2))
diff --git a/core/layout.inc b/core/layout.inc
index 14cbabfd..ef892afc 100644
--- a/core/layout.inc
+++ b/core/layout.inc
@@ -41,7 +41,7 @@ LATEBSS_START equ 0B800h
; Use .earlybss for things that MUST be in low memory.
section .earlybss nobits start=BSS_START
section .config write progbits align=4
- section .config.end write nobits align=4
+ section .replacestub exec write progbits align=16
; Use .bss for things that doesn't have to be in low memory;
; with .bss1 and .bss2 to offload. .earlybss should be used
@@ -81,7 +81,46 @@ RBFG_brainfuck: resb 2048 ; Bigger than an Ethernet packet...
extern __%1_len, __%1_dwords
%endmacro
SECINFO config
+ SECINFO replacestub
global _start
section .text
+
+;
+; Segment assignments in the bottom 640K
+; Keep the low-memory footprint as small as possible... overrun is a hard
+; failure!
+;
+; 0000h - main code/data segment (and BIOS segment)
+
+xfer_buf_seg equ 1000h
+aux_seg equ 2000h
+
+;
+; Contents of aux_seg
+;
+ struc aux
+.fontbuf resb 8192
+ alignb 4096 ; Align the next segment to 4K
+ endstruc
+
+aux_seg_end equ aux_seg + (aux_size >> 4)
+
+;
+; Bounce buffer for I/O to high mem
+; Note: we keep all the segments page-aligned, even if that probably
+; is somewhat excessive. Sector alignment is obligatory, however.
+;
+
+%if IS_ISOLINUX
+; ISOLINUX doesn't have a block cache yet
+real_mode_seg equ aux_seg_end
+%else
+cache_seg equ aux_seg_end ; 64K area for metadata cache
+real_mode_seg equ cache_seg + 1000h
+
+pktbuf_seg equ cache_seg ; PXELINUX packet buffers
+%endif
+
+comboot_seg equ real_mode_seg ; COMBOOT image loading zone
diff --git a/core/ldlinux.asm b/core/ldlinux.asm
index 72a6d15d..8a3ce82a 100644
--- a/core/ldlinux.asm
+++ b/core/ldlinux.asm
@@ -78,18 +78,6 @@ vk_end: equ $ ; Should be <= vk_size
endstruc
;
-; Segment assignments in the bottom 640K
-; Stick to the low 512K in case we're using something like M-systems flash
-; which load a driver into low RAM (evil!!)
-;
-; 0000h - main code/data segment (and BIOS segment)
-;
-real_mode_seg equ 3000h
-cache_seg equ 2000h ; 64K area for metadata cache
-xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem
-comboot_seg equ real_mode_seg ; COMBOOT image loading zone
-
-;
; File structure. This holds the information for each currently open file.
;
struc open_file_t
@@ -602,7 +590,7 @@ syslinux_banner db 0Dh, 0Ah
db VERSION_STR, ' ', DATE_STR, ' ', 0
db 0Dh, 0Ah, 1Ah ; EOF if we "type" this in DOS
- align 8, db 0
+ alignz 8
ldlinux_magic dd LDLINUX_MAGIC
dd LDLINUX_MAGIC^HEXDATE
@@ -1226,7 +1214,7 @@ search_dos_dir:
ret
section .data
- align 4, db 0
+ alignz 4
; Note: we have no use of the first 32 bytes (header),
; nor of the folloing 32 bytes (case mapping of control
; characters), as long as we adjust the offsets appropriately.
@@ -2088,7 +2076,7 @@ exten_table_end:
debug_magic dw 0D00Dh ; Debug code sentinel
%endif
- alignb 4, db 0
+ alignz 4
BufSafe dw trackbufsize/SECTOR_SIZE ; Clusters we can load into trackbuf
BufSafeBytes dw trackbufsize ; = how many bytes?
%ifndef DEPEND
diff --git a/core/macros.inc b/core/macros.inc
index f5e2c924..f3727c24 100644
--- a/core/macros.inc
+++ b/core/macros.inc
@@ -1,6 +1,7 @@
;; -----------------------------------------------------------------------
;;
;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
+;; Copyright 2009 Intel Corporation; author: H. Peter Anvin
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -56,39 +57,39 @@
%endmacro
;
+; Align with zero bytes in a progbits segment
+;
+%macro alignz 1.nolist
+ times (((%1) - (($-$$) % (%1))) % (%1)) db 0
+%endmacro
+
+;
; Macro to emit an unsigned decimal number as a string
;
%macro asciidec 1.nolist
-%ifndef DEPEND ; Not safe for "depend"
-%if %1 >= 1000000000
- db ((%1/1000000000) % 10) + '0'
-%endif
-%if %1 >= 100000000
- db ((%1/100000000) % 10) + '0'
-%endif
-%if %1 >= 10000000
- db ((%1/10000000) % 10) + '0'
-%endif
-%if %1 >= 1000000
- db ((%1/1000000) % 10) + '0'
-%endif
-%if %1 >= 100000
- db ((%1/100000) % 10) + '0'
-%endif
-%if %1 >= 10000
- db ((%1/10000) % 10) + '0'
-%endif
-%if %1 >= 1000
- db ((%1/1000) % 10) + '0'
-%endif
-%if %1 >= 100
- db ((%1/100) % 10) + '0'
-%endif
-%if %1 >= 10
- db ((%1/10) % 10) + '0'
-%endif
- db (%1 % 10) + '0'
-%endif
+ %ifndef DEPEND ; Not safe for "depend"
+ %push asciidec
+ %assign %$v %1
+ %if %$v == 0
+ db '0'
+ %else
+ %assign %$dcount 0
+ %assign %$n %$v
+ %assign %$d 1
+ %rep 20
+ %if %$n != 0
+ %assign %$dcount %$dcount + 1
+ %assign %$n %$n / 10
+ %assign %$d %$d * 10
+ %endif
+ %endrep
+ %rep %$dcount
+ %assign %$d %$d / 10
+ db ((%$v / %$d) % 10) + '0'
+ %endrep
+ %endif
+ %pop
+ %endif
%endmacro
;
diff --git a/core/parseconfig.inc b/core/parseconfig.inc
index 0ea1f137..593687d0 100644
--- a/core/parseconfig.inc
+++ b/core/parseconfig.inc
@@ -458,7 +458,7 @@ VKernelEnd resd 1 ; Lowest high memory address used
HighMemRsvd equ VKernelEnd
; by vkernels
section .config
- align 4, db 0
+ alignz 4
KbdTimeout dd 0 ; Keyboard timeout (if any)
TotalTimeout dd 0 ; Total timeout (if any)
AppendLen dw 0 ; Bytes in append= command
diff --git a/core/pxeidle.inc b/core/pxeidle.inc
index 7d85beb5..0e0e8b28 100644
--- a/core/pxeidle.inc
+++ b/core/pxeidle.inc
@@ -55,7 +55,7 @@ pxe_detect_nic_type:
;; List of devices for which we want to actually issue idle calls.
;;
section .data
- align 4, db 0
+ alignz 4
pxe_idle_pci_list:
;
; Older Broadcom NICs; these need idle calls to avoid FIFO stalls.
diff --git a/core/pxelinux.asm b/core/pxelinux.asm
index 370cc2bb..b9ef963a 100644
--- a/core/pxelinux.asm
+++ b/core/pxelinux.asm
@@ -39,8 +39,6 @@ MAX_OPEN_LG2 equ 5 ; log2(Max number of open sockets)
MAX_OPEN equ (1 << MAX_OPEN_LG2)
PKTBUF_SIZE equ (65536/MAX_OPEN) ; Per-socket packet buffer size
TFTP_PORT equ htons(69) ; Default TFTP port
-PKT_RETRY equ 6 ; Packet transmit retry count
-PKT_TIMEOUT equ 12 ; Initial timeout, timer ticks @ 55 ms
; Desired TFTP block size
; For Ethernet MTU is normally 1500. Unfortunately there seems to
; be a fair number of networks with "substandard" MTUs which break.
@@ -115,15 +113,6 @@ vk_end: equ $ ; Should be <= vk_size
endstruc
;
-; Segment assignments in the bottom 640K
-; 0000h - main code/data segment (and BIOS segment)
-;
-real_mode_seg equ 3000h
-pktbuf_seg equ 2000h ; Packet buffers segments
-xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem
-comboot_seg equ real_mode_seg ; COMBOOT image loading zone
-
-;
; BOOTP/DHCP packet pattern
;
struc bootp_t
@@ -208,7 +197,6 @@ StrucPtr resd 1 ; Pointer to PXENV+ or !PXE structure
APIVer resw 1 ; PXE API version found
IdleTimer resw 1 ; Time to check for ARP?
LocalBootType resw 1 ; Local boot return code
-PktTimeout resw 1 ; Timeout for current packet
RealBaseMem resw 1 ; Amount of DOS memory after freeing
OverLoad resb 1 ; Set if DHCP packet uses "overloading"
DHCPMagic resb 1 ; PXELINUX magic flags
@@ -284,7 +272,6 @@ _start1:
lss esp,[BaseStack]
sti ; Stack set up and ready
-
;
; Initialize screen (if we're using one)
;
@@ -992,10 +979,9 @@ searchdir:
call allocate_socket
jz .ret
- mov ax,PKT_RETRY ; Retry counter
- mov word [PktTimeout],PKT_TIMEOUT ; Initial timeout
+ mov ax,TimeoutTable ; Reset timeout
-.sendreq: push ax ; [bp-2] - Retry counter
+.sendreq: push ax ; [bp-2] - Timeout pointer
push si ; [bp-4] - File name
mov di,packet_buf
@@ -1060,7 +1046,9 @@ searchdir:
;
; Packet transmitted OK, now we need to receive
-.getpacket: push word [PktTimeout] ; [bp-10]
+.getpacket: mov bx,[bp-2]
+ movzx bx,byte [bx]
+ push bx ; [bp-10] - timeout in ticks
push word [BIOS_timer] ; [bp-12]
.pkt_loop: mov bx,[bp-8] ; TID
@@ -1080,11 +1068,10 @@ searchdir:
cmp dx,[bp-12]
je .pkt_loop
mov [bp-12],dx
- dec word [bp-10] ; Timeout
+ dec word [bp-10]
jnz .pkt_loop
pop ax ; Adjust stack
pop ax
- shl word [PktTimeout],1 ; Exponential backoff
jmp .failure
.got_packet:
@@ -1098,7 +1085,7 @@ searchdir:
jne .no_packet
; Got packet - reset timeout
- mov word [PktTimeout],PKT_TIMEOUT
+ mov word [bp-2],TimeoutTable
pop ax ; Adjust stack
pop ax
@@ -1268,14 +1255,17 @@ searchdir:
call writestr_early
jmp kaboom
-.bailnow: mov word [bp-2],1 ; Immediate error - no retry
+.bailnow:
+ ; Immediate error - no retry
+ mov word [bp-2],TimeoutTableEnd-1
.failure: pop bx ; Junk
pop bx
pop si
pop ax
- dec ax ; Retry counter
- jnz .sendreq ; Try again
+ inc ax
+ cmp ax,TimeoutTableEnd
+ jb .sendreq ; Try again
.error: mov si,bx ; Socket pointer
.error_si: ; Socket pointer already in SI
@@ -1622,6 +1612,7 @@ unmangle_name:
; While we're at it, save and restore all registers.
;
pxenv:
+ pushfd
pushad
%if USE_PXE_PROVIDED_STACK == 0
mov [cs:PXEStack],sp
@@ -1640,20 +1631,17 @@ pxenv:
.jump: call 0:0
add sp,6
mov [cs:PXEStatus],ax
- add ax,-1 ; Set CF unless AX was 0
-
%if USE_PXE_PROVIDED_STACK == 0
lss sp,[cs:PXEStack]
%endif
+ mov bp,sp
+ and ax,ax
+ setnz [bp+32] ; If AX != 0 set CF on return
- ; This clobbers the AX return, but we don't use it
- ; except for testing it against zero (and setting CF),
- ; which we did above. For anything else,
- ; use the Status field in the reply.
- ; For the COMBOOT function, the value is saved in
+ ; This clobbers the AX return, but we already saved it into
; the PXEStatus variable.
popad
- cld ; Make sure DF <- 0
+ popfd ; Restore flags (incl. IF, DF)
ret
; Must be after function def due to NASM bug
@@ -1790,10 +1778,10 @@ fill_buffer:
.packet_loop:
; Start by ACKing the previous packet; this should cause the
; next packet to be sent.
- mov cx,PKT_RETRY
- mov word [PktTimeout],PKT_TIMEOUT
+ mov bx,TimeoutTable
-.send_ack: push cx ; <D> Retry count
+.send_ack: push bx ; <D> Retry pointer
+ movzx cx,byte [bx] ; Timeout
mov ax,[si+tftp_lastpkt]
call ack_packet ; Send ACK
@@ -1807,7 +1795,6 @@ fill_buffer:
.send_ok: ; Now wait for packet.
mov dx,[BIOS_timer] ; Get current time
- mov cx,[PktTimeout]
.wait_data: push cx ; <E> Timeout
push dx ; <F> Old time
@@ -1836,9 +1823,10 @@ fill_buffer:
je .wait_data ; Same clock tick
loop .wait_data ; Decrease timeout
- pop cx ; <D> Didn't get any, send another ACK
- shl word [PktTimeout],1 ; Exponential backoff
- loop .send_ack
+ pop bx ; <D> Didn't get any, send another ACK
+ inc bx
+ cmp bx,TimeoutTableEnd
+ jb .send_ack
jmp kaboom ; Forget it...
.recv_ok: pop dx ; <F>
@@ -1903,6 +1891,19 @@ fill_buffer:
jmp .ret
;
+; TimeoutTable: list of timeouts (in 18.2 Hz timer ticks)
+;
+; This is roughly an exponential backoff...
+;
+ section .data
+TimeoutTable:
+ db 2, 2, 3, 3, 4, 5, 6, 7, 9, 10, 12, 15, 18
+ db 21, 26, 31, 37, 44, 53, 64, 77, 92, 110, 132
+ db 159, 191, 229, 255, 255, 255, 255
+TimeoutTableEnd equ $
+
+ section .text
+;
; ack_packet:
;
; Send ACK packet. This is a common operation and so is worth canning.
@@ -2000,8 +2001,8 @@ get_packet_gpxe:
; the memory.
;
unload_pxe:
- test byte [KeepPXE],01h ; Should we keep PXE around?
- jnz reset_pxe
+ cmp byte [KeepPXE],0 ; Should we keep PXE around?
+ jne reset_pxe
push ds
push es
@@ -2678,7 +2679,7 @@ bootif_str_len equ $-bootif_str
; Extensions to search for (in *forward* order).
; (.bs and .bss are disabled for PXELINUX, since they are not supported)
;
- align 4, db 0
+ alignz 4
exten_table: db '.cbt' ; COMBOOT (specific)
db '.0', 0, 0 ; PXE bootstrap program
db '.com' ; COMBOOT (same as DOS)
@@ -2771,7 +2772,7 @@ gpxe_file_read:
;
; Misc initialized (data) variables
;
- alignb 4, db 0
+ alignz 4
BaseStack dd StackBuf ; ESP of base stack
dw 0 ; SS of base stack
NextSocket dw 49152 ; Counter for allocating socket numbers
@@ -2790,7 +2791,7 @@ blksize_len equ ($-blksize_str)
db 0
tftp_tail_len equ ($-tftp_tail)
- alignb 2, db 0
+ alignz 2
;
; Options negotiation parsing table (string pointer, string len, offset
; into socket structure)
@@ -2808,7 +2809,7 @@ tftp_opt_err dw TFTP_ERROR ; ERROR packet
db 'tsize option required', 0 ; Error message
tftp_opt_err_len equ ($-tftp_opt_err)
- alignb 4, db 0
+ alignz 4
ack_packet_buf: dw TFTP_ACK, 0 ; TFTP ACK packet
;
@@ -2822,7 +2823,7 @@ ServerPort dw TFTP_PORT ; TFTP server port
;
; Variables that are uninitialized in SYSLINUX but initialized here
;
- alignb 4, db 0
+ alignz 4
BufSafe dw trackbufsize/TFTP_BLOCKSIZE ; Clusters we can load into trackbuf
BufSafeBytes dw trackbufsize ; = how many bytes?
%ifndef DEPEND
diff --git a/core/rawcon.inc b/core/rawcon.inc
index 10d7a764..f0d434c8 100644
--- a/core/rawcon.inc
+++ b/core/rawcon.inc
@@ -8,6 +8,7 @@ writechr_full:
%else
writechr:
%endif
+ pushfd
push ds
push cs
pop ds
@@ -16,7 +17,6 @@ writechr:
call vgaclearmode
.videook:
call write_serial ; write to serial port if needed
- pushfd
test byte [DisplayCon],01h ; Write to screen?
jz .nothing
@@ -51,8 +51,8 @@ writechr:
int 10h
.ret: popad
.nothing:
- popfd
pop ds
+ popfd
ret
.scroll: dec dh
mov bh,[BIOS_page]
diff --git a/core/runkernel.inc b/core/runkernel.inc
index f13f1469..8bfc8b8d 100644
--- a/core/runkernel.inc
+++ b/core/runkernel.inc
@@ -95,12 +95,6 @@ construct_cmdline:
;
parse_cmdline:
mov di,cmd_line_here
- xor ax,ax
- mov [InitRDPtr],ax ; No initrd= option (yet)
- mov [QuietBoot],al
-%if IS_PXELINUX
- and byte [KeepPXE],~2
-%endif
.skipspace: mov al,[es:di]
inc di
.skipspace_loaded:
@@ -176,7 +170,7 @@ opt_quiet:
%if IS_PXELINUX
opt_keeppxe:
- or byte [KeepPXE],2 ; KeepPXE set by command line
+ or byte [KeepPXE],1 ; KeepPXE set by command line
ret
%endif
diff --git a/core/syslinux.ld b/core/syslinux.ld
index 6f7f5a78..c1da230e 100644
--- a/core/syslinux.ld
+++ b/core/syslinux.ld
@@ -44,7 +44,7 @@ SECTIONS
__bss_len = __bss_end - __bss_start;
__bss_dwords = (__bss_len + 3) >> 2;
- .config : AT (__config_lma) {
+ .config : AT (__config_lma) {
__config_start = .;
*(.config)
__config_end = .;
@@ -52,6 +52,15 @@ SECTIONS
__config_len = __config_end - __config_start;
__config_dwords = (__config_len + 3) >> 2;
+ . = ALIGN(16);
+ .replacestub : AT (__replacestub_lma) {
+ __replacestub_start = .;
+ *(.replacestub)
+ __replacestub_end = .;
+ }
+ __replacestub_len = __replacestub_end - __replacestub_start;
+ __replacestub_dwords = (__replacestub_len + 3) >> 2;
+
/* Stack */
STACK_BASE = 0x7c00 - STACK_LEN;
@@ -99,6 +108,10 @@ SECTIONS
__config_lma = .;
. += SIZEOF(.config);
+ . = ALIGN(4);
+ __replacestub_lma = .;
+ . += SIZEOF(.replacestub);
+
/* ADV, must be the last intialized section */
. = ALIGN(512);
diff --git a/core/ui.inc b/core/ui.inc
index d59143bb..4c6e04a0 100644
--- a/core/ui.inc
+++ b/core/ui.inc
@@ -310,16 +310,6 @@ command_done:
load_kernel: ; Load the kernel now
;
-; Common initialization for all kernel types
-;
- xor ax,ax
- mov [InitRDPtr],ax
- mov [QuietBoot],al
-%if IS_PXELINUX
- mov [KeepPXE],al
-%endif
-
-;
; First we need to mangle the kernel name the way DOS would...
;
mov si,command_line
@@ -603,6 +593,15 @@ kernel_good_saved:
kernel_good:
pushad
+ ;
+ ; Common initialization for all kernel types
+ ;
+ xor ax,ax
+ mov [InitRDPtr],ax
+ mov [QuietBoot],al
+%if IS_PXELINUX
+ mov [KeepPXE],al
+%endif
mov si,KernelName
mov di,KernelCName
@@ -698,7 +697,7 @@ err_notfound db 'Could not find kernel image: ',0
err_notkernel db CR, LF, 'Invalid or corrupt kernel image.', CR, LF, 0
- align 2, db 0
+ alignz 2
kerneltype_table:
dw is_unknown_filetype ; VK_KERNEL
dw is_linux_kernel ; VK_LINUX
diff --git a/doc/comboot.txt b/doc/comboot.txt
index b1334511..cf18b2b6 100644
--- a/doc/comboot.txt
+++ b/doc/comboot.txt
@@ -937,13 +937,20 @@ AX=0024h [3.80] Cleanup, shuffle and boot, raw version
entry, the destination is used as an entry point, and the
source represents the type of entry point:
- 0 Real mode (dst is CS:IP)
+ 0 16-bit protected mode (dst is CS.base)
1 Flat 32-bit protected mode (dst is EIP)
- This routine does not set up any register state whatsoever,
- including stack. It is the responsibility of the caller to
- make sure the entry point provided sets up any registers
- needed. This is particularly important that a real mode entry
- point reloads all data segment registers at the earliest
- possible point.
+ This routine does not set up any GPR register state
+ whatsoever, including stack. It is the responsibility of the
+ caller to make sure the entry point provided sets up any
+ registers needed.
+ For mode 0 (16-bit real mode), EAX will contain CR0 with bit 0
+ masked out, suitable for loading into CR0 to immediately enter
+ real mode. Note: if real-mode entry is planned,
+ (CS.base & 0xfff0000f) should == 0 for compatibility with KVM,
+ and possibly other virtualization solutions.
+
+ In both mode 0 and mode 1, the data segments will be loaded
+ with base-zero read/write segments. For mode 0, B=0 and the
+ limits will be 64K, for mode 1, B=1 and the limits will be 4 GB.
diff --git a/doc/extlinux.txt b/doc/extlinux.txt
index cb26fada..53f9f483 100644
--- a/doc/extlinux.txt
+++ b/doc/extlinux.txt
@@ -38,7 +38,7 @@ slight modifications.
4. EXTLINUX now supports symbolic links. However, extremely long
symbolic links might hit the pathname limit. Also, please note
that absolute symbolic links are interpreted from the root *of the
- filesystem*, which might be different from now the running system
+ filesystem*, which might be different from how the running system
would interpret it (e.g. in the case of a separate /boot
partition.) Therefore, use relative symbolic links if at all
possible.
diff --git a/doc/menu.txt b/doc/menu.txt
index 72bc9dca..97e172fc 100644
--- a/doc/menu.txt
+++ b/doc/menu.txt
@@ -276,6 +276,7 @@ DEFAULT label
MENU SAVE
+MENU NOSAVE
Remember the last entry selected and make that the default for
the next boot. A password-protected menu entry is *not*
@@ -289,7 +290,12 @@ MENU SAVE
file gracefully.
The MENU SAVE information can be cleared with
- "extlinux --reset-adv".
+ "extlinux --reset-adv <bootdir>".
+
+ A MENU SAVE or MENU NOSAVE at the top of a (sub)menu affects
+ all entries underneath that (sub)menu except those that in
+ turn have MENU SAVE or MENU NOSAVE declared. This can be used
+ to only save certain entires when selected.
INCLUDE filename [tagname]
diff --git a/doc/syslinux.txt b/doc/syslinux.txt
index 72f38d34..94141415 100644
--- a/doc/syslinux.txt
+++ b/doc/syslinux.txt
@@ -2,7 +2,7 @@
A suite of bootloaders for Linux
- Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
+ Copyright 1994-2009 H. Peter Anvin and contributors
This program is provided under the terms of the GNU General Public
License, version 2 or, at your option, any later version. There is no
@@ -271,7 +271,7 @@ LABEL label
This is mostly useful for initramfs, which can be composed of
multiple separate cpio or cpio.gz archives.
Note: all files except the last one are zero-padded to a
- 4K page boundary. This should not affect initramfs.)
+ 4K page boundary. This should not affect initramfs.
IMPLICIT flag_val
If flag_val is 0, do not load a kernel image unless it has been
diff --git a/gpxe/src/arch/i386/firmware/pcbios/e820mangler.S b/gpxe/src/arch/i386/firmware/pcbios/e820mangler.S
index 4ba3fb14..decb0835 100644
--- a/gpxe/src/arch/i386/firmware/pcbios/e820mangler.S
+++ b/gpxe/src/arch/i386/firmware/pcbios/e820mangler.S
@@ -490,6 +490,18 @@ get_mangled_e820:
.size get_mangled_e820, . - get_mangled_e820
/****************************************************************************
+ * Set/clear CF on the stack as appropriate, assumes stack is as it should
+ * be immediately before IRET
+ ****************************************************************************
+ */
+patch_cf:
+ pushw %bp
+ movw %sp, %bp
+ setc 8(%bp) /* Set/reset CF; clears PF, AF, ZF, SF */
+ popw %bp
+ ret
+
+/****************************************************************************
* INT 15,e820 handler
****************************************************************************
*/
@@ -500,7 +512,8 @@ int15_e820:
popw %ds
call get_mangled_e820
popw %ds
- lret $2
+ call patch_cf
+ iret
.size int15_e820, . - int15_e820
/****************************************************************************
@@ -512,7 +525,7 @@ int15_e801:
/* Call previous handler */
pushfw
lcall *%cs:int15_vector
- pushfw
+ call patch_cf
/* Edit result */
pushw %ds
pushw %cs:rm_ds
@@ -524,9 +537,7 @@ int15_e801:
xchgw %ax, %cx
xchgw %bx, %dx
popw %ds
- /* Restore flags returned by previous handler and return */
- popfw
- lret $2
+ iret
.size int15_e801, . - int15_e801
/****************************************************************************
@@ -538,16 +549,14 @@ int15_88:
/* Call previous handler */
pushfw
lcall *%cs:int15_vector
- pushfw
+ call patch_cf
/* Edit result */
pushw %ds
pushw %cs:rm_ds
popw %ds
call patch_1m
popw %ds
- /* Restore flags returned by previous handler and return */
- popfw
- lret $2
+ iret
.size int15_88, . - int15_88
/****************************************************************************
diff --git a/gpxe/src/arch/i386/firmware/pcbios/fakee820.c b/gpxe/src/arch/i386/firmware/pcbios/fakee820.c
index e171edfd..552bf41d 100644
--- a/gpxe/src/arch/i386/firmware/pcbios/fakee820.c
+++ b/gpxe/src/arch/i386/firmware/pcbios/fakee820.c
@@ -63,6 +63,8 @@ void fake_e820 ( void ) {
"cmpl $0x534d4150, %%edx\n\t"
"jne 99f\n\t"
"pushaw\n\t"
+ "movw %%sp, %%bp\n\t"
+ "andb $~0x01, 22(%%bp)\n\t" /* Clear return CF */
"leaw e820map(%%bx), %%si\n\t"
"cs rep movsb\n\t"
"popaw\n\t"
@@ -73,8 +75,7 @@ void fake_e820 ( void ) {
"xorl %%ebx,%%ebx\n\t"
"\n1:\n\t"
"popfw\n\t"
- "clc\n\t"
- "lret $2\n\t"
+ "iret\n\t"
"\n99:\n\t"
"popfw\n\t"
"ljmp *%%cs:real_int15_vector\n\t" )
diff --git a/gpxe/src/arch/i386/interface/pxe/pxe_entry.S b/gpxe/src/arch/i386/interface/pxe/pxe_entry.S
index 22ef4181..0e8c8e2d 100644
--- a/gpxe/src/arch/i386/interface/pxe/pxe_entry.S
+++ b/gpxe/src/arch/i386/interface/pxe/pxe_entry.S
@@ -199,9 +199,12 @@ pxe_int_1a:
shll $4, %edx
addl $pxenv, %edx
movw $0x564e, %ax
+ pushw %bp
+ movw %sp, %bp
+ andb $~0x01, 8(%bp) /* Clear CF on return */
+ popw %bp
popfw
- clc
- lret $2
+ iret
1: /* INT 1A,other - pass through */
popfw
ljmp *%cs:pxe_int_1a_vector
diff --git a/man/extlinux.1 b/man/extlinux.1
new file mode 100644
index 00000000..426eeb37
--- /dev/null
+++ b/man/extlinux.1
@@ -0,0 +1,59 @@
+.TH extlinux "1" "18 December 2007" "SYSLINUX for ext2/ext3 filesystem"
+.SH NAME
+extlinux \- install the \s-1SYSLINUX\s+1 bootloader on a ext2/ext3 filesystem
+.SH SYNOPSIS
+.B extlinux
+[\fIoptions\fP] \fIdirectory\fP
+.SH DESCRIPTION
+\fBEXTLINUX\fP is a new syslinux derivative, which boots from a Linux ext2/ext3
+filesystem. It works the same way as \fBSYSLINUX\fP, with a few slight modifications.
+It is intended to simplify first-time installation of Linux, and for creation of
+rescue and other special-purpose boot disks.
+.PP
+The installer is designed to be run on a mounted directory. For example, if you have an
+ext2 or ext3 usb key mounted on /mnt, you can run the following command:
+.IP
+.B extlinux --install /mnt
+.SH OPTIONS
+.TP
+\fB\-H\fR, \fB\-\-heads\fR=#
+Force the number of heads.
+.TP
+\fB\-i\fR, \fB\-\-install\fR
+Install over the current bootsector.
+.TP
+\fB\-O\fR, \fB\-\-clear\-once\fR
+Clear the boot-once command.
+.TP
+\fB\-o\fR, \fB\-\-once\fR=\fIcommand\fR
+Execute a command once upon boot.
+.TP
+\fB\-r\fR, \fB\-\-raid\fR
+Fall back to the next device on boot failure.
+.TP
+\fB\-\-reset\-adv\fR
+Reset auxiliary data.
+.TP
+\fB\-S\fR, \fB\-\-sectors\fR=\fI#\fR
+Force the number of sectors per track.
+.TP
+\fB\-U\fR, \fB\-\-update\fR
+Updates a previous \fBEXTLINUX\fP installation.
+.TP
+\fB\-z\fR, \fB\-\-zip\fR
+Force zipdrive geometry (-H 64 -S 32).
+.SH BUGS
+I would appreciate hearing of any problems you have with \s-1SYSLINUX\s+1. I
+would also like to hear from you if you have successfully used \s-1SYSLINUX\s+1,
+especially if you are using it for a distribution.
+.PP
+If you are reporting problems, please include all possible information
+about your system and your BIOS; the vast majority of all problems
+reported turn out to be BIOS or hardware bugs, and I need as much
+information as possible in order to diagnose the problems.
+.PP
+There is a mailing list for discussion among \s-1SYSLINUX\s+1 users and for
+announcements of new and test versions. To join, send a message to
+majordomo@linux.kernel.org with the line:
+.SH SEE ALSO
+.BR syslinux (1)
diff --git a/memdisk/setup.c b/memdisk/setup.c
index 0fee9820..ebc7a36a 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -374,6 +374,7 @@ struct geometry {
uint32_t offset; /* Byte offset for disk */
uint8_t type; /* Type byte for INT 13h AH=08h */
uint8_t driveno; /* Drive no */
+ const char *hsrc, *ssrc; /* Origins of H and S geometries */
};
/* Format of a DOS partition table entry */
@@ -457,6 +458,8 @@ const struct geometry *get_disk_image_geometry(uint32_t where, uint32_t size)
sectors = xsectors = (size-offset) >> 9;
+ hd_geometry.hsrc = "guess";
+ hd_geometry.ssrc = "guess";
hd_geometry.sectors = sectors;
hd_geometry.offset = offset;
@@ -471,14 +474,20 @@ const struct geometry *get_disk_image_geometry(uint32_t where, uint32_t size)
hd_geometry.s = dosemu.s;
hd_geometry.offset += dosemu.offset;
sectors = (size-hd_geometry.offset) >> 9;
+
+ hd_geometry.hsrc = hd_geometry.ssrc = "DOSEMU";
}
if ( CMD_HASDATA(p = getcmditem("c")) && (v = atou(p)) )
hd_geometry.c = v;
- if ( CMD_HASDATA(p = getcmditem("h")) && (v = atou(p)) )
+ if ( CMD_HASDATA(p = getcmditem("h")) && (v = atou(p)) ) {
hd_geometry.h = v;
- if ( CMD_HASDATA(p = getcmditem("s")) && (v = atou(p)) )
+ hd_geometry.hsrc = "cmd";
+ }
+ if ( CMD_HASDATA(p = getcmditem("s")) && (v = atou(p)) ) {
hd_geometry.s = v;
+ hd_geometry.ssrc = "cmd";
+ }
if ( !hd_geometry.h || !hd_geometry.s ) {
int h, s, max_h, max_s;
@@ -510,6 +519,7 @@ const struct geometry *get_disk_image_geometry(uint32_t where, uint32_t size)
hd_geometry.driveno = extra->bs_drvnum & 0x80;
max_h = fs->bpb_numheads;
max_s = fs->bpb_secpertrk;
+ hd_geometry.hsrc = hd_geometry.ssrc = "FAT";
}
}
@@ -552,6 +562,7 @@ const struct geometry *get_disk_image_geometry(uint32_t where, uint32_t size)
if (ok) {
max_h = h;
max_s = s;
+ hd_geometry.hsrc = hd_geometry.ssrc = "fd";
} else {
/* No valid floppy geometry, fake it by simulating broken
sectors at the end of the image... */
@@ -565,7 +576,7 @@ const struct geometry *get_disk_image_geometry(uint32_t where, uint32_t size)
hd_geometry.driveno = 0x80; /* Assume hard disk */
- if (*(uint16_t *)((char *)where+512) == 0xaa55)
+ if (*(uint16_t *)((char *)where+512-2) == 0xaa55) {
for ( i = 0 ; i < 4 ; i++ ) {
if ( ptab[i].type && !(ptab[i].active & 0x7f) ) {
s = (ptab[i].start_s & 0x3f);
@@ -577,10 +588,17 @@ const struct geometry *get_disk_image_geometry(uint32_t where, uint32_t size)
s = (ptab[i].end_s & 0x3f);
h = ptab[i].end_h + 1;
- if ( max_h < h ) max_h = h;
- if ( max_s < s ) max_s = s;
+ if ( max_h < h ) {
+ max_h = h;
+ hd_geometry.hsrc = "MBR";
+ }
+ if ( max_s < s ) {
+ max_s = s;
+ hd_geometry.ssrc = "MBR";
+ }
}
}
+ }
}
}
@@ -781,14 +799,15 @@ __cdecl void setup(__cdecl syscall_t cs_syscall, void *cs_bounce)
pptr->configflags |= CONFIG_SAFEINT;
}
- printf("Disk is %s %d, %u%s K, C/H/S = %u/%u/%u, EDD %s, %s\n",
- (geometry->driveno & 0x80) ? "hard disk" : "floppy",
+ printf("Disk is %s%d, %u%s K, C/H/S = %u/%u/%u (%s/%s), EDD %s, %s\n",
+ (geometry->driveno & 0x80) ? "hd" : "fd",
geometry->driveno & 0x7f,
geometry->sectors >> 1,
(geometry->sectors & 1) ? ".5" : "",
geometry->c, geometry->h, geometry->s,
+ geometry->hsrc, geometry->ssrc,
do_edd ? "on" : "off",
- pptr->configflags & CONFIG_READONLY ? "readonly" : "read-write");
+ pptr->configflags & CONFIG_READONLY ? "ro" : "rw");
puts("Using ");
switch (pptr->configflags & CONFIG_MODEMASK) {