OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 9:12 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: File System Implementation Trouble
PostPosted: Sun Mar 20, 2011 8:43 pm 
Offline

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


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Sun Mar 20, 2011 9:18 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 25, 2007 6:03 am
Posts: 734
Location: Perth, Western Australia
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


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Sun Mar 20, 2011 9:19 pm 
Offline
Member
Member
User avatar

Joined: Sat Jul 17, 2010 12:45 am
Posts: 487
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 !


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Sun Mar 20, 2011 9:29 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 18, 2011 5:40 pm
Posts: 25
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!


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Mon Mar 21, 2011 5:03 am 
Offline

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


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Mon Mar 21, 2011 7:05 am 
Offline
Member
Member

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

_________________
Getting_Started on the wiki
x86 technical information
Interrupt Jump Table
Real Programmers Don't Use Pascal
My open-source projects


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Mon Mar 21, 2011 7:08 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
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 ]


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Mon Mar 21, 2011 7:25 am 
Offline
Member
Member
User avatar

Joined: Fri Feb 18, 2011 5:40 pm
Posts: 25
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!


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Mon Mar 21, 2011 3:09 pm 
Offline

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


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Mon Mar 21, 2011 6:14 pm 
Offline
Member
Member

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

_________________
Getting_Started on the wiki
x86 technical information
Interrupt Jump Table
Real Programmers Don't Use Pascal
My open-source projects


Top
 Profile  
 
 Post subject: Re: File System Implementation Trouble
PostPosted: Tue Mar 22, 2011 5:24 am 
Offline

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 61 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group