how to use bochs

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
vinise
Posts: 10
Joined: Mon Nov 22, 2010 3:33 pm

how to use bochs

Post by vinise »

Hy everyone

i've got to write a boot sequence for school... i'm actually using a amaising floppy disk and rebooting a computer over and over again ... i'm getting sick...

anyway i've find bochs but i dont find how to use it right.

i use nasm to make binary file (nasm boots.asm -o boots.bin -f bin)
and dd to transfer it into my flopy (dd if=boot.bin of=/dev/sda0)

how can i do the same with bochs?
HitmanYesman
Member
Member
Posts: 47
Joined: Fri Apr 23, 2010 8:27 am

Re: how to use bochs

Post by HitmanYesman »

This should do it:

Code: Select all

romimage: file=BIOS-bochs-latest, address=0xf0000 
vgaromimage: file=VGABIOS-lgpl-latest 

floppya: 1_44=a:, status=inserted
 
log: report.log
It essentially boots off whatever is inside the floppy a: drive.
vinise
Posts: 10
Joined: Mon Nov 22, 2010 3:33 pm

Re: how to use bochs

Post by vinise »

Message: ROM: System BIOS must end at 0xfffff

and if i'm using bochs it's to stop using a real floppy.... how can i create and use img?
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: how to use bochs

Post by f2 »

vinise wrote:Message: ROM: System BIOS must end at 0xfffff
Replace address=0xf0000 by address=0xe0000. The size of the Bochs BIOS is 128kb, not 64kb.
vinise wrote:and if i'm using bochs it's to stop using a real floppy.... how can i create and use img?
RawWrite can do that.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
vinise
Posts: 10
Joined: Mon Nov 22, 2010 3:33 pm

Re: how to use bochs

Post by vinise »

RawWrite make img out off a floppy...
i want to make img from mine binary file... and boot on my binarry file
Hangin10
Member
Member
Posts: 162
Joined: Wed Feb 27, 2008 12:40 am

Re: how to use bochs

Post by Hangin10 »

http://wiki.osdev.org/Virtual_Floppy_Disk

Next time, search the wiki first.
vinise
Posts: 10
Joined: Mon Nov 22, 2010 3:33 pm

Re: how to use bochs

Post by vinise »

Hangin10 wrote:http://wiki.osdev.org/Virtual_Floppy_Disk

Next time, search the wiki first.
very not useful for linux :/
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: how to use bochs

Post by Combuster »

dd can be used just as well for image files as it can be used for actual devices. But Hangin is right - there are a ton of methods to create images, if only you bothered to search. Shame on you for not finding the first entry in the frequently asked questions.
"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 ]
vinise
Posts: 10
Joined: Mon Nov 22, 2010 3:33 pm

Re: how to use bochs

Post by vinise »

Combuster wrote:dd can be used just as well for image files as it can be used for actual devices. But Hangin is right - there are a ton of methods to create images, if only you bothered to search. Shame on you for not finding the first entry in the frequently asked questions.
if you're speaking of this http://wiki.osdev.org/Disk_Images i've seen it and try... but it's not working... i may do something wrong ere is what's im doing:

Code: Select all

dd if=/dev/zero of=floppy.flp bs=512 count=2880
nasm boot1.asm -o boot1.bin -f bin
dd if=boot1.bin of=floppy.flp
cat .bochsrc

Code: Select all

romimage: file=/usr/share/bochs/BIOS-bochs-latest, address=0xe0000
vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest

floppya: 1_44=~/floppy.flp, status=inserted

log: report.log
and when i run bochs i get :
Booting from Floppy...
Boot failed could not read the boot disk

FATAL: No bootable device.
User avatar
Thomas
Member
Member
Posts: 284
Joined: Thu Jun 04, 2009 11:12 pm

Re: how to use bochs

Post by Thomas »

Hi ,

Code: Select all

dd if=/dev/zero of=floppy.flp bs=512 count=2880
nasm boot1.asm -o boot1.bin -f bin
dd if=boot1.bin of=floppy.flp
Use this instead .

Code: Select all

dd if=boot1.bin of=floppy.flp conv= notrunc seek=0
If you have noticed the size of the floopy img reduces to 512 bytes after your last command . I have to look at the dd manual though , I do not have a linux box at my desk.

--Thomas
vinise
Posts: 10
Joined: Mon Nov 22, 2010 3:33 pm

Re: how to use bochs

Post by vinise »

hy
i've look the all night...

thanks Thomas... it was a part of the problem but the other part came from my boot sequence

I used to do the boot signature as :

Code: Select all

DB    0x55,0xAA
and it's not working with bochs ... a bit strange... it's working find with a real floppy and a computer
anyway i put

Code: Select all

DW    0x55AA
and it's working just fine :)


Thanks to every one
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: how to use bochs

Post by Owen »

One word: Endian
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: how to use bochs

Post by egos »

Code: Select all

DB    0x55,0xAA
This is right.

Code: Select all

DW    0x55AA
But this is not.
If you have seen bad English in my words, tell me what's wrong, please.
Post Reply