gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > Corruption of a full memory card

#136057 - calcprogrammer1 - Sat Jul 28, 2007 8:05 pm

I use DSFTP a lot, but unfortunately I don't think it knows when the card is full. I think I wrote too much stuff to my card and it corrupted some folders...it still boots but some folder names show up weird in DSOrganize.
_________________
DS Firmware 1, Datel Games n' Music card / Chism's FW hacked GBA MP v2 CF

There's no place like 127.0.0.1.

#136127 - pas - Sun Jul 29, 2007 3:16 pm

That's what's my problem sometimes too... I wished there would be some way to get shown the space left like windows does (although DM said it would be impossible to do so).

Moonshell can show the size of folders, so what about an easy calc ? Don't punish me for giving Ideas that will never work, I just think out loud ^^.
_________________
Starcraft DS ?

#136139 - dantheman - Sun Jul 29, 2007 5:02 pm

The only way I know of to determine the amount of remaining space on a card from the DS itself is to open DSLinux and type "df"

#136143 - tepples - Sun Jul 29, 2007 5:46 pm

That or do the following:
  1. sync the file system,
  2. read the boot sector with disc_io to get the volume size, cluster size, and starting sector of the FAT,
  3. read the FAT with disc_io, counting the clusters that are set to the "free" value, and
  4. stop when you're sure that enough clusters are free.
Should I try to implement this in C for the benefit of readers?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#136144 - calcprogrammer1 - Sun Jul 29, 2007 5:59 pm

tepples wrote:
Should I try to implement this in C for the benefit of readers?


Only if it would be implemented in the applications used most often. If it were implemented in DSOrganize, DSFTP, MoonShell, etc, then it would be useful. You should check with the developers of these applications or post this error in their topics on DS Homebrew Announcements.
_________________
DS Firmware 1, Datel Games n' Music card / Chism's FW hacked GBA MP v2 CF

There's no place like 127.0.0.1.

#136165 - Galactic Lord Xenu - Sun Jul 29, 2007 9:10 pm

dantheman wrote:
As laptops are unlikely to have the wireless cards needed for WMB, your main options are DSFTP and Lilou FTP. There's also a few wifiloaders that load games into RAM before execution without writing to the card. You could also use HTTPexec in a pinch if you rename files often.


I've experienced file corruption with Lilou FTP.

#136166 - wandafritsch - Sun Jul 29, 2007 9:13 pm

calcprogrammer1 wrote:
Only if it would be implemented in the applications used most often. If it were implemented in DSOrganize, DSFTP, MoonShell, ...

.... and not to forget DSFileBrowser.

;-)

#136167 - wandafritsch - Sun Jul 29, 2007 9:14 pm

tepples wrote:
Should I try to implement this in C for the benefit of readers?

Yes, please!

I just decided to start DS programming. (That means start learning...)
Could you please do a little example how to use this as a tiny standalone app?

:-)

#136181 - pas - Sun Jul 29, 2007 10:21 pm

@dantheman: if I open dslinux and type df then it says df not found. What build are you using ?
_________________
Starcraft DS ?

#136190 - Galactic Lord Xenu - Sun Jul 29, 2007 11:58 pm

Question: You use DSFTP a lot... and it doesn't freeze? I can't get the thing stable.

#136934 - dantheman - Mon Aug 06, 2007 5:29 pm

pas wrote:
@dantheman: if I open dslinux and type df then it says df not found. What build are you using ?


I'm using the DLDI build downloaded a couple of weeks ago. It might have been disabled since then, though I don't know why it would have been. You're not getting any "syntax errors" upon bootup, are you?

#137238 - wandafritsch - Thu Aug 09, 2007 9:00 am

calcprogrammer1 wrote:
tepples wrote:
Should I try to implement this in C for the benefit of readers?

Only if it would be implemented in the applications used most often. If it were implemented in DSOrganize, DSFTP, ....


The right place to implement is the libfat, isn't it.

Every potentially harmful file handling - like copy/paste, make/store,... -
should check for enough place left beforehand, I think.

!-)

#137243 - tepples - Thu Aug 09, 2007 12:12 pm

wandafritsch wrote:
The right place to implement is the libfat, isn't it.

Yes, and wintermute agrees. However, I've been having some trouble getting a hold of chishm due to the 14 hour time zone difference between Fort Wayne and Canberra.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#137247 - wandafritsch - Thu Aug 09, 2007 2:18 pm

tepples wrote:
Should I try to implement this in C for the benefit of readers?

A little standalone tool is still interesting,
because it will take a long time until all
apps will use a lib-function!

:-)

#137273 - tepples - Thu Aug 09, 2007 7:53 pm

wandafritsch wrote:
tepples wrote:
Should I try to implement this in C for the benefit of readers?

A little standalone tool is still interesting

I wish I could. I started to write one, but I stopped once I read the source code of libfat and realized that it does not expose any APIs for low-level access to the boot sector and FAT. I've managed to talk wintermute and chishm into implementing at least a useful subset of the POSIX function statvfs, which takes a path, looks at what file system it sits on (e.g. SLOT-1 or SLOT-2), and returns information about the cluster size, number of clusters, and number of remaining clusters on this file system. Once that happens, I'll be able to write an app that can show this information to the user.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#137297 - dantheman - Fri Aug 10, 2007 12:12 am

Would the hacked libfat used for MCtool be of any use to you?
http://forum.gbadev.org/viewtopic.php?t=12315
http://forum.gbadev.org/viewtopic.php?t=12114