aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-25 17:52:02 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-25 17:52:02 -0700
commit3ea01d1af4dd0c22b292ce887141a95c9d629f19 (patch)
tree5277ac8c13749f0cedfb8fcc96cca062e6effd4a /com32/hdt
parent5fa9fcefee51b0ea0dd27ab655a4acec6426a935 (diff)
downloadhdt-3ea01d1af4dd0c22b292ce887141a95c9d629f19.tar.gz
hdt-3ea01d1af4dd0c22b292ce887141a95c9d629f19.tar.xz
hdt-3ea01d1af4dd0c22b292ce887141a95c9d629f19.zip
hdt: Improve disk output (CLI)
Do not print EDD C/H/S info, since it is not really useful. Add disk size to the summary. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/hdt')
-rw-r--r--com32/hdt/hdt-cli-disk.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/com32/hdt/hdt-cli-disk.c b/com32/hdt/hdt-cli-disk.c
index 9bd4b1fe..0d3cc18d 100644
--- a/com32/hdt/hdt-cli-disk.c
+++ b/com32/hdt/hdt-cli-disk.c
@@ -175,18 +175,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];
+ char disk_size[8];
+
+ if ((int) d->edd_params.sectors > 0)
+ sectors_to_size((int) d->edd_params.sectors, disk_size);
+ else
+ memset(disk_size, 0, sizeof disk_size);
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,
+ more_printf(" C/H/S: %d cylinders, %d heads, %d sectors/track\n",
+ d->legacy_max_cylinder + 1, d->legacy_max_head + 1,
+ d->legacy_sectors_per_track);
+ more_printf(" EDD: Version: %X\n", d->edd_version);
+ more_printf(" Size: %s, %d bytes/sector, %d sectors/track\n",
+ disk_size,
+ (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);