Jump to content
Keatah

Wiping the VTOC

Recommended Posts

Like most hard disks and other floppy systems, deleting something on a standard 143K Apple diskette doesn't really delete anything. It just writes to VTOC and that's it. Both the program and it's VTOC entry are available for recovery at a later date. So what programs are available that will clear both VTOC and the data area of the deleted program?

 

(Initializing a disk does the job in a brute-force blanket way. Giving you a fresh disk from which to start.)

Share this post


Link to post
Share on other sites

I'm using the "Certify & erase disk" from EDD. It erase the entire disk using half tracks. It may requires the EDD card though.

I think you could also use the "Disk Drive Test/General Operation" from MECC Computer Inspector as it erase the entire disk.

Share this post


Link to post
Share on other sites

Totally forgot to mention I wanted to keep valid data on the disk, intact. Just erase the un-used VTOC entries and the sectors they point to.

 

Not so much for security. But for other reasons like zipping a disk to its smallest size possible.

 

Share this post


Link to post
Share on other sites

Since you rarely zip a disk until all the files on it that you want, just do a file copy to a fresh inited disk.  This also has the added affect of de-fragmenting a disk so files load faster.

Share this post


Link to post
Share on other sites

Mmm yes probably so. I wanted to see how far they took disk optimization back in the day.

 

With Zmodem protocol, whenever there was a string of zeros or similar, some terminal programs would speed past that part of the disk so to speak. Data compression on the fly and all. And at 300 baud back then it was a big deal. A huge deal even! At night it would mean the difference between getting 1, 2, 3, or sometimes more games depending on sizes. Obviously the smaller the better.

 

I even remember that Cat-Fur and/or Cat-Send had a utility to zero out unused sectors. And of course DDD and other disk packers did the same thing.

 

Why worry about shit like this today? Well just because! And it's amusing to say that a number of disk images can fit entirely within the L2 or even L1 cache of a modern CPU when doing emulation. Just trivia, but interesting and comparative trivia nonetheless.

 

Share this post


Link to post
Share on other sites

Didn't the Copy ][ Utilities has this feature??

 

 

MarkO

 

Share this post


Link to post
Share on other sites

I'm not aware that it did. Unless it's been in one specific version and no others. The utilities can sort the catalog or do a disk map, or a full-disk format. But I think that's it.

 

 

Share this post


Link to post
Share on other sites

Thought I'd revisit this topic and see if there's ideas how to clear away deleted file entries in a ProDOS directory. Ciderpress shows this, and I want to remove them via a utility. Sure it can be brute-forced via freshly formatting a disk and copying everything over to it. But is there a tool that can go through the directory and do it without wiping?

 

540375829.thumb.png.26e5e2091acffb6d0f956c68cda9faa7.png

Share this post


Link to post
Share on other sites

For starters let me remind you before using any kind of tool do to any of this kind of work, still requires a backup to be made.

 

Normal methods of displaying a directory will usually skip displaying deleted files, so there has never really been a need for such tools.  CiderPress bypasses the normal method, which sometimes is good as it can show other files or programs that the author of a disk image might have been working on.  Sometimes it is worth it to try to undelete those files.  There are a couple of programs that use what is called, Trimming, to zero out unused blocks that still contain data, but these don't hide the deleted directory entries and have only seen them as IIGS software.

 

Now to the question at hand.  One of the easiest methods would be to create as many directories as there are deleted files.  Each directory entry will be created over top of where there is a deleted file entry and replace all the info in the deleted entry.  Instead of deleted files, your directory will show empty directories.

 

Another is to use Basic.systems powerful BLOAD feature and just type "BLOAD /volume.name/directory.name,TDIR,A$2000" will load the entire named directory to memory.  Go into the monitor with CALL-151 and do a hex dump by specifying a range likes so:  2000.2100

 

