Please help me

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
Gandalf

Please help me

Post by Gandalf »

hi all

I am developing my kernel using Redhat Linux 8.0 and using bochs for system simulation. I am using GRUB bootloader to load my ELF kernel.

Here's my problem:

1) If I use the floppy as my boot device then the Linux kernel does not load the kernel from the floppy every time I restart bochs. The reason is that Linux finds that the name and size of my kernel doesn't change) and thus probably serves bochs the internally cached version of the kernel when I first mounted my floppy. So any changes that I make to my kernel is not reflected in bochs. The solution ? Well I have to do umount/mount each time (But What a heck of time it consumes).

So if you know of a better alternative please reply here.


2) I tried another way: I made a virtual block device using 'mknod'. But I dont know how to create a file system (coz I am using GRUB) and dont know how to copy my kernel inside it.

Please help. It will save me lot of time.


Thanking
carbonBased

RE:Please help me

Post by carbonBased »

synch

It'll write all unused buffers to disk, should clear the cache, and you'll be all set.

Cheers,
jeff
carbonBased

RE:Please help me

Post by carbonBased »

sorry... sync... no 'h'
carbonBased

RE:Please help me

Post by carbonBased »

btw... try the following (it'll save you shloads of time)...

first, create a bootdisk 'image':
dd if=/dev/zero of=disk.img bs=512 count=2880

That should give you a 1.44MB floppy image with nothing on it...

Now, create a file system on it...
mkdosfs disk.img

Now you can mount this disk image like a regular floppy:
mount /mnt/floppy disk.img -o loop

So now, you have a floppy disk... but... stored on the harddrive... MUCH faster!

Alternatively, sense you already have a floppy made up, try this:
dd if=/dev/floppy of=disk.img

which will copy your floppy over into the disk image, which can then be mounted/used as shown above.

But still, don't forget to 'sync' every now and then to flush the disk cache!

Cheers,
Jeff
Gandalf

THANKS it saved a lot of time

Post by Gandalf »

Thanks jeff, I tried what you said. It works great.

This is what I did:

dd if=/dev/fd0 of=disk.img bs=512  #This floppy contains GRUB installed.
mount disk.img /mnt/floppy -o loop


& changed my bochsrc.txt entry
floppya 1_44=/root/myosdir/disk.img

Now to change my kernel all I do is compile it and copy it to /mnt/floppy followed by a sync @ shell (GOD how quick it works!!!)

Thanks once again jeff
carbonBased

RE:THANKS it saved a lot of time

Post by carbonBased »

Cheers!

Glad I could help! :)

Jeff
Post Reply