Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can Bochs for Linux boot a hard disk?

597 views
Skip to first unread message

Rod Pemberton

unread,
Aug 4, 2015, 12:28:04 AM8/4/15
to

Is Bochs capable of booting a physical hard disk,
on Linux, parititioned and formatted as DOS FAT32,
as either a raw device or a mounted directory?

I have no problem doing this with DOSBox, dosemu,
and Qemu. All three boot and emulate the partition.
It was simple to set them up, e.g., under five minutes.
However, after hours of attempts, I'm still having
serious problems with Bochs. Qemu works with an
unmounted raw device. The other two need a directory
for mounted device and either a line in a configuration
file or a soft link.

The Bochs manpage that came with Bochs has almost no
info other than basic flags. A Ubuntu manpage for
Bochs says 'vvfat' will work with 'ata' commandline.
However, Bochs always panics when trying to boot the
DOS drive. It then crashes with either a segmentation
fault or a failure to read the device directory, i.e.,
garbled.

This is my best guess as to the correct commandline
for booting a FAT32 DOS hard disk partition with
Bochs under Linux:

bochs -q -n 'boot:disk' 'ata0-master: type=disk, path=/media/XXXX-XXXX, mode=vvfat, journal=vvfat.redolog'

where XXXX-XXXX is the drive's serial number.

Can anyone confirm the correct command line?
I.e., should it be 'boot:c' or am I missing an
ata parameter? Is the journal option required?

The hard drive is actually SATA, not IDE, but
Bochs doesn't seem to have any options for that.
I'm not finding much with Google searches either
on the correct format for non-floppy commandlines
or for bochsrc, .bochsrc or bochsrc.txt files.

The current source code for Bochs in vvfat.c says
'vvfat' only works with floppies, only FAT12 or
FAT16, has LFNs, and does *NOT* support hard disks.
Are the manpages wrong here? Apparently, FAT32
isn't supported either? I'm a bit confused by this.

The Bochs version is the current version 2.6.8 as
pre-compiled for 64-bit Linux from Sourceforge as
file bochs-2.6.8-1.x86_64.rpm.

Do I need to recompile the source code from scratch?

Also, Bochs keeps complaining about a missing module
called 'soundmod'. No such module is included in
the binaries or sources and isn't present in my Linux.


Rod Pemberton

--
Scientists now say we'll experience a mini-ice in 2030.
So, I guess we need more global warming today ...

Wildman

unread,
Aug 4, 2015, 1:21:09 AM8/4/15
to
Bochs' feature page says that physical hard drives are
supported on some archs but not recommended. It does
not give any reason and does not say which archs are
supported. And it does not say if it is talking about
the host arch or the client arch.

However, according to Bochs' man pages, your command
syntax looks correct. Try it with a hard drive that
you don't mind loosing, just in case.

Personally I have never tried to boot a hard drive
from Bochs. Only images.

--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!

Benjamin David Lunt

unread,
Aug 5, 2015, 8:52:00 AM8/5/15
to

"Rod Pemberton" <b...@fasdfrewar.cdm> wrote in message
news:op.x2ttddvbyfako5@localhost...
>
> Is Bochs capable of booting a physical hard disk,
> on Linux, parititioned and formatted as DOS FAT32,
> as either a raw device or a mounted directory?

Rod, sorry I don't have much input on this. I don't
use Linux or have every worked on the Linux part of
the code for Bochs.

Let me pass on this question to some of those who
have worked on this part and I will get back with
you.

Thanks,
Ben



Benjamin David Lunt

unread,
Aug 10, 2015, 7:36:07 PM8/10/15
to

"Benjamin David Lunt" <zf...@fysnet.net> wrote in message
news:mpt0tc$d73$1...@speranza.aioe.org...
Rod,

I heard back from one of the main maintainers of Bochs,
and he too suggests that you do not boot from an actual
partition on the host. The code is not 100% sure of
no corruption of data, and may not work as intended
anyway.

