mirror of
https://github.com/psankar/simplefs.git
synced 2025-07-23 22:15:03 +02:00
A simple filesystem to understand things. This is a Work In Progress. Do not use this yet. The source files are licensed under Creative Commons Zero License. More information at: http://creativecommons.org/publicdomain/zero/1.0/ Full license text at: http://creativecommons.org/publicdomain/zero/1.0/legalcode To compile: ------------ install linux kernel sources and run make from the checkedout directory. To test: --------- psankar@linux-9dni:~/src/simplefs> make psankar@linux-9dni:~/src/simplefs> dd bs=4096 count=100 if=/dev/zero of=image 100+0 records in 100+0 records out 409600 bytes (410 kB) copied, 0.00106026 s, 386 MB/s psankar@linux-9dni:~/src/simplefs> ./mkfs-simplefs image Super block written succesfully root directory inode written succesfully welcomefile inode written succesfully inode store padding bytes (after the two inodes) written sucessfully root directory datablocks (name+inode_no pair for welcomefile) written succesfully padding after the rootdirectory children written succesfully welcomefilebody has been written succesfully psankar@linux-9dni:~/src/simplefs> Now as root: linux-9dni:/home/psankar/src/simplefs # insmod simplefs.ko ; mount -o loop -t simplefs image /home/psankar/src/simplefs/mount/ ; dmesg [51422.091945] Sucessfully registered simplefs [51422.094713] The magic number obtained in disk is: [268640275] [51422.094719] simplefs filesystem of version [1] formatted with a block size of [4096] detected in the device. [51422.094744] simplefs is succesfully mounted on [/dev/loop5] linux-9dni:/home/psankar/src/simplefs # cat mount/vanakkam Love is God. God is Love. Anbe Murugan. linux-9dni:/home/psankar/src/simplefs # cp mount/vanakkam . linux-9dni:/home/psankar/src/simplefs # cat vanakkam Love is God. God is Love. Anbe Murugan. linux-9dni:/home/psankar/src/simplefs # umount mount; rmmod simplefs.ko ; dmesg [51422.091945] Sucessfully registered simplefs [51422.094713] The magic number obtained in disk is: [268640275] [51422.094719] simplefs filesystem of version [1] formatted with a block size of [4096] detected in the device. [51422.094744] simplefs is succesfully mounted on [/dev/loop5] [51469.971919] simplefs superblock is destroyed. Unmount succesful. [51469.977426] Sucessfully unregistered simplefs linux-9dni:/home/psankar/src/simplefs #
Description
Languages
C
92.7%
Shell
6.5%
Makefile
0.8%