aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-19 18:25:44 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-19 18:25:44 -0700
commita1d3996b00a34089500253ca20ff87d79a41a7dc (patch)
tree4104c4a96eae2096f3e6cd60845f4e2745813096 /com32
parent62edfe42a1863f69db0c486f705fec17519641c3 (diff)
downloadsyslinux.git-a1d3996b00a34089500253ca20ff87d79a41a7dc.tar.gz
syslinux.git-a1d3996b00a34089500253ca20ff87d79a41a7dc.tar.xz
syslinux.git-a1d3996b00a34089500253ca20ff87d79a41a7dc.zip
hdt: Adapt disk CLI/menu to new struct devinfo
The struct devinfo has slightly changed. Reflect the changes in hdt. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32')
-rw-r--r--com32/hdt/hdt-cli-disk.c21
-rw-r--r--com32/hdt/hdt-common.c8
-rw-r--r--com32/hdt/hdt-menu-disk.c26
3 files changed, 34 insertions, 21 deletions
diff --git a/com32/hdt/hdt-cli-disk.c b/com32/hdt/hdt-cli-disk.c
index 6d9c3f06..a035b58c 100644
--- a/com32/hdt/hdt-cli-disk.c
+++ b/com32/hdt/hdt-cli-disk.c
@@ -48,12 +48,21 @@ void main_show_disk(int argc __unused, char **argv __unused,
if (!hardware->disk_info[i].cbios)
continue; /* Invalid geometry */
struct driveinfo *d = &hardware->disk_info[i];
- more_printf
- ("DISK 0x%X:\n\ts/t=%d, sectors=%d, cylinders=%d, heads=%d, b/s=%d\n"
- "\tBus type: %s, Interface type: %s\n\tEDD=%X (ebios=%d, cbios=%d)\n",
- d->disk, d->sectors_per_track, d->sectors, d->cylinder, d->heads,
- d->bytes_per_sector, d->host_bus_type, d->interface_type,
- d->edd_version, d->ebios, d->cbios);
+
+ more_printf("DISK 0x%X:\n", d->disk);
+ more_printf(" C/H/S: %d heads, %d cylinders\n",
+ d->legacy_max_head + 1, d->legacy_max_cylinder + 1);
+ more_printf(" %d sectors/track, %d drives\n",
+ d->legacy_sectors_per_track, d->legacy_max_drive);
+ more_printf(" EDD: ebios=%d, EDD version: %X\n",
+ d->ebios, d->edd_version);
+ more_printf(" %d heads, %d cylinders\n",
+ (int) d->edd_params.heads, (int) d->edd_params.cylinders);
+ more_printf(" %d sectors, %d bytes/sector, %d sectors/track\n",
+ (int) d->edd_params.sectors, (int) d->edd_params.bytes_per_sector,
+ (int) d->edd_params.sectors_per_track);
+ more_printf(" Host bus: %s, Interface type: %s\n\n",
+ d->edd_params.host_bus_type, d->edd_params.interface_type);
}
}
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index 84939844..7be72557 100644
--- a/com32/hdt/hdt-common.c
+++ b/com32/hdt/hdt-common.c
@@ -254,8 +254,12 @@ void detect_disks(struct s_hardware *hardware)
i++;
hardware->disk_info[i].disk = drive;
err = get_drive_parameters(&hardware->disk_info[i]);
- /* Do not show errors when a disk is not found (0x01) */
- if (err && err != 0x01) {
+
+ /* Do not print output when drive does not exists */
+ if (err == -1)
+ continue;
+
+ if (err) {
get_error(err, &error_msg);
more_printf("Error 0x%Xh while reading disk 0x%X:\n\t%s\n",
err, drive, error_msg);
diff --git a/com32/hdt/hdt-menu-disk.c b/com32/hdt/hdt-menu-disk.c
index 30b13b80..dc2d9a4c 100644
--- a/com32/hdt/hdt-menu-disk.c
+++ b/com32/hdt/hdt-menu-disk.c
@@ -41,7 +41,7 @@ int compute_disk_module(struct s_my_menu *menu, int nb_sub_disk_menu,
/* Compute device size */
char previous_unit[3], unit[3]; //GB
- int previous_size, size = d[disk_number].sectors / 2; // Converting to bytes
+ int previous_size, size = d[disk_number].edd_params.sectors / 2; // Converting to bytes
strlcpy(unit, "KB", 2);
strlcpy(previous_unit, unit, 2);
previous_size = size;
@@ -70,44 +70,44 @@ int compute_disk_module(struct s_my_menu *menu, int nb_sub_disk_menu,
menu[nb_sub_disk_menu].items_count++;
snprintf(buffer, sizeof buffer, "Interface : %s",
- d[disk_number].interface_type);
+ d[disk_number].edd_params.interface_type);
snprintf(statbuffer, sizeof statbuffer, "Interface: %s",
- d[disk_number].interface_type);
+ d[disk_number].edd_params.interface_type);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu[nb_sub_disk_menu].items_count++;
snprintf(buffer, sizeof buffer, "Host Bus : %s",
- d[disk_number].host_bus_type);
+ d[disk_number].edd_params.host_bus_type);
snprintf(statbuffer, sizeof statbuffer, "Host Bus Type: %s",
- d[disk_number].host_bus_type);
+ d[disk_number].edd_params.host_bus_type);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu[nb_sub_disk_menu].items_count++;
snprintf(buffer, sizeof buffer, "Sectors : %d",
- d[disk_number].sectors);
+ (int) d[disk_number].edd_params.sectors);
snprintf(statbuffer, sizeof statbuffer, "Sectors: %d",
- d[disk_number].sectors);
+ (int) d[disk_number].edd_params.sectors);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu[nb_sub_disk_menu].items_count++;
snprintf(buffer, sizeof buffer, "Heads : %d",
- d[disk_number].heads);
+ d[disk_number].legacy_max_head + 1);
snprintf(statbuffer, sizeof statbuffer, "Heads: %d",
- d[disk_number].heads);
+ d[disk_number].legacy_max_head + 1);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu[nb_sub_disk_menu].items_count++;
snprintf(buffer, sizeof buffer, "Cylinders : %d",
- d[disk_number].cylinder);
+ d[disk_number].legacy_max_cylinder + 1);
snprintf(statbuffer, sizeof statbuffer, "Cylinders: %d",
- d[disk_number].cylinder);
+ d[disk_number].legacy_max_cylinder + 1);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu[nb_sub_disk_menu].items_count++;
snprintf(buffer, sizeof buffer, "Sectors/Track: %d",
- d[disk_number].sectors_per_track);
+ d[disk_number].legacy_sectors_per_track);
snprintf(statbuffer, sizeof statbuffer, "Sectors per Track: %d",
- d[disk_number].sectors_per_track);
+ d[disk_number].legacy_sectors_per_track);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu[nb_sub_disk_menu].items_count++;