File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / sys / stand / vdfmt / exercise.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:29:50 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21

#include	"vdfmt.h"

#define	verbose	1

/*
**
*/

exercise()
{
	int		cyl, trk;
	dskadr		ead, sad;

	print("Starting disk exercise on ");
	printf("controller %d, drive %d, ", cur.controller, cur.drive);
	printf("type %s.\n",CURRENT->type_name);

	if(read_bad_sector_map() == true) {
		if(bad_map->bs_id != D_INFO.id) {
			print("Module serial numbers do not match!\n");
			print("Use `info' to find the real serial number.\n");
			_longjmp(abort_environ, 1);
		}
	}
	else if(is_formatted() == false) {
		print("Can not exercise unformatted drives!\n");
		_longjmp(abort_environ, 1);
	}
	print("Starting read test.\n");
	cur.state = exec;
	sad.track = sad.sector = 0;
	indent();
	for(sad.cylinder=0; sad.cylinder<CURRENT->ncyl; sad.cylinder++) {
		print("pass %d...\n", sad.cylinder);
		for(cyl=0; cyl<CURRENT->ncyl-NUMSYS; cyl++){
			ead.cylinder = cyl;
			for(trk=0; trk<CURRENT->ntrak; trk++) {
				ead.track = trk;
				ead.sector = 0;
				access_dsk((char *)scratch, &sad, SEEK, 1, 1);
				verify_track(&ead, 16, verbose);
				if(kill_processes == true)
					goto exit;
			}
		}
	}
	exdent(2);
exit:	sync_bad_sector_map();
	printf("Exercise completed successfully.\n");
}


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.