Now, if you don't care if the booted from drive's data
gets corrupt, then I guess this is a moot point.

However, he gave no, and I have no idea of how to make
it work on a Linux platform. I would guess you could
mount the drive as a directory/folder/file (however Linux
does it) and then see if it will boot that as an "image".
However, doing so, may not include the boot sector of
the drive.

Sorry, I don't use Linux, so cannot shine any more light
on the subject.

Ben

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Forever Young Software
http://www.fysnet.net/index.htm
http://www.fysnet.net/osdesign_book_series.htm
To reply by email, please remove the zzzzzz's

Batteries not included, some Assembly required.


Rod Pemberton

unread,
Aug 10, 2015, 8:13:18 PM8/10/15
to
On Mon, 10 Aug 2015 19:35:35 -0400, Benjamin David Lunt <zf...@fysnet.net> wrote:

> "Benjamin David Lunt" <zf...@fysnet.net> wrote in message
> news:mpt0tc$d73$1...@speranza.aioe.org...
>> "Rod Pemberton" <b...@fasdfrewar.cdm> wrote in message
>> news:op.x2ttddvbyfako5@localhost...

>>> Is Bochs capable of booting a physical hard disk,
>>> on Linux, parititioned and formatted as DOS FAT32,
>>> as either a raw device or a mounted directory?
>>
>> Rod, sorry I don't have much input on this. I don't
>> use Linux or have every worked on the Linux part of
>> the code for Bochs.
>>
>> Let me pass on this question to some of those who
>> have worked on this part and I will get back with
>> you.
>
> I heard back from one of the main maintainers of Bochs,
> and he too suggests that you do not boot from an actual
> partition on the host. The code is not 100% sure of
> no corruption of data, and may not work as intended
> anyway.

They say that with the other emulators too, DOSBox,
dosemu, and Qemu. I haven't had an issue, except
when I tried to run all three at once against the
same drive ... Don't do that. Trust me. Some will
update file changes to the drive, others don't. I
just need to run a bunch of programs on the drive.

> Now, if you don't care if the booted from drive's data
> gets corrupt, then I guess this is a moot point.

Yep. Moot even if I care ... and I do.
I'd really strongly prefer to test the system that way.

> However, he gave no, and I have no idea of how to make
> it work on a Linux platform. I would guess you could
> mount the drive as a directory/folder/file (however Linux
> does it) and then see if it will boot that as an "image".
> However, doing so, may not include the boot sector of
> the drive.
>
> Sorry, I don't use Linux, so cannot shine any more light
> on the subject.
>

Ok. Thank you for checking anyway. It would be real
convenient and nice if this was supported, someday.

It's just that I had a large number of DOS programs I wanted
to test with Bochs the same way I did with the others. So,
I didn't want to go through the work of creating an image,
and I wanted my entire, exact configuration to boot when
running them.

I'm still not sure if it's merely a command line issue or
an implementation issue. It seems like it might not be
implemented or they're being overly paternalistic. E.g.,
like Linux apps blocking running as root ...

Now, on to the next question for me to find an answer to.
Just how does one fdisk, format, ans sys a DOS image for
Bochs? ...

Wildman

unread,
Aug 10, 2015, 9:49:35 PM8/10/15
to
On Mon, 10 Aug 2015 20:13:29 -0400, Rod Pemberton wrote:

> On Mon, 10 Aug 2015 19:35:35 -0400, Benjamin David Lunt <zf...@fysnet.net> wrote:
>
>> Sorry, I don't use Linux, so cannot shine any more light
>> on the subject.
>>
>
> Ok. Thank you for checking anyway. It would be real
> convenient and nice if this was supported, someday.

This is from Bochs' online manual under minimum requirements...

"These are the minimum requirements for running an OS inside of Bochs:
the Bochs executable
the BIOS image (usually called BIOS-bochs-latest)
the VGA BIOS image (e.g. VGABIOS-lgpl-latest or VGABIOS-elpin-2.40)
at least one bootable media, either as disk image (floppy, hard disk
or CD-ROM) or physical disk (floppy or CD-ROM)"

