11/05/87	10:26 am
11/16/87	10:14 am	update

Format
======
- Give generic warning which includes the message that system will reboot 
  after this operation.
- Inquire physical unit number (0-7) from user.
- Inquire disk type (MEGAFILE 40, SH204, etc...) from user.
- Get format parameters from wincap.
- Attempt to read bad sector list into memory.  If it fails, create one.
- Format the disk (including set mode, etc...).
- Destructively markbad the entire device.
  - Write different kinds of data and read them back. eg. all 1's, all 0's,
    alternating 10's and alternating 01's. (etc...)
- Add new bad sectors into the Vendor Bad Sector List, update the counter for
  bad sectors.
- Install the format parameters into root sector.
- Partition the disk with the default scheme (or let them pick?).
- Install bad sector list at physical (unit) sector 1.
- Set the system to reboot.

Related files:
--------------
- bootsect.s
- bootstop.s
- fmt.c
- hdx.c
- rootsect.s



Partition
=========
- Give generic warning including that the system will reboot afterwards.
- Inquire logical unit number (C:-P:) from the user.
- Inquire partition scheme from the user.
- Calculate and set the parameters for all partitions.
- Write partition headers.  Check from the bad sector list and make sure that 
  they do not lie on any bad sectors.  If any of them does, adjust the sizes 
  of the adjacent partition(s) to move the header(s) to a clean chunk.
- Zero the FATs and Root Dir.
- Update FAT tables about bad sectors using the bad sector list.
- Set the system to reboot.

To be considered:
-----------------
- Menu of partition schemes.  Show only those that are legal and appropiate,
  or disable those that are illegal.
- Check if new scheme is the same as current one.  If so, skip the calculation
  part? 

Related files:
--------------
- epart.c
- hdx.c
- part.c
- sect.c



Zero
====
- Give generic warning.
- Inquire logical unit number from the user.
- Clean up FATs and Root Dir of drive.
- Force media change.

Related files:
--------------
- hdx.c
- sect.c
- zero.c



Markbad (Non-destructive)
=========================
- Give generic warning.
- Inquire logical unit number from the user.
- Allocate the biggest buffer possible (make that as BUFSIZ).
- Try to read BUFSIZE sectors from the drive.  If fails, read the chunk over
  again one sector at a time to narrow down which sector(s) is/are bad.
- Add the non-readable sectors to User Bad Sector List.
- Mark the bad sectors in FATs.
  - For each bad sector;
	determine whether it has been allocated to a file;
	if it has been allocated to a file
	    find out what file it belongs to;
	determine whether it is a subdirectory or a regular file;
	if it is a regular file
	    ask user if they want to delete the file, skip over the bad sector
	    or ignore the bad sector, and do that;
	if it is a subdirectory
	    ask user if they want to skip over the bad sector or ignore it;
	    if they want to skip over the bad sector
		find a free cluster on ?:;
		make a sector of deleted files' directory entries;
		determine if bad sector is 1st or 2nd sector of a cluster;
		write the sector of deleted files' directory entries in place
		  of the bad sector in the free cluster found;
		write the undamaged sector from original cluster to the appro-
		   piate sector in the free cluster found;
		determine whether bad sector resides in starting cluster;

		
	
- Force media change.

Related files:
--------------
- hdx.c
- markbad.c
- sect.c
