- geometry autodetection for 'concat' mode hard disk images added
- removed all references to the old 'split-hd' feature (now: 'concat' mode) - updated documentation for 'concat' images
This commit is contained in:
parent
7569667c8f
commit
6730922952
bochs
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
================================================================
|
||||
doc/docbook/user/user.dbk
|
||||
$Id: user.dbk,v 1.212 2006-05-14 09:16:29 vruppert Exp $
|
||||
$Id: user.dbk,v 1.213 2006-06-04 21:49:17 vruppert Exp $
|
||||
|
||||
This is the top level file for the Bochs Users Manual.
|
||||
================================================================
|
||||
@ -3301,12 +3301,10 @@ but <emphasis>we don't recommend it</emphasis> for safety reasons. In Windows, t
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The path is always mandatory.
|
||||
</para>
|
||||
<para>
|
||||
For flat hard disk images created with bximage geometry autodetection can
|
||||
be used (cylinders are calculated using heads=16 and spt=63). For other
|
||||
hard disk images and modes the cylinders, heads, and spt are mandatory.
|
||||
For 'flat' and 'concat' mode hard disk images created with bximage it is possible
|
||||
to use geometry autodetection with cylinders=0 (cylinders are calculated using
|
||||
heads=16 and spt=63). For other hard disk images and modes the cylinders, heads,
|
||||
and spt are mandatory.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -7232,30 +7230,7 @@ On some host OSes, Bochs flat disk images are limited to 2GiB.
|
||||
|
||||
<section><title>concat</title>
|
||||
<para>
|
||||
&FIXME; text from old enable-split-hd option, to be completed
|
||||
<screen>
|
||||
When enabled, this allows a series of partial hard disk image files to be
|
||||
treated as if it was one large file. The .bochsrc specifies the first
|
||||
partial HD image (example win95-1) and then bochs searches for the other
|
||||
partial images in as a sequence (win95-2, win95-3, etc.) and opens them
|
||||
all. Then, it treats the series as if there was a single large file
|
||||
created by "cat win95-1 win95-2 win95-3".
|
||||
All files must be a multiple of 512 bytes.
|
||||
</screen>
|
||||
|
||||
<screen>
|
||||
// This option enables "split hard drive" support, which means
|
||||
// that a series of partial hard disk images can be treated
|
||||
// as a single large image. If you set up the partition sizes and
|
||||
// file sizes correctly, this allows you to store each partition
|
||||
// in a separate file, which is very convenient if you want to operate
|
||||
// on a single partition (e.g. mount with loopback, create filesystem,
|
||||
// fsck, etc.).
|
||||
// [[Provide example of partitioning]]
|
||||
</screen>
|
||||
|
||||
</para>
|
||||
|
||||
<section><title>description</title>
|
||||
<para>
|
||||
In concat mode, all sectors of the harddisk are stored in several flat files,
|
||||
@ -7264,29 +7239,34 @@ in lba order.
|
||||
</section>
|
||||
<section><title>image creation</title>
|
||||
<para>
|
||||
&FIXME; to be completed
|
||||
Disk images for the usage in 'concat' mode can be created with the bximage
|
||||
utility (see <xref linkend="using-bximage"> for more information).
|
||||
</para>
|
||||
</section>
|
||||
<section><title>path</title>
|
||||
<para>
|
||||
The "path" option of the ataX-xxx directive in the configuration file
|
||||
must point to the first file. The lower layer files names are found by
|
||||
adding 1 to the last character.
|
||||
must point to the first file (e.g. win95-1). The lower layer files names are
|
||||
found by adding 1 to the last character (e.g. win95-2, win95-3, etc.).
|
||||
</para>
|
||||
</section>
|
||||
<section><title>external tools</title>
|
||||
<para>
|
||||
&FIXME; to be completed
|
||||
If every single file contains a complete partition, they can be accessed
|
||||
with same tools as the 'flat' mode images.
|
||||
</para>
|
||||
</section>
|
||||
<section><title>typical use</title>
|
||||
<para>
|
||||
&FIXME; to be completed
|
||||
If the partition sizes and file sizes are set up correctly, this allows you to
|
||||
store each partition in a separate file, which is very convenient if you want
|
||||
to operate on a single partition (e.g. mount with loopback, create filesystem,
|
||||
fsck, etc.).
|
||||
</para>
|
||||
</section>
|
||||
<section><title>limitations</title>
|
||||
<para>
|
||||
&FIXME; to be completed
|
||||
On some host OSes, there is a limit of 2GiB per file.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\"Document Author: Timothy R. Butler - tbutler@uninetsolutions.com"
|
||||
.TH bochsrc 5 "29 Jan 2006" "bochsrc" "The Bochs Project"
|
||||
.TH bochsrc 5 "04 Jun 2006" "bochsrc" "The Bochs Project"
|
||||
.\"SKIP_SECTION"
|
||||
.SH NAME
|
||||
bochsrc \- Configuration file for Bochs.
|
||||
@ -261,10 +261,10 @@ works with it.
|
||||
In UNIX it is possible to use a raw device as a Bochs hard disk,
|
||||
but WE DON'T RECOMMEND IT.
|
||||
|
||||
The path is always mandatory. For flat hard disk images created with bximage
|
||||
geometry autodetection can be used (cylinders=0 -> cylinders are calculated
|
||||
using heads=16 and spt=63). For other hard disk images and modes the cylinders,
|
||||
heads, and spt are mandatory.
|
||||
The path is always mandatory. For 'flat' and 'concat' mode hard disk images
|
||||
created with bximage it is possible to use geometry autodetection with
|
||||
cylinders=0 (cylinders are calculated using heads=16 and spt=63).
|
||||
For other hard disk images and modes the cylinders, heads, and spt are mandatory.
|
||||
|
||||
The mode option defines how the disk image is handled. Disks can be defined as:
|
||||
- flat : one file flat layout
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: siminterface.cc,v 1.158 2006-06-04 07:55:34 vruppert Exp $
|
||||
// $Id: siminterface.cc,v 1.159 2006-06-04 21:49:17 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// See siminterface.h for description of the siminterface concept.
|
||||
@ -476,7 +476,7 @@ int n_keyboard_type_names = 3;
|
||||
|
||||
char *atadevice_type_names[] = { "disk", "cdrom", NULL };
|
||||
int n_atadevice_type_names = 2;
|
||||
//char *atadevice_mode_names[] = { "flat", "concat", "external", "dll", "sparse", "vmware3", "split", "undoable", "growing", "volatile", "z-undoable", "z-volatile", NULL };
|
||||
//char *atadevice_mode_names[] = { "flat", "concat", "external", "dll", "sparse", "vmware3", "undoable", "growing", "volatile", "z-undoable", "z-volatile", NULL };
|
||||
char *atadevice_mode_names[] = { "flat", "concat", "external", "dll", "sparse", "vmware3", "undoable", "growing", "volatile", NULL };
|
||||
int n_atadevice_mode_names = 9;
|
||||
char *atadevice_status_names[] = { "ejected", "inserted", NULL };
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: harddrv.cc,v 1.167 2006-05-29 22:33:38 sshwarts Exp $
|
||||
// $Id: harddrv.cc,v 1.168 2006-06-04 21:49:17 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -137,13 +137,13 @@ bx_hard_drive_c::~bx_hard_drive_c()
|
||||
|
||||
void bx_hard_drive_c::init(void)
|
||||
{
|
||||
Bit8u channel;
|
||||
Bit8u channel, image_mode;
|
||||
char string[5];
|
||||
char sbtext[8];
|
||||
char ata_name[20];
|
||||
bx_list_c *base;
|
||||
|
||||
BX_DEBUG(("Init $Id: harddrv.cc,v 1.167 2006-05-29 22:33:38 sshwarts Exp $"));
|
||||
BX_DEBUG(("Init $Id: harddrv.cc,v 1.168 2006-06-04 21:49:17 vruppert Exp $"));
|
||||
|
||||
for (channel=0; channel<BX_MAX_ATA_CHANNEL; channel++) {
|
||||
sprintf(ata_name, "ata.%d.resources", channel);
|
||||
@ -265,7 +265,8 @@ void bx_hard_drive_c::init(void)
|
||||
Bit64u disk_size = (Bit64u)cyl * heads * spt * 512;
|
||||
|
||||
/* instantiate the right class */
|
||||
switch (SIM->get_param_enum("mode", base)->get()) {
|
||||
image_mode = SIM->get_param_enum("mode", base)->get();
|
||||
switch (image_mode) {
|
||||
|
||||
case BX_ATA_MODE_FLAT:
|
||||
BX_INFO(("HD on ata%d-%d: '%s' 'flat' mode ", channel, device,
|
||||
@ -352,7 +353,7 @@ void bx_hard_drive_c::init(void)
|
||||
default:
|
||||
BX_PANIC(("HD on ata%d-%d: '%s' unsupported HD mode : %s", channel, device,
|
||||
SIM->get_param_string("path", base)->getptr(),
|
||||
atadevice_mode_names[SIM->get_param_enum("mode", base)->get()]));
|
||||
atadevice_mode_names[image_mode]));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -360,7 +361,7 @@ void bx_hard_drive_c::init(void)
|
||||
BX_HD_THIS channels[channel].drives[device].hard_drive->heads = heads;
|
||||
BX_HD_THIS channels[channel].drives[device].hard_drive->sectors = spt;
|
||||
|
||||
if (SIM->get_param_enum("mode", base)->get() == BX_ATA_MODE_FLAT) {
|
||||
if ((image_mode == BX_ATA_MODE_FLAT) || (image_mode == BX_ATA_MODE_CONCAT)) {
|
||||
if ((heads == 0) || (spt == 0)) {
|
||||
BX_PANIC(("ata%d/%d cannot have zero heads, or sectors/track", channel, device));
|
||||
}
|
||||
@ -375,7 +376,7 @@ void bx_hard_drive_c::init(void)
|
||||
BX_PANIC(("ata%d-%d: could not open hard drive image file '%s'", channel, device, SIM->get_param_string("path", base)->getptr()));
|
||||
}
|
||||
|
||||
if (SIM->get_param_enum("mode", base)->get() == BX_ATA_MODE_FLAT) {
|
||||
if ((image_mode == BX_ATA_MODE_FLAT) || (image_mode == BX_ATA_MODE_CONCAT)) {
|
||||
if (cyl > 0) {
|
||||
if (disk_size != (Bit64u)BX_HD_THIS channels[channel].drives[device].hard_drive->hd_size) {
|
||||
BX_PANIC(("ata%d/%d image size doesn't match specified geometry", channel, device));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: hdimage.cc,v 1.3 2006-05-14 21:15:33 vruppert Exp $
|
||||
// $Id: hdimage.cc,v 1.4 2006-06-04 21:49:17 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -95,12 +95,12 @@ ssize_t default_image_t::write (const void* buf, size_t count)
|
||||
return ::write(fd, (char*) buf, count);
|
||||
}
|
||||
|
||||
char increment_string (char *str, int diff)
|
||||
char increment_string(char *str, int diff)
|
||||
{
|
||||
// find the last character of the string, and increment it.
|
||||
char *p = str;
|
||||
while (*p != 0) p++;
|
||||
BX_ASSERT (p>str); // choke on zero length strings
|
||||
BX_ASSERT(p>str); // choke on zero length strings
|
||||
p--; // point to last character of the string
|
||||
(*p) += diff; // increment to next/previous ascii code.
|
||||
BX_DEBUG(("increment string returning '%s'", str));
|
||||
@ -109,17 +109,17 @@ char increment_string (char *str, int diff)
|
||||
|
||||
/*** concat_image_t function definitions ***/
|
||||
|
||||
concat_image_t::concat_image_t ()
|
||||
concat_image_t::concat_image_t()
|
||||
{
|
||||
fd = -1;
|
||||
}
|
||||
|
||||
void concat_image_t::increment_string (char *str)
|
||||
void concat_image_t::increment_string(char *str)
|
||||
{
|
||||
::increment_string(str, +1);
|
||||
}
|
||||
|
||||
int concat_image_t::open (const char* pathname0)
|
||||
int concat_image_t::open(const char* pathname0)
|
||||
{
|
||||
char *pathname = strdup (pathname0);
|
||||
BX_DEBUG(("concat_image_t.open"));
|
||||
@ -148,8 +148,7 @@ int concat_image_t::open (const char* pathname0)
|
||||
}
|
||||
#ifdef S_ISBLK
|
||||
if (S_ISBLK(stat_buf.st_mode)) {
|
||||
BX_PANIC(("block devices should REALLY NOT be used with --enable-split-hd. "
|
||||
"Please reconfigure with --disable-split-hd"));
|
||||
BX_PANIC(("block devices should REALLY NOT be used as concat images"));
|
||||
}
|
||||
#endif
|
||||
if ((stat_buf.st_size % 512) != 0) {
|
||||
@ -158,7 +157,7 @@ int concat_image_t::open (const char* pathname0)
|
||||
length_table[i] = stat_buf.st_size;
|
||||
start_offset_table[i] = start_offset;
|
||||
start_offset += stat_buf.st_size;
|
||||
increment_string (pathname);
|
||||
increment_string(pathname);
|
||||
}
|
||||
// start up with first image selected
|
||||
index = 0;
|
||||
@ -166,10 +165,11 @@ int concat_image_t::open (const char* pathname0)
|
||||
thismin = 0;
|
||||
thismax = length_table[0]-1;
|
||||
seek_was_last_op = 0;
|
||||
hd_size = start_offset;
|
||||
return 0; // success.
|
||||
}
|
||||
|
||||
void concat_image_t::close ()
|
||||
void concat_image_t::close()
|
||||
{
|
||||
BX_DEBUG(("concat_image_t.close"));
|
||||
if (fd > -1) {
|
||||
@ -177,7 +177,7 @@ void concat_image_t::close ()
|
||||
}
|
||||
}
|
||||
|
||||
off_t concat_image_t::lseek (off_t offset, int whence)
|
||||
off_t concat_image_t::lseek(off_t offset, int whence)
|
||||
{
|
||||
if ((offset % 512) != 0)
|
||||
BX_PANIC( ("lseek HD with offset not multiple of 512"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user