aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt/hdt-cli-disk.c
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-23 10:29:36 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-23 10:29:36 -0700
commit9dcb397d48dce00a81611b8d9219d07d2152a371 (patch)
tree12bec1cf67def5e9b0273bea8d24ffcedb3ac69a /com32/hdt/hdt-cli-disk.c
parent5ead2538bd63a816d592dcc29748e4d5dc4adc02 (diff)
downloadhdt-9dcb397d48dce00a81611b8d9219d07d2152a371.tar.gz
hdt-9dcb397d48dce00a81611b8d9219d07d2152a371.tar.xz
hdt-9dcb397d48dce00a81611b8d9219d07d2152a371.zip
hdt: print bootloader name (CLI)
`show disks' in the CLI now prints bootloader information, e.g. DISK 0x83: C/H/S: 1023 cylinders, 255 heads, 63 sectors/track EDD: Version: 30 Size: 10 GiB, 512 bytes/sector, 63 sectors/track Host bus: ISA, Interface type: ATA Bootloader: Grub (id 0xEB48) Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/hdt/hdt-cli-disk.c')
-rw-r--r--com32/hdt/hdt-cli-disk.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/com32/hdt/hdt-cli-disk.c b/com32/hdt/hdt-cli-disk.c
index 4e2994d9..be171acf 100644
--- a/com32/hdt/hdt-cli-disk.c
+++ b/com32/hdt/hdt-cli-disk.c
@@ -31,6 +31,7 @@
#include <stdlib.h>
#include <errno.h>
+#include <disk/bootloaders.h>
#include <disk/errno_disk.h>
#include <disk/geom.h>
#include <disk/read.h>
@@ -115,11 +116,15 @@ void main_show_disk(int argc, char **argv,
int i = drive - 0x80;
struct driveinfo *d = &hardware->disk_info[i];
char disk_size[9];
+ char bootloader_name[50];
detect_disks(hardware);
if (!hardware->disk_info[i].cbios)
return; /* Invalid geometry */
+ get_bootloader_string(hardware->bootloader_ids[i], &bootloader_name,
+ 50);
+
if ((int) d->edd_params.sectors > 0)
sectors_to_size((int) d->edd_params.sectors, disk_size);
else
@@ -129,12 +134,14 @@ void main_show_disk(int argc, char **argv,
" C/H/S: %d cylinders, %d heads, %d sectors/track\n"
" EDD: Version: %X\n"
" Size: %s, %d bytes/sector, %d sectors/track\n"
- " Host bus: %s, Interface type: %s\n\n",
+ " Host bus: %s, Interface type: %s\n"
+ " Bootloader: %s (id 0x%X)\n\n",
d->disk,
d->legacy_max_cylinder + 1, d->legacy_max_head + 1, d->legacy_sectors_per_track,
d->edd_version,
disk_size, (int) d->edd_params.bytes_per_sector, (int) d->edd_params.sectors_per_track,
- remove_spaces(d->edd_params.host_bus_type), remove_spaces(d->edd_params.interface_type));
+ remove_spaces(d->edd_params.host_bus_type), remove_spaces(d->edd_params.interface_type),
+ bootloader_name, hardware->bootloader_ids[i]);
if (parse_partition_table(d, &show_partition_information)) {
if (errno_disk) {