Category : System Diagnostics for your computer
Archive   : TRACK0.ZIP
Filename : RT0.C

 
Output of file : RT0.C contained in archive : TRACK0.ZIP
#include
#include
#include
#include
#include
#include
#include
#include

/*
* This program will restore your hard disk's track zero data. It
* is specifically designed to provide a remedy against the the so-called
* "Columbus day" virus.
*
* This program may be freely copied.
*
* Author: Dave Bushong, KZ1O [70441,2456]
*
*/

void error(int code)
{
switch (code) {
case 1:
fprintf(stderr, "Unable to allocate enough memory\n");
break;
case 2:
fprintf(stderr, "Unable to open file A:TRACK.000\n");
break;
case 4:
fprintf(stderr, "Unable to complete reading floppy disk\n");
break;
default:
fprintf(stderr, "Unknown error occurred: %d\n", code);
break;
}
exit(code);
}

int main(void)
{
char *buffer;

unsigned cx, dx;
int maxhead, maxsectors, h;
int fd;
unsigned bytes;

printf("Restoring hard disk track zero from A:TRACK.000\n"
"More public domain software from D. Bushong [70441,2456]\n");

_DL = 0x80;
_AH = 8;
geninterrupt(0x13); /* get params */

cx = _CX;
dx = _DX;

maxhead = dx >> 8;
maxsectors = cx & 0x3f;

#ifndef ALLCYLINDER
maxhead=0;
#endif

buffer = calloc(bytes = (maxsectors * 512), 1);
if (buffer == NULL)
error(1);

fd = _open("a:track.000", 0);
if (fd < 0)
error(2);

for (h = 0; h <= maxhead; h++) {
if (_read(fd, buffer, bytes) != bytes)
error(4);
biosdisk(3, 0x80, h, 0, 1, maxsectors, buffer);
}
close(fd);
return 0;
}



  3 Responses to “Category : System Diagnostics for your computer
Archive   : TRACK0.ZIP
Filename : RT0.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/