Error with Bochs... "couldn't open ROM file"...

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.
Spyes
Posts: 12
Joined: Tue Dec 30, 2008 6:10 pm

Error with Bochs... "couldn't open ROM file"...

Post 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 :)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Error with Bochs... "couldn't open ROM file"...

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Error with Bochs... "couldn't open ROM file"...

Post by Troy Martin »

You're probably missing a "romimage:" line in your bochsrc file or there's a broken one.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Spyes
Posts: 12
Joined: Tue Dec 30, 2008 6:10 pm

Re: Error with Bochs... "couldn't open ROM file"...

Post 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='?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Error with Bochs... "couldn't open ROM file"...

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Spyes
Posts: 12
Joined: Tue Dec 30, 2008 6:10 pm

Re: Error with Bochs... "couldn't open ROM file"...

Post 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
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Error with Bochs... "couldn't open ROM file"...

Post by Troy Martin »

What's in your directory with the bochs executable in it?
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Spyes
Posts: 12
Joined: Tue Dec 30, 2008 6:10 pm

Re: Error with Bochs... "couldn't open ROM file"...

Post 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
Spyes
Posts: 12
Joined: Tue Dec 30, 2008 6:10 pm

Re: Error with Bochs... "couldn't open ROM file"...

Post 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
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Error with Bochs... "couldn't open ROM file"...

Post by Troy Martin »

Invoke bochs with just "bochs" and add a "boot: floppy" line to your bochsrc, that might work.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Spyes
Posts: 12
Joined: Tue Dec 30, 2008 6:10 pm

Re: Error with Bochs... "couldn't open ROM file"...

Post 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
Spyes
Posts: 12
Joined: Tue Dec 30, 2008 6:10 pm

Re: Error with Bochs... "couldn't open ROM file"...

Post 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
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Error with Bochs... "couldn't open ROM file"...

Post 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.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Hangin10
Member
Member
Posts: 162
Joined: Wed Feb 27, 2008 12:40 am

Re: Error with Bochs... "couldn't open ROM file"...

Post 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.
Spyes
Posts: 12
Joined: Tue Dec 30, 2008 6:10 pm

Re: Error with Bochs... "couldn't open ROM file"...

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