<br><br><div class="gmail_quote">On Tue, Nov 8, 2011 at 8:48 PM, Manish Katiyar <span dir="ltr"><<a href="mailto:mkatiyar@gmail.com">mkatiyar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, Nov 8, 2011 at 6:02 AM, Dan Luedtke <<a href="mailto:maildanrl@googlemail.com">maildanrl@googlemail.com</a>> wrote:<br>
> Thanks for all the answers!<br>
><br>
>> You need to look at other block-based file systems in the kernel sources in fs dir for examples and understand how they do it.<br>
> I looked at fs/minix/* fs/fat/* and peeked into fs/ext2/, but got more<br>
> confused so I decided to ask for a starting point.<br>
<br>
</div>Hi Dan,<br>
<br>
You may find <a href="https://github.com/mkatiyar/testfs" target="_blank">https://github.com/mkatiyar/testfs</a> helpful.<br>
<div><div></div><div class="h5"><br>
><br>
>> Also i think if you are interested in reading the first sector<br>
>> then you can probably check the block/genhd.c file<br>
>> get the disk (i.e struct genhd) then the partition (struct hdpart)<br>
>> you will be able to get the first sector.<br>
> Thanks, a well documented source file. However, shouldn't I get the<br>
> right partition (I called it block device in previously sent mails,<br>
> thought of e.g. /dev/sda2 as a device not a partition) from VFS when a<br>
> user requestes mounting it?<br>
><br>
>> That's an old assignment from my uni.<br>
> Wow, exactly what I needed! Thanks for this starting point.<br>
><br>
>> I would redirect you to learn about struct gendisk and struct bio.<br>
> Noted, I will take a look after studying the vvfs-files from Stephens link.<br>
><br>
>> Can you tell what are you trying to achieve?<br>
> I'd like to implement a filesystem as kernel modul (like fat, ext2,<br>
> ...). The filesystem is a very simple one, based on chained blocks<br>
> (similar to linked lists in c). I "invented" it when I tried to write<br>
> a bootloader that does not require a second stage to read an kernel<br>
> image. (This is all more or less a "because we can"-project, no<br>
> commercial background, just learning).<br>
><br>
> Once again, thank you guys!<br>
><br>
> Greetings,<br>
><br>
> Dan<br>
> --<br>
> Dan Luedtke<br>
> <a href="http://www.danrl.de" target="_blank">http://www.danrl.de</a><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Thanks -<br>
Manish<br>
</font></blockquote></div><br>Nice reference manish :)<br><br>Regards,<br>Rohan Puri<br>