It appears that physical hard drives are not supported
even though their Feature Page says something different.

> It's just that I had a large number of DOS programs I wanted
> to test with Bochs the same way I did with the others. So,
> I didn't want to go through the work of creating an image,
> and I wanted my entire, exact configuration to boot when
> running them.
>
> I'm still not sure if it's merely a command line issue or
> an implementation issue. It seems like it might not be
> implemented or they're being overly paternalistic. E.g.,
> like Linux apps blocking running as root ...
>
> Now, on to the next question for me to find an answer to.
> Just how does one fdisk, format, ans sys a DOS image for
> Bochs? ...

Of course you will need a bootable image of the DOS you
are using that contains fdisk, etc. And you will also
need an image of a hard drive.

In Linux you can use dd to create the hard drive image
or you can use bximage which I believe is a more user
friendly program, not to mention safer. If you are using
Debian or one of its derivatives, bximage will be in
the repo. Don't know about the distros that use rpm's.

Once you have the images, add these 3 lines to bochsrc.
Make necessary changes for the hard drive geometry
and the paths to the image files...

ata0-master: type=disk, path="/path/to/image.img", cylinders=615, heads=6, spt=17
floppya: 1_44="/path/to/bootimage.img", status=inserted
boot: floppy

That *should* do it. BTW I am not certain about the
correct order of the above lines so YMMV. :-)

--
<Wildman> GNU/Linux user #557453
The little toe is a precision geo-location instrument
for finding furniture under low-level light.

Benjamin David Lunt

unread,
Aug 10, 2015, 9:52:46 PM8/10/15
to

"Rod Pemberton" <b...@fasdfrewar.cdm> wrote in message
news:op.x26f8rfhyfako5@localhost...
>
> Now, on to the next question for me to find an answer to.
> Just how does one fdisk, format, ans sys a DOS image for
> Bochs? ...

Depends. Do you have a bootable DOS floppy image?

If so, does that floppy image have fdisk.exe and
format[.exe | .com] on it?

The way I do it is use any utility to create a file the
size of the hard drive I wish. Old Bochs versions required
the file to be a multiple of cylinder size. Recent versions
no longer require this.

Then I boot a DOS floppy that has DOS 5.0 or Freedos installed
on it with fdisk and format already on it. Then boot the
floppy, and off I go.

However, I also have a utility that will create a MBR and
various partitions within an image file. It does nothing
more than create a MBR table, copying the MBR code from
a given file, if specified, and then placing partitions
within the image file from already created and formatted
images on the host.

For example, given the following files:

mbr.bin
part1.img
part2.img
part3.img

I can run the app telling it to create "image1.img" using
mbr.bin as the boot code, placing part1, part2, and part3
within the image at specified positions.

I believe I included this app with Volume 1 of my book
series...yes, called MPART.EXE. Here is an example from the
example resource file (watch for line wrap):

###############################################################
# Example 3
# Same as Example 2 above except two (2) logical partitions
# (other comments are now omitted)
out: file="out.bin", spt=63, heads=16
mbr: file="mbr.bin" # use "mbr.bin" as the MBR image file
part: file="part0.img", base=63, size=65536, type=4, active=0, last=0
part: file="part1.img", base=65646, size=65536, type=11, active=1, last=0
part: base=131229, size=65591, type=15, last=1
part: file="part2.img", base=131230, size=32768, type=131, active=0,
last=0
part: file="part3.img", base=164052, size=32768, type=131, active=0,
last=1


Anyway, it is quite simple to create hard drive images, with
multiple partitions if desired, using existing tools.

I also have WinImage installed on one of my test machines. It
is an older version, but you can mount a hard drive image
through Windows, copying files as if it was an actual hard
drive. It is Shareware, or whatever that type of software is
called now, the type where you can use it but should register
and pay a small fee to continue using it. (I haven't used it in
a while, I wonder if it has a time limit...)

