Page 1 of 1

Bochs does not want to work for me

Posted: Sat Feb 26, 2011 8:53 pm
by rocko384
I want to have Bochs setup for when I actually start writing code, so I assembled the bootable code from Babysteps 1 and made it into an img file. I then followed all the tutorials I could, but I cant get Bochs to boot the file. Help?

Re: Bochs does not want to work for me

Posted: Sat Feb 26, 2011 9:04 pm
by a5498828
whats the error?

Re: Bochs does not want to work for me

Posted: Sat Feb 26, 2011 9:08 pm
by rocko384
C:\Program Files (x86)\Bochs-2.4.5\bochsrc.bxrc:596: a bochsrc option needs at least one parameter

Re: Bochs does not want to work for me

Posted: Sat Feb 26, 2011 9:09 pm
by thepowersgang
May I point you to the forum rules. Specifically #4 (and to a lesser extent, #3)

To be of any help, we need to know what you did, how it failed, and what you have already tried.
Posting your compilation commands and source usually helps.

[EDIT] I emphasise rule 3 now that I have seen your problem.

Re: Bochs does not want to work for me

Posted: Sat Feb 26, 2011 9:10 pm
by rocko384
Sorry if I'm not much help in providing info, I'm just not familiar with using an emulator to test my stuff.

Re: Bochs does not want to work for me

Posted: Sat Feb 26, 2011 9:11 pm
by a5498828
...so whats in line 596?

Re: Bochs does not want to work for me

Posted: Sat Feb 26, 2011 9:14 pm
by rocko384

Code: Select all

#=======================================================================
# ROM-IMAGE:
#=======================================================================
romimage: file=$BXSHARE/BIOS-bochs-latest, address=0xf0000
#=======================================================================
# CPU:
#=======================================================================
cpu: count=1, ips=10000000, reset_on_triple_fault=1
#=======================================================================
# Amount of RAM in MB
#=======================================================================
megs: 32
#=======================================================================
# VGA ROM IMAGE
#=======================================================================
vgaromimage: file= $BXSHARE/VGABIOS-lgpl-latest
#=======================================================================
# VGA:
#=======================================================================
vga: extension= vbe
#=======================================================================
# FLOPPY:
#=======================================================================
floppya: 1_44= "boot1.img" , status=inserted
#=======================================================================
# ATA0, ATA1, ATA2, ATA3 (Set up Hard disk and CD-ROM IRQ's and I/O address)
#=======================================================================
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9

#=======================================================================
# ATA[0-3]-MASTER, ATA[0-3]-SLAVE
#=======================================================================
ata0-master: type=disk, path="MyOS\c.img" , mode=flat, 
             cylinders=20, heads=16, spt=63, translation=none
ata1-master: type=disk, path="MyOS\d.img" , mode=flat, 
             cylinders=2, heads=16, spt=63, translation=none
ata0-slave: type=cdrom, path=MyOS\cdrom.iso, status=inserted
ata1-slave: type=cdrom, path=MyOS\E.iso, status=inserted 
#=======================================================================
# BOOT from:
#=======================================================================
boot: disk
#=======================================================================
# COM1, COM2, COM3, COM4:
#=======================================================================
 Com1: enabled=1,  dev="COM1"
#=======================================================================
# Parallel ports
#=======================================================================
parport1: enabled=1, file="LPT1"
#=======================================================================
# SB16:
# This defines the SB16 sound emulation.
#=======================================================================

sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, 
      loglevel=2, log=sb16.log, dmatimer=600000

#=======================================================================
# VGA_UPDATE_INTERVAL:
#=======================================================================
vga_update_interval: 300000

#=======================================================================
# MOUSE: support:
#=======================================================================
mouse: enabled=0
#=======================================================================
# ne2k: NE2000 compatible ethernet adapter 
#      (Now you can connect to the Internet):
#=======================================================================
ne2k: ioaddr=0x240, irq=9, mac=b0:c4:20:00:00:01, 
      ethmod=vnet, ethdev="c:/temp"

#=======================================================================
# I440FXSUPPORT: PCI-Controller:
#=======================================================================
i440fxsupport: enabled=1

#=======================================================================
# USB1:
#=======================================================================
usb1: enabled=1

#=======================================================================
# CMOSIMAGE:
#=======================================================================
#cmosimage: file=cmos.img, rtc_init=time0

#-------------------------
# PCI host device mapping (Inserting a PCI device).
#-------------------------
pcidev: vendor=0x1234, device=0x5678

#=======================================================================
# GDBSTUB: (GDB debugger)
#=======================================================================
#gdbstub: enabled=0, port=1234, text_base=0, data_base=0, bss_base=0
#=======================================================================
# IPS: (Instruction Per seconds)
#=======================================================================
ips: 10000000

#=======================================================================
# FOR MORE INFORMATION !!!!!
#=======================================================================
#For more information see the Bches Documentation 
#and "bochsrc-sample.txt" (this is in the Bochs directory).
This is my bochsrc.bxrc file. When I open Bochs, I click Load, select the file, and try to run the emulation. I get said error, and then I kill the emulation.

Code: Select all

;boot.asm
     cli
 hang:
     jmp hang
 
     times 510-($-$$) db 0
     db 0x55
     db 0xAA
The code I'm using as a basis

Re: Bochs does not want to work for me

Posted: Sat Feb 26, 2011 9:16 pm
by rocko384
@a549 nothing. Well, there was, but I tried a different, shorter version of the bochsrc-sample. I'm probably wrong, but is 596 an error code maybe? :?

Re: Bochs does not want to work for me

Posted: Sat Feb 26, 2011 9:20 pm
by a5498828

Code: Select all

boot: disk


type=disk, path="MyOS\c.img" , mode=flat,
             cylinders=20, heads=16, spt=63, translation=none
 type=disk, path="MyOS\d.img" , mode=flat,
             cylinders=2, heads=16, spt=63, translation=none

     times 510-($-$$) db 0
     db 0x55
     db 0xAA
use lba trnaslation ald align YOUR ENTIRE FILE to 20*16*63*512 if you use first one.
solved?



and try running bochs from command line or script. Save a lot of time if you compile and run bochs at single key press.

Re: Bochs does not want to work for me

Posted: Sun Feb 27, 2011 7:17 am
by Gigasoft
rocko384 wrote:I've been programming for 6 years, and can learn most languages in a day....you really wanna start a fight?
You fight like a dairy farmer.

(Sorry, couldn't resist :P)

Re: Bochs does not want to work for me

Posted: Sun Feb 27, 2011 2:08 pm
by rocko384
@Giga...troll...XD