creating an image to test grub-loaded kernel with bochs
Posted: Thu Jul 17, 2003 10:07 pm
Hi.
I've been using bochs extensively to test my code in the past, and up until a few days ago this was relatively easy to do. I had my own bootloader, which would simply load ther kernel starting from sector 2, so to create a floppy image to load into bochs, i would simply combine the files before launching bochs, and use it as the floppy, and everything worked fine.
A few days ago, my kernel became too big to work with my existing bootloader. I decided it wasn't worth the effort at this time to figure out why my bootloader wasn't working, and finally make the move to switch to grub. I ave successfully created a bootable floppy, to which i can simply copy my kernel and boot in a regular pc and it works fine. However, no this means i have to take the time to copy the kernel to the floppy, and then boot off the floppy, which adds considerable time, especially since I am used to testing very small changes until i get something just right (i do a LOT of testing). Now this adds considerable time to development i'd like to avoid.
I was wondering if anyone has any idea how to create an on-the-fly grub-bootable image like i used to do with my own bootloader? I've looked into it, and it seems like it would be difficult because grub hard-codes offset to stage2 into stage1, so i'm not sure how this would work. is there a way to create a filesystem-fee grub bootdisk? i know the default one is, but it won't boot anything, only load the setup program. can i force grub to boot my kernel from a specific sector? am i missing something big? thanks for your help!
I've been using bochs extensively to test my code in the past, and up until a few days ago this was relatively easy to do. I had my own bootloader, which would simply load ther kernel starting from sector 2, so to create a floppy image to load into bochs, i would simply combine the files before launching bochs, and use it as the floppy, and everything worked fine.
A few days ago, my kernel became too big to work with my existing bootloader. I decided it wasn't worth the effort at this time to figure out why my bootloader wasn't working, and finally make the move to switch to grub. I ave successfully created a bootable floppy, to which i can simply copy my kernel and boot in a regular pc and it works fine. However, no this means i have to take the time to copy the kernel to the floppy, and then boot off the floppy, which adds considerable time, especially since I am used to testing very small changes until i get something just right (i do a LOT of testing). Now this adds considerable time to development i'd like to avoid.
I was wondering if anyone has any idea how to create an on-the-fly grub-bootable image like i used to do with my own bootloader? I've looked into it, and it seems like it would be difficult because grub hard-codes offset to stage2 into stage1, so i'm not sure how this would work. is there a way to create a filesystem-fee grub bootdisk? i know the default one is, but it won't boot anything, only load the setup program. can i force grub to boot my kernel from a specific sector? am i missing something big? thanks for your help!