Difference between revisions of "Bochs on Linux"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(how to create a disk image)
m (template updates)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{stub}}
+
{{seedling}}
[[Techniques]]: [[Emulators]]: [[Bochs]]: [[Bochs on Linux]]
+
{|
This article is about setting up and using the [[Bochs]]
+
|-
[[emulators|emulator]] on [[Linux]].
+
| [[Computing]]: || [[Linux]]:<br>[[Emulators]]: [[Bochs]]: || [[Bochs on Linux]]
 +
|}
 +
 
 +
This article is about setting up and using the [[Bochs]] [[emulators|emulator]] on [[Linux]].
 
==Articles==
 
==Articles==
 
===Commands===
 
===Commands===
*[[bximage]]: one way of creating a disk image for Bochs to boot
+
* [[bximage]]: one way of creating a disk image for Bochs to boot (included in Bochs distribution)
(included in Bochs distribution)
+
* {{l/linux/cmd/dd}}: standard Linux command which can be used for creating a disk image
*[[dd]]: standard Linux command which can be used for creating a disk
 
image
 
 
==Creating a Disk Image==
 
==Creating a Disk Image==
If you are using Bochs to run a disk-based operating system, you will
+
If you are using Bochs to run a disk-based operating system, you will need to create a simulated disk drive, or "disk image", for Bochs to use. You can use either dd or bximage to do this.
need to create a simulated disk drive, or "disk image", for Bochs to
+
* {{l/linux/cmd/dd}} can be used to create a disk image by running this command:
use. You can use either dd or bximage to do this.
 
*[[dd]] can be used to create a disk image by running this command:
 
 
**'''dd if=/dev/zero of='''''filename'' '''bs=512 count='''''sectors''
 
**'''dd if=/dev/zero of='''''filename'' '''bs=512 count='''''sectors''
 
**:''sectors'' = Cylinders * Heads * SectorsPerTrack
 
**:''sectors'' = Cylinders * Heads * SectorsPerTrack
 
**:''filename'' = name of output file, usually (something).img
 
**:''filename'' = name of output file, usually (something).img
**:You will need to remember the three figures (cylinders, heads,
+
**:You will need to remember the three figures (cylinders, heads, sectors/track) used to calculate the ''sectors'' value; they go in the Bochs configuration file. (Tip: name your file using the actual numbers use for the three figures, e.g. for a 1 GB drive with 2080 cylinders, 16 heads, and 63 sectors per track, name your file myfile-2080cyl-16hds-63sec.img, as a memory aid.)
sectors/track) used to calculate the ''sectors'' value; they go in the
+
*[[bximage]] has a user-friendly interactive mode, which you invoke by running it with no command-line parameters.
Bochs configuration file. (Tip: name your file using the actual numbers
 
use for the three figures, e.g. for a 1 GB drive with 2080 cylinders,
 
16 heads, and 63 sectors per track, name your file
 
myfile-2080cyl-16hds-63sec.img, as a memory aid.)
 
*[[bximage]] has a user-friendly interactive mode, which you invoke by
 
running it with no command-line parameters.
 
 
==Setup Notes==
 
==Setup Notes==
I had Bochs working using an .img file as the Windows c:\ drive, and
+
I had Bochs working using an .img file as the Windows c:\ drive, and then it mysteriously stopped working (probably due to an [[Ubuntu]] upgrade) so I'm taking notes as I rebuild the .img file to (hopefully) fix the problem. The same image worked quite well under [[Qemu]], though.
then it mysteriously stopped working (probably due to an Ubuntu
+
 
upgrade) so I'm taking notes as I rebuild the .img file to (hopefully)
+
Some notes I took last time (will explain them when I figure out what they mean):
fix the problem.
+
{{l/linux/cmd|mknod}} /dev/loop0
Some notes I took last time (will explain them when I figure out what
+
{{l/linux/cmd|modprobe}} loop
they mean): [[Linux:mknod|mknod]] /dev/loop0
+
/sbin/{{l/linux/cmd|losetup}} /dev/loop0 /home/woozle/win98/c.img
[[Linux:modprobe|modprobe]] loop /sbin/[[Linux:losetup|losetup]]
+
"Edit /etc/{{l/linux/cmd|fstab}} &ndash; set up /dev/loop0 just like D drive"
/dev/loop0 /home/woozle/win98/c.img
+
{{l/linux/cmd|mount}} /dev/loop0
"Edit /etc/[[Linux:fstab|fstab]] -- set up /dev/loop0 just like D
+
{{l/linux/cmd|mknod}} /dev/tap0 c 36 16
drive" [[Linux:mount|mount]] /dev/loop0 [[Linux:mknod|mknod]] /dev/tap0
 
c 36 16
 
 
"Next time: try tuntap"
 
"Next time: try tuntap"

Latest revision as of 20:56, 5 January 2018

This is a growing seedling article. You can help HTYP by watering it.
Computing: Linux:
Emulators: Bochs:
Bochs on Linux

This article is about setting up and using the Bochs emulator on Linux.

Articles

Commands

  • bximage: one way of creating a disk image for Bochs to boot (included in Bochs distribution)
  • dd: standard Linux command which can be used for creating a disk image

Creating a Disk Image

If you are using Bochs to run a disk-based operating system, you will need to create a simulated disk drive, or "disk image", for Bochs to use. You can use either dd or bximage to do this.

  • dd can be used to create a disk image by running this command:
    • dd if=/dev/zero of=filename bs=512 count=sectors
      sectors = Cylinders * Heads * SectorsPerTrack
      filename = name of output file, usually (something).img
      You will need to remember the three figures (cylinders, heads, sectors/track) used to calculate the sectors value; they go in the Bochs configuration file. (Tip: name your file using the actual numbers use for the three figures, e.g. for a 1 GB drive with 2080 cylinders, 16 heads, and 63 sectors per track, name your file myfile-2080cyl-16hds-63sec.img, as a memory aid.)
  • bximage has a user-friendly interactive mode, which you invoke by running it with no command-line parameters.

Setup Notes

I had Bochs working using an .img file as the Windows c:\ drive, and then it mysteriously stopped working (probably due to an Ubuntu upgrade) so I'm taking notes as I rebuild the .img file to (hopefully) fix the problem. The same image worked quite well under Qemu, though.

Some notes I took last time (will explain them when I figure out what they mean):

mknod /dev/loop0
modprobe loop
/sbin/losetup /dev/loop0 /home/woozle/win98/c.img

"Edit /etc/fstab – set up /dev/loop0 just like D drive"

mount /dev/loop0
mknod /dev/tap0 c 36 16

"Next time: try tuntap"