Page 2 of 3
Re: Which Linux version?
Posted: Wed May 27, 2009 1:16 pm
by NickJohnson
As long as you can get it installed with a development toolchain quickly, it doesn't matter too much which distro you use. I too would recommend Ubuntu for new users, although I use Gentoo myself.
Re: Which Linux version?
Posted: Thu May 28, 2009 6:03 pm
by quanganht
I'm gonna stick with Ubuntu. But I'm stucking at how to modify the floppy image: After compiling, I want to copy the kernel to the floppy image and test it. Is there any way to accomplish that? ( it's better be automatically. I mean after make is done, some kind of shell script is called to do all the things above)
Re: Which Linux version?
Posted: Thu May 28, 2009 6:30 pm
by Coty
Ubuntu is great to start out with, and I love it.
Re: Which Linux version?
Posted: Thu May 28, 2009 6:40 pm
by pcmattman
quanganht wrote:I'm gonna stick with Ubuntu. But I'm stucking at how to modify the floppy image: After compiling, I want to copy the kernel to the floppy image and test it. Is there any way to accomplish that? ( it's better be automatically. I mean after make is done, some kind of shell script is called to do all the things above)
losetup & mount.
Re: Which Linux version?
Posted: Thu May 28, 2009 6:41 pm
by NickJohnson
You probably want to use the loopback filesystem. It lets you use a file as a virtual block device. You also probably want to use a preformatted floppy image with GRUB installed to start from. Try looking at JamesM's tutorials:
http://www.jamesmolloy.co.uk/tutorial_html/index.html - he shows you make a setup like that, one which I still use.
Re: Which Linux version?
Posted: Thu May 28, 2009 7:03 pm
by quanganht
I tried loopback device but it's readonly, which is no good.
EDIT: ah. I forgot some nice scripts on JM's page...
Re: Which Linux version?
Posted: Thu May 28, 2009 7:06 pm
by NickJohnson
Loopback should allow you to write to the file... you may have to use root/sudo though.
Re: Which Linux version?
Posted: Thu May 28, 2009 11:32 pm
by quanganht
I can't setup loop0. Used loop1 instead but it is read-only.
Re: Which Linux version?
Posted: Fri May 29, 2009 8:42 am
by Troy Martin
What happens when you try loop0? Paste it. And the results of loop1.
Re: Which Linux version?
Posted: Fri May 29, 2009 5:28 pm
by pcmattman
Also, there are literally hundreds of tutorials out there that will tell you how to mount a disk image using losetup. There's even tutorials that show how to mount
partitions of disk images using losetup. There's even
this article on the wiki. Googled and searched the wiki yet? I doubt it.
Re: Which Linux version?
Posted: Fri May 29, 2009 11:56 pm
by quanganht
If I didn't see that page, then how the hell i mounted my disk image???
Re: Which Linux version?
Posted: Sat May 30, 2009 12:39 am
by pcmattman
Searched Google for something along the lines of "losetup read only" yet? The wiki link was only part of my post.
Re: Which Linux version?
Posted: Sat May 30, 2009 3:38 am
by quanganht
I found the problem myself:
image_update.sh
Code: Select all
sudo losetup /dev/loop1 /home/quanganht/fd.img
sudo mount /dev/loop1 /mnt
sudo cp binary /mnt/boot
sudo umount /dev/loop1
sudo losetup -d /dev/loop1
It was because I forgot to add the file name needed to copy.
So, line 3 must be:
Code: Select all
sudo cp binary/kernel.bin /mnt/boot
Re: Which Linux version?
Posted: Sat May 30, 2009 3:59 am
by RevivalDBM
I find that Ubuntu, is not always the best beginner's distro, if you're a total newbie to the Linux concepts, but FreeSpire is more suitable, rather, though I use a form of Gentoo.
As for the losetup issue, just use "mount -o loop".
Re: Which Linux version?
Posted: Sat May 30, 2009 4:00 am
by ruisleipa
Couldn't you just do the following?