How Bochs work?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Tehy

How Bochs work?

Post 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?
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:How Bochs work?

Post 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
crc

Re:How Bochs work?

Post 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 :-)
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:How Bochs work?

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Tehy

Re:How Bochs work?

Post 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...
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:How Bochs work?

Post 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...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:How Bochs work?

Post by Solar »

Oh my, where have those 1.76 MB floppies gone... 8)
Every good solution is obvious once you've found it.
sandy

how w'ould be my .bochsrc file

Post 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..?
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:how w'ould be my .bochsrc file

Post 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?
Post Reply