Hope this helps,
Ben

P.S. 1.44 meg floppy images of Freedos are hard to find, but
there is a floppy image of FreeDOS of each available floppy
size at http://odin.fdos.org/odin2005/. You have to add
'fdisk' and 'format' to the floppy image
(http://www.freedos.org/software/?cat=base)
but once you have, you have a bootable FreeDOS floppy image
with the utilities you need.

Rod Pemberton

unread,
Aug 11, 2015, 2:03:24 AM8/11/15
to
On Mon, 10 Aug 2015 21:49:12 -0400, Benjamin David Lunt <zf...@fysnet.net> wrote:

> "Rod Pemberton" <b...@fasdfrewar.cdm> wrote in message
> news:op.x26f8rfhyfako5@localhost...

>> Now, on to the next question for me to find an answer to.
>> Just how does one fdisk, format, ans sys a DOS image for
>> Bochs? ...
>
> Depends. Do you have a bootable DOS floppy image?

Yes. Mostly MS-DOS v7.10, but also FreeDOS.

> If so, does that floppy image have fdisk.exe and
> format[.exe | .com] on it?

MS-DOS, yes. FreeDOS, with whatever their equivalent
utils are called.

> The way I do it is use any utility to create a file the
> size of the hard drive I wish.

Yes. This is where I have some issues.

I can create such a file in Linux, I think. I can copy
files to it from Linux. But, I can't run fdisk, format,
or sys from Linux, nor can I access such a file from DOS
to do so. On Linux, I know there is a utility that will
install the MBR to a hard disk image. There must be one
to format too. On DOS, I'm guessing I'd probably have
to setup a ramdisk as a hard disk to fdisk, format, and
sys, then use partcopy or rawread to get an image file.

> Old Bochs versions required the file to be a multiple
> of cylinder size. Recent versions no longer require this.

Ok.

> Then I boot a DOS floppy that has DOS 5.0 or Freedos
> installed on it with fdisk and format already on it.
> Then boot the floppy, and off I go.

I'm assuming you mean you boot a DOS floppy image with
Bochs and not the PC itself.

> However, I also have a utility that will create a MBR and
> various partitions within an image file. It does nothing
> more than create a MBR table, copying the MBR code from
> a given file, if specified, and then placing partitions
> within the image file from already created and formatted
> images on the host.
>
> For example, given the following files:
>
> mbr.bin
> part1.img
> part2.img
> part3.img
>
> I can run the app telling it to create "image1.img" using
> mbr.bin as the boot code, placing part1, part2, and part3
> within the image at specified positions.

Yes, I'd need such a utility or have to manually construct
an image from parts such as this using partcopy and/or
rawread/rawrite. In Linux, you can mount an image and treat
it like a normal filesystem, but I can't run the DOS utils
from Linux against the image. Well, I don't know how to ...
If I had the image copied to DOS, I still doubt I could
treat the image like a filesystem, unless maybe loaded to
a ramdisk. I don't want to set up an actual partition to
copy as an image, but that is an option.

7-zip will extract but not create floppy images. UNDDI will
extract in DOS but not create floppy images.

> I believe I included this app with Volume 1 of my book
> series...yes, called MPART.EXE. Here is an example from the
> example resource file (watch for line wrap):
>
...

> Anyway, it is quite simple to create hard drive images, with
> multiple partitions if desired, using existing tools.

Ok. If you have any more suggestions about that, that would
be good.

> I also have WinImage installed on one of my test machines.

It would need to work with Windows 98/SE for me to be able
to use it. Preferably, I need DOS or Linux utils.

> It is an older version, but you can mount a hard drive image
> through Windows, copying files as if it was an actual hard
> drive.

I was thinking I needed a ramdisk for DOS and it would be
best if compatible with John Fine's partcopy.exe.

> It is Shareware, or whatever that type of software is
> called now, the type where you can use it but should register
> and pay a small fee to continue using it. (I haven't used it in
> a while, I wonder if it has a time limit...)

Ok.

> Hope this helps,

Getting there.

> P.S. 1.44 meg floppy images of Freedos are hard to find, but
> there is a floppy image of FreeDOS of each available floppy
> size at http://odin.fdos.org/odin2005/. You have to add
> 'fdisk' and 'format' to the floppy image
> (http://www.freedos.org/software/?cat=base)
> but once you have, you have a bootable FreeDOS floppy image
> with the utilities you need.

I constructed my own for Freedos to make sure all the typical
utilities I had on MS-DOS boot disks were present. I thought
I started with a standard FreeDOS boot disk image. Yes, I
have a directory labeled ODIN2005 as well as four other FreeDOS
image, at least one of which is mine, and at least one which
isn't (360KB).

Rod Pemberton

unread,
Aug 11, 2015, 2:03:25 AM8/11/15
to
On Mon, 10 Aug 2015 21:49:33 -0400, Wildman <best...@yahoo.com> wrote:

> On Mon, 10 Aug 2015 20:13:29 -0400, Rod Pemberton wrote:
>> On Mon, 10 Aug 2015 19:35:35 -0400, Benjamin David Lunt <zf...@fysnet.net> wrote:

>> Now, on to the next question for me to find an answer to.
>> Just how does one fdisk, format, ans sys a DOS image for
>> Bochs? ...
>
> Of course you will need a bootable image of the DOS you
> are using that contains fdisk, etc. And you will also
> need an image of a hard drive.

I'd prefer to just have a hard drive image.

How do I create the hard drive image?

E.g., to create a floppy image from DOS, I insert an actual
floppy, format it, sys it, copy files, use partcopy or rawread
to get an image. I'd prefer to not have to set up an actual
hard disk partition to get an image. So, for DOS, I don't
know how to do that, unless I can use a ramdisk. For Linux,
I know I can create a blank image and I know I can mount a
FAT image loopback which allows me to copy files to the image.
There must be some utilities to partition the image, format
the image, and install system files.

I haven't yet searched for this using Google, so it offers
James a chance to return my GIYF ... ;-)

> In Linux you can use dd to create the hard drive image

Yes.

> or you can use bximage which I believe is a more user
> friendly program, not to mention safer.

I've not heard of that.

> If you are using Debian or one of its derivatives,

64-bit Velocity (VectorLinux), Slackware based

> bximage will be in the repo. Don't know about the distros
> that use rpm's.

This distro seems to use txz sometimes tgz when the package
is prepared for it, but I have used rpms for some packages.

> Once you have the images, add these 3 lines to bochsrc.

There is no bochsrc, bochsrc.txt, etc anywhere.

> Make necessary changes for the hard drive geometry
> and the paths to the image files...
>
> ata0-master: type=disk, path="/path/to/image.img", cylinders=615, heads=6, spt=17
> floppya: 1_44="/path/to/bootimage.img", status=inserted
> boot: floppy
>
> That *should* do it. BTW I am not certain about the
> correct order of the above lines so YMMV. :-)
>

