Type ASSEMBLE
Source Lines : 447
Fixes Applied : 0
Most Recent Version : Tuesday, December 12, 1978
Last Fix ID : [Unmodified]
Module
DMSAUD
Function
TO RESERVE SPACE ON DISK FOR REWRITING A NEW COPY OF THE USER FILE DIRECTORY (UFD) ON DISK, AND THEN TO UPDATE THE UFD ON DISK.
Attributes
NUCLEUS RESIDENT, REENTRANT
Operation
DMSAUD IS THE ROUTINE THAT UPDATES THE USER FILE DIRECTORY FOR A GIVEN DISK. IT IS CALLED IN ONE OF TWO WAYS: WHEN DMSFNSA HAS CLOSED THE LAST OPEN OUTPUT FILE FOR A GIVEN DISK, IT CALLS THE FIRST ENTRY TO UPDATE THE UFD FOR THAT DISK; WHEN DMSERS FINDS A FILE TO BE ERASED IT FIRST CALLS THE SECOND ENTRY TO RESERVE SOME TRACKS, THEN DOES ITS ERASING FUNCTION, THEN CALLS THE THIRD ENTRY TO WRITE THE NEW UFD ON DISK. THIS LOGIC MAKES POSSIBLE WHAT IS CALLED A "DOUBLE DIRECTORY" SCHEME, WHEREIN THE OLD DIRECTORY STILL EXISTS ON DISK UNTIL THE MFD ITSELF IS FINALLY REWRITTEN ON RECORD 4 OF THE DISK, COMPLETING THE NEW DIRECTORY. IF THE SYSTEM IS INTERRUPTED IN ANY WAY IN THE MIDDLE OF THE PROCESS, THE OLD DIRECTORY IS STILL INTACT, AND ANY OLD FILES POINTED TO THEREBY ARE STILL INTACT. DMSAUD, THEN, HAS BASICALLY TWO STEPS. ENTRY (2) - CALLED ONLY BY DMSERS - DOES ONLY THE FIRST STEP; ENTRY (3) - ALSO CALLED BY DMSERS - DOES ONLY THE SECOND STEP. THE ACTION TAKEN BY EACH STEP IS AS FOLLOWS: STEP 1: AN 800-BYTE BUFFER FOR THE CONSTRUCTING OF A NEW MFD IS OBTAINED FROM FREE STORAGE, AND THE FIRST 600 BYTES ARE CLEARED. AVAILABLE DISK-ADDRESSES ARE OBTAINED FROM DMSTRKA FOR EACH FST HYPERBLOCK AND STORED IN THE MFD, JUST OBTAINED, IN SEQUENTIAL HALFWORDS. THEN, IF THERE ARE NO MORE THAN 215 BYTES OF SIGNIFICANT DATA IN THE QMSK BITMASK, A SENTINEL OF X'FFFF' IS STORED FOLLOWING THESE, AND STEP 1 IS COMPLETE. IF THE QMSK IS LARGER THAN 215 BYTES IN LENGTH AND THERE IS SIGNIFICANT DATA PAST THE 215TH BYTE, HOWEVER, ADDITIONAL DISK-ADDRESSES ARE OBTAINED (AS MANY AS ARE NEEDED), AND STORED FOLLOWING A SENTINEL OF X'FFFD'. ALL NEEDED DISK-ADDRESSES FOR THE NEW MFD HAVE NOW BEEN OBTAINED AND STORED, WITHOUT AFFECTING ANY OLD DATA ON DISK. IF ENTRY (2) WAS CALLED BY DMSERS, DMSAUD EXITS AT THIS POINT. STEP 2: NOW WE CONTINUE IN LINE, OR ENTER HERE IF ENTRY (3) IS CALLED BY DMSERS. DMSAUD NOW CYCLES THROUGH THE OLD MFD (IF ANY) LEFT IN CORE BY THE FILE MANAGEMENT PROGRAMS, AND RETURNS OLD DISK-ADDRESSES CONTAINED THEREIN BY CALLING DMSTRKX TO RETURN THEM TO THE QMSK TABLE. THE OLD MFD IS THEN RETURNED TO FREE STORAGE VIA FRET. NOW THE FST HYPERBLOCKS IN CORE, AND ANY PQMSK EXTENSIONS ARE WRITTEN ON DISK, CALLING WRTK, USING THE DISK-ADDRESSES RESERVED ABOVE IN STEP 1. NEXT, ALL THE DISK COUNTS (ADTNUM, ADTCYL, ETC.), THE FIRST 215 BYTES (OR LESS) OF THE QMSK, THE QQMSK, AND THE UNIT-TYPE BYTE ARE MOVED TO THE MFD, AND THE MFD FINALLY WRITTEN BACK ON RECORD 4 OF THE DISK, COMPLETING THE NEW UFD ON DISK. FINALLY, THE SIGNIFCANT PART OF THE NEW MFD, STILL IN CORE, INCLUDING THE DISK-ADDRESSES OF THE FST HYPERBLOCKS, THE FFFF OR THE FFFD SENTINEL, AND THE DISK-ADDRESSES OF THE QMSK EXTENSION(S) ARE RETAINED IN CORE (IN THE HIGH-NUMBERED END OF THE BUFFER THAT WAS USED FOR THE NEW MFD), AND THE REST OF THE 800-BYTE BUFFER GIVEN BACK TO FREE STORAGE VIA DMSFRET. NOTES: IF A PERMANENT DISK ERROR OCCURS WRITING THE NEW UFD AT ANY POINT, OR IF NECESSARY FREE STORAGE CANNOT BE OBTAINED, THE DMSAUD ROUTINE PURPOSELY TRANSFERS TO THE DMSFNSD CODE, SO THAT THE OLD DIRECTORY WILL BE INTACT UNTIL THE DISK ERROR CAN BE CORRECTED, OR A LARGER VIRTUAL MACHINE DEFINED. SEE ALSO "DMSAUDUP" AND "DMSAUDL", WHICH STILL SERVE A USEFUL PURPOSE, AND ARE RETAINED FOR COMPATIBILITY WITH EXISTING PROGRAMS. DMSAUDUP AND DMSAUDL ARE INCLUDED AS ENTRY-POINTS IN THE DMSAUD ROUTINE.
Calls to Other Routines
DMSFREE, DMSFRET, DMSTRKA, DMSTRKX, DMSDIOW, DMSFNSD