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.
Then, I copy boot2.bin and kernel.bin to /mnt/myfloppy directory. The 'floppya' in bochs points to /dev/loop0. I just wanted to know, should i 'dd' boot.bin and copy boot2.bin, kernel.bin to /mnt/myfloppy, whenever I recompile my kernel? Because, the change that I make in the kernel is not reflected in the bochs, when i just copy kernel.bin. Also, if i do all the steps, sometimes, the change is not reflected.
Perhaps you're falling for Linux buffering the output. Changes are not written to devices immediately, but when it's convenient. Try to unmount the image on the Linux side before reading it from the Bochs side.
Every good solution is obvious once you've found it.
Solar wrote:
Perhaps you're falling for Linux buffering the output. Changes are not written to devices immediately, but when it's convenient. Try to unmount the image on the Linux side before reading it from the Bochs side.
If i unmount the image, will bochs be able to read it? Or do you mean by unmounting and mounting it again before running bochs? Is there any way to forcely write the changes to the image?
I tried by unmounting /mnt/myfloppy, it worked. But, when I use sync command, I face some strange problems like ldtr.valid=0, my OS getting rebooted in bochs, etc. Could you please explain me, why such strange thing happens in case of sync command?
'sync' just flushes the filesystem caches out to disk, it doesn't unmount any filesystems. Bochs can't read a mounted filesystem.
If you're just changing one file on the image then you'd be much better off using mtools (FAT images) or e2tools (ext2fs images) to inject the file into the image. That way you don't have to bother with any mounting. Since they don't require root permissions they also fit quite nicely into a makefile.