So, you're booting a floppy and using a non-boot harddisk
image as a secondary drive.

Do you know if there is a Linux command or utility that will
display the cylinders, heads, and spt for a device or partition?

I didn't know what to use in the command line I tried.
Maybe, that was a factor in it not booting correctly.

Benjamin David Lunt

unread,
Aug 11, 2015, 6:09:10 PM8/11/15
to

"Rod Pemberton" <b...@fasdfrewar.cdm> wrote in message
news:op.x26wgbdgyfako5@localhost...
> On Mon, 10 Aug 2015 21:49:33 -0400, Wildman <best...@yahoo.com> wrote:
>
>> On Mon, 10 Aug 2015 20:13:29 -0400, Rod Pemberton wrote:
>
>>> Now, on to the next question for me to find an answer to.
>>> Just how does one fdisk, format, ans sys a DOS image for
>>> Bochs? ...
>>
>> Of course you will need a bootable image of the DOS you
>> are using that contains fdisk, etc. And you will also
>> need an image of a hard drive.
>
> I'd prefer to just have a hard drive image.
>
> How do I create the hard drive image?

Simply create a file. Any file that has a size that
is a multiple of 512 bytes. Period. You have a hard
drive image.

Bochs doesn't care what the contents of that image is,
just that it is a multiple of 512 bytes.

