Making custom FS is ****!!!!

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

Making custom FS is ****!!!!

Post 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)
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Making custom FS is ****!!!!

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Making custom FS is ****!!!!

Post 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.
Every good solution is obvious once you've found it.
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Making custom FS is ****!!!!

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Making custom FS is ****!!!!

Post 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.
Every good solution is obvious once you've found it.
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: Making custom FS is ****!!!!

Post 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
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
User avatar
pauldinhqd
Member
Member
Posts: 37
Joined: Tue Jul 12, 2011 9:14 am
Location: Hanoi
Contact:

Re: Making custom FS is ****!!!!

Post 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.
AMD Sempron 140
nVidia GTS 450
Transcend DDR2 2x1
LG Flatron L1742SE
LindusSystem
Member
Member
Posts: 63
Joined: Sat Apr 28, 2012 9:41 am
Location: Earth -> Asia

Re: Making custom FS is ****!!!!

Post 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. :D
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
User avatar
pauldinhqd
Member
Member
Posts: 37
Joined: Tue Jul 12, 2011 9:14 am
Location: Hanoi
Contact:

Re: Making custom FS is ****!!!!

Post 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. :D
That is a big drawback. Consider re-designing the FS for extensibility.
AMD Sempron 140
nVidia GTS 450
Transcend DDR2 2x1
LG Flatron L1742SE
Post Reply