ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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:
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.
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.
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.