> E.g., to create a floppy image from DOS, I insert an actual
> floppy, format it, sys it, copy files, use partcopy or rawread
> to get an image. I'd prefer to not have to set up an actual
> hard disk partition to get an image. So, for DOS, I don't
> know how to do that, unless I can use a ramdisk. For Linux,
> I know I can create a blank image and I know I can mount a
> FAT image loopback which allows me to copy files to the image.
> There must be some utilities to partition the image, format
> the image, and install system files.
>
> I haven't yet searched for this using Google, so it offers
> James a chance to return my GIYF ... ;-)

I don't know much about the Linux side, but for the Windows
side, there aren't very many utils that will allow you to,
especially with Win9x versions.

I use various utilities that I have written
http://www.fysnet.net/mtools.htm
to create/modify disk images and only update those
utilities when I need the further function of the
utility.

>> ata0-master: type=disk, path="/path/to/image.img", cylinders=615,
>> heads=6, spt=17
>> floppya: 1_44="/path/to/bootimage.img", status=inserted
>> boot: floppy

With later versions of Bochs, you don't need the cylinders=,
heads=, or spt= parameters. The initialization code will
assume 16 heads and 63 spt, then calculate the cyls from there.

(On a side note, Bochs now supports "growing" images. If
the virtual sector is never written to or read from, the
actual disk image does not contain that sector. You can
have a 128 gig virtual disk image, but unless you access
all of the sectors of the image, the actual file on the
host's drive may be only a few meg in size.)

>> That *should* do it. BTW I am not certain about the
>> correct order of the above lines so YMMV. :-)

The order doesn't really matter.

> So, you're booting a floppy and using a non-boot harddisk
> image as a secondary drive.

Rod, how large is the actual (physical) disk that you wanted
to boot from while within bochs?

Do you have another drive that is (considerably) larger than
the said drive?

If so, create an image of the said drive using rawwrite or
one of my utilities, such as mgetimg.exe and place it on
the larger drive. Then simply point Bochs to that image.

Wildman

unread,
Aug 11, 2015, 8:44:36 PM8/11/15
to
On Tue, 11 Aug 2015 02:03:37 -0400, Rod Pemberton wrote:

> On Mon, 10 Aug 2015 21:49:33 -0400, Wildman <best...@yahoo.com> wrote:
>
>> On Mon, 10 Aug 2015 20:13:29 -0400, Rod Pemberton wrote:
>>> On Mon, 10 Aug 2015 19:35:35 -0400, Benjamin David Lunt <zf...@fysnet.net> wrote:
>
>>> Now, on to the next question for me to find an answer to.
>>> Just how does one fdisk, format, ans sys a DOS image for
>>> Bochs? ...
>>
>> Of course you will need a bootable image of the DOS you
>> are using that contains fdisk, etc. And you will also
>> need an image of a hard drive.
>
> I'd prefer to just have a hard drive image.

It didn't dawn on me while I was writing the post that you
can use a physical floppy drive/disk and just have the hard
drive image... if you have a floppy drive.

> How do I create the hard drive image?
>
> E.g., to create a floppy image from DOS, I insert an actual
> floppy, format it, sys it, copy files, use partcopy or rawread
> to get an image. I'd prefer to not have to set up an actual
> hard disk partition to get an image. So, for DOS, I don't
> know how to do that, unless I can use a ramdisk. For Linux,
> I know I can create a blank image and I know I can mount a
> FAT image loopback which allows me to copy files to the image.
> There must be some utilities to partition the image, format
> the image, and install system files.
>
> I haven't yet searched for this using Google, so it offers
> James a chance to return my GIYF ... ;-)