You will see the entire directory.  It is then just a matter of writing a short applesoft basic program to navigate and find the deleted entries and zeroing them out.  One caveat though is you can't write the directory back to disk using the same method, but there is a way to locate the block that the deleted file was on and once zeroed, can then write the block back to disk without any harm to the directory structure.  But again, only do this on a backup of your disk, never the original, because mistakes will be made.

 

On another note, I wrote tools for Prodos that encrypts and decrypts the directory so that it can no longer be displayed as readable text.  Without using the regular boot method and a key, Programs like CiderPress, won't be able to display the directory any more.  This is my fun on adding security to an otherwise open system.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 1/20/2022 at 12:00 PM, Iamgroot said:

For starters let me remind you before using any kind of tool do to any of this kind of work, still requires a backup to be made.

Absolutely.

 

On 1/20/2022 at 12:00 PM, Iamgroot said:

Normal methods of displaying a directory will usually skip displaying deleted files, so there has never really been a need for such tools.  CiderPress bypasses the normal method, which sometimes is good as it can show other files or programs that the author of a disk image might have been working on.  Sometimes it is worth it to try to undelete those files.  There are a couple of programs that use what is called, Trimming, to zero out unused blocks that still contain data, but these don't hide the deleted directory entries and have only seen them as IIGS software.

I found that Glen Bredon's BeachComber will optimize a disk by moving everything to the front. And it organizes the programs by the same order in which they appear in the directory. For real floppy use this cuts down on head movements. All the executable stuff is close to the boot track and VTOC sector.

 

Pretty sure it also zero's out unused sectors. Good for those old-time 300/1200 baud transfers AFTER you've compressed the disk with DDD or similar packers. Tons'O'fun!

 

But it does nothing to deleted entries. There's still record of them.

 

There's also CatDoctor, which does some directory operations like locking and renaming and sorting. I discovered if you do a sort option, but don't actually sort anything and exit. It writes the directory back to the disk WITHOUT the deleted/zombie filenames.

 

However that fails on larger directories, not sure what the limit is.

 

 

Share this post


Link to post
Share on other sites

No one used Zmodem at 300 baud.  By the time Zmodem came about and was implemented on the Apple II 14.4k was a reality.

 

Share this post


Link to post
Share on other sites

The slowest I recall using ZModem was at 2400 baud. Perhaps 300/1200 when bad line conditions ensued.

 

ZModem came to the Apple //e 1987-1988, via Intrec's ProTerm version 2.1.

14,400 v.32 bis modems weren't available till 1992.

 

Share this post


Link to post
Share on other sites

And it wasn't implemented correctly until 3.0 or 3.1, and very few Apple II BBS's supported it.  Wiki says 1991 for 14.4, but 9600 was 1984, although there were a lot of flavors of that.  Point is, 300 baud was dead in 1988.

 

What's the difference in doing a Disk Archive vs File Archive?  File Archive probably wouldn't have the extraneous data on the disk, and would Disk archivers archive the zeros?  I know that a disk archive is not always the same size, so I would imagine something gets trimmed....

 

Share this post


Link to post
Share on other sites

A file archiver would just store the file data and file names. And when it comes time to write them back, the files could be placed anywhere on the disk. An advantage is you can pick and choose which files to extract and put them on whatever disk(s) you want. There's no overwriting the entire disk. You may store just one file, or many.

 

A disk archive stores and compresses the tracks, 0-34. The entire disk. Each track is read and compressed then put into one long-ass file. The advantage here is the disk is written back exactly as it had been stored. So if you're optimizing file-placement for speed and less head movements, this will preserve that. It will of course store all the blank tracks or zeros in just a few bytes via compression. 200 sequential zeros might be replaced by a statement saying "put 200 zeros here". 20 characters vs 200 individually stored bytes. A savings of 180 bytes. A disk archive will also capture any recently deleted files that hadn't yet been overwritten - you could use Copy II Plus to maybe do an undelete operation. Disk archivers are oblivious to individual files, they operate on tracks.

Edited by Keatah

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...