Which Linux version?

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.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Which Linux version?

Post 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.
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Which Linux version?

Post 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)
"Programmers are tools for converting caffeine into code."
User avatar
Coty
Member
Member
Posts: 286
Joined: Thu Feb 12, 2009 5:12 pm

Re: Which Linux version?

Post by Coty »

Ubuntu is great to start out with, and I love it.
My hero, is Mel.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Which Linux version?

Post 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.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Which Linux version?

Post 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.
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Which Linux version?

Post 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... :D
"Programmers are tools for converting caffeine into code."
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Which Linux version?

Post by NickJohnson »

Loopback should allow you to write to the file... you may have to use root/sudo though.
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Which Linux version?

Post by quanganht »

I can't setup loop0. Used loop1 instead but it is read-only.
"Programmers are tools for converting caffeine into code."
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Which Linux version?

Post by Troy Martin »

What happens when you try loop0? Paste it. And the results of loop1.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Which Linux version?

Post 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.
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Which Linux version?

Post by quanganht »

If I didn't see that page, then how the hell i mounted my disk image???
"Programmers are tools for converting caffeine into code."
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Which Linux version?

Post by pcmattman »

Searched Google for something along the lines of "losetup read only" yet? The wiki link was only part of my post.
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Which Linux version?

Post 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
"Programmers are tools for converting caffeine into code."
RevivalDBM
Member
Member
Posts: 34
Joined: Sun Aug 03, 2008 5:38 am

Re: Which Linux version?

Post 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".
ruisleipa
Member
Member
Posts: 46
Joined: Wed Sep 10, 2008 8:39 am
Location: Finland

Re: Which Linux version?

Post by ruisleipa »

Couldn't you just do the following?

Code: Select all

mount floppy.img -o loop /mnt
http://code.google.com/p/rmmtos/ - Real Mode MultiTasking Operating System
Post Reply