Page 1 of 1
Making custom FS is ****!!!!
Posted: Tue May 15, 2012 10:33 am
by LindusSystem
I have made my own detailed File System(Random Stuff is there).I have the code for it, but I want to make a disk image(*.img) with my File System and I want to copy the kernel files into it.But (I use Windows)Windows dose not recognise such partitions.
My QUestion!
Can i use the FS Code in my OS and complie it for Windows so that Windows supports my FS and also I can copy,delete files(Function are there to delete,create,copy,etc).
Or is there another way?
I am just aiming to prepare a disk image with my FS installed.
(1 thing my friend told was to make the partition and save it to HDD while I run my OS, I am tooooo(100 'o's) far back to read HDD, but I want to use my FS Only)
EDIT: (The four *s are "S H I T", I dont use any low-level words except S HIT)
Re: Making custom FS is ****!!!!
Posted: Tue May 15, 2012 10:51 am
by bluemoon
LindusSystem wrote:My QUestion!
Can i use the FS Code in my OS and complie it for Windows so that Windows supports my FS and also I can copy,delete files(Function are there to delete,create,copy,etc).
Sure, consult Windows DDK or FUSE for detail. However I think writing windows driver or FUSE develpment is out of this forum scope.
LindusSystem wrote:Or is there another way?
Most people use existing tool or write their own tool to manipulate the raw image; or better yet, use a supported file systems(FAT,EXT2, SFS, or even tar) in early stage of development.
To manipulate a raw image, you just fread/fwrite with the proper offset.
Re: Making custom FS is ****!!!!
Posted: Wed May 16, 2012 1:25 am
by Solar
The file system API in your OS and the one used by other operating systems are most likely too different from each other to make this a simple task, unless you actively designed your FS code in such a modular way as to allow optimal re-use of components.
If I were you, I'd write up a tool that can do basic operations on "image with CustomFS" - list, delete-from, copy-into - in portable C/C++. That way, anyone on any OS in the world can handle images with CustomFS, and you don't have to bother with any specific OS' FS API.
Re: Making custom FS is ****!!!!
Posted: Wed May 16, 2012 2:32 am
by turdus
I've created a very simple tool written in C to manage disk images with my fs. It's called mkfs (what a surprise). You can use it like
Code: Select all
mkfs create (partitiondefs)
mkfs mkdir (path/name)
mkfs addfile (path/name) (local file)
mkfs addsymlink (path/name) (linked)
mkfs addhardlink (path/name) (linked)
...etc.
To create given partitions (MBR+GPT), to create a directory, copy a file into it etc. I call it from Makefiles after link, like
Code: Select all
@${CC} ${OBJS} -o myfile.bin
@mkfs addfile /bin/myfile myfile.bin
So when an object file is recompiled, it will be updated in image immediately.
Re: Making custom FS is ****!!!!
Posted: Wed May 16, 2012 4:04 am
by Solar
Pretty much exactly what I had in mind. Since this doesn't require anything beyond fopen() / fread() / fwrite() / fseek() / fclose(), you can write this tool once and use it on whatever host OS you please.
Re: Making custom FS is ****!!!!
Posted: Wed May 16, 2012 6:48 am
by Yoda
There is another solution for accessing image under Windows. If you use Total Commander, then you can write a simple plugin for it for accessing your image file with your own FS. I mean "packer plugin API", but actually it doesn't need to pack anything. There is demo code also for download.
http://www.ghisler.com/plugins.htm
Re: Making custom FS is ****!!!!
Posted: Sun May 20, 2012 9:20 pm
by pauldinhqd
LindusSystem wrote:I have made my own detailed File System(Random Stuff is there).I have the code for it, but I want to make a disk image(*.img) with my File System and I want to copy the kernel files into it.But (I use Windows)Windows dose not recognise such partitions.
My QUestion!
Can i use the FS Code in my OS and complie it for Windows so that Windows supports my FS and also I can copy,delete files(Function are there to delete,create,copy,etc).
Or is there another way?
I am just aiming to prepare a disk image with my FS installed.
(1 thing my friend told was to make the partition and save it to HDD while I run my OS, I am tooooo(100 'o's) far back to read HDD, but I want to use my FS Only)
EDIT: (The four *s are "S H I T", I dont use any low-level words except S HIT)
Build yourself a specific FS binding tool since the FS you created is not understood by any other software.
The same thing to my case, I'm creating a custom FS, and so, I create a binding tool for joining the files in an NTFS folder to put into the image file.
Re: Making custom FS is ****!!!!
Posted: Sun May 20, 2012 10:54 pm
by LindusSystem
I made my tool, it just writes sectors to an image file, but it skips the first 5 sectors(That is my FS stuff there) and adds an entry to the 5 sectos of the new file.
One disadvantage of my FSis it suports maximum of 16 folders and 128 files.I never read any book of FS,I randomly made it.
Re: Making custom FS is ****!!!!
Posted: Sun May 20, 2012 11:05 pm
by pauldinhqd
LindusSystem wrote:
One disadvantage of my FSis it suports maximum of 16 folders and 128 files.I never read any book of FS,I randomly made it.
That is a big drawback. Consider re-designing the FS for extensibility.