Page 1 of 1

File System Implementation Trouble

Posted: Sun Mar 20, 2011 8:43 pm
by blackfireize
Hey guys, I am new to the forum but, I have been struggling with file systems in my very crude "Lino Commando" OS. Here are some details on the project:

- I am running Windows XP SP3
- I made the kernel in C used ASM for the GDT, IRQ, and GRUB for bootloader (Tools: DJGPP, NASM).
- I am using bochs to test the OS from a floppy image (.img) file.
- I have interrupts working, and a simple command line interface with three commands
- I have been trying for a long time to implement file system support, I have two possible file systems I might want to use, ISO 9660 (because I want the OS to be Live-CD), or FAT - 12/16/32 (because I have heard FAT is simple to implement)

Heres my problem: I have no idea how to implement a file system! I have read a lot of articles explaining the theory of file systems and possible C structures to use, and they are great! But none seem to touch base on implementation from the ground up. Can anyone provide any resources or shed some light on possible steps to take to implement one of the two file systems I mentioned? Thanks in advance, and great forum!

Re: File System Implementation Trouble

Posted: Sun Mar 20, 2011 9:18 pm
by thepowersgang
I would take a look at the idea of a "Virtual Filesystem" (check out the wiki)
Once you've created that, writing a driver for an existing filesystem should be relatively easy.

Re: File System Implementation Trouble

Posted: Sun Mar 20, 2011 9:19 pm
by Chandra
Did you check the wiki?

Re: File System Implementation Trouble

Posted: Sun Mar 20, 2011 9:29 pm
by xfelix
Building a Virtual File System First is a really good idea, because it's similar, easier, and fun.
I built a Virtual RAM based file system using a very simple library called FUSE (File system in USEr space) see http://fuse.sourceforge.net/
They have a good wiki page linked to the site I gave with examples of how to get started. The only problem is that you're going to need to
use a unix type environment (linux, mac, freebsd, etc)

Re: File System Implementation Trouble

Posted: Mon Mar 21, 2011 5:03 am
by blackfireize
xfelix wrote:Building a Virtual File System First is a really good idea, because it's similar, easier, and fun.
I built a Virtual RAM based file system using a very simple library called FUSE (File system in USEr space) see http://fuse.sourceforge.net/
They have a good wiki page linked to the site I gave with examples of how to get started. The only problem is that you're going to need to
use a unix type environment (linux, mac, freebsd, etc)
I am a total noob to file systems, thanks for help (I never bothered to look at Virtual file systems), but could I use cygwin on windows instead of my ubuntu box?

Re: File System Implementation Trouble

Posted: Mon Mar 21, 2011 7:05 am
by Tosi
No, as far as I know FUSE only works on Linux. If you have some form of it installed, then what's the point of trying to do it in Cygwin?

Re: File System Implementation Trouble

Posted: Mon Mar 21, 2011 7:08 am
by Combuster
The idea of FUSE is that you can write a FS implementation and then have others natively access it. You don't need it to just implement a filesystem - just provide a suitable interface to use which will obviously be different under cygwin or even native windows.

Re: File System Implementation Trouble

Posted: Mon Mar 21, 2011 7:25 am
by xfelix
Tosi wrote:No, as far as I know FUSE only works on Linux. If you have some form of it installed, then what's the point of trying to do it in Cygwin?
I was doing under graduate research for a class (http://lagoon.cs.umd.edu/classes/dfs-f10/) on distributed file systems. And the professor
was showing me stuff on a Mac, you can just use MacFUSE.

Re: File System Implementation Trouble

Posted: Mon Mar 21, 2011 3:09 pm
by blackfireize
Tosi wrote:No, as far as I know FUSE only works on Linux. If you have some form of it installed, then what's the point of trying to do it in Cygwin?
Well, when I tried to port it to Ubuntu, I kept getting a load of errors from the linker.

Re: File System Implementation Trouble

Posted: Mon Mar 21, 2011 6:14 pm
by Tosi
I was confusing FUSE with something else then, probably the read-only NTFS support in the linux kernel.
If you are trying to use FUSE under Ubuntu, then can't you install it with the package manager?

Re: File System Implementation Trouble

Posted: Tue Mar 22, 2011 5:24 am
by blackfireize
Tosi wrote:I was confusing FUSE with something else then, probably the read-only NTFS support in the linux kernel.
If you are trying to use FUSE under Ubuntu, then can't you install it with the package manager?
No, I meant porting the kernel source, and I have to remake the whole project anyway, so I don't think that I'll need to worry about file systems for a while.