[Resolved] Somewhat Easy Question (Bochs)
[Resolved] Somewhat Easy Question (Bochs)
Alright, I'm kind of a noob at this, so I need your help. I've compiled a very, very, basic kernel of my own, but I want to be able to test it with bochs, or qemu, or some other emulator (Preferably bochs.). I have really no idea how to do this. Does anyone have suggestions? Thanks in advance.
[P.S. I'm running on Windows XP]
[P.S. I'm running on Windows XP]
Last edited by Bobalandi on Mon Dec 03, 2007 5:27 pm, edited 1 time in total.
Hi,
I would have a look at the Bochs Guide which takes you through how to install and run bochs (I'm using it on XP too). It really is just a matter of writing a config file (theres a sample one in the Bochs install dir, or get the bochs configuration tool to do it for you when you start Bochs) and running it.
You probably want to use a floppy image - have a look at VFD for that.
Cheers,
Adam
I would have a look at the Bochs Guide which takes you through how to install and run bochs (I'm using it on XP too). It really is just a matter of writing a config file (theres a sample one in the Bochs install dir, or get the bochs configuration tool to do it for you when you start Bochs) and running it.
You probably want to use a floppy image - have a look at VFD for that.
Cheers,
Adam
Yupp
Yah, I have it installed and all, but what I meant to ask (sorry...) was how would I put my kernel binary into the image?
With VFD (link above), you create a complete virtual floppy disk. You simply copy over your kernel with Windows. Then edit menu.cfg in \boot and you're away!
Cheers,
Adam
[edit]If you have an existing image, just open it with VFD and tell it to become, for example, drive b:. This all assumes you have GRUB on the image (or some other boot loader). [/edit]
Cheers,
Adam
[edit]If you have an existing image, just open it with VFD and tell it to become, for example, drive b:. This all assumes you have GRUB on the image (or some other boot loader). [/edit]
Ok,
Firstly, is it really a kernel, or is it a boot loader? If it's a boot loader (and therefore needs to be on the first disk sector), see http://www.osdever.net/tutorials/usingpcopy.php.
If you have a boot loader, and you simply want to put kernel.bin on that floppy disk (FAT12), just copy the file, as usual, in Windows using explorer. If you are using GRUB, you will need to navigate to [fddletter]:\boot\menu.cfg and edit a new entry for your kernel.
Now, for Bochs, create a new file called bochsrc.bxrc in notepad (not with a .txt extension). Add the following lines to the file:
You will, of course, need to exchange the letter 'b:' with whatever the letter of your disk drive is. If you are just developping a boot sector, you can replace:
with
Save the file and double-click on it. Bochs should start and try to run your floppy image. If not, let me know the error message you get and we will try to sort it out.
Cheers,
Adam
Firstly, is it really a kernel, or is it a boot loader? If it's a boot loader (and therefore needs to be on the first disk sector), see http://www.osdever.net/tutorials/usingpcopy.php.
If you have a boot loader, and you simply want to put kernel.bin on that floppy disk (FAT12), just copy the file, as usual, in Windows using explorer. If you are using GRUB, you will need to navigate to [fddletter]:\boot\menu.cfg and edit a new entry for your kernel.
Now, for Bochs, create a new file called bochsrc.bxrc in notepad (not with a .txt extension). Add the following lines to the file:
Code: Select all
# Memory and BIOS
megs: 32
romimage: file="C:\Program Files\Bochs-2.3.5\BIOS-bochs-latest"
vgaromimage: file="C:\Program Files\Bochs-2.3.5\VGABIOS-lgpl-latest"
log: bochsout.txt
log: -
# Boot Source
boot: floppy
floppy_bootsig_check: disabled=0
floppya: 1_44="b:", status=inserted
Code: Select all
floppya: 1_44="b:", status=inserted
Code: Select all
floppya: 1_44=[path to kernel.bin], status=inserted
Cheers,
Adam
I used this in my bochsrc:
and I got that there was no bootable device. If it helps at all, I used this tutorial for most of my kernel.
http://osdever.net/bkerndev/Docs/intro.htm
Code: Select all
floppya: 1_44=kernel.bin, status=inserted
http://osdever.net/bkerndev/Docs/intro.htm
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Well,
I tried with a grub boot loader and it didn't work, it just stopped after saying.
Code: Select all
GRUB _
Ah - I see why I wasn't answering your question properly now!
A boot sector must be exactly 512b long and must end with 0x55AA. Have a look at the articles at this link http://www.osdever.net/tutorials.php?cat=2&sort=1.
Also, if you don't want to use your own boot loader, see http://www.osdever.net/bkerndev/index.php, which gives you an idea of what you need to do to get a multiboot kernel up and running.
Cheers,
Adam
A boot sector must be exactly 512b long and must end with 0x55AA. Have a look at the articles at this link http://www.osdever.net/tutorials.php?cat=2&sort=1.
Also, if you don't want to use your own boot loader, see http://www.osdever.net/bkerndev/index.php, which gives you an idea of what you need to do to get a multiboot kernel up and running.
Cheers,
Adam
That tutorial doesn't actually tell you *how* to set up a grub image. Use the wiki or
http://www.jamesmolloy.co.uk/tutorial_h ... setup.html
See the link under "compiling": There is a fully made GRUB boot image ready for your kernel.bin file.
Try that, and report what errors/what happens.
http://www.jamesmolloy.co.uk/tutorial_h ... setup.html
See the link under "compiling": There is a fully made GRUB boot image ready for your kernel.bin file.
Try that, and report what errors/what happens.
OK - have a look at this floppy image - that should get you started - I'll leave the link active for a few days: www.ajsoft.co.uk/files/grub.zip
Cheers,
Adam
Cheers,
Adam