OSDev.org

The Place to Start for Operating System Developers
It is currently Mon May 20, 2024 10:29 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Filesytem, cool thing I just realized about mine.
PostPosted: Sun Feb 22, 2009 8:27 pm 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
Anyway, I just thought I'd let everybody know. The RWFS filesystem that I've been working on, apparently can handle 536862719.75000381 exabytes of disk space at on one partition! Simply by using the computers ability to calculate, instead of listing. Anyway, it's not done yet but I thought it was pretty cool.

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Mon Feb 23, 2009 9:44 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
First of all, instead of trying to manage the whole hard disk as just a series of blocks. I decided to split it into even larger divisions called block sections. These sections have no characteristics other than number, and files can stretch across any number of block sections. They are really only used to calculate logical addresses. I'm kinda stuck for time right now so more later... :D

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Mon Feb 23, 2009 2:51 pm 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
Also, it uses 32 bit multiplication to represent id's and blocks and such. So It's main limitation is what the operating system is willing to calculate 64 bit 128 bit etc.

EDIT:
Code:
/*Copyright (C) Kristian Hart 2009

typedef struct
{
    unsigned short version_id; //allow for reading different versions of the filesystem
    unsigned short system_id;//id that an operating system can use to know what os the filesystem originated on
    unsigned short m_ownerid;//the id of the person who is admin of the filesystem
    unsigned short sector_size;// size of a sector in bytes
    unsigned short  blocksize;//the size of a block in the fs in number of sectors
    unsigned int   blocksections;//number of block sections
    unsigned int   num_file_entry_blocks;
}FS_DESCRIPTOR;//structure that defines a filesystems characteristics

typedef struct
{
    unsigned int idbase;//directory id base
    unsigned int idcalc;// a number to multiply the idbase by to get the actual id(usually 1 on small trees)
    unsigned int parent_idbase;
    unsigned int parent_idcalc;
    char         name[20];
}DS_DENTRY;//defines an entry in the directory tree

typedef struct
{
    unsigned int blocksection;
    unsigned int blockstart;// start block
    unsigned int blocks;//consecutive blocks in the array entry
}BLOCK_ARRAY_ENTRY;//enty in a list of blocks

typedef struct
{
    unsigned char system;//bits the system uses for characteristics
    char name[20];
    unsigned int parent_idbase;//id base of the parent folder
    unsigned int parent_idcalc;//id calc of the parent folder
    unsigned int num_barray_blks;// number of block entry array blocks (they are always consecutive)
    unsigned int blocksection;//the blocksection the array is in
    unsigned int blockstart;//first block in the array
}FD_ENTRY;//file descriptor entry


This should give you an idea of how it works. The filesytem is designed so that information is really only given as needed to find the files.

EDIT 2:
I think I've gotten into the habit of extreme commenting.... :twisted:

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Thu Feb 26, 2009 5:51 am 
Offline
Member
Member
User avatar

Joined: Sun Feb 22, 2009 9:15 am
Posts: 50
happens to all of us at some point :lol:
btw where can i find some tutorial for a barebone filesystem that i can build on? :D

_________________
One Tequila, Two Tequila, Three Tequila, Floor!


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Thu Feb 26, 2009 7:51 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
I've almost got a disk image program for it working. :D
I wonder, has anyone used this technique to allow this much storage so far?

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Thu Feb 26, 2009 9:53 am 
Offline
Member
Member
User avatar

Joined: Fri Apr 18, 2008 4:40 pm
Posts: 1686
Location: Langley, Vancouver, BC, Canada
I might like to implement it for floppy storage in TBOS now that I've read over some existing FAT12 code.

_________________
Image
Image
Solar wrote:
It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.

I wish I could add more tex


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Thu Feb 26, 2009 11:42 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
Wondering, would an article about this particular filesystem be wanted for the wiki? At least, once I get my kernel to boot from it. :D

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Sat Feb 28, 2009 3:01 pm 
Offline
Member
Member
User avatar

Joined: Sat Feb 28, 2009 11:43 am
Posts: 80
Using it in my OS!

_________________
Current work on a OS: SauOS (project homepage: http://code.google.com/p/sauos/)
Image


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Sat Feb 28, 2009 7:33 pm 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
Use it as you like, I only ask that you make mention of me in your OS design or code.

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Sun Mar 01, 2009 5:07 pm 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
Not to advertise my os (as it is only just starting), but the design for the fs (the layout that is) is at http://code.google.com/p/leviathanv/ in the wiki.

EDIT: It's not complete but it will give you an idea of how the fs is a arranged.

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Mon Mar 02, 2009 7:53 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
Actually I'm rethinking that. Wondering, around what percent of sectors are usually bad?
EDIT: If it's a relatively small amount, I can just list bad sectors in a table.

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Mon Mar 02, 2009 9:09 am 
Offline
Member
Member

Joined: Sun Nov 09, 2008 2:55 am
Posts: 524
Location: Pennsylvania, USA
Wikipedia agrees:

[quote=Wikipedia]A modern hard drive comes with many spare sectors. When a sector is found to be bad by the firmware of a disk controller, the disk controller remaps the logical sector to a different physical sector.[/quote]

So I wouldn't worry about bad sectors. You'll probably end up blacklisting sectors that the firmware later remaps and repairs.


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Mon Mar 02, 2009 9:37 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
Ah, the reason I was worrying about bad sectors was that Tanenbaum's book says that not all hard disks do that. So I'm cutting that section out of the filesystem.

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Mon Mar 02, 2009 9:09 pm 
Offline
Member
Member
User avatar

Joined: Wed Mar 05, 2008 9:10 pm
Posts: 391
I have now the fully revised version 1 of the RWFS filesystem. Check the wiki at http://code.google.com/p/leviathanv/wiki/RWFS for the updated structures(Really only one small addition to the FS_DESCRIPTOR structure). I added an entry for allocating free blocks.

EDIT: Once, I have the filesystem implemented in an image program and have my kernel booting, I'll try to add a complete article on implementing it in the OSDEV wiki. :D

_________________
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc


Top
 Profile  
 
 Post subject: Re: Filesytem, cool thing I just realized about mine.
PostPosted: Mon Mar 02, 2009 9:58 pm 
Offline
Member
Member
User avatar

Joined: Fri Apr 18, 2008 4:40 pm
Posts: 1686
Location: Langley, Vancouver, BC, Canada
nekros wrote:
Once, I have the filesystem implemented in an image program and have my kernel booting, I'll try to add a complete article on implementing it in the OSDEV wiki. :D

Please do, and if possible, make the source for the image program available so we can compile it and simplify making images with the FS onboard :)

_________________
Image
Image
Solar wrote:
It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.

I wish I could add more tex


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group