

; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE MOUDK1 (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'X0011'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! Copyright (c) 1977

;	0009	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0010	!

;	0011	! This software is furnished  under a license for use only on a single

;	0012	! computer  system and  may be  copied only with  the inclusion of the

;	0013	! above copyright notice.  This software, or any other copies thereof,

;	0014	! may not be provided or  otherwise made available to any other person

;	0015	! except for use on such system and to one who agrees to these license

;	0016	! terms.  Title to and  ownership of the  software  shall at all times

;	0017	! remain in DEC.

;	0018	!

;	0019	! The information in this software is subject to change without notice

;	0020	! and should  not be construed  as a commitment  by Digital  Equipment

;	0021	! Corporation.

;	0022	!

;	0023	! DEC assumes  no  responsibility  for  the use or  reliability of its

;	0024	! software on equipment which is not supplied by DEC.

;	0025	

;	0026	!++

;	0027	!

;	0028	! FACILITY:  MOUNT Utility Structure Level 1

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	This routine performs all of the mechanics of mounting a disk,

;	0033	!	given as input the parsed and partially validated command line.

;	0034	!

;	0035	! ENVIRONMENT:

;	0036	!

;	0037	!	STARLET operating system, including privileged system services

;	0038	!	and internal exec routines.

;	0039	!

;	0040	!--

;	0041	!

;	0042	!

;	0043	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  17-Oct-1977  17:41

;	0044	!

;	0045	! REVISION HISTORY:

;	0046	!

;	0047	!   Andrew C. Goldstein, 22-Dec-1977  14:17

;	0048	!   X0002 - File ID interface changes

;	0049	!

;	0050	!   Andrew C. Goldstein, 27-Dec-1977  14:10

;	0051	!   X0003 - Make disk deallocatable if shared

;	0052	!

;	0053	!   Andrew C. Goldstein, 12-Feb-1978  15:44

;	0054	!   X0004 - Make volume owner UIC of mounter on foreign mount

;	0055	!



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 1-1

; Digital Equipment Corporation

;

;	0056	!   Andrew C. Goldstein, 21-Feb-1978  13:44

;	0057	!   X0005 - Add /DATACHECK switch

;	0058	!

;	0059	!   Andrew C. Goldstein, 11-May-78  13:58

;	0060	!   X0006 - Get default values from SYSPARAM

;	0061	!

;	0062	!   Andrew C. Goldstein, 16-May-78  16:26

;	0063	!   X0007 - Set UNLOAD bit in UCB

;	0064	!

;	0065	!   Andrew C. Goldstein, 15-Jun-78  15:47

;	0066	!   X0008 - Add bitmap error warning

;	0067	!

;	0068	!   Andrew C. Goldstein, 26-Jun-78  14:09

;	0069	!   X0009 - Add error log entry on mount

;	0070	!

;	0071	!   Andrew C. Goldstein, 18-Jul-78  21:39

;	0072	!   X0010 - Use given volume name on foreign mount

;	0073	!

;	0074	!   Andrew C. Goldstein, 19-Jul-78  17:17

;	0075	!   X0011 - Fix ownership check on protection override

;	0076	!

;	0077	!**

;	0078	

;	0079	

;	0080	LIBRARY 'SYS$LIBRARY:LIB.L32';

;	0081	REQUIRE 'SRC$:MOUDEF.B32';

;	0388	REQUIRE 'LIBD$:[VMSLIB.OBJ]MOUNTMSG.B32';

;	0488	

;	0489	

;	0490	FORWARD ROUTINE

;	0491		MOUNT_DISK1	: NOVALUE,	! main disk mounting routine

;	0492		MAKE_DISK_MOUNT,		! kernel mode mount routine

;	0493		KERNEL_HANDLER	: NOVALUE;	! kernel mode condition handler



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 2

; Digital Equipment Corporation

;

;	0494	!+

;	0495	!

;	0496	! Own storage for this module.

;	0497	!

;	0498	!-

;	0499	

;	0500	LITERAL

;	0501		WINDOW_SIZE	= 30*6;		! maximum index file window size

;	0502	

;	0503	OWN

;	0504		BUFFER		: BBLOCK [512],		! buffer for disk blocks

;	0505		PROTO_VCB	: BBLOCK [VCB$C_LENGTH], ! prototype VCB

;	0506		PROTO_FCB	: BBLOCK [FCB$C_LENGTH], ! prototype index file FCB

;	0507		PROTO_WCB	: BBLOCK [WCB$C_LENGTH+WINDOW_SIZE],

;	0508							! prototype index file window

;	0509		SYSEXV		: VECTOR [2],		! place to save system vectors

;	0510		VOLUME_UIC;				! owner UIC of volume



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3

; Digital Equipment Corporation

;

;	0511	GLOBAL ROUTINE MOUNT_DISK1 : NOVALUE =

;	0512	

;	0513	!++

;	0514	!

;	0515	! FUNCTIONAL DESCRIPTION:

;	0516	!

;	0517	!	This routine performs all of the mechanics of mounting a structure

;	0518	!	level 1 disk, given as input the parsed and partially validated

;	0519	!	command line.

;	0520	!

;	0521	!

;	0522	! CALLING SEQUENCE:

;	0523	!	MOUNT_DISK ()

;	0524	!

;	0525	! INPUT PARAMETERS:

;	0526	!	NONE

;	0527	!

;	0528	! IMPLICIT INPUTS:

;	0529	!	MOUNT parser data base

;	0530	!	CHANNEL: channel number for I/O

;	0531	!	HOME_BLOCK: buffer containing volume home block

;	0532	!	HOMEBLOCK_LBN: LBN of home block

;	0533	!

;	0534	! OUTPUT PARAMETERS:

;	0535	!	NONE

;	0536	!

;	0537	! IMPLICIT OUTPUTS:

;	0538	!	NONE

;	0539	!

;	0540	! ROUTINE VALUE:

;	0541	!	NONE

;	0542	!

;	0543	! SIDE EFFECTS:

;	0544	!	volume mounted: VCB, etc., created, ACP started

;	0545	!

;	0546	!--

;	0547	

;	0548	BEGIN

;	0549	

;	0550	BUILTIN

;	0551		ROT,

;	0552		FFS,

;	0553		FFC;

;	0554	

;	0555	LOCAL

;	0556		PROCESS_UIC,			! UIC of this process

;	0557		PRIVILEGE_MASK	: REF BBLOCK,	! address of process privilege mask

;	0558		P,				! random pointer

;	0559		C,				! string count

;	0560		STATUS,				! utility status word

;	0561		MAP_AREA	: REF BBLOCK,	! pointer to file header map area

;	0562		MAP_POINTER	: REF BBLOCK,	! pointer to scan map pointers

;	0563		BIAS,				! offset for storage map location

;	0564		COUNT,				! number of blocks in storage map

;	0565		LBN,				! current LBN in use



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-1

; Digital Equipment Corporation

;

;	0566		FREE,				! number of free blocks on volume

;	0567		X,				! longword of bitmap

;	0568		B1,				! start point of bit scan

;	0569		B2;				! end point of bit scan

;	0570	

;	0571	EXTERNAL

;	0572		MOUNT_OPTIONS	: BITVECTOR,	! command option flags

;	0573		DEVICE_CHAR	: BBLOCK,	! device characteristics

;	0574		LABEL_STRING	: VECTOR,	! volume label string in command

;	0575		PHYS_NAME	: VECTOR,	! descriptor of physical device name

;	0576		DEVICE_COUNT,			! number of device specified

;	0577		DRIVE_COUNT	: VECTOR,	! number of drives per device

;	0578		WINDOW,				! command specified window size

;	0579		ACCESSED,			! command specified LRU limit

;	0580		EXTENSION,			! command specified default file extend

;	0581		HOME_BLOCK	: BBLOCK,	! buffer containing volume home block

;	0582		HOMEBLOCK_LBN,			! LBN of home block

;	0583		HEADER_LBN,			! LBN of current file header

;	0584		CTL$GL_PHD	: REF BBLOCK ADDRESSING_MODE (ABSOLUTE),

;	0585						! vector page pointer to process header

;	0586		ACP$GB_WINDOW	: BYTE ADDRESSING_MODE (ABSOLUTE),

;	0587						! default window size for /SYSTEM

;	0588		ACP$GW_SYSACC	: WORD	ADDRESSING_MODE (ABSOLUTE);

;	0589						! default LRU limit for /SYSTEM

;	0590	

;	0591	EXTERNAL ROUTINE

;	0592		GET_UIC,			! get UIC of process

;	0593		CHECK_HEADER,			! verify file header

;	0594		READ_BLOCK,			! read a block from the disk

;	0595		INIT_FCB,			! initialize FCB

;	0596		TURN_WINDOW1;			! initialize window

;	0597	

;	0598	

;	0599	! For maximum safety, we do as much setup work in user mode as possible. We

;	0600	! read all of the disk blocks (index file and storage map headers and the

;	0601	! storage map) in user mode so that the program is abortable in case something

;	0602	! hangs. Prototype control blocks are built in local storage and are copied

;	0603	! into the system pool by the kernel mode routine.

;	0604	!

;	0605	! Get the process UIC and the volume owner UIC. Make the privilege checks

;	0606	! for overriding volume protection and options requiring operator privilege.

;	0607	!

;	0608	

;	0609	IF .DEVICE_COUNT NEQ 1 OR .DRIVE_COUNT[0] GTR 1

;	0610	THEN ERR_EXIT (MOUN$_DEVICES);

;	0611	

;	0612	PROCESS_UIC = KERNEL_CALL (GET_UIC);

;	0613	PRIVILEGE_MASK = CTL$GL_PHD[PHD$Q_PRIVMSK];

;	0614	VOLUME_UIC = 0;

;	0615	IF .MOUNT_OPTIONS[OPT_IS_FILES11]

;	0616	THEN

;	0617	    BEGIN

;	0618	    VOLUME_UIC = .(HOME_BLOCK[HM1$W_VOLOWNER])<0,8>;

;	0619	    VOLUME_UIC<16,8> = .(HOME_BLOCK[HM1$W_VOLOWNER])<8,8>;

;	0620	    END;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-2

; Digital Equipment Corporation

;

;	0621	

;	0622	IF  (

;	0623	    .MOUNT_OPTIONS[OPT_OVR_PRO]

;	0624	    AND NOT (.PRIVILEGE_MASK[PRV$V_VOLPRO]

;	0625			OR .VOLUME_UIC EQL 0

;	0626			OR .VOLUME_UIC EQL .PROCESS_UIC)

;	0627	    )

;	0628	

;	0629	OR  (

;	0630	    (  .MOUNT_OPTIONS[OPT_WINDOW]

;	0631	    OR .MOUNT_OPTIONS[OPT_ACCESSED]

;	0632	    OR .MOUNT_OPTIONS[OPT_UNIQUEACP]

;	0633	    OR .MOUNT_OPTIONS[OPT_SAMEACP]

;	0634	    OR .MOUNT_OPTIONS[OPT_FILEACP]

;	0635	    )

;	0636	    AND NOT .PRIVILEGE_MASK[PRV$V_OPER]

;	0637	    )

;	0638	

;	0639	OR  (

;	0640	    .MOUNT_OPTIONS[OPT_GROUP]

;	0641	    AND NOT .PRIVILEGE_MASK [PRV$V_GRPNAM]

;	0642	    )

;	0643	

;	0644	OR  (

;	0645	    .MOUNT_OPTIONS[OPT_SYSTEM]

;	0646	    AND NOT .PRIVILEGE_MASK [PRV$V_SYSNAM]

;	0647	    )

;	0648	

;	0649	THEN ERR_EXIT (SS$_NOPRIV);

;	0650	

;	0651	IF .MOUNT_OPTIONS[OPT_FOREIGN]

;	0652	THEN VOLUME_UIC = .PROCESS_UIC;

;	0653	

;	0654	! First fill in the prototype VCB from the data in the home block.

;	0655	!

;	0656	

;	0657	CH$FILL (0, VCB$C_LENGTH, PROTO_VCB);	! init to zero

;	0658	PROTO_VCB[VCB$W_TRANS] = 1;		! transaction count

;	0659	PROTO_VCB[VCB$W_MCOUNT] = 1;		! mount count

;	0660	

;	0661	IF .MOUNT_OPTIONS[OPT_GROUP]

;	0662	THEN PROTO_VCB[VCB$V_GROUP] = 1;

;	0663	IF .MOUNT_OPTIONS[OPT_SYSTEM]

;	0664	THEN PROTO_VCB[VCB$V_SYSTEM] = 1;

;	0665	

;	0666	IF .MOUNT_OPTIONS[OPT_IS_FILES11]

;	0667	AND NOT (.MOUNT_OPTIONS[OPT_FOREIGN] AND .MOUNT_OPTIONS[OPT_LABEL])

;	0668	THEN

;	0669	    BEGIN

;	0670						! volume label, blank filled

;	0671						! find trailing zero, if any

;	0672	    P = CH$FIND_CH (HM1$S_VOLNAME, HOME_BLOCK[HM1$T_VOLNAME], 0);

;	0673	    C = 12;				! compute string length

;	0674	    IF NOT CH$FAIL (.P)

;	0675	    THEN C = .P - HOME_BLOCK[HM1$T_VOLNAME];



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-3

; Digital Equipment Corporation

;

;	0676	    CH$COPY (.C, HOME_BLOCK[HM1$T_VOLNAME], ' ',

;	0677		     VCB$S_VOLNAME, PROTO_VCB[VCB$T_VOLNAME]);

;	0678	    END

;	0679	ELSE

;	0680	    CH$COPY (.LABEL_STRING[0], .LABEL_STRING[1], ' ',

;	0681		     VCB$S_VOLNAME, PROTO_VCB[VCB$T_VOLNAME]);

;	0682	

;	0683	IF NOT .MOUNT_OPTIONS[OPT_FOREIGN]

;	0684	THEN

;	0685	    BEGIN

;	0686	    PROTO_VCB[VCB$L_HOMELBN] = .HOMEBLOCK_LBN; ! home block LBN

;	0687						! index file bitmap LBN

;	0688	    PROTO_VCB[VCB$L_IBMAPLBN] = ROT (.HOME_BLOCK[HM1$L_IBMAPLBN], 16);

;	0689	    PROTO_VCB[VCB$W_CLUSTER] = 1;		! volume cluster factor

;	0690						! default window size

;	0691	    PROTO_VCB[VCB$B_WINDOW] = .HOME_BLOCK[HM1$B_WINDOW];

;	0692	    IF .PROTO_VCB[VCB$B_WINDOW] EQL 0

;	0693	    THEN PROTO_VCB[VCB$B_WINDOW] = 7;

;	0694	    IF .MOUNT_OPTIONS[OPT_SYSTEM]

;	0695	    THEN PROTO_VCB[VCB$B_WINDOW] = .ACP$GB_WINDOW;

;	0696	    IF .MOUNT_OPTIONS[OPT_WINDOW]

;	0697	    THEN PROTO_VCB[VCB$B_WINDOW] = .WINDOW;

;	0698						! directory LRU limit

;	0699	    PROTO_VCB[VCB$B_LRU_LIM] = .HOME_BLOCK[HM1$B_LRU_LIM];

;	0700	    IF .MOUNT_OPTIONS[OPT_SYSTEM]

;	0701	    THEN PROTO_VCB[VCB$B_LRU_LIM] = .ACP$GW_SYSACC;

;	0702	    IF .MOUNT_OPTIONS[OPT_ACCESSED]

;	0703	    THEN PROTO_VCB[VCB$B_LRU_LIM] = .ACCESSED;

;	0704						! default file extend

;	0705	    PROTO_VCB[VCB$W_EXTEND] = .HOME_BLOCK[HM1$B_EXTEND];

;	0706	    IF .PROTO_VCB[VCB$W_EXTEND] EQL 0

;	0707	    THEN PROTO_VCB[VCB$W_EXTEND] = 5;

;	0708	    IF .MOUNT_OPTIONS[OPT_EXTENSION]

;	0709	    THEN PROTO_VCB[VCB$W_EXTEND] = .EXTENSION;

;	0710						! index file bitmap size

;	0711	    PROTO_VCB[VCB$B_IBMAPSIZE] = .HOME_BLOCK[HM1$W_IBMAPSIZE];

;	0712						! maximum number of files

;	0713	    PROTO_VCB[VCB$L_MAXFILES] = .HOME_BLOCK[HM1$W_MAXFILES];

;	0714	

;	0715	! Now read the index file header, verify it, and initialize the prototype

;	0716	! index file FCB.

;	0717	!

;	0718	

;	0719	    HEADER_LBN = .PROTO_VCB[VCB$L_IBMAPLBN] + .PROTO_VCB[VCB$B_IBMAPSIZE];

;	0720	    STATUS = READ_BLOCK (.HEADER_LBN, BUFFER);

;	0721	    IF NOT .STATUS THEN ERR_EXIT (.STATUS);

;	0722	    IF NOT CHECK_HEADER (BUFFER, UPLIT WORD (1, 1, 0)) THEN ERR_EXIT ();

;	0723	

;	0724	    CH$FILL (0, FCB$C_LENGTH, PROTO_FCB);

;	0725	    PROTO_FCB[FCB$L_STVBN] = 1;

;	0726	    INIT_FCB (PROTO_FCB, BUFFER);

;	0727	    PROTO_FCB[FCB$W_ACNT] = 1;

;	0728	    IF NOT .MOUNT_OPTIONS[OPT_UNLOCK]

;	0729	    THEN PROTO_FCB[FCB$W_LCNT] = 1;

;	0730	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-4

; Digital Equipment Corporation

;

;	0731	! Build the prototype index file window.

;	0732	!

;	0733	

;	0734	    CH$FILL (0, WCB$C_LENGTH, PROTO_WCB);

;	0735	    PROTO_WCB[WCB$W_SIZE] = WCB$C_LENGTH + WINDOW_SIZE;

;	0736	    PROTO_WCB[WCB$V_READ] = 1;

;	0737	    IF NOT .MOUNT_OPTIONS[OPT_UNLOCK]

;	0738	    THEN PROTO_WCB[WCB$V_NOWRITE] = 1;

;	0739	    TURN_WINDOW1 (PROTO_WCB, BUFFER, 3, 1);

;	0740	

;	0741	! Now read the storage map file header and find the starting LBN of the

;	0742	! storage map. Note that we skip the "storage control block", which may or

;	0743	! may not be represented by a separate retrieval pointer.

;	0744	!

;	0745	

;	0746	    STATUS = READ_BLOCK (.PROTO_VCB[VCB$L_IBMAPLBN] + .PROTO_VCB[VCB$B_IBMAPSIZE] + 1, BUFFER);

;	0747	    IF NOT .STATUS OR NOT CHECK_HEADER (BUFFER, UPLIT WORD (2, 2, 0))

;	0748	    THEN

;	0749		BEGIN

;	0750		ERR_MESSAGE (MOUN$_MAPHDRBAD);

;	0751		PROTO_VCB[VCB$V_NOALLOC] = 1;

;	0752		END

;	0753	

;	0754	    ELSE

;	0755		BEGIN

;	0756		MAP_AREA = BUFFER + .BUFFER[FH1$B_MPOFFSET]*2;

;	0757		MAP_POINTER = .MAP_AREA + FM1$C_POINTERS;

;	0758	

;	0759		BIAS = 1;				! assume one retrieval pointer

;	0760		IF .MAP_AREA[FM1$B_INUSE] GTR 4

;	0761		OR .MAP_AREA[FM1$B_INUSE] LSS 2

;	0762		THEN ERR_EXIT (SS$_FILESTRUCT);	! more than 2 or no pointers

;	0763		IF .MAP_AREA[FM1$B_INUSE] EQL 4

;	0764		THEN

;	0765		    BEGIN

;	0766		    BIAS = 0;			! 2 pointers - use the second

;	0767		    MAP_POINTER = .MAP_POINTER + 4;

;	0768		    END;

;	0769	

;	0770		COUNT = .(.MAP_POINTER)<8,8> + 1 - .BIAS;

;	0771		LBN = .(.MAP_POINTER)<16,16>;

;	0772		LBN<16,8> = .(.MAP_POINTER)<0,8>;

;	0773		LBN = .LBN + .BIAS;

;	0774	

;	0775		PROTO_VCB[VCB$L_SBMAPLBN] = .LBN;

;	0776		PROTO_VCB[VCB$B_SBMAPSIZE] = .COUNT;

;	0777	

;	0778	! Scan the storage map to compute the number of free blocks on the volume.

;	0779	!

;	0780	

;	0781		FREE = 0;

;	0782		DECR J FROM .COUNT TO 1 DO

;	0783		    BEGIN

;	0784		    MAP BUFFER : VECTOR;

;	0785	



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-5

; Digital Equipment Corporation

;

;	0786		    STATUS = READ_BLOCK (.LBN, BUFFER);

;	0787		    IF NOT .STATUS

;	0788		    THEN

;	0789			BEGIN

;	0790			ERR_MESSAGE (MOUN$_BITMAPERR, 0, .STATUS);

;	0791			PROTO_VCB[VCB$V_NOALLOC] = 1;

;	0792			FREE = 0;

;	0793			EXITLOOP;

;	0794			END;

;	0795	

;	0796		    INCR I FROM 0 TO 127 DO

;	0797			BEGIN

;	0798			X = .BUFFER[.I];

;	0799			IF .X NEQ 0

;	0800			THEN

;	0801			    BEGIN

;	0802			    B2 = 0;

;	0803			    WHILE 1 DO

;	0804				BEGIN

;	0805				IF FFS (B2, %REF (32-.B2), X, B1)

;	0806				THEN EXITLOOP;

;	0807				FFC (B1, %REF (32-.B1), X, B2);

;	0808				FREE = .FREE + .B2 - .B1;

;	0809				IF .B2 GEQ 32 THEN EXITLOOP;

;	0810				END;

;	0811			    END;

;	0812			END;

;	0813		    LBN = .LBN + 1;

;	0814		    END;

;	0815	

;	0816		PROTO_VCB[VCB$L_FREE] = .FREE;

;	0817		END;

;	0818	

;	0819	    END;				! end of Files-11 specific mount processing

;	0820	

;	0821	! Finally call the kernel mode routine to make it all real. Note that all the

;	0822	! hookups, including generating the mounted volume list entry, are done

;	0823	! within one kernel mode call so that they are uninterruptible by the user.

;	0824	!

;	0825	

;	0826	STATUS = KERNEL_CALL (MAKE_DISK_MOUNT);

;	0827	IF NOT .STATUS THEN ERR_EXIT (.STATUS);

;	0828	

;	0829	! Announce that the volume is mounted.

;	0830	!

;	0831	

;	0832	ERR_MESSAGE (MOUN$_MOUNTED, 3, VCB$S_VOLNAME, PROTO_VCB[VCB$T_VOLNAME], PHYS_NAME[0]);

;	0833	

;	0834	END;					! end of routine MOUNT_DISK





							    .TITLE  MOUDK1

							    .IDENT  \X0011\



							    .PSECT  $PLIT$,NOWRT,NOEXE,2



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-6

; Digital Equipment Corporation

;



					      00000 P.AAA:  .WORD   1, 1, 0						      ;

					      00006	    .BLKB   2

					      00008 P.AAB:  .WORD   2, 2, 0						      ;

					      0000E	    .BLKB   2



							    .PSECT  $OWN$,NOEXE,2



					      00000 BUFFER: .BLKB   512

					      00200 PROTO_VCB:

							    .BLKB   84

					      00254 PROTO_FCB:

							    .BLKB   72

					      0029C PROTO_WCB:

							    .BLKB   216

					      00374 SYSEXV: .BLKB   8

					      0037C VOLUME_UIC:

							    .BLKB   4



							    .GLOBL  MOUNT_OPTIONS, DEVICE_CHAR, LABEL_STRING, PHYS_NAME

							    .GLOBL  DEVICE_COUNT, DRIVE_COUNT, WINDOW, ACCESSED, EXTENSION

							    .GLOBL  HOME_BLOCK, HOMEBLOCK_LBN, HEADER_LBN, CTL$GL_PHD

							    .GLOBL  ACP$GB_WINDOW, ACP$GW_SYSACC, GET_UIC, CHECK_HEADER

							    .GLOBL  READ_BLOCK, INIT_FCB, TURN_WINDOW1, SYS$CMKRNL



							    .PSECT  $CODE$,NOWRT,2



					 0FFC 00000 	    .ENTRY  MOUNT_DISK1, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 0511

		         59 00000000G  00  9E 00002 	    MOVAB   LIB$STOP, R9					      ;

		         5A	0000G  CF  9E 00009 	    MOVAB   MOUNT_OPTIONS, R10					      ;

		         5B	0000'  CF  9E 0000E 	    MOVAB   BUFFER, R11						      ;

		         01	0000G  CF  D1 00013 	    CMPL    DEVICE_COUNT, #1					      ; 0609

				       07  12 00018 	    BNEQ    1$							      ;

		         01	0000G  CF  D1 0001A 	    CMPL    DRIVE_COUNT, #1					      ;

				       09  15 0001F 	    BLEQ    2$							      ;

			    00728174   8F  DD 00021 1$:     PUSHL   #7504244						      ; 0610

		         69	       01  FB 00027 	    CALLS   #1, LIB$STOP					      ;

				       7E  D4 0002A 2$:     CLRL    -(SP)						      ; 0612

				       5E  DD 0002C 	    PUSHL   SP							      ;

				0000G  CF  9F 0002E 	    PUSHAB  GET_UIC						      ;

	      00000000G  9F	       03  FB 00032 	    CALLS   #3, @#SYS$CMKRNL					      ;

		         52	       50  D0 00039 	    MOVL    R0, PROCESS_UIC					      ;

		         50 00000000G  9F  D0 0003C 	    MOVL    @#CTL$GL_PHD, PRIVILEGE_MASK			      ; 0613

				037C   CB  D4 00043 	    CLRL    VOLUME_UIC						      ; 0614

	   0E	         6A	       21  E1 00047 	    BBC     #33, MOUNT_OPTIONS, 3$				      ; 0615

		  037C   CB	0000G  CF  9A 0004B 	    MOVZBL  HOME_BLOCK+30, VOLUME_UIC				      ; 0618

		  037E   CB	0000G  CF  90 00052 	    MOVB    HOME_BLOCK+31, VOLUME_UIC+2				      ; 0619

	   11	         6A	       20  E1 00059 3$:     BBC     #32, MOUNT_OPTIONS, 4$				      ; 0623

	   0D	         60	       15  E0 0005D 	    BBS     #21, (PRIVILEGE_MASK), 4$				      ; 0624

				037C   CB  D5 00061 	    TSTL    VOLUME_UIC						      ; 0625

				       07  13 00065 	    BEQL    4$							      ;

		         52	037C   CB  D1 00067 	    CMPL    VOLUME_UIC, PROCESS_UIC				      ; 0626

				       2C  12 0006C 	    BNEQ    8$							      ;

		         14	  03   AA  E8 0006E 4$:     BLBS    MOUNT_OPTIONS+3, 5$					      ; 0630

	   0F	    03   AA	       01  E0 00072 	    BBS     #1, MOUNT_OPTIONS+3, 5$				      ; 0631



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-7

; Digital Equipment Corporation

;

	   0A	    03   AA	       02  E0 00077 	    BBS     #2, MOUNT_OPTIONS+3, 5$				      ; 0632

	   05	    03   AA	       03  E0 0007C 	    BBS     #3, MOUNT_OPTIONS+3, 5$				      ; 0633

	   04	    03   AA	       04  E1 00081 	    BBC     #4, MOUNT_OPTIONS+3, 6$				      ; 0634

	   10	         60	       12  E1 00086 5$:     BBC     #18, (PRIVILEGE_MASK), 8$				      ; 0636

	   04	         6A	       07  E1 0008A 6$:     BBC     #7, MOUNT_OPTIONS, 7$				      ; 0640

	   08	         60	       03  E1 0008E 	    BBC     #3, (PRIVILEGE_MASK), 8$				      ; 0641

		         09	  01   AA  E9 00092 7$:     BLBC    MOUNT_OPTIONS+1, 9$					      ; 0645

	   05	         60	       02  E0 00096 	    BBS     #2, (PRIVILEGE_MASK), 9$				      ; 0646

				       24  DD 0009A 8$:     PUSHL   #36							      ; 0649

		         69	       01  FB 0009C 	    CALLS   #1, LIB$STOP					      ;

	   05	    01   AA	       03  E1 0009F 9$:     BBC     #3, MOUNT_OPTIONS+1, 10$				      ; 0651

		  037C   CB	       52  D0 000A4 	    MOVL    PROCESS_UIC, VOLUME_UIC				      ; 0652

	   00	         6E	       00  2C 000A9 10$:    MOVC5   #0, (SP), #0, #84, PROTO_VCB			      ; 0657

		  0200   CB	0054   8F     000AD									      ;

		  020C   CB	       01  B0 000B3 	    MOVW    #1, PROTO_VCB+12					      ; 0658

		  024C   CB	       01  B0 000B8 	    MOVW    #1, PROTO_VCB+76					      ; 0659

	   06	         6A	       07  E1 000BD 	    BBC     #7, MOUNT_OPTIONS, 11$				      ; 0661

		  020B   CB	  40   8F  88 000C1 	    BISB2   #64, PROTO_VCB+11					      ; 0662

		         06	  01   AA  E9 000C7 11$:    BLBC    MOUNT_OPTIONS+1, 12$				      ; 0663

		  020B   CB	  80   8F  88 000CB 	    BISB2   #128, PROTO_VCB+11					      ; 0664

	   33	         6A	       21  E1 000D1 12$:    BBC     #33, MOUNT_OPTIONS, 16$				      ; 0666

	   05	    01   AA	       03  E1 000D5 	    BBC     #3, MOUNT_OPTIONS+1, 13$				      ; 0667

	   29	    03   AA	       07  E0 000DA 	    BBS     #7, MOUNT_OPTIONS+3, 16$				      ;

    0000G  CF	         0C	       00  3A 000DF 13$:    LOCC    #0, #12, HOME_BLOCK+14				      ; 0672

				       02  12 000E5 	    BNEQ    14$							      ;

				       51  D4 000E7 	    CLRL    R1							      ;

		         50	       51  D0 000E9 14$:    MOVL    R1, P						      ;

		         52	       0C  D0 000EC 	    MOVL    #12, C						      ; 0673

				       50  D5 000EF 	    TSTL    P							      ; 0674

				       09  13 000F1 	    BEQL    15$							      ;

		         51	0000G  CF  9E 000F3 	    MOVAB   HOME_BLOCK+14, R1					      ; 0675

	   52	         50	       51  C3 000F8 	    SUBL3   R1, P, C						      ;

	   20	  0000G  CF	       52  2C 000FC 15$:    MOVC5   C, HOME_BLOCK+14, #32, #12, PROTO_VCB+20		      ; 0676

		  0214   CB	       0C     00102									      ;

				       0C  11 00106 	    BRB     17$							      ; 0666

	   20	  0000G  DF	0000G  CF  2C 00108 16$:    MOVC5   LABEL_STRING, @LABEL_STRING+4, #32, #12, PROTO_VCB+20     ; 0680

		  0214   CB	       0C     00110									      ;

	   03	    01   AA	       03  E1 00114 17$:    BBC     #3, MOUNT_OPTIONS+1, 18$				      ; 0683

				     0205  31 00119 	    BRW     42$							      ;

		  0224   CB	0000G  CF  D0 0011C 18$:    MOVL    HOMEBLOCK_LBN, PROTO_VCB+36				      ; 0686

    0230   CB	  0000G  CF	       10  9C 00123 	    ROTL    #16, HOME_BLOCK+2, PROTO_VCB+48			      ; 0688

		  023C   CB	       01  B0 0012B 	    MOVW    #1, PROTO_VCB+60					      ; 0689

		  0248   CB	0000G  CF  90 00130 	    MOVB    HOME_BLOCK+44, PROTO_VCB+72				      ; 0691

				       05  12 00137 	    BNEQ    19$							      ; 0692

		  0248   CB	       07  90 00139 	    MOVB    #7, PROTO_VCB+72					      ; 0693

		         09	  01   AA  E9 0013E 19$:    BLBC    MOUNT_OPTIONS+1, 20$				      ; 0694

		  0248   CB 00000000G  9F  90 00142 	    MOVB    @#ACP$GB_WINDOW, PROTO_VCB+72			      ; 0695

		         07	  03   AA  E9 0014B 20$:    BLBC    MOUNT_OPTIONS+3, 21$				      ; 0696

		  0248   CB	0000G  CF  90 0014F 	    MOVB    WINDOW, PROTO_VCB+72				      ; 0697

		  0249   CB	0000G  CF  90 00156 21$:    MOVB    HOME_BLOCK+46, PROTO_VCB+73				      ; 0699

		         09	  01   AA  E9 0015D 	    BLBC    MOUNT_OPTIONS+1, 22$				      ; 0700

		  0249   CB 00000000G  9F  90 00161 	    MOVB    @#ACP$GW_SYSACC, PROTO_VCB+73			      ; 0701

	   07	    03   AA	       01  E1 0016A 22$:    BBC     #1, MOUNT_OPTIONS+3, 23$				      ; 0702

		  0249   CB	0000G  CF  90 0016F 	    MOVB    ACCESSED, PROTO_VCB+73				      ; 0703

		  023E   CB	0000G  CF  9B 00176 23$:    MOVZBW  HOME_BLOCK+45, PROTO_VCB+62				      ; 0705



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-8

; Digital Equipment Corporation

;

				       05  12 0017D 	    BNEQ    24$							      ; 0706

		  023E   CB	       05  B0 0017F 	    MOVW    #5, PROTO_VCB+62					      ; 0707

	   07	    02   AA	       07  E1 00184 24$:    BBC     #7, MOUNT_OPTIONS+2, 25$				      ; 0708

		  023E   CB	0000G  CF  B0 00189 	    MOVW    EXTENSION, PROTO_VCB+62				      ; 0709

		  0238   CB	0000G  CF  90 00190 25$:    MOVB    HOME_BLOCK, PROTO_VCB+56				      ; 0711

		  0244   CB	0000G  CF  3C 00197 	    MOVZWL  HOME_BLOCK+6, PROTO_VCB+68				      ; 0713

		         50	0238   CB  9A 0019E 	    MOVZBL  PROTO_VCB+56, R0					      ; 0719

    0000G  CF	  0230   CB	       50  C1 001A3 	    ADDL3   R0, PROTO_VCB+48, HEADER_LBN			      ;

				       5B  DD 001AB 	    PUSHL   R11							      ; 0720

				0000G  CF  DD 001AD 	    PUSHL   HEADER_LBN						      ;

		  0000G  CF	       02  FB 001B1 	    CALLS   #2, READ_BLOCK					      ;

		         56	       50  D0 001B6 	    MOVL    R0, STATUS						      ;

		         05	       56  E8 001B9 	    BLBS    STATUS, 26$						      ; 0721

				       56  DD 001BC 	    PUSHL   STATUS						      ;

		         69	       01  FB 001BE 	    CALLS   #1, LIB$STOP					      ;

				0000'  CF  9F 001C1 26$:    PUSHAB  P.AAA						      ; 0722

				       5B  DD 001C5 	    PUSHL   R11							      ;

		  0000G  CF	       02  FB 001C7 	    CALLS   #2, CHECK_HEADER					      ;

		         05	       50  E8 001CC 	    BLBS    R0, 27$						      ;

				       7E  D4 001CF 	    CLRL    -(SP)						      ;

		         69	       01  FB 001D1 	    CALLS   #1, LIB$STOP					      ;

	   00	         6E	       00  2C 001D4 27$:    MOVC5   #0, (SP), #0, #72, PROTO_FCB			      ; 0724

		  0254   CB	0048   8F     001D8									      ;

		  027C   CB	       01  D0 001DE 	    MOVL    #1, PROTO_FCB+40					      ; 0725

				       5B  DD 001E3 	    PUSHL   R11							      ; 0726

				0254   CB  9F 001E5 	    PUSHAB  PROTO_FCB						      ;

		  0000G  CF	       02  FB 001E9 	    CALLS   #2, INIT_FCB					      ;

		  026C   CB	       01  B0 001EE 	    MOVW    #1, PROTO_FCB+24					      ; 0727

	   05	    01   AA	       02  E0 001F3 	    BBS     #2, MOUNT_OPTIONS+1, 28$				      ; 0728

		  026E   CB	       01  B0 001F8 	    MOVW    #1, PROTO_FCB+26					      ; 0729

	   00	         6E	       00  2C 001FD 28$:    MOVC5   #0, (SP), #0, #36, PROTO_WCB			      ; 0734

		  029C   CB	       24     00201									      ;

		  02A4   CB	  D8   8F  9B 00205 	    MOVZBW  #216, PROTO_WCB+8					      ; 0735

		  02A7   CB	       01  88 0020B 	    BISB2   #1, PROTO_WCB+11					      ; 0736

	   05	    01   AA	       02  E0 00210 	    BBS     #2, MOUNT_OPTIONS+1, 29$				      ; 0737

		  02B0   CB	       01  88 00215 	    BISB2   #1, PROTO_WCB+20					      ; 0738

				       01  DD 0021A 29$:    PUSHL   #1							      ; 0739

				       03  DD 0021C 	    PUSHL   #3							      ;

				       5B  DD 0021E 	    PUSHL   R11							      ;

				029C   CB  9F 00220 	    PUSHAB  PROTO_WCB						      ;

		  0000G  CF	       04  FB 00224 	    CALLS   #4, TURN_WINDOW1					      ;

				       5B  DD 00229 	    PUSHL   R11							      ; 0746

		         50	0238   CB  9A 0022B 	    MOVZBL  PROTO_VCB+56, R0					      ;

		         50	0230   CB  C0 00230 	    ADDL2   PROTO_VCB+48, R0					      ;

				  01   A0  9F 00235 	    PUSHAB  1(R0)						      ;

		  0000G  CF	       02  FB 00238 	    CALLS   #2, READ_BLOCK					      ;

		         56	       50  D0 0023D 	    MOVL    R0, STATUS						      ;

		         0E	       56  E9 00240 	    BLBC    STATUS, 30$						      ; 0747

				0000'  CF  9F 00243 	    PUSHAB  P.AAB						      ;

				       5B  DD 00247 	    PUSHL   R11							      ;

		  0000G  CF	       02  FB 00249 	    CALLS   #2, CHECK_HEADER					      ;

		         15	       50  E8 0024E 	    BLBS    R0, 31$						      ;

			    00729010   8F  DD 00251 30$:    PUSHL   #7507984						      ; 0750

	      00000000G  00	       01  FB 00257 	    CALLS   #1, LIB$SIGNAL					      ;

		  020B   CB	       10  88 0025E 	    BISB2   #16, PROTO_VCB+11					      ; 0751



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-9

; Digital Equipment Corporation

;

				     00BB  31 00263 	    BRW     42$							      ; 0747

		         50	  01   AB  9A 00266 31$:    MOVZBL  BUFFER+1, R0					      ; 0756

		         52	     6B40  3E 0026A 	    MOVAW   BUFFER[R0], MAP_AREA				      ;

	   53	         52	       0A  C1 0026E 	    ADDL3   #10, MAP_AREA, MAP_POINTER				      ; 0757

		         54	       01  D0 00272 	    MOVL    #1, BIAS						      ; 0759

		         04	  08   A2  91 00275 	    CMPB    8(MAP_AREA), #4					      ; 0760

				       06  1A 00279 	    BGTRU   32$							      ;

		         02	  08   A2  91 0027B 	    CMPB    8(MAP_AREA), #2					      ; 0761

				       08  1E 0027F 	    BGEQU   33$							      ;

		         7E	08C0   8F  3C 00281 32$:    MOVZWL  #2240, -(SP)					      ; 0762

		         69	       01  FB 00286 	    CALLS   #1, LIB$STOP					      ;

		         04	  08   A2  91 00289 33$:    CMPB    8(MAP_AREA), #4					      ; 0763

				       05  12 0028D 	    BNEQ    34$							      ;

				       54  D4 0028F 	    CLRL    BIAS						      ; 0766

		         53	       04  C0 00291 	    ADDL2   #4, MAP_POINTER					      ; 0767

		         50	  01   A3  9A 00294 34$:    MOVZBL  1(MAP_POINTER), R0					      ; 0770

		         50	       54  C2 00298 	    SUBL2   BIAS, R0						      ;

				       50  D6 0029B 	    INCL    COUNT						      ;

		         55	  02   A3  3C 0029D 	    MOVZWL  2(MAP_POINTER), LBN					      ; 0771

	   08	         10	       63  F0 002A1 	    INSV    (MAP_POINTER), #16, #8, LBN				      ; 0772

				       55     002A5									      ;

		         55	       54  C0 002A6 	    ADDL2   BIAS, LBN						      ; 0773

		  0234   CB	       55  D0 002A9 	    MOVL    LBN, PROTO_VCB+52					      ; 0775

		  0239   CB	       50  90 002AE 	    MOVB    COUNT, PROTO_VCB+57					      ; 0776

				       52  D4 002B3 	    CLRL    FREE						      ; 0781

	   54	         50	       01  C1 002B5 	    ADDL3   #1, COUNT, J					      ; 0782

				       5E  11 002B9 	    BRB     40$							      ;

				0820   8F  BB 002BB 35$:    PUSHR   #^M<R5,R11>						      ; 0786

		  0000G  CF	       02  FB 002BF 	    CALLS   #2, READ_BLOCK					      ;

		         56	       50  D0 002C4 	    MOVL    R0, STATUS						      ;

		         1A	       56  E8 002C7 	    BLBS    STATUS, 36$						      ; 0787

				       56  DD 002CA 	    PUSHL   STATUS						      ; 0790

				       7E  D4 002CC 	    CLRL    -(SP)						      ;

			    00729020   8F  DD 002CE 	    PUSHL   #7508000						      ;

	      00000000G  00	       03  FB 002D4 	    CALLS   #3, LIB$SIGNAL					      ;

		  020B   CB	       10  88 002DB 	    BISB2   #16, PROTO_VCB+11					      ; 0791

				       52  D4 002E0 	    CLRL    FREE						      ; 0792

				       38  11 002E2 	    BRB     41$							      ; 0793

				       50  D4 002E4 36$:    CLRL    I							      ; 0796

		         57	     6B40  D0 002E6 37$:    MOVL    BUFFER[I], X					      ; 0798

				       23  13 002EA 	    BEQL    39$							      ; 0799

				       53  D4 002EC 	    CLRL    B2							      ; 0802

	   51	         20	       53  C3 002EE 38$:    SUBL3   B2, #32, R1						      ; 0805

	   57	         51	       53  EA 002F2 	    FFS     B2, R1, X, B1					      ;

				       58     002F6									      ;

				       16  13 002F7 	    BEQL    39$							      ;

	   51	         20	       58  C3 002F9 	    SUBL3   B1, #32, R1						      ; 0807

	   57	         51	       58  EB 002FD 	    FFC     B1, R1, X, B2					      ;

				       53     00301									      ;

	   51	         52	       53  C1 00302 	    ADDL3   B2, FREE, R1					      ; 0808

	   52	         51	       58  C3 00306 	    SUBL3   B1, R1, FREE					      ;

		         20	       53  D1 0030A 	    CMPL    B2, #32						      ; 0809

				       DF  19 0030D 	    BLSS    38$							      ;

	   CF	         50 0000007F   8F  F3 0030F 39$:    AOBLEQ  #127, I, 37$					      ; 0796

				       55  D6 00317 	    INCL    LBN							      ; 0813



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 3-10

; Digital Equipment Corporation

;

		         9F	       54  F5 00319 40$:    SOBGTR  J, 35$						      ; 0782

		  0240   CB	       52  D0 0031C 41$:    MOVL    FREE, PROTO_VCB+64					      ; 0816

				       7E  D4 00321 42$:    CLRL    -(SP)						      ; 0826

				       5E  DD 00323 	    PUSHL   SP							      ;

				0000V  CF  9F 00325 	    PUSHAB  MAKE_DISK_MOUNT					      ;

	      00000000G  9F	       03  FB 00329 	    CALLS   #3, @#SYS$CMKRNL					      ;

		         56	       50  D0 00330 	    MOVL    R0, STATUS						      ;

		         05	       56  E8 00333 	    BLBS    STATUS, 43$						      ; 0827

				       56  DD 00336 	    PUSHL   STATUS						      ;

		         69	       01  FB 00338 	    CALLS   #1, LIB$STOP					      ;

				0000G  CF  9F 0033B 43$:    PUSHAB  PHYS_NAME						      ; 0832

				0214   CB  9F 0033F 	    PUSHAB  PROTO_VCB+20					      ;

				       0C  DD 00343 	    PUSHL   #12							      ;

				       03  DD 00345 	    PUSHL   #3							      ;

			    0072A003   8F  DD 00347 	    PUSHL   #7512067						      ;

	      00000000G  00	       05  FB 0034D 	    CALLS   #5, LIB$SIGNAL					      ;

					   04 00354 	    RET     							      ; 0511



; Routine Size:  853 bytes







; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 4

; Digital Equipment Corporation

;

;	0835	ROUTINE MAKE_DISK_MOUNT =

;	0836	

;	0837	!++

;	0838	!

;	0839	! FUNCTIONAL DESCRIPTION:

;	0840	!

;	0841	!	This routine does all of the data base manipulation needed to get

;	0842	!	a volume actually mounted. It allocates the real VCB, FCB, and

;	0843	!	window, and hooks then all together. It also starts up the ACP

;	0844	!	gets the mounted volume list entry made.

;	0845	!

;	0846	!

;	0847	! CALLING SEQUENCE:

;	0848	!	MAKE_DISK_MOUNT ()

;	0849	!

;	0850	! INPUT PARAMETERS:

;	0851	!	NONE

;	0852	!

;	0853	! IMPLICIT INPUTS:

;	0854	!	MOUNT parser data base

;	0855	!	own storage of this module

;	0856	!

;	0857	! OUTPUT PARAMETERS:

;	0858	!	NONE

;	0859	!

;	0860	! IMPLICIT OUTPUTS:

;	0861	!	NONE

;	0862	!

;	0863	! ROUTINE VALUE:

;	0864	!	1 if successful

;	0865	!	status values if not

;	0866	!

;	0867	! SIDE EFFECTS:

;	0868	!	volume mounted

;	0869	!

;	0870	!--

;	0871	

;	0872	BEGIN

;	0873	

;	0874	BUILTIN

;	0875		INSQUE;

;	0876	

;	0877	LOCAL

;	0878		WINDOW_SIZE,			! size in bytes needed for window

;	0879		UCB		: REF BBLOCK;	! pointer to volume UCB

;	0880	

;	0881	EXTERNAL

;	0882		MOUNT_OPTIONS	: BITVECTOR,	! command parser options

;	0883		CLEANUP_FLAGS	: BITVECTOR,	! cleanup action flags

;	0884		CHANNEL,			! channel assigned to device

;	0885		HOME_BLOCK	: BBLOCK,	! buffer containing home block

;	0886		OWNER_UIC,			! owner UIC from command

;	0887		PROTECTION,			! volume protection from command

;	0888		REAL_VCB	: REF BBLOCK,	! address of VCB allocated

;	0889		REAL_FCB	: REF BBLOCK,	! address of FCB allocated



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 4-1

; Digital Equipment Corporation

;

;	0890		REAL_WCB	: REF BBLOCK,	! address of window allocated

;	0891		CTL$GL_VOLUMES	: ADDRESSING_MODE (ABSOLUTE);

;	0892						! count of volumes mounted by process

;	0893	

;	0894	EXTERNAL ROUTINE

;	0895		GET_CHANNELUCB,			! get UCB assigned to channel

;	0896		ALLOCATE_MEM,			! allocate system dynamic memory

;	0897		START_ACP,			! start and connect ACP to device

;	0898		SET_DATACHECK,			! set volume data check attributes

;	0899		LOCK_IODB,			! lock I/O database mutex

;	0900		UNLOCK_IODB,			! unlock I/O database mutex

;	0901		ALLOC_LOGNAME,			! create logical name and MTL blocks

;	0902		ENTER_LOGNAME,			! enter logical name and MTL in lists

;	0903		SEND_ERRLOG;			! send message to error logger

;	0904	

;	0905	

;	0906	! Disable the kernel exception vectors and enable our condition handler.

;	0907	! Then allocate all of the required control blocks. We allocate them in

;	0908	! advance to avoid having to back out of some awkward situations later on.

;	0909	! The one exception is the AQB, which is either found or allocated by

;	0910	! START_ACP.

;	0911	!

;	0912	

;	0913	ENABLE KERNEL_HANDLER;

;	0914	$SETEXV (VECTOR = 0, PRVHND = SYSEXV[0]);

;	0915	$SETEXV (VECTOR = 1, PRVHND = SYSEXV[1]);

;	0916	

;	0917	! ***** For debug: If the previous handler addresses are found to be in

;	0918	! process space, put them back since they belong to the debugger.

;	0919	!

;	0920	

;	0921	IF .SYSEXV[0] GTR 0

;	0922	THEN $SETEXV (VECTOR = 0, ADDRES = .SYSEXV[0]);

;	0923	IF .SYSEXV[1] GTR 0

;	0924	THEN $SETEXV (VECTOR = 1, ADDRES = .SYSEXV[1]);

;	0925	

;	0926	REAL_VCB = ALLOCATE_MEM (VCB$C_LENGTH, 0);

;	0927	REAL_VCB[VCB$B_TYPE] = DYN$C_VCB;

;	0928	CH$MOVE (VCB$C_LENGTH-11, PROTO_VCB+11, .REAL_VCB+11);

;	0929	

;	0930	IF NOT .MOUNT_OPTIONS[OPT_FOREIGN]

;	0931	THEN

;	0932	    BEGIN

;	0933	    REAL_VCB[VCB$L_FCBFL] = REAL_VCB[VCB$L_FCBFL];

;	0934	    REAL_VCB[VCB$L_FCBBL] = REAL_VCB[VCB$L_FCBFL];

;	0935	

;	0936	    REAL_FCB = ALLOCATE_MEM (FCB$C_LENGTH, 0);

;	0937	    REAL_FCB[FCB$B_TYPE] = DYN$C_FCB;

;	0938	    CH$MOVE (FCB$C_LENGTH-11, PROTO_FCB+11, .REAL_FCB+11);

;	0939	    REAL_FCB[FCB$L_WLFL] = REAL_FCB[FCB$L_WLFL];

;	0940	    REAL_FCB[FCB$L_WLBL] = REAL_FCB[FCB$L_WLFL];

;	0941	    INSQUE (.REAL_FCB, REAL_VCB[VCB$L_FCBFL]);

;	0942	

;	0943	    WINDOW_SIZE = WCB$C_LENGTH + MAXU (.PROTO_WCB[WCB$W_NMAP] + 2, 6) * 6;

;	0944	    REAL_WCB = ALLOCATE_MEM (.WINDOW_SIZE, 0);



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 4-2

; Digital Equipment Corporation

;

;	0945	    REAL_WCB[WCB$B_TYPE] = DYN$C_WCB;

;	0946	    CH$MOVE (.WINDOW_SIZE-11, PROTO_WCB+11, .REAL_WCB+11);

;	0947	    REAL_WCB[WCB$L_FCB] = .REAL_FCB;

;	0948	    INSQUE (.REAL_WCB, REAL_FCB[FCB$L_WLFL]);

;	0949	    END;

;	0950	

;	0951	ALLOC_LOGNAME ();

;	0952	

;	0953	! All data blocks except the AQB are now allocated. First set up the

;	0954	! volume ownership and protection in the VCB. Now hook up the blocks

;	0955	! to the device data base and start the ACP.

;	0956	!

;	0957	

;	0958	UCB = GET_CHANNELUCB (.CHANNEL);

;	0959	REAL_VCB[VCB$L_RVT] = .UCB;

;	0960	

;	0961	UCB[UCB$V_UNLOAD] = 1;

;	0962	UCB[UCB$L_OWNUIC] = .VOLUME_UIC;

;	0963	IF .MOUNT_OPTIONS[OPT_OWNER_UIC]

;	0964	THEN UCB[UCB$L_OWNUIC] = .OWNER_UIC;

;	0965	

;	0966	IF .MOUNT_OPTIONS[OPT_FOREIGN]

;	0967	THEN UCB[UCB$W_VPROT] = %X'FF00'

;	0968	ELSE UCB[UCB$W_VPROT] = .HOME_BLOCK[HM1$W_PROTECT];

;	0969	IF .MOUNT_OPTIONS[OPT_GROUP]

;	0970	THEN UCB[UCB$W_VPROT] = .UCB[UCB$W_VPROT] OR %X'F000';

;	0971	IF .MOUNT_OPTIONS[OPT_PROTECTION]

;	0972	THEN UCB[UCB$W_VPROT] = .PROTECTION;

;	0973	

;	0974	IF NOT .MOUNT_OPTIONS[OPT_FOREIGN]

;	0975	THEN

;	0976	    BEGIN

;	0977	    REAL_WCB[WCB$L_ORGUCB] = .UCB;

;	0978	    START_ACP (.UCB, .REAL_VCB, AQB$K_F11V1);

;	0979	    END

;	0980	ELSE

;	0981	    BEGIN

;	0982	    LOCK_IODB ();

;	0983	    UCB[UCB$L_VCB] = .REAL_VCB;

;	0984	    UCB[UCB$L_DEVCHAR] = .UCB[UCB$L_DEVCHAR]

;	0985				OR (DEV$M_MNT OR DEV$M_DIR OR DEV$M_FOR);

;	0986	    SET_DATACHECK (.UCB, 0);

;	0987	    UNLOCK_IODB ();

;	0988	    END;

;	0989	

;	0990	IF .MOUNT_OPTIONS[OPT_NOSHARE] AND .CLEANUP_FLAGS[CLF_DEALLOCATE]

;	0991	THEN UCB[UCB$V_DEADMO] = 1;

;	0992	

;	0993	IF NOT .MOUNT_OPTIONS[OPT_WRITE]

;	0994	THEN BBLOCK [UCB[UCB$L_DEVCHAR], DEV$V_SWL] = 1;

;	0995	

;	0996	! If the device is being mounted /NOSHARE, clear the allocation access

;	0997	! mode in the UCB to make the allocation permanent. Otherwise, set it to

;	0998	! user mode to permit deallocation by the image.

;	0999	!



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 4-3

; Digital Equipment Corporation

;

;	1000	

;	1001	IF .MOUNT_OPTIONS[OPT_NOSHARE]

;	1002	THEN UCB[UCB$B_AMOD] = 0

;	1003	ELSE UCB[UCB$B_AMOD] = 3;

;	1004	

;	1005	! Enter the logical name for the volume; bump the user's volume mount count,

;	1006	! and make the error log entry for the mount.

;	1007	!

;	1008	

;	1009	ENTER_LOGNAME (.UCB, .REAL_VCB);

;	1010	CTL$GL_VOLUMES = .CTL$GL_VOLUMES + 1;

;	1011	SEND_ERRLOG (1, .UCB);

;	1012	

;	1013	! Restore the system exception vectors.

;	1014	!

;	1015	

;	1016	$SETEXV (VECTOR = 0, ADDRES = .SYSEXV[0]);

;	1017	$SETEXV (VECTOR = 1, ADDRES = .SYSEXV[1]);

;	1018	

;	1019	RETURN 1;

;	1020	

;	1021	END;					! end of routine MAKE_DISK_MOUNT







							    .GLOBL  CLEANUP_FLAGS, CHANNEL, OWNER_UIC, PROTECTION

							    .GLOBL  REAL_VCB, REAL_FCB, REAL_WCB, CTL$GL_VOLUMES, GET_CHANNELUCB

							    .GLOBL  ALLOCATE_MEM, START_ACP, SET_DATACHECK, LOCK_IODB

							    .GLOBL  UNLOCK_IODB, ALLOC_LOGNAME, ENTER_LOGNAME, SEND_ERRLOG

							    .GLOBL  SYS$SETEXV



					 0FFC 00355 MAKE_DISK_MOUNT:

							    .WORD   Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11		      ; 0835

		         57	0000G  CF  9E 00357 	    MOVAB   ALLOCATE_MEM, R7					      ;

		         58	0000G  CF  9E 0035C 	    MOVAB   REAL_VCB, R8					      ;

		         59	0000G  CF  9E 00361 	    MOVAB   MOUNT_OPTIONS, R9					      ;

		         5A	0000'  CF  9E 00366 	    MOVAB   SYSEXV, R10						      ;

		         5B 00000000G  9F  9E 0036B 	    MOVAB   @#SYS$SETEXV, R11					      ;

		         6D 000001A9   EF  DE 00372 	    MOVAL   16$, (FP)						      ; 0872

				       5A  DD 00379 	    PUSHL   R10							      ; 0914

				       7E  7C 0037B 	    CLRQ    -(SP)						      ;

				       7E  D4 0037D 	    CLRL    -(SP)						      ;

		         6B	       04  FB 0037F 	    CALLS   #4, SYS$SETEXV					      ;

				  04   AA  9F 00382 	    PUSHAB  SYSEXV+4						      ; 0915

				       7E  7C 00385 	    CLRQ    -(SP)						      ;

				       01  DD 00387 	    PUSHL   #1							      ;

		         6B	       04  FB 00389 	    CALLS   #4, SYS$SETEXV					      ;

		         50	       6A  D0 0038C 	    MOVL    SYSEXV, R0						      ; 0921

				       09  15 0038F 	    BLEQ    1$							      ;

				       7E  7C 00391 	    CLRQ    -(SP)						      ; 0922

				       50  DD 00393 	    PUSHL   R0							      ;

				       7E  D4 00395 	    CLRL    -(SP)						      ;

		         6B	       04  FB 00397 	    CALLS   #4, SYS$SETEXV					      ;

		         50	  04   AA  D0 0039A 1$:     MOVL    SYSEXV+4, R0					      ; 0923

				       09  15 0039E 	    BLEQ    2$							      ;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 4-4

; Digital Equipment Corporation

;

				       7E  7C 003A0 	    CLRQ    -(SP)						      ; 0924

				       50  DD 003A2 	    PUSHL   R0							      ;

				       01  DD 003A4 	    PUSHL   #1							      ;

		         6B	       04  FB 003A6 	    CALLS   #4, SYS$SETEXV					      ;

				       7E  D4 003A9 2$:     CLRL    -(SP)						      ; 0926

		         7E	  54   8F  9A 003AB 	    MOVZBL  #84, -(SP)						      ;

		         67	       02  FB 003AF 	    CALLS   #2, ALLOCATE_MEM					      ;

		         68	       50  D0 003B2 	    MOVL    R0, REAL_VCB					      ;

		         56	       68  D0 003B5 	    MOVL    REAL_VCB, R6					      ; 0927

		    0A   A6	       11  90 003B8 	    MOVB    #17, 10(R6)						      ;

      0B   A6	  FE97   CA	0049   8F  28 003BC 	    MOVC3   #73, PROTO_VCB+11, 11(R6)				      ; 0928

	   76	    01   A9	       03  E0 003C5 	    BBS     #3, MOUNT_OPTIONS+1, 4$				      ; 0930

		         66	       56  D0 003CA 	    MOVL    R6, (R6)						      ; 0933

		    04   A6	       56  D0 003CD 	    MOVL    R6, 4(R6)						      ; 0934

				       7E  D4 003D1 	    CLRL    -(SP)						      ; 0936

		         7E	  48   8F  9A 003D3 	    MOVZBL  #72, -(SP)						      ;

		         67	       02  FB 003D7 	    CALLS   #2, ALLOCATE_MEM					      ;

		  0000G  CF	       50  D0 003DA 	    MOVL    R0, REAL_FCB					      ;

		         56	0000G  CF  D0 003DF 	    MOVL    REAL_FCB, R6					      ; 0937

		    0A   A6	       07  90 003E4 	    MOVB    #7, 10(R6)						      ;

      0B   A6	  FEEB   CA	       3D  28 003E8 	    MOVC3   #61, PROTO_FCB+11, 11(R6)				      ; 0938

		    10   A6	  10   A6  9E 003EF 	    MOVAB   16(R6), 16(R6)					      ; 0939

		    14   A6	  10   A6  9E 003F4 	    MOVAB   16(R6), 20(R6)					      ; 0940

		    00   B8	       66  0E 003F9 	    INSQUE  (R6), @REAL_VCB					      ; 0941

		         50	FF3E   CA  3C 003FD 	    MOVZWL  PROTO_WCB+22, R0					      ; 0943

		         50	       02  C0 00402 	    ADDL2   #2, R0						      ;

		         06	       50  D1 00405 	    CMPL    R0, #6						      ;

				       03  1E 00408 	    BGEQU   3$							      ;

		         50	       06  D0 0040A 	    MOVL    #6, R0						      ;

		         50	       06  C4 0040D 3$:     MULL2   #6, R0						      ;

	   52	         50	       24  C1 00410 	    ADDL3   #36, R0, WINDOW_SIZE				      ;

				       7E  D4 00414 	    CLRL    -(SP)						      ; 0944

				       52  DD 00416 	    PUSHL   WINDOW_SIZE						      ;

		         67	       02  FB 00418 	    CALLS   #2, ALLOCATE_MEM					      ;

		  0000G  CF	       50  D0 0041B 	    MOVL    R0, REAL_WCB					      ;

		         56	0000G  CF  D0 00420 	    MOVL    REAL_WCB, R6					      ; 0945

		    0A   A6	       12  90 00425 	    MOVB    #18, 10(R6)						      ;

		         52	       0B  C2 00429 	    SUBL2   #11, R2						      ; 0946

      0B   A6	  FF33   CA	       52  28 0042C 	    MOVC3   R2, PROTO_WCB+11, 11(R6)				      ;

		         50	0000G  CF  D0 00433 	    MOVL    REAL_FCB, R0					      ; 0947

		    18   A6	       50  D0 00438 	    MOVL    R0, 24(R6)						      ;

		    10   A0	       66  0E 0043C 	    INSQUE  (R6), 16(R0)					      ; 0948

		  0000G  CF	       00  FB 00440 4$:     CALLS   #0, ALLOC_LOGNAME					      ; 0951

				0000G  CF  DD 00445 	    PUSHL   CHANNEL						      ; 0958

		  0000G  CF	       01  FB 00449 	    CALLS   #1, GET_CHANNELUCB					      ;

		         52	       50  D0 0044E 	    MOVL    R0, UCB						      ;

		         51	       68  D0 00451 	    MOVL    REAL_VCB, R1					      ; 0959

		    20   A1	       52  D0 00454 	    MOVL    UCB, 32(R1)						      ;

		    59   A2	       10  88 00458 	    BISB2   #16, 89(UCB)					      ; 0961

		    1C   A2	  08   AA  D0 0045C 	    MOVL    VOLUME_UIC, 28(UCB)					      ; 0962

	   06	    02   A9	       02  E1 00461 	    BBC     #2, MOUNT_OPTIONS+2, 5$				      ; 0963

		    1C   A2	0000G  CF  D0 00466 	    MOVL    OWNER_UIC, 28(UCB)					      ; 0964

		         50	  1A   A2  9E 0046C 5$:     MOVAB   26(UCB), R0						      ; 0967

	   07	    01   A9	       03  E1 00470 	    BBC     #3, MOUNT_OPTIONS+1, 6$				      ; 0966

		         60	FF00   8F  B0 00475 	    MOVW    #-256, (R0)						      ; 0967



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 4-5

; Digital Equipment Corporation

;

				       05  11 0047A 	    BRB     7$							      ; 0966

		         60	0000G  CF  B0 0047C 6$:     MOVW    HOME_BLOCK+32, (R0)					      ; 0968

	   05	         69	       07  E1 00481 7$:     BBC     #7, MOUNT_OPTIONS, 8$				      ; 0969

		    01   A0	  F0   8F  88 00485 	    BISB2   #240, 1(R0)						      ; 0970

	   05	    02   A9	       01  E1 0048A 8$:     BBC     #1, MOUNT_OPTIONS+2, 9$				      ; 0971

		         60	0000G  CF  B0 0048F 	    MOVW    PROTECTION, (R0)					      ; 0972

	   16	    01   A9	       03  E0 00494 9$:     BBS     #3, MOUNT_OPTIONS+1, 10$				      ; 0974

		         50	0000G  CF  D0 00499 	    MOVL    REAL_WCB, R0					      ; 0977

		    10   A0	       52  D0 0049E 	    MOVL    UCB, 16(R0)						      ;

				       01  DD 004A2 	    PUSHL   #1							      ; 0978

				       51  DD 004A4 	    PUSHL   R1							      ;

				       52  DD 004A6 	    PUSHL   UCB							      ;

		  0000G  CF	       03  FB 004A8 	    CALLS   #3, START_ACP					      ;

				       1F  11 004AD 	    BRB     11$							      ; 0974

		  0000G  CF	       00  FB 004AF 10$:    CALLS   #0, LOCK_IODB					      ; 0982

		    30   A2	       68  D0 004B4 	    MOVL    REAL_VCB, 48(UCB)					      ; 0983

		    34   A2 01080008   8F  C8 004B8 	    BISL2   #17301512, 52(UCB)					      ; 0985

				       7E  D4 004C0 	    CLRL    -(SP)						      ; 0986

				       52  DD 004C2 	    PUSHL   UCB							      ;

		  0000G  CF	       02  FB 004C4 	    CALLS   #2, SET_DATACHECK					      ;

		  0000G  CF	       00  FB 004C9 	    CALLS   #0, UNLOCK_IODB					      ; 0987

	   0A	         69	       04  E1 004CE 11$:    BBC     #4, MOUNT_OPTIONS, 12$				      ; 0990

	   04	  0000G  CF	       01  E1 004D2 	    BBC     #1, CLEANUP_FLAGS, 12$				      ;

		    59   A2	       04  88 004D8 	    BISB2   #4, 89(UCB)						      ; 0991

	   04	    01   A9	       01  E0 004DC 12$:    BBS     #1, MOUNT_OPTIONS+1, 13$				      ; 0993

		    37   A2	       02  88 004E1 	    BISB2   #2, 55(UCB)						      ; 0994

	   05	         69	       04  E1 004E5 13$:    BBC     #4, MOUNT_OPTIONS, 14$				      ; 1001

				  53   A2  94 004E9 	    CLRB    83(UCB)						      ; 1002

				       04  11 004EC 	    BRB     15$							      ; 1001

		    53   A2	       03  90 004EE 14$:    MOVB    #3, 83(UCB)						      ; 1003

				       68  DD 004F2 15$:    PUSHL   REAL_VCB						      ; 1009

				       52  DD 004F4 	    PUSHL   UCB							      ;

		  0000G  CF	       02  FB 004F6 	    CALLS   #2, ENTER_LOGNAME					      ;

			    00000000G  9F  D6 004FB 	    INCL    @#CTL$GL_VOLUMES					      ; 1010

				       52  DD 00501 	    PUSHL   UCB							      ; 1011

				       01  DD 00503 	    PUSHL   #1							      ;

		  0000G  CF	       02  FB 00505 	    CALLS   #2, SEND_ERRLOG					      ;

				       7E  7C 0050A 	    CLRQ    -(SP)						      ; 1016

				       6A  DD 0050C 	    PUSHL   SYSEXV						      ;

				       7E  D4 0050E 	    CLRL    -(SP)						      ;

		         6B	       04  FB 00510 	    CALLS   #4, SYS$SETEXV					      ;

				       7E  7C 00513 	    CLRQ    -(SP)						      ; 1017

				  04   AA  DD 00515 	    PUSHL   SYSEXV+4						      ;

				       01  DD 00518 	    PUSHL   #1							      ;

		         6B	       04  FB 0051A 	    CALLS   #4, SYS$SETEXV					      ;

		         50	       01  D0 0051D 	    MOVL    #1, R0						      ; 1019

					   04 00520 	    RET     							      ; 0835

					 0000 00521 16$:    .WORD   Save nothing					      ; 0872

				       7E  D4 00523 	    CLRL    -(SP)						      ;

				       5E  DD 00525 	    PUSHL   SP							      ;

		         7E	  04   AC  7D 00527 	    MOVQ    4(AP), -(SP)					      ;

		  0000V  CF	       03  FB 0052B 	    CALLS   #3, KERNEL_HANDLER					      ;

					   04 00530 	    RET     							      ;



; Routine Size:  476 bytes



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 4-6

; Digital Equipment Corporation

;







; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 5

; Digital Equipment Corporation

;

;	1022	ROUTINE KERNEL_HANDLER (SIGNAL, MECHANISM) : NOVALUE =

;	1023	

;	1024	!++

;	1025	!

;	1026	! FUNCTIONAL DESCRIPTION:

;	1027	!

;	1028	!	This routine is the condition handler for all of the kernel mode

;	1029	!	code. It undoes any damage done so far and returns the error

;	1030	!	status to the user mode caller.

;	1031	!

;	1032	!

;	1033	! CALLING SEQUENCE:

;	1034	!	KERNEL_HANDLER (ARG1, ARG2)

;	1035	!

;	1036	! INPUT PARAMETERS:

;	1037	!	ARG1: address of signal vector

;	1038	!	ARG2: address of mechanism vector

;	1039	!

;	1040	! IMPLICIT INPUTS:

;	1041	!	global pointers to blocks allocated

;	1042	!

;	1043	! OUTPUT PARAMETERS:

;	1044	!	NONE

;	1045	!

;	1046	! IMPLICIT OUTPUTS:

;	1047	!	NONE

;	1048	!

;	1049	! ROUTINE VALUE:

;	1050	!	NONE

;	1051	!

;	1052	! SIDE EFFECTS:

;	1053	!	stack unwound, allocations undone

;	1054	!

;	1055	!--

;	1056	

;	1057	BEGIN

;	1058	

;	1059	MAP

;	1060		SIGNAL		: REF BBLOCK,	! signal vector

;	1061		MECHANISM	: REF BBLOCK;	! mechanism vector

;	1062	

;	1063	LOCAL

;	1064		P		: REF BBLOCK,	! pointer to scan system lists

;	1065		AREA;				! allocation area code

;	1066	

;	1067	EXTERNAL

;	1068		MOUNT_OPTIONS	: BITVECTOR,	! command parser options

;	1069		CLEANUP_FLAGS	: BITVECTOR,	! cleanup action flags

;	1070		MAILBOX_CHANNEL,		! channel number of ACP mailbox

;	1071		REAL_VCB	: REF BBLOCK,	! address of VCB allocated

;	1072		REAL_FCB	: REF BBLOCK,	! address of FCB allocated

;	1073		REAL_WCB	: REF BBLOCK,	! address of window allocated

;	1074		REAL_AQB	: REF BBLOCK,	! address of AQB allocated

;	1075		LOG_ENTRY	: REF BBLOCK,	! address of logical name allocated

;	1076		MTL_ENTRY	: REF BBLOCK,	! address of mounted volume list entry



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 5-1

; Digital Equipment Corporation

;

;	1077		IOC$GL_AQBLIST	: REF BBLOCK ADDRESSING_MODE (ABSOLUTE);

;	1078						! system AQB list

;	1079	

;	1080	EXTERNAL ROUTINE

;	1081		LOCK_IODB,			! interlock system I/O database

;	1082		UNLOCK_IODB,			! unlock system I/O database

;	1083		DEALLOCATE_MEM;			! deallocate system dynamic memory

;	1084	

;	1085	

;	1086	! Deallocate whatever control blocks exist to wherever they came from.

;	1087	!

;	1088	

;	1089	IF .SIGNAL[CHF$L_SIG_NAME] NEQ SS$_UNWIND

;	1090	THEN

;	1091	    BEGIN

;	1092	

;	1093	! Restore the system exception vectors.

;	1094	!

;	1095	

;	1096	    $SETEXV (VECTOR = 0, ADDRES = .SYSEXV[0]);

;	1097	    $SETEXV (VECTOR = 1, ADDRES = .SYSEXV[1]);

;	1098	

;	1099	! If there is a mailbox in existence, deassign its channel, thereby

;	1100	! deleting the mailbox.

;	1101	!

;	1102	

;	1103	    IF .CLEANUP_FLAGS[CLF_DEASSMBX]

;	1104	    THEN

;	1105		$DASSGN (CHAN = .MAILBOX_CHANNEL);

;	1106	

;	1107	! If we have created an AQB but no ACP, we must remove the AQB from the

;	1108	! system list.

;	1109	!

;	1110	

;	1111	    IF .CLEANUP_FLAGS[CLF_DELAQB]

;	1112	    THEN

;	1113		BEGIN

;	1114		LOCK_IODB ();

;	1115		P = .IOC$GL_AQBLIST;

;	1116		IF .P EQL .REAL_AQB

;	1117		THEN

;	1118		    IOC$GL_AQBLIST = .REAL_AQB[AQB$L_LINK]

;	1119		ELSE

;	1120		    BEGIN

;	1121		    UNTIL .P[AQB$L_LINK] EQL .REAL_AQB

;	1122		    DO P = .P[AQB$L_LINK];

;	1123		    P[AQB$L_LINK] = .REAL_AQB[AQB$L_LINK];

;	1124		    END;

;	1125		DEALLOCATE_MEM (.REAL_AQB, 0);

;	1126		UNLOCK_IODB ();

;	1127		END;

;	1128	

;	1129	    AREA = 2;				! assume process allocation area

;	1130	    IF .MOUNT_OPTIONS[OPT_GROUP]

;	1131	    OR .MOUNT_OPTIONS[OPT_SYSTEM]



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 5-2

; Digital Equipment Corporation

;

;	1132	    THEN AREA = 1;			! system paged pool if system or group

;	1133	

;	1134	    IF .REAL_VCB NEQ 0

;	1135	    THEN DEALLOCATE_MEM (.REAL_VCB, 0);

;	1136	

;	1137	    IF .REAL_FCB NEQ 0

;	1138	    THEN DEALLOCATE_MEM (.REAL_FCB, 0);

;	1139	

;	1140	    IF .REAL_WCB NEQ 0

;	1141	    THEN DEALLOCATE_MEM (.REAL_WCB, 0);

;	1142	

;	1143	    IF .LOG_ENTRY NEQ 0

;	1144	    THEN DEALLOCATE_MEM (.LOG_ENTRY, .AREA);

;	1145	

;	1146	    IF .MTL_ENTRY NEQ 0

;	1147	    THEN DEALLOCATE_MEM (.MTL_ENTRY, .AREA);

;	1148	

;	1149	! Return the condition code in R0.

;	1150	!

;	1151	

;	1152	    MECHANISM[CHF$L_MCH_SAVR0] = .SIGNAL[CHF$L_SIG_NAME];

;	1153	    $UNWIND ();

;	1154	

;	1155	    END;

;	1156	END;					! end of routine KERNEL_HANDLER







							    .GLOBL  MAILBOX_CHANNEL, REAL_AQB, LOG_ENTRY, MTL_ENTRY

							    .GLOBL  IOC$GL_AQBLIST, DEALLOCATE_MEM, SYS$DASSGN, SYS$UNWIND



					 0E0C 00531 KERNEL_HANDLER:

							    .WORD   Save R2,R3,R9,R10,R11				      ; 1022

		         59 00000000G  9F  9E 00533 	    MOVAB   @#IOC$GL_AQBLIST, R9				      ;

		         5A 00000000G  9F  9E 0053A 	    MOVAB   @#SYS$SETEXV, R10					      ;

		         5B	0000G  CF  9E 00541 	    MOVAB   DEALLOCATE_MEM, R11					      ;

		         53	  04   AC  D0 00546 	    MOVL    SIGNAL, R3						      ; 1089

	      00000920   8F	  04   A3  D1 0054A 	    CMPL    4(R3), #2336					      ;

				       01  12 00552 	    BNEQ    1$							      ;

					   04 00554 	    RET     							      ;

				       7E  7C 00555 1$:     CLRQ    -(SP)						      ; 1096

				0000'  CF  DD 00557 	    PUSHL   SYSEXV						      ;

				       7E  D4 0055B 	    CLRL    -(SP)						      ;

		         6A	       04  FB 0055D 	    CALLS   #4, SYS$SETEXV					      ;

				       7E  7C 00560 	    CLRQ    -(SP)						      ; 1097

				0000'  CF  DD 00562 	    PUSHL   SYSEXV+4						      ;

				       01  DD 00566 	    PUSHL   #1							      ;

		         6A	       04  FB 00568 	    CALLS   #4, SYS$SETEXV					      ;

	   0B	  0000G  CF	       03  E1 0056B 	    BBC     #3, CLEANUP_FLAGS, 2$				      ; 1103

				0000G  CF  DD 00571 	    PUSHL   MAILBOX_CHANNEL					      ; 1105

	      00000000G  9F	       01  FB 00575 	    CALLS   #1, @#SYS$DASSGN					      ;

	   35	  0000G  CF	       02  E1 0057C 2$:     BBC     #2, CLEANUP_FLAGS, 6$				      ; 1111

		  0000G  CF	       00  FB 00582 	    CALLS   #0, LOCK_IODB					      ; 1114

		         50	       69  D0 00587 	    MOVL    IOC$GL_AQBLIST, P					      ; 1115

		         51	0000G  CF  D0 0058A 	    MOVL    REAL_AQB, R1					      ; 1116



; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 5-3

; Digital Equipment Corporation

;

		         51	       50  D1 0058F 	    CMPL    P, R1						      ;

				       06  12 00592 	    BNEQ    3$							      ;

		         69	  10   A1  D0 00594 	    MOVL    16(R1), IOC$GL_AQBLIST				      ; 1118

				       11  11 00598 	    BRB     5$							      ; 1116

		         51	  10   A0  D1 0059A 3$:     CMPL    16(P), R1						      ; 1121

				       06  13 0059E 	    BEQL    4$							      ;

		         50	  10   A0  D0 005A0 	    MOVL    16(P), P						      ; 1122

				       F4  11 005A4 	    BRB     3$							      ; 1121

		    10   A0	  10   A1  D0 005A6 4$:     MOVL    16(R1), 16(P)					      ; 1123

				       7E  D4 005AB 5$:     CLRL    -(SP)						      ; 1125

				       51  DD 005AD 	    PUSHL   R1							      ;

		         6B	       02  FB 005AF 	    CALLS   #2, DEALLOCATE_MEM					      ;

		  0000G  CF	       00  FB 005B2 	    CALLS   #0, UNLOCK_IODB					      ; 1126

		         52	       02  D0 005B7 6$:     MOVL    #2, AREA						      ; 1129

	   05	  0000G  CF	       07  E0 005BA 	    BBS     #7, MOUNT_OPTIONS, 7$				      ; 1130

		         03	0000G  CF  E9 005C0 	    BLBC    MOUNT_OPTIONS+1, 8$					      ; 1131

		         52	       01  D0 005C5 7$:     MOVL    #1, AREA						      ; 1132

		         50	0000G  CF  D0 005C8 8$:     MOVL    REAL_VCB, R0					      ; 1134

				       07  13 005CD 	    BEQL    9$							      ;

				       7E  D4 005CF 	    CLRL    -(SP)						      ; 1135

				       50  DD 005D1 	    PUSHL   R0							      ;

		         6B	       02  FB 005D3 	    CALLS   #2, DEALLOCATE_MEM					      ;

		         50	0000G  CF  D0 005D6 9$:     MOVL    REAL_FCB, R0					      ; 1137

				       07  13 005DB 	    BEQL    10$							      ;

				       7E  D4 005DD 	    CLRL    -(SP)						      ; 1138

				       50  DD 005DF 	    PUSHL   R0							      ;

		         6B	       02  FB 005E1 	    CALLS   #2, DEALLOCATE_MEM					      ;

		         50	0000G  CF  D0 005E4 10$:    MOVL    REAL_WCB, R0					      ; 1140

				       07  13 005E9 	    BEQL    11$							      ;

				       7E  D4 005EB 	    CLRL    -(SP)						      ; 1141

				       50  DD 005ED 	    PUSHL   R0							      ;

		         6B	       02  FB 005EF 	    CALLS   #2, DEALLOCATE_MEM					      ;

		         50	0000G  CF  D0 005F2 11$:    MOVL    LOG_ENTRY, R0					      ; 1143

				       05  13 005F7 	    BEQL    12$							      ;

				       05  BB 005F9 	    PUSHR   #^M<R0,R2>						      ; 1144

		         6B	       02  FB 005FB 	    CALLS   #2, DEALLOCATE_MEM					      ;

		         50	0000G  CF  D0 005FE 12$:    MOVL    MTL_ENTRY, R0					      ; 1146

				       05  13 00603 	    BEQL    13$							      ;

				       05  BB 00605 	    PUSHR   #^M<R0,R2>						      ; 1147

		         6B	       02  FB 00607 	    CALLS   #2, DEALLOCATE_MEM					      ;

		         50	  08   AC  D0 0060A 13$:    MOVL    MECHANISM, R0					      ; 1152

		    0C   A0	  04   A3  D0 0060E 	    MOVL    4(R3), 12(R0)					      ;

				       7E  7C 00613 	    CLRQ    -(SP)						      ; 1153

	      00000000G  9F	       02  FB 00615 	    CALLS   #2, @#SYS$UNWIND					      ;

					   04 0061C 14$:    RET     							      ; 1022



; Routine Size:  236 bytes





;	1157	

;	1158	END

;	1159	ELUDOM









; Bliss-32 7.352	Saturday 21-AUG-1978 23:53:24	DBB3:[MOUNT.SRC]MOUDK1.B32;21					Page 5-4

; Digital Equipment Corporation

;



							    .GLOBL  LIB$SIGNAL, LIB$STOP



;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $OWN$          	   896    WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $PLIT$         	    16  NOWRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $CODE$         	  1565  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        84         1       285











; Size:		1565 code + 912 data bytes

; Run Time:	00:51.5

; Elapsed Time:	02:10.2

; Memory Used:	441 pages

; Compilation Complete

