Page 1 of 1
How Bochs work?
Posted: Wed Nov 03, 2004 9:09 am
by Tehy
I just don't know how I will get bochs work...
I have been install it (Windows)
My problem is how I can test some OS with bochs?
Re:How Bochs work?
Posted: Wed Nov 03, 2004 1:10 pm
by Candy
Tehy wrote:
I just don't know how I will get bochs work...
I have been install it (Windows)
My problem is how I can test some OS with bochs?
You make some bootable medium for the OS to boot from, install the OS on it using some method (say, copying or using the install method), and then make a bochsrc (or bochsrc.txt or something like that) that points bochs to that file. It also explains to bochs what sort of fake-computer you'd like to have, and how fast it'd probably run (it isn't synchronized).
Using advanced stuff for bochs (AMD64 support, multi-cpu support etc.) requires that you recompile it.
Most OSes provide bootable floppies or harddisk images, and if you're making one your own you can create your own bootable floppy that should work for a normal pc, and then read it in with RAWriteXP or something like it (note: the image must be EXACTLY 1457664 bytes). Then, point bochs to that image and start it up
Good luck
Re:How Bochs work?
Posted: Wed Nov 03, 2004 8:12 pm
by crc
the image must be EXACTLY 1457664 bytes
Not true! My disk image is just 6,811 bytes and it works fine with Bochs and Qemu
Re:How Bochs work?
Posted: Wed Nov 03, 2004 8:37 pm
by Brendan
Hi,
the image must be EXACTLY 1457664 bytes
Ummm, a "1.44 Mb" is actually 1440 Kb, or 1474560 bytes (1457664 bytes would be 16.5 Kb or 33 sectors less than a normal floppy).
Cheers,
Brendan
Re:How Bochs work?
Posted: Wed Nov 03, 2004 11:53 pm
by Tehy
Ok, If I got some OS in .IMG file can I just run that in bochs when I have done the another setup...
Re:How Bochs work?
Posted: Thu Nov 04, 2004 1:22 am
by Candy
Brendan wrote:
the image must be EXACTLY 1457664 bytes
Ummm, a "1.44 Mb" is actually 1440 Kb, or 1474560 bytes (1457664 bytes would be 16.5 Kb or 33 sectors less than a normal floppy).
*smacks forehead* NOT the dos formatted free size, the full size...
Re:How Bochs work?
Posted: Thu Nov 04, 2004 3:53 am
by Solar
Oh my, where have those 1.76 MB floppies gone...
how w'ould be my .bochsrc file
Posted: Thu Nov 04, 2004 11:47 pm
by sandy
Hi All,
I am using bochs-2.1.1 . I created one file (floppy.img) using dd and coppied bxImage to it. Then I created 1 more file (disk.img) using dd command and to use it as a loop device I used "losetup /dev/loop0 disk.img". Then I have created single partition on the device using "fdisk -u -C20 -H16 -S63 disk.img" and formated it with ext2 file system. and then copied the my rootfs image(rootfs) to the disk.img. Then I am doing the following steps:
losetup /dev/loop1 floppy.img (setting as loop device)
rdev /dev/loop1 /dev/hda1 (to tell the kernel that my rootfs is in /dev/hda1)
rdev -R /dev/loop1 1 ( read only rootfs)
Now I want to boot from floppy image using bochs.
following is the imp. things of my .bochsrc file:
"config_interface: textconfig
romimage: file=$BXSHARE/BIOS-bochs-latest, address=0xf0000
floppya: 1_44=./floppy.img, status=inserted
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, mode=flat, path=disk1.img, cylinders=20, heads=16, spt=63
boot: floppy"
Now when I am running ./bochs its booting from the floppy but then is unable to mount rootfs . Its saying : Kernel panic: Unable to mount fs on 3:01
Is my .bochsrc file ok..?
Re:how w'ould be my .bochsrc file
Posted: Fri Nov 05, 2004 12:15 am
by Candy
sandy wrote:
I am using bochs-2.1.1 . I created one file (floppy.img) using dd and coppied bxImage to it. Then I created 1 more file (disk.img) using dd command and to use it as a loop device I used "losetup /dev/loop0 disk.img". Then I have created single partition on the device using "fdisk -u -C20 -H16 -S63 disk.img" and formated it with ext2 file system. and then copied the my rootfs image(rootfs) to the disk.img.
Did you mke2fs the partition on the disk (which is quite complex) or the entire disk?