Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > Requests > Undelete/unformat on disk images command-line tool
2021-11-28 11:44
Krill

Registered: Apr 2002
Posts: 2980
Undelete/unformat on disk images command-line tool

Claus and i are planning to add an undelete/unformat option to cc1541.

This would find files (or fragments of files) in disk images that aren't listed in the directory, then re-add them (possibly with a synthetic name) and mark their blocks as used.

In order to avoid re-inventing the wheel...

Does such a tool exist already? Does it work well? Could it do anything better? Is it open-source? Has it been thrown at the entire CSDb corpus? =)
 
... 6 posts hidden. Click here to view all posts....
 
2021-12-30 15:38
Claus_2015

Registered: Oct 2012
Posts: 53
Ok, it's cc1541 so we might want to provide more control than other tools. My suggestion is to have 4 levels of restore to chose from:

level 0: Fix dir entries for files with valid t/s chains.
level 1: Also add wild sector chains with valid t/s chains.
level 2: Also fix dir entries with invalid t/s chains (i.e. terminate the t/s chain).
level 3: Also add and fix wild invalid t/s chains (i.e. terminate the t/s chain).
level 4: Only restore all dir entries without touching any t/s links.

Wild means no reference from any scratched dir entry. Level 4 would be the advanced Krill level, while the other levels would cater the mere mortals :-).
2021-12-30 16:20
chatGPZ

Registered: Dec 2001
Posts: 11386
What about a mode that also restores single block files... put their "loadaddress" into the filename so its easy to see which could be legit files (perhaps extra mode to only restore those that have $0801)
2021-12-30 16:29
Krill

Registered: Apr 2002
Posts: 2980
Not so sure about the levels. 1 does more than 0, 2 does more than 1, etc., but 4 does less than... 2? =)
2021-12-30 17:12
Claus_2015

Registered: Oct 2012
Posts: 53
For single block files: how would you differentiate them from trash? By a track link of 0? Seems this might create many trash files, or?

Levels: true, I also thought about this. Level 4 somehow does not fit into the row. Maybe I call them modes, then it doesn't have to :-)?
2021-12-30 17:19
JackAsser

Registered: Jun 2002
Posts: 2014
What about hidden t/s chains that actually occupy the dir entry blocks you’re about to write? Care must be taken here.
2021-12-30 17:21
Krill

Registered: Apr 2002
Posts: 2980
Quoting Claus_2015
For single block files: how would you differentiate them from trash? By a track link of 0? Seems this might create many trash files, or?
If the block doesn't have a valid T/S link (and isn't linked to), the DOS wouldn't load it anyways, so there's little value in having a directory entry for it.
If the first byte (track link) is 0, the block may be considered invalid if the payload bytes after the last one (as denoted by the second byte in the block) are not 0.

There should be some kind of log to list invalid blocks, however. =)
2021-12-30 17:22
Claus_2015

Registered: Oct 2012
Posts: 53
Conflicts with the directory will be taken care of: first, all chains that shall be restored are marked in the BAM, then directory entries are created and sectors allocated for that as needed, taking the new BAM into account.
2021-12-30 17:48
Claus_2015

Registered: Oct 2012
Posts: 53
Krill: sorry, I don't get it. You say that single block files (which have a track link of 0 in their only block) should be ignored, if the sector link byte is not 0? Wouldn't it normally not be 0, if it was an actual file?
2021-12-30 17:56
Krill

Registered: Apr 2002
Posts: 2980
Quoting Claus_2015
Krill: sorry, I don't get it. You say that single block files (which have a track link of 0 in their only block) should be ignored, if the sector link byte is not 0? Wouldn't it normally not be 0, if it was an actual file?
No no, i mean that regular single-block files have a "T/S link" of (0, index-of-last-byte) and are filled up with zeroes.
Anything beyond the last byte shall be 0, so if there are non-0 bytes beyond the payload, something is weird. =)
2021-12-30 19:47
Claus_2015

Registered: Oct 2012
Posts: 53
Ah, that totally makes sense indeed!
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
The Human Co../Maste..
Flashback
E$G/HF ⭐ 7
Shake/Role
Hoild/Ultimate Newco..
Chesser/Blazon
El Gato
Steffan/BOOM!
v3nt0r/ibex-crew
aNdy/AL/Cosine
t0m3000/hf^boom!^ibx
MCM/ONSLAUGHT
Fred/Channel 4
Hobbit/Laser Inc.
Guests online: 131
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.072 sec.