Page 1 of 1

Help!

Posted: Wed Mar 12, 2003 6:30 am
by nuno_silva_pt
can anyone tell me links about making filesystems?
and how can i make memory management aplications?

Re:Help!

Posted: Wed Mar 12, 2003 7:34 am
by distantvoices

Re:Help!

Posted: Fri Mar 14, 2003 7:54 am
by Pype.Clicker
i suggest you start reading http://members.tripod.com/~averstak/fatdox/00dindex.htm, which seems to be a good tutorial on how FAT filesystem works. As FAT is -- afaik -- the simplest file system ever, i suggest you train yourself by reimplementing one.

But before you start coding, you should learn how disks work in general (http://www.nondot.org/sabre/os/articles ... iscDrives/), except if you decide to work on a ramdisk (i.e. a simulated disk in memory).

Filesystem in general have to solve 2 problems:
  • for a given filename, create a structure that will be used to access the file (the file handle,
  • for a given file handle, read from/write to the file.
A possible file handle under FAT would include the sector number for the first cluster of the file, the sector number for the current sector, the size of the file, the logical position in the file and a memory cache for the current sector.

Creating this handle is trivial once you know how to read the entry from the FAT directory structure, so all you have to worry about is how to update it when a read() or write() is issued.