Page 1 of 1
Configure bochs -help!
Posted: Thu Nov 04, 2004 12:00 am
by Kimm
hm...
I find it pretty anoying having to reboot the computer every time I want to try something in my OS. I knew that there is a free emulator (bochs), and I figured it could make it alot simpler! however, I have tried to use bochs beafure withouth any luck, I just dont know how to configure the thing. So I was woundering if anyone where knows how to do it and can give me a detailed description of how to do this (...please...
. And does anyone know where I can find a BIOS image to use??
Re: Configure bochs -help!
Posted: Thu Nov 04, 2004 12:00 am
by [AlAdDiN]
It's a good idea to use an emulator of course, but bichs is not the only free solution, now there is another emulator called qemu, it don't need any configuration , and work better than bochs here is the link to its homepage
http://fabrice.bellard.free.fr/qemu/
if you want to use bochs here is its homepage
http://bochs.sourceforge.net/
to configure it, the easiest way is to run bochs, then, when he prompt you chose configure bochs instead of start emulation, then give it the the configuration u want to emul, and save your changes to bochsrc.txt, then start emulation, if you still have some problems, send yout bochsrc.txt file to this forum, with error message so we can help you ;D
Re: Configure bochs -help!
Posted: Fri Nov 05, 2004 12:00 am
by Kimm
wow, thank you [AlAdDiN] that emulator was realy cool! I just have a small question.
If I want to boot My Kernel Image, would it be correct to type this in the console:
qemu Documents/KixOS\ Test/Kernel.bin
if it is, something is realy wrong with my kernel
Re: Configure bochs -help!
Posted: Fri Nov 05, 2004 12:00 am
by bregma
Kimm wrote:... I have tried to use bochs beafure withouth any luck, I just dont know how to configure the thing. So I was woundering if anyone where knows how to do it and can give me a detailed description of how to do this
Your best bet would be to create a bootable floppy image containing your OS then use a fairly vanilla (ie generic) Bochs config file.
My generic bochs config file looks like this.
Code: Select all
romimage: file=@ZYG_BOCHSDIR@/BIOS-bochs-2-processors, address=0xf0000
vgaromimage: @ZYG_BOCHSDIR@/VGABIOS-lgpl-latest
floppya: 1_44=@abs_top_builddir@/disk.img, status=inserted
boot: floppy
log: zygomatic.log
error: action=report
info: action=report
where
@ZYG_BOCHSDIR@ gets replaced (by autoconf) with the location of the Bochs installation and
@abs_top_builddir@ gets replaced with the locaton of my build directory, but you can just substitute by hand if you don't want to go all out.
You will have to replace the solidi with backslashes if you are running Bochs on a DOS-based platform (including Windows and Cygwin).
You just have to pass the name of the config file to Bochs on the command line using the -f switch. You probably also want to use the -q switch.
I use GNU automake and autoconf to customize my development environments (I have multiple development platforms). I have a make target to create the bootable floppy and to run Bochs automatically, so I just have to type "make bochs" and the kernel gets rebuilt, floppy image created, and up pops Bochs running my kernel. Much faster turnaround than to reboot hardware.
Kimm wrote:And does anyone know where I can find a BIOS image to use??
The Bochs distributions (source and binary) come with open-sourced BIOS images, both system BIOS and VGA BIOS. These are legal and (mostly) work.
Re: Configure bochs -help!
Posted: Fri Nov 05, 2004 12:00 am
by Legend
Better use both of those emulators ...
I know some code that for example works with QEmu, but not with Bochs, and on a real machine not either
Re: Configure bochs -help!
Posted: Fri Nov 05, 2004 12:00 am
by Kimm
ok, thank you!
Re: Configure bochs -help!
Posted: Fri Nov 05, 2004 12:00 am
by [AlAdDiN]
Legend wrote:
Better use both of those emulators ...
I know some code that for example works with QEmu, but not with Bochs, and on a real machine not either
a well programmed kernel should work on different emulators and real machines
qemu is an exception because it is still under developpement and some bugs are not yet fixed
Kimm wrote:
wow, thank you [AlAdDiN] that emulator was realy cool! I just have a small question.
If I want to boot My Kernel Image, would it be correct to type this in the console:
Quote:
qemu Documents/KixOS\ Test/Kernel.bin
if it is, something is realy wrong with my kernel
you have to create a floppy disk image that contain the boot loader and ther kernel (and other files if needed)
if you are using linux or can use it i can give you a script to create floppy image
Re: Configure bochs -help!
Posted: Fri Nov 05, 2004 12:00 am
by Kimm
well I dont have a bootloader for my os (I use GRUB to boot it). But I do run Linux...
Re: Configure bochs -help!
Posted: Fri Nov 05, 2004 12:00 am
by [AlAdDiN]
here is a part of my Makefile that create a floppy image
-you need mkdosks to be installed
-you must be root when you run this.
-your kernel must support loop devices (/dev/loop)
-you heve to create a directory called temp in the current folder (will be used to mount/umount the fake floppy)
MKDOSFS=/usr/sbin/mkdosfs (give the right path to the mkdosfs command)
DD=/bin/dd (give the right path to dd command)
compil :
compil your bootsector
compil your os files ...
image: compil
@echo "Creatinf floppy image"
@$(MKDOSFS) -C -F 12 -S 512 -s 2 -v osimage.img 1440
@echo 'coping bootsector'
@$(DD) if=yourbootsector of=osimage.img conv=notrunc
@echo '[OK]'
@sudo mount osimage.img temp -t msdos -o loop=/dev/loop0,blocksize=2880
@echo Copying system files...
sudo cp path/to/my/fist/file temp
sudo cp path/to/my/second/file temp
@sudo umount temp