Author Topic: Knight Filesystem Specification  (Read 15022 times)

0 Members and 5 Guests are viewing this topic.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Knight Filesystem Specification
« Reply #15 on: September 28, 2010, 09:43:53 pm »
What wears a flash chip is erasing it (setting all the 0 bits back to 1's)
However, having it clean up after each deletion rather than all at once would be slower and yes, it would probably wear the flash more.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Knight Filesystem Specification
« Reply #16 on: September 28, 2010, 10:08:15 pm »
I'm thinking of doing a garbage collection at boot, to avoid locking up the entire system for a garbage collection while saving a file.  Thoughts?

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Knight Filesystem Specification
« Reply #17 on: September 28, 2010, 10:12:32 pm »
Well, how long will a garbage collection take? If it's no more than ~30sec, I see no problem in making it an atomic operation, IMO.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Knight Filesystem Specification
« Reply #18 on: September 28, 2010, 10:13:33 pm »
I would estimate it at 10-20 seconds.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Knight Filesystem Specification
« Reply #19 on: September 28, 2010, 10:17:39 pm »
At least IMO it's fine. It's not like they'll happen at a very great frequency anyway... and since you can completely pause any running program (or, more advanced, just those that are using files in the FS being garbage collected ;)) it doesn't seems like it'd be too bad.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Knight Filesystem Specification
« Reply #20 on: September 28, 2010, 10:19:29 pm »
Ooo, it might be a good idea to freeze file streams when garbage collections are in progress, instead of only allowing one file at a time.  This is something I've been struggling with: how to edit multiple files at once?  I know I will probably use filestreams to make it easier on the user to cross page boundaries and such.  But I'm still not sure how to handle multiple pages.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Knight Filesystem Specification
« Reply #21 on: September 28, 2010, 10:24:30 pm »
Ooo, it might be a good idea to freeze file streams when garbage collections are in progress, instead of only allowing one file at a time.
Elaborate, please, I'm confused. ???
Quote
This is something I've been struggling with: how to edit multiple files at once?
What's getting in your way?
Quote
I know I will probably use filestreams to make it easier on the user to cross page boundaries and such.
Do programs handle flash almost directly, or am I misunderstanding?
Quote
But I'm still not sure how to handle multiple pages.
As above, but also, sectors might be a worry too.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Knight Filesystem Specification
« Reply #22 on: September 28, 2010, 10:26:53 pm »
I think that a solution to the multiple files problem is making programs define the size beforehand.  As for programs handling flash directly, I would prefer they use filestreams in the OS to handle it, because the OS will handle the page boundaries.  A filestream is a means to reading and writing files or memory, or in KOSes case, only files.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Knight Filesystem Specification
« Reply #23 on: September 28, 2010, 10:31:02 pm »
You still haven't answered my question of how are multiple files a problem. :P
Also, I thought you earlier had an idea of "edit buffers" or something like that where programs edited pieces of a file one piece at a time in RAM. Was that scrapped?
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Knight Filesystem Specification
« Reply #24 on: September 28, 2010, 10:47:28 pm »
It will probably be scrapped, seeing as most files will probably end up being too big.  I don't want to edit files that take up most of available RAM.  In KFS, three bytes are dedicated to filesize, and I want to make sure I support that.
As for editing multiple files, if two files are growing in flash alongside each other, there will be significant problems unless I garbage collect every time a byte is written.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Knight Filesystem Specification
« Reply #25 on: September 28, 2010, 10:50:50 pm »
Why would you be garbage collecting? If one file encroaches on another, you'll have to delete and move it (unless you can't ???), and I recommend you make provisions to be able to skip a certain amount of extra space after file to prevent what you and I described from happening :)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Knight Filesystem Specification
« Reply #26 on: September 28, 2010, 10:51:39 pm »
Delete+move would mean that the garbage would pile up very quickly.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Knight Filesystem Specification
« Reply #27 on: September 28, 2010, 10:53:04 pm »
Definitely, hence why I recommend providing extra space at the end of a file :D (And make sure you don't update the size byte in flash until the file is closed :P)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Knight Filesystem Specification
« Reply #28 on: September 28, 2010, 10:55:49 pm »
Yeah, I'm not sure about that.  I'll think it over for a bit.  Imagine if two programs were writing large files, multi-page, perhaps.  It might garbage collect 10 times over the course of saving them.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Knight Filesystem Specification
« Reply #29 on: September 28, 2010, 10:59:31 pm »
Garbage collecting at boot seems like a good idea, as long as it won't wear the flash chip faster if it garbage collects even when the memory is not very fragmented

Keep up the good work on KnightOS :D