LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-09-2007, 03:29 PM   #1
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Rep: Reputation: 47
Integrating a filesystem into linux kernel


Where to begin.... First off I am not asking anyone to do anything for me or for anyone to give me in depth instructions for what I want hear, this is me asking for people who know wher eI can find the information I need, I am willing to do the legwork.

*added* for this to work I have been assuming that a filesystem accessing a drive see's the drive basically as one big array and there is the ability to read/write chunks of that array... if this is inaccurate I have a problem. *added*

I have an idea for how I would like to organise data across a hard drive... As such I am interested in writing the code for this. I am confident in my ability to write a program to do what I want using a file instead of a hard drive, treating the file as the hard drive surface.... however If it turns out to work the way I want I would be interested in trying to actually use it as a filesystem... this is where it breaks down... I am wondering if anyone can point out some documents, tutorials, etc. that contain the information or reference material necessary to learn how to integrate a filesystem into the kernel... I am not a kernel programmer, and quite frankly I am not interested in all the extra stuff a kernel has to do, I am only interested in the stuff necessary to integrate a filesystem into it.

Assuming at this point I would have a working codebase that when given a file of a static size it can organise data and files into that file.

Last edited by exodist; 01-09-2007 at 03:37 PM.
 
Old 01-09-2007, 03:38 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Not sure on this but you might be able to build a filesystem on top of the Fuse interface. Might look at ntfs-3g and sshfs. They run on top of the Fuse interface.

Brian
 
Old 01-09-2007, 03:43 PM   #3
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Original Poster
Rep: Reputation: 47
At this point my biggest concern is how to interface with the drive, how to request a chunk of data, and how to write a chunk back, then comes the how to mount and unmount it (ie what functions I need to provide, what stuff I need to write, etc.The inbetween stuff is what I am gonna write.
 
Old 01-09-2007, 04:23 PM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
If you use FUSE fully, you just tell it how to do basic file operations on your file system. Mounting is problem of kernel, proper kernel interface (constantly changing!) is FUSE problem - not yours. And you are in user space - do not forget performance and memory usage, something can try to rely on your file system running without coffee breaks, but never mind 4K stack or absence of some library.

You can download FUSE distribution (it is in your kernel, but you need user space utilities, and even if your distribution ships them, there are two simple examples!)

About reading disk: first I would create a dumb FAT32 partition, put a big file there and work with it. It's easier (in terms of absence of caveats), and as file size never changes FAT32 will handle this only file with little effort. Do not forget to flush() it. As far as I understand, block device is just a file - you can open() it and seek() on it. Then read(). Nevertheless, check 'dd' source in coreutils distribution.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba: Integrating Linux and Windows Lucky13 Linux - Newbie 1 12-12-2006 12:02 PM
Minix V3 filesystem now supported by Linux kernel pistachio Other *NIX 0 01-15-2006 04:34 AM
Integrating Windows AD and Linux markham82 Linux - Networking 1 11-15-2004 03:32 PM
How to enable linux filesystem capabilities for kernel 2.24.18 toubo Linux - General 8 08-20-2004 10:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration