Type ASSEMBLE
Source Lines : 654
Fixes Applied : 1
Most Recent Version : Tuesday, December 12, 1978
Last Fix ID : [HRC004DS]
Module
DMSACM (READMFD)
Function
TO READ THE MASTER FILE DIRECTORY (MFD) AND OTHER INFORMATION INTO CORE FROM DISK.
Attributes
TRANSIENT, REENTRANT
Operation
DMSACF AND DMSACM WHEN USED TOGETHER ARE CALLED BY DMSACC OR DMSING TO BRING ALL OR PART OF A USER FILE DIRECTORY INTO STORAGE OR TO READ THE LABEL OF THE O/S DISK BEING ACCESSED. DMSACM DOES NOT BRING IN ANY FST HYPERBLOCKS (THAT BEING DONE BY DMSACF), AND IS THEREFORE CALLED DIRECTLY BY DMSACC WHEN ACCESSING A DISK USING THE (ERASE) OPTION. DMSACM DOES THE FOLLOWING: A DIAGNOSE IS ISSUED TO CP FOR THE DEVICE TYPE OF THE ADDRESS SPECIFIED. AN ERROR CODE IS RETURNED TO THE CALLER IF A NON-ZERO CONDITION CODE IS RETURNED FROM DIAGNOSE(I.E. THE DEVICE IS NOT ATTACHED). REGISTER 15 FROM DIAGNOSE IS INTERROGATED FOR THE FOLLOWING: 1) IF IT IS NOT A DASD DEVICE, AN ERROR CODE OF 3 IS RETURNED TO THE CALLER; 2) IF THE LOW ORDER BYTE OF R15 INDICATES THAT THE DEVICE IS A HRC004DS A 3330(X'10'), 2314(X'40'), 3340(X'01'), HRC004DS 3350(X'08') OR 3380(X'20'), HRC004DS A X'09', X'08', X'07', X'0B', OR X'0E' HRC004DS RESPECTIVELY, IS STORED IN THE FOURTH BYTE OF THE 12-BYTE DEVICE-TABLE ENTRY IN THE NUCON TABLE, FOR THE PARTICULAR DEVICE GIVEN BY THE ACTIVE DISK TABLE. IF THE DEVICE IS NONE OF THESE, CONTROL IS RETURNED TO THE USER WITH AN ERROR CODE OF 3. THEN THE DISK LABEL (RECORD NO. 3 - THAT IS, CYLINDER 0, HEAD 0, RECORD 3) IS READ FROM DISK AND A TEST IS MADE TO DETERMINE IF THE DISK IS A CMS OR AN O/S DISK. IF THE DISK IS O/S, CONTROL GOES TO A SPECIAL ROUTINE. NEXT, THE MASTER FILE DIRECTORY (RECORD NO. 4 - THAT IS, CYLINDER 0, HEAD 0, RECORD 4) IS READ FROM DISK INTO A BUFFER OBTAINED FROM FREE STORAGE. (ERROR 1 IF CANNOT BE READ SUCCESSFULLY). THE FIRST HALFWORD OF THE MFD IS CHECKED TO MAKE SURE DATA IS THERE (ERROR 1 IF NOT). THE DISK ADDRESSES AT THE BEGINNING OF THE MFD ARE THEN CHECKED, SCANNING FOR AN ENDING SENTINEL OF FFFF, FFFE, FFFD, TO DETERMINE HOW MANY FST HYPERBLOCKS ARE ON DISK, AND WHERE THE QMSK EXTENSIONS (IF ANY) ARE STORED ON DISK. THE NUMBER OF FST HYPERBLOCKS IS STORED ON DISK. THE NUMBER OF FST HYPERBLOCKS IS STORED AD ADTHBCT IN THE ACTIVE DISK TABLE FOR FUTURE USE (USUALLY BY DMSRCF). THE DISK COUNTS ADTNUM, ETC., ARE STORED IN THE ACTIVE DISK TABLE FROM MFD, ALONG WITH THE NUMBER OF CYLINDERS. AT THIS POINT, IF THE READ-ONLY FLAG-BIT ADTFRO IN THE ADTFLG1 FLAG IS SET, DMSACM ACCEPTS THE DISKS AS READ-ONLY, LEAVES THE MFD BLOCK IN A FREE STORAGE BUFFER OR JUST ENOUGHT SIZE TO INCLUDE ALL THE DISK-ADDRESSES AT THE BEGINNING, AND EXITS TO THE CALLER, NORMALLY DMSACF. IF THE DISK IS NOT FLAGGED READ-ONLY, DMSACM ATTEMPTS TO WRITE THE MFD EXACTLY AS IS RIGHT BACK ON DISK USING DMSDIOW. IF UNSUCCESSFUL BECAUSE THE DISK IS READ-ONLY 9(AN ERROR 6 FROM DMSDIOW), DMSACM FINISHES UP AS DESCRIBED IN THE ABOVE PARAGRAPH (THE READ-ONLY BIT BEING SET NOW), AND EXIT IS SUBSEQUENTLY MADE WITH ERROR 4 (NONFATAL). IF THE MFD WAS SUCCESSFULLY WRITTEN BACK ON DISK, THE READ-WRITE FLAG-BIT IS SET, AND DMSACM CONTINUES. NEXT THE RIGHT AMOUNT OF FREE STORAGE IS OBTAINED FOR THE QMSK BIT-MASK (DEPENDING ON THE SIZE OF ADTNUM - THE TOTAL NUMBER OF RECORDS ON DISK). THEN THE QMSK EXTNESIONS (IF ANY) ARE READ INTO THE FREE STORAGE AREA, DOUBLE-WORD ALIGNED, AND WITH AN INTEGRAL NUMBER OF DOUBLE-WORDS IN THE READ (TO PREVENT A POSSIBLE CHAINING CHECK WHEN RUNNING ON CP), AND THEN MOVED TO THE PROPER PLACE IN THE QMSK BUFFER: THE FIRST 215 BYTES OF THE QMSK ARE THEN MOVED FROM THE MFD TO THE QMSK IN CORE. (IF THE QMSK IS LESS THAN 215 BYTES, ONLY THE CORRECT NUMBER OF BYTES IS MOVED). WHEN THROUGH, THE QMSK IS LAID OUT IN CORE AS ONE CONTIGUOUS TABLE, WITH AN INTEGRAL NUMBER OF BYTES, PADDED (IF NECESSARY) TO AN INTEGRAL NUMBER OF DOUBLE WORDS, IN FREE STORAGE. THE LOCATION OF THE QMSK IS OF COURSE STORED WHERE NEEDED, AND THE OTHER COUNTS (ADTPQM1 THROUGH ADTPQM3), COMPUTED AND STORED. FREE STORAGE IS THEN OBTAINED FOR THE QQMSK, IF A 2314 READ/WRITE DISK AND THE 200-BYTE QQMSK TABLE MOVED INTO POSITION FROM THE MFD. LASTLY, AS MENTIONED ABOVE FOR THE READ-ONLY CASES, JUST ENOUGH FREE STORAGE IS OBTAINED FOR THE INFORMATION ON DISK ADDRESSES CONTAINED AT THE BEGINNING OF THE MFD TO BE KEPT IN CORE, THE CRUCIAL DATA IS MOVED THERETO, AND THE 800-BYTE BUFFER IS RELEASED. IF THE DISK IS AN O/S DISK, THE DISK LABEL AND VTOC ADDRESS ARE SAVED IN THE ADT BLOCK. A CHECK IS MADE TO DETERMINE IF DMSROS HAS BEEN LOADED (BY A PREVIOUS ACCESS OF AN O/S DISK) AND IF NOT DMSSTT IS CALLED TO VERIFY THAT DMSROS TEXT EXISTS. UPON SUCCESSFUL RETURN FROM STATE (IF NOT FOUND, AN ERROR MSG IS ISSUED), DMSROS TEXT IS LOADED INTO HIGH STORAGE AREA WITH PROTECT KEY OF NUCLEUS AND A BRANCH IS MADE TO THE O/S ACCESS ROUTINE OF DMSROS TO READ THE FORMAT 4 DSCB OF THE DISK. UPON SUCCESSFUL RETURN FROM DMSROS, CONTROL IS RETURNED TO THE CALLER. ANY OTHER ERRORS ARE TREATED AS GENERAL LOGIN ERRORS. TO SUMMARIZE: FOR A READ-WRITE DISK, DMSACM READS IN ALL OF THE USER FILE DIRECTORY EXCEPT THE FST HYPERBLOCKS AND INITIALIZES ALL APPROPRIATE INFORMATION IN THE ACTIVE DISK TABLE. FOR A R/O CMS DISK, DMSACM READS IN ALL OF THE USER FILE DIRECTORY EXCEPT THE FST HYPERBLOCKS, THE QMSK AND QQMSK TABLES, AND THE COUNTS IN THE LATTER HALF OF THE ACTIVE DISK TABLE ASSOCIATED WITH THE QMSK AND QQMSK TABLES, WHICH ARE NOT NEEDED IN CORE FOR A READ-ONLY DISK.
Calls to Other Routines
DMSFREE, DMSFRET, DMSDIOR, DMSDIOW, DMSROS