aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt/hdt-cli-disk.c
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-23 14:57:45 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-23 14:57:45 -0700
commitcfd8a6c226eadce693865f35e1818365d74508dd (patch)
tree878886dafd1d75554402bc351c8e77cf4470bb42 /com32/hdt/hdt-cli-disk.c
parent06ad79e000496ad0c6a54b95fc06a09c0d9b4813 (diff)
downloadhdt-cfd8a6c226eadce693865f35e1818365d74508dd.tar.gz
hdt-cfd8a6c226eadce693865f35e1818365d74508dd.tar.xz
hdt-cfd8a6c226eadce693865f35e1818365d74508dd.zip
hdt: enhance user experience (CLI) - try harder
Alright - let's try again. * Manually increment the display_line_nb counter in the disk CLI (we are doing a multi line more_printf!) * Add the pause_printf() macro to pause the CLI as needed 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.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/com32/hdt/hdt-cli-disk.c b/com32/hdt/hdt-cli-disk.c
index ac1b15fd..0cbf1a96 100644
--- a/com32/hdt/hdt-cli-disk.c
+++ b/com32/hdt/hdt-cli-disk.c
@@ -100,6 +100,7 @@ static void show_partition_information(struct driveinfo *drive_info,
void main_show_disk(int argc, char **argv,
struct s_hardware *hardware)
{
+ reset_more_printf();
if (!argc) {
more_printf("Which disk?\n");
return;
@@ -141,6 +142,7 @@ void main_show_disk(int argc, char **argv,
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),
bootloader_name, hardware->bootloader_ids[i]);
+ display_line_nb += 6;
if (parse_partition_table(d, &show_partition_information)) {
if (errno_disk) {
@@ -161,11 +163,19 @@ void main_show_disks(int argc __unused, char **argv __unused,
reset_more_printf();
detect_disks(hardware);
+ int first_one = 0;
for (int drive = 0x80; drive < 0xff; drive++) {
- char buf[5] = "";
- sprintf(buf, "0x%x", drive);
- char *argv[1] = { buf };
- main_show_disk(1, argv, hardware);
+ if (hardware->disk_info[drive - 0x80].cbios) {
+ if (!first_one) {
+ first_one = 1;
+ } else {
+ pause_printf();
+ }
+ char buf[5] = "";
+ sprintf(buf, "0x%x", drive);
+ char *argv[1] = { buf };
+ main_show_disk(1, argv, hardware);
+ }
}
}