<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi,</p>
<p>You don't have to write a kernel module (which would better be
written in C), you can do everything in userspace and in Haskell
with FUSE: <a class="moz-txt-link-freetext" href="https://en.wikipedia.org/wiki/Filesystem_in_Userspace">https://en.wikipedia.org/wiki/Filesystem_in_Userspace</a><br>
It seems to already have Haskell bindings:
<a class="moz-txt-link-freetext" href="https://hackage.haskell.org/package/HFuse-0.2.4.5/docs/System-Fuse.html">https://hackage.haskell.org/package/HFuse-0.2.4.5/docs/System-Fuse.html</a><br>
<br>
To implement the file system operations, you can use binary
(<a class="moz-txt-link-freetext" href="https://hackage.haskell.org/package/binary">https://hackage.haskell.org/package/binary</a>), Foreign.Ptr,
Data.Bits, etc. You can write data on any real partition by using
the associated block devices (e.g., /dev/sda1).<br>
</p>
Sylvain<br>
<br>
<div class="moz-cite-prefix">On 09/05/2016 20:50, Silent Leaf wrote:<br>
</div>
<blockquote
cite="mid:CAGFccjN27gA1-vFf_igUCi6SNY_PONEUtDzBn2yF904Jec15Rw@mail.gmail.com"
type="cite">Mostly all in the title.<br>
<br>
I have a project of developing a personal filesystem, possibly at
first virtual (the file(s) representing a virtual partition
formatted with my filesystem, would be saved in a host filesys, eg
ext4 or whatever), but probably in the end not virtual, directly
working on the contents of a real partition.<br>
<br>
Can haskell do that kind of thing, aka writing data on a partition
directly (without using a known filesys), etc? Is it at least more
or less adapted for this task (not talking about performances,
unless the consequences be a *really* slow filesys), aka doable,
easily doable, relatively speaking (aka not worse than with
another language)?<br>
Incidentally, if i wanted Linux to recognize the filesys, i've
heard one has to write a module and put it in connection with the
kernel or something. could haskell do that?<br>
<br>
if that's a "no" somewhere for one of my questions, which parts
can't be written in haskell (without horrible performances or code
very very hard to write), and can they be written in C (or
whatever) as foreign functions? which parts would that represent
for the whole program?<br>
<br>
Thanks a lot in advance!<br>
<br>
PS: just in case, tips on sources of information on how to do any
of the above will be extremely appreciated! (even if it's in, say
C, for that matter, providing there's a way to translate the steps
into a haskell program)
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@haskell.org">Beginners@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a>
</pre>
</blockquote>
<br>
</body>
</html>