I have compiled linux kernel 2.6.39 already, and I would like to simulate it in BOCHS.Then, How to boot from this compiled kernel in BOCHS?
I have an idea that make a boot .ISO file .But I do not know how to do it.
I have compiled linux kernel 2.6.39 already, and I would like to simulate it
Share
Bochs seems to lack the ability of directly booting an executable, so you should create a virtual disk disk image first (tutorial). Then you can setup the image as a loop device with kpartx:
This will create loopNp1 under /dev (with N depending on the used loop devices, usually 0).
Now you can format and mount it:
You can then copy your kernel image (zImage, bzImage or similar) into /mnt/boot.
To make it work, however, you will need also a bootloader. You can easily install grub (if you are already using it on your system) with
You will also need a grub.cfg like
Place it under /mnt/boot/grub. Now we are done, umount everything, add to your bochsrc a line like
ata0-master: type=disk, path=image.img, mode=flat, cylinders=0, heads=0, spt=0, translation=auto
(note: in some cases you may need to manually specify CHS values) and it should work (well, at least until it tries to run init – but that is a different question).