From 66b311a8a6d3f0bd076d8de50955ca420ed340f3 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Fri, 25 Oct 2013 19:10:09 +0000 Subject: [PATCH] Some work on the new bximage utility - added support to use 'concat' and 'dll' mode images as convert source. A prefix ("concat:" or "dll:") must be added to the path since autodetection doesn't work for these modes. - create: fixed virtual disk size calculation based on C/H/S - convert / resize (interactive mode): use original filename as the template for the new one if not specified on the command line --- bochs/doc/docbook/user/user.dbk | 9 +++++++-- bochs/iodev/hdimage/hdimage.cc | 7 ++++--- bochs/misc/bximage.cc | 36 +++++++++++++++++++++++++++++---- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/bochs/doc/docbook/user/user.dbk b/bochs/doc/docbook/user/user.dbk index 420fffdd8..1844f46d1 100644 --- a/bochs/doc/docbook/user/user.dbk +++ b/bochs/doc/docbook/user/user.dbk @@ -8735,12 +8735,12 @@ Other arguments: concat Create only - No + Convert source only dll No - No + Convert source only sparse @@ -8771,6 +8771,11 @@ Other arguments: + +Disk image mode autodetection does not work for the modes concat +and dll. To use those images as convert source, you have to +add a prefix ("concat:" or "dll:") to the image path. +
Create image This function can be used to create several disk image formats for the diff --git a/bochs/iodev/hdimage/hdimage.cc b/bochs/iodev/hdimage/hdimage.cc index 1e7520c71..05818ffc5 100644 --- a/bochs/iodev/hdimage/hdimage.cc +++ b/bochs/iodev/hdimage/hdimage.cc @@ -515,7 +515,7 @@ char increment_string(char *str, int diff) p--; // point to last character of the string (*p) += diff; // increment to next/previous ascii code. BX_DEBUG(("increment string returning '%s'", str)); - return (*p); + return (*p); } /*** concat_image_t function definitions ***/ @@ -527,7 +527,7 @@ concat_image_t::concat_image_t() void concat_image_t::increment_string(char *str) { - ::increment_string(str, +1); + ::increment_string(str, +1); } int concat_image_t::open(const char* _pathname0, int flags) @@ -535,7 +535,7 @@ int concat_image_t::open(const char* _pathname0, int flags) UNUSED(flags); pathname0 = _pathname0; char *pathname = strdup(pathname0); - BX_DEBUG(("concat_image_t.open")); + BX_DEBUG(("concat_image_t::open")); Bit64s start_offset = 0; for (int i=0; i= (1 << BX_MAX_CYL_BITS)) fatal("ERROR: number of cylinders out of range !\n"); - printf("\nCreating hard disk image '%s' with CHS=%ld/16/63\n", bx_filename_1, cyl); + printf("\nCreating hard disk image '%s' with CHS=%ld/%d/%d\n", bx_filename_1, + cyl, heads, spt); + hdsize = cyl * heads * spt * 512; create_hard_disk_image(bx_filename_1, imgmode, hdsize); } printf("\nThe following line should appear in your bochsrc:\n");