File System Implementation Trouble

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
blackfireize
Posts: 16
Joined: Sun Mar 20, 2011 8:19 pm

File System Implementation Trouble

Post 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!
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: File System Implementation Trouble

Post 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.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: File System Implementation Trouble

Post by Chandra »

Did you check the wiki?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
xfelix
Member
Member
Posts: 25
Joined: Fri Feb 18, 2011 5:40 pm

Re: File System Implementation Trouble

Post 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)
The More I See, The More I See There Is To See!
blackfireize
Posts: 16
Joined: Sun Mar 20, 2011 8:19 pm

Re: File System Implementation Trouble

Post 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?
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: File System Implementation Trouble

Post 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?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: File System Implementation Trouble

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
xfelix
Member
Member
Posts: 25
Joined: Fri Feb 18, 2011 5:40 pm

Re: File System Implementation Trouble

Post 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.
The More I See, The More I See There Is To See!
blackfireize
Posts: 16
Joined: Sun Mar 20, 2011 8:19 pm

Re: File System Implementation Trouble

Post 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.
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: File System Implementation Trouble

Post 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?
blackfireize
Posts: 16
Joined: Sun Mar 20, 2011 8:19 pm

Re: File System Implementation Trouble

Post 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.
Post Reply