Page 1 of 2
Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 6:16 pm
by Spyes
Hey everyone!
So I just started out with kernel development, and I read around some stuff and decided to try out the bare bone example on the wiki. I did basically everything they did there, except that in kernel.c I added my own functions for writing text and clearing the screen, but that isn't the issue (everything compiled and linked just fine).
I created a floppy.img file as the instructions say, and when I fire up Bochs it gives me the follow error:
00000000000i[MEM0 ] 4.00MB
00000000000i[MEM0 ] ROM: couldn't open ROM image file ''.
Any idea of what's happening here??
By the way, I am currently running this on Damn Small Linux on a virtual machine...
Thanks
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 6:21 pm
by Combuster
for bochs you need to write a configuration file (bochs comes with a default called bochsrc, full with comments - make a copy for your OS). There you will also find entries pointing to the various image files (system bios, vga bios, floppy image, HD image, ...)
Right now you have either no configuration, or one which is missing important things.
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 6:23 pm
by Troy Martin
You're probably missing a "romimage:" line in your bochsrc file or there's a broken one.
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 6:27 pm
by Spyes
Thanks for the quick reply guys!
I have a ~/.bochrc file, which has:
boot: floppy
floppya: 1_44="floppy.img", status=inserted
I just read something about romimage: actually, but I don't know exactly what I should do... I tried a couple of things but they didn't work. Any suggestions as to what I should use for 'file='?
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 6:30 pm
by Combuster
over here its /usr/share/bochs/BIOS-bochs-latest (and /usr/share/bochs/VGABIOS-lgpl-latest) but it may differ on your distro.
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 6:34 pm
by Spyes
Ok... so I did
romimage: file=/usr/share/bochs/BIOS-bochs-latest, address 0xe0000
but it returns:
00000000000i[MEM0 ] 4.00MB
00000000000i[MEM0 ] rom at 0xe0000/65536 ('/usr/share/bochs/BIOS-bochs-latest')
00000000000i[MEM0 ] ROM: couldn't open ROM image file ''.
This is what I have in /usr/share/bochs:
root@box:/# ls /usr/share/bochs/
BIOS-bochs-2-processors BIOS-bochs-latest README
BIOS-bochs-4-processors CHANGES keymaps
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 6:59 pm
by Troy Martin
What's in your directory with the bochs executable in it?
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 7:12 pm
by Spyes
Well, I'm running this on linux, the executable is in /usr/bin, so... that directory just has a bunch of other executables...
If you mean the directory where floppy.img is:
dsl@box:/root/Kernel$ ls
floppy.img kernel.c linker.ld loader.s pad~ stage2
kernel.bin kernel.o loader.o pad stage1
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 7:18 pm
by Spyes
Hmmm... Seems I missed something that -might- help..
Scrolling up, I see this:
00000000000i[ ] reading configuration from /tmp/8515
00000000000p[ ] >>PANIC<< /tmp/8515: boot directive with unknown boot device 'floppy'. use 'a', 'c' or 'cdrom'.
========================================================================
Event type: PANIC
Device: [ ]
Message: [ ] /tmp/8515: boot directive with unknown boot device 'floppy'. use 'a', 'c' or 'cdrom'.
then it just restarts and gives the errors that I original talked about....
Oh, and this is how I'm invoking bochs:
dsl@box:/root/Kernel$ bochs floppy
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 7:23 pm
by Troy Martin
Invoke bochs with just "bochs" and add a "boot: floppy" line to your bochsrc, that might work.
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 7:29 pm
by Spyes
Ok, I think I'm getting somewhere..
I added
vgaromimage: /usr/share/vgabios/vgabios.bin
to ~/.bochsrc
And now it's giving me:
00000000000i[MEM0 ] 4.00MB
00000000000i[MEM0 ] rom at 0xf0000/65536 ('/usr/share/bochs/BIOS-bochs-latest')
00000000000i[MEM0 ] rom at 0xc0000/26106 ('/usr/share/vgabios/vgabios.bin')
00000000000i[CMOS ] Setting initial clock to: Wed Dec 31 02:03:16 2008
00000000000i[FDD ] fd0: 'floppy.img' ro=0, h=2,t=80,spt=18
00000000000p[XGUI ] >>PANIC<< Could not open vga font. See docs-html/install.html
Reading install.html, it says I need to install vga fonts...
but what's confusing is the way they explain it... I installed using apt-get
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 7:31 pm
by Spyes
First, here's my bochsrc file:
boot: floppy
floppya: 1_44="floppy.img", status=inserted
romimage: file=/usr/share/bochs/BIOS-bochs-latest, address=0xf0000
vgaromimage: /usr/share/vgabios/vgabios.bin
when I run it with just 'bochs' it complains about needing a disk?
Please specify which disk set to boot (without the suffix):
Usage: bochs <disk>
Where <disk> will replace the #disk# strings in ~/.bochsrc
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 7:40 pm
by Troy Martin
I'm just guessing, I haven't done a bochsrc by hand in a year. Been using Virtual PC cause Bochs 2.3 was crap enough for me to seek an alternative.
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Tue Dec 30, 2008 8:33 pm
by Hangin10
Is it still complaining if you don't use any options?
Try running it with: bochs -f .bochsrc
Although according to the docs it should search for a .bochsrc in the current directory (on Linux), wouldn't hurt
to spare it the search.
Re: Error with Bochs... "couldn't open ROM file"...
Posted: Wed Dec 31, 2008 1:01 am
by Spyes
Tried it, still doesn't work....
/usr/bin/bochs: line 55: 11780 Exit 1
cat $bochs_wrap /dev/stdin
11781 Segmentation fault | /usr/lib/bochs/bochs
and it's still complaining about vga fonts..
Stuff like that.... would you guys recommend giving up on bochs and using qemu or something of the sort?