I have not been able to find a way to create a bootable
hard drive image using Linux tools. If you was dealing
with physical drives, there would not be a problem.
Everything I have found either only works on physical
drives or only iso or floppy images. Of course there
are likely programs out there that I know nothing about
that might do the job.

>> In Linux you can use dd to create the hard drive image
>
> Yes.
>
>> or you can use bximage which I believe is a more user
>> friendly program, not to mention safer.
>
> I've not heard of that.

Actually I found out that bximage is pulled in as a
dependency when bochs is installed on Debian systems.

>> If you are using Debian or one of its derivatives,
>
> 64-bit Velocity (VectorLinux), Slackware based
>
>> bximage will be in the repo. Don't know about the distros
>> that use rpm's.
>
> This distro seems to use txz sometimes tgz when the package
> is prepared for it, but I have used rpms for some packages.

I know very little about Slackware. There is a joke
used on the Ubuntu newsgroup, "Ubuntu: An African word
that means Slackware is too hard for me." :-)

>> Once you have the images, add these 3 lines to bochsrc.
>
> There is no bochsrc, bochsrc.txt, etc anywhere.

On Debian based system you would fine bochsrc in
/etc/bochs-int. It should be where ever Velocity
stores configuration files. It has to be there
somewhere. Try this in a terminal...

whereis bochsrc

Or if you are using a window manager or desktop that
has file searching capabilities, use that starting
the search from /.

>> Make necessary changes for the hard drive geometry
>> and the paths to the image files...
>>
>> ata0-master: type=disk, path="/path/to/image.img", cylinders=615, heads=6, spt=17
>> floppya: 1_44="/path/to/bootimage.img", status=inserted
>> boot: floppy
>>
>> That *should* do it. BTW I am not certain about the
>> correct order of the above lines so YMMV. :-)
>>
>
> So, you're booting a floppy and using a non-boot harddisk
> image as a secondary drive.
>
> Do you know if there is a Linux command or utility that will
> display the cylinders, heads, and spt for a device or partition?

Use sudo fdisk -l. Some versions of fdisk do not give
you the head count but that can be calculated from the
other numbers.

> I didn't know what to use in the command line I tried.
> Maybe, that was a factor in it not booting correctly.
>
>
> Rod Pemberton

From what I have found out so far, using the floppy
drive/image and the hard drive image may be your only
option, at least in Linux. And of course you need to
get both images mounted in bochs, meaning bochsrc must
be found.

--
<Wildman> GNU/Linux user #557453

Rod Pemberton

unread,
Aug 12, 2015, 2:18:06 AM8/12/15
to
On Tue, 11 Aug 2015 18:08:43 -0400, Benjamin David Lunt <zf...@fysnet.net> wrote:

> Rod, how large is the actual (physical) disk that you
> wanted to boot from while within bochs?

It's 500GB SATA hard drive, using BIOS boot emulation,
with one FAT32 partition at the start, which is 130GB.
IIRC, that was the max that some DOS or Windows 98/SE
utilities could handle, reliably.

FYI, Linux 'fdisk -l' reports the head, sectors, cylinders:
255 63 60801

> Do you have another drive that is (considerably) larger
> than the said drive?

Yes, I have an internal 1GB and external 1.5GB hard drive,
which are still in box. I'd like to keep them that way.
I keep planning on moving Linux from my small SSD to one
of them. I'm not entirely sure of the safest way to upgrade
drives for Linux, but found some info on the internet. The
0.5GB was pulled from another external drive. So, I can put
the small SSD into the external enclosure. Maybe, that'll
help improve it's speed. My files are now split between
the DOS and Linux systems. I'd like to get them merged to
one drive someday ...

> If so, create an image of the said drive using rawwrite or
> one of my utilities, such as mgetimg.exe and place it on
> the larger drive. Then simply point Bochs to that image.

That's a rather odd workaround. Although, there is space
for another partition on that drive. Linux would need to
be able to mount an extended DOS partition. However, I'm
sure that formatting and copying all of that would take a
long time. I probably only need well below 500MB. I.e.,
creating an image is probably less work.

Rod Pemberton

unread,
Aug 12, 2015, 2:19:07 AM8/12/15
to
On Tue, 11 Aug 2015 20:44:35 -0400, Wildman <best...@yahoo.com> wrote:

> On Tue, 11 Aug 2015 02:03:37 -0400, Rod Pemberton wrote:

>> How do I create the hard drive image?
>>
>
> I have not been able to find a way to create a bootable
> hard drive image using Linux tools.

Ok.

> If you [were] dealing
> with physical drives, there would not be a problem.

I didn't understand that at first, since I couldn't
get Bochs to boot the physical drive.

> Everything I have found either only works on physical
> drives or only iso or floppy images. Of course there
> are likely programs out there that I know nothing about
> that might do the job.

Ok. So, you're saying I need a hard disk partition to
create the image from since the utilties work that way.

> Actually I found out that bximage is pulled in as a
> dependency when bochs is installed on Debian systems.

Yes, it seems it installed it in /bin. Thanks.

>>> Once you have the images, add these 3 lines to bochsrc.
>>
>> There is no bochsrc, bochsrc.txt, etc anywhere.
>
> On Debian based system you would fine bochsrc in
> /etc/bochs-int. It should be where ever Velocity
> stores configuration files. It has to be there
> somewhere. Try this in a terminal...
>
> whereis bochsrc

There is no '/etc/boch-int' directory on this Linux.
'whereis' returns only man pages beginning with bochsrc.
'find' finds one bochsrc.txt in a bochsdlx directory,
which is for 'bochsdlx' command which runs a sample DLX
linux setup.

I.e., I'd have to create it, once I find out where it
goes ...

> From what I have found out so far, using the floppy
> drive/image and the hard drive image may be your only
> option, at least in Linux. And of course you need to
> get both images mounted in bochs, meaning bochsrc must
> be found.

Ok.

Wildman

unread,
Aug 12, 2015, 10:32:36 AM8/12/15
to
On Wed, 12 Aug 2015 02:19:18 -0400, Rod Pemberton wrote:

> There is no '/etc/boch-int' directory on this Linux.
> 'whereis' returns only man pages beginning with bochsrc.
> 'find' finds one bochsrc.txt in a bochsdlx directory,
> which is for 'bochsdlx' command which runs a sample DLX
> linux setup.

I got that wrong. It should have been /ect/bochs-init.
Probable won't matter since whereis didn't find it.

Benjamin David Lunt

unread,
Aug 13, 2015, 3:44:05 PM8/13/15
to

"Benjamin David Lunt" <zf...@fysnet.net> wrote in message
news:mqbkhb$56h$1...@speranza.aioe.org...
>
> However, I also have a utility that will create a MBR and
> various partitions within an image file. It does nothing
> more than create a MBR table, copying the MBR code from
> a given file, if specified, and then placing partitions
> within the image file from already created and formatted
> images on the host.
>
> For example, given the following files:
>
> mbr.bin
> part1.img
> part2.img
> part3.img
>
> I can run the app telling it to create "image1.img" using
> mbr.bin as the boot code, placing part1, part2, and part3
> within the image at specified positions.
>
> I believe I included this app with Volume 1 of my book
> series...yes, called MPART.EXE. Here is an example from the
> example resource file (watch for line wrap):

Rod, if you are still looking for a utility to create multiple
partitions on a disk image, I have now included the utility
I wrote of above with my MTOOLS package.

http://www.fysnet.net/mtools.htm

See the samples.txt file for comments on how to use it.

It includes source and I believe that it will compile as-is
with Linux tools for Linux, though I don't use Linux
and could be wrong. If you have to make some modifications
to get it to compile for Linux, please post it here so that
I can see what you had to do.

Thanks,
Ben
0 new messages