B ;Clear the XRB (Returns: R4 => XRB+0) MOV #SLEEP,(R4) ;Sleep time .IF EQ DEBUG .SLEEP .IFF NOP .ENDC CALL OPNCLO ;Do we need to open or close our files? MOV #FRSTJB,R0 ;Start with first job MOV R0, R3 ASL R3 ;R3 = job number * 2 LOOP: CALL CLRFQB ;Clear FIRQB (R4 => FIRQB+FQFUN) MOVB #UU.SYS,(R4)+ ;Return job status MOVB R0, (R4)+ ;Of job number R0 MOVB #1, (R4)+ ;Subfunction 1 .UUO MOVB IOSTS, R1 ;Any errors? BEQ 5$ ;No, continue CMPB #PRVIOL, R1 ;Which error? BNE CYSTRT ;BADFUO = End of job table MOV #0, CPUTIM ;Reset CPU Time - this job's gone JMP RCDTME ;Error PRVIOL = No such job 5$: MOVB FIRQB+FQMODE,R1 ;Get the job's priority BIT #4,R1 ;Is the special runbit set? BNE EOLOOP ;Yes, skip it CMP R1,#PRIOR1 ;Is is above PRIOR1? BGT EOLOOP ;Yes, skip it CMP R1,#PRIOR4 ;Is it below PRIOR4? BLT EOLOOP ;Yes, skip it BIT #2,R1 ;Did this job type a CTRL/C? BEQ 10$ ;No, keep going CMP R1,#PRIOR1 ;Yes, is it below PRIOR1? BEQ RCDTME ;No, record its time and go on BR RAISE ;Yes, raise it to PRIOR1 and go on 10$: MOV FIRQB+12,JBSTAT ;Remember the job status word MOV FIRQB+14,JBWAIT ;Remember the wait status word CALL CLRFQB ;Clear the FIRQB (R4 => FIRQB+FQFUN) MOVB #UU.SYS,(R4)+ ;Return job status MOVB R0, (R4)+ ;Of job number R0 MOVB #0, (R4)+ ;Subfunction 0 .UUO TSTB IOSTS ;Any errors? BNE EOLOOP ;If so, the job logged out on us MOV FIRQB+FQNAM1,CPUTIM ;Record LSB of current CPU time BIT JBWAIT,JBSTAT ;Running? BNE 20$ ;Yes, STATE = 0 BIT JBWAIT,#WAITBT ;Waiting on Disk? BEQ 20$ ;Yes, as bad as running! STATE = 0 MOV #-1,STATE ;Job's not doing anything harsh BR 30$ 20$: CLR STATE ;Job's running or waiting on disk 30$: CMP #PRIOR1,R1 ;Is it PRIOR1? BEQ LEVEL1 ;Yes, handle it CMP #PRIOR2,R1 ;Is it PRIOR2? BEQ LEVEL2 ;Yes, handle it CMP #PRIOR3,R1 ;Is it PRIOR3? BEQ LEVEL3 ;Yes, handle it BR LEVEL4 ;No, must be PRIOR4, handle it. ;+ ; PRIOR1 - Jobs that did not use more than PERCENT % of the CPU since last ; cycle are left at this priority ;- LEVEL1: MOV CPUTIM,R1 ;Get this CPU time SUB TIMUSD(R3),R1 ;Subtract that of last time CMP R1,#L1TCKS ;Are we less than BUSY ticks? BLE RCDTME ;Yes, record time and go on TST STATE ;No, but is job doing anything now? BNE RCDTME ;No, record time and go on CLR CYCLES(R3) ;Yes, clear its LEVEL2 residency count and MOV #PRIOR2,PRIOR ; drop it to PRIOR2 MOV #BURST2,BURST BR SCHED ;Go schedule ;+ ; PRIOR2 - A job is lowered to this priority from PRIOR1. ; It will stay at PRIOR2 until it is detected in some I/O wait ; state (raised to PRIOR1) or stays "compute bound" for L2CYCL ; cycles (lowered to PRIOR3). ;- LEVEL2: TST STATE ;Is job doing anything now? BNE RAISE ;No, jump it to level 1 INC CYCLES(R3) ;Yes, increment the nr of busy cycles counter CMP CYCLES(R3),#L2CYCL ;Has it used its quota of Level 2 cycles? BLE EOLOOP ;No, go on CLR CYCLES(R3) ;Yes, clear level 3 count and MOV #PRIOR3,PRIOR ; drop it to Level 3 MOV #BURST3,BURST ; BR SCHED ;Go schedule ;+ ; PRIOR3 - A job is lowered to this priority from PRIOR2. ; It will stay at PRIOR3 until it is detected in some I/O wait ; state (raised to PRIOR1) or stays "compute bound" for L3CYCL ; cycles (lowered to PRIOR4). ;- LEVEL3: TST STATE ;Is job doing anything now? BNE RAISE ;No, jump it to level 1 INC CYCLES(R3) ;Yes, increment the nr of busy cycles counter CMP CYCLES(R3),#L3CYCL ;Has it used its quota of Level 3 cycles? BLE EOLOOP ;No, go on MOV #PRIOR4,PRIOR ;Drop it to Level 4 MOV #BURST4,BURST ; BR SCHED ;Go schedule ;+ ; PRIOR4 - A job is lowered to this priority from PRIOR3. ; It will remain at PRIOR4 until it is detected in some I/O ; wait state when it will be raised to PRIOR1. ;- LEVEL4: TST STATE ;Is job doing anything now? BEQ EOLOOP ;Yes, leave it here ;No, raise it to PRIOR1 RAISE: MOV #PRIOR1,PRIOR ;RaiBIGBROMAC[.050001]BIGBRO.MAC[.050001]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddf NOT to change size .UUO ;Do the work RETURN ;+ ; OPNCLO Open or close our 15 favorite files. ; ; CALL: CALL OPNCLO ; ; Input: R5 ; R5 = -1 ==> Close the files ; ; R5 = 0 ==> Open the files ; ; If our job's priority has the special run bit set (priority ; -4) then just RETURN else set priority -4 and open or close ; our files, whichever was not done last time. ; ; This allows one to SET JOB/PRIORITY=-8 n (where n is this ; program's job number) in order to signal BIGBRO to open or ; close its files. ;- OPNCLO: CALL CLRFQB ;Clear the FIRQB (R4 => FIRQB+FQFUN) MOVB #UU.SYS,(R4)+ ;Return job status MOVB MYJBNR, (R4)+ ;of my job MOVB #1, (R4)+ ;subfunction 1 .UUO MOVB FIRQB+FQMODE,R1 ;What's our priority? BIT #4, R1 ;Is the special run bit set? BNE NOMORE ;No, just RETURN = noting new to do. MOV #PRIOR1,PRIOR ;Put Highest Priority in PRIOR MOV #BURST1,BURST ;Put burst1 in BURST CALL SETPRI ;Set our priority to PRIOR1 CALL CLRXRB ;Clear XRB with R4 => XRB+0 MOV #400,(R4) ;Set special run priority bit .SET ;Set it COM R5 ;Flip-flop the open/close switch BEQ CLOSES OPENS: CALL CLRXRB ;Must gain 1K for file names buffer space MOV #2, (R4) .IF EQ DEBUG .CORE .IFF NOP .ENDC CALL CLRFQB ;Clear the FIRQB and XRB CALL CLRXRB MOV #FNLEN, (R4) ;Set up to open FILNAM MOV (R4)+, (R4)+ MOV #FILNAM,(R4) .FSS MOV #FIRQB+FQFUN,R4 ;Open FILNAM on channel 1 MOVB #OPNFQ, (R4)+ MOVB #1*2, (R4)+ CALFIP TSTB IOSTS ;Any errors? BNE NOMORE ;Yes, give up. CALL CLRXRB ;No, continue... Clear the XRB MOV #512., (R4)+ CLR (R4)+ ;Read one block from FILNAM into BUFFER MOV #BUFFER,(R4)+ MOVB #1*2, (R4) .READ CALL CLOSES ;Close FILNAM MOV #15.*2, R0 ;Start with channel 15 MOV #BUFFER,R1 ;Start our scan of BUFFER at its top LOOP1: MOV #SKIPS, R2 ;Point R2 to the list of chrs to skip 1$: CMPB (R2), (R1) ;Move R1 over any SKIP characters BNE 2$ INC R1 CMP R1, #BUFFER+512. ;Don't get out of the buffer BGE NOMORE BR LOOP1 2$: TSTB (R2)+ ;Have we checked all the SKIP characters? BNE 1$ ;No, check it MOV R1, R3 ;Yes, copy R1 into R3 LOOP2: MOV #SKIPS, R2 1$: CMPB (R2), (R3) ;Move R3 up the buffer until we find a SKIP chr BEQ 2$ TSTB (R2)+ BNE 1$ INC R3 BR LOOP2 2$: MOV R3, R2 ;Now we know were the file name starts & ends SUB R1, R2 ;Compute the file name's length CALL CLRFQB CALL CLRXRB MOV R2, (R4) ;Set up the file name in the XRB MOV (R4)+, (R4)+ MOV R1, (R4) .FSS MOV #FIRQB+FQFUN,R4 ;Open the file MOVB #OPNFQ, (R4)+ MOVB R0, (R4) MOV #RDRGLS,FIRQB+FQMODE ;Read regardless CALFIP MOV R3, R1 ;Set R1 to the start of the next file spec SUB #2, R0 ;Set up next channel number BGT LOOP1 ;Go again if we haven't done 15 channels NOMORE: CALL CLRXRB ;We do not need our file names buffer until MOV #1, (R4) ; the next open so we can shed 1K .IF EQ DEBUG .CORE .IFF NOP .ENDC RETURN CLOSES: CALL CLRFQB ;Close all channels MOVB #RSTFQ, (R4) CALFIP RETURN .SBTTL Data Section MYJBNR: .BLKW 1 JBWAIT: .BLKW 1 JBSTAT: .BLKW 1 PRIOR: .BLKW 1 BURST: .BLKW 1 STATE: .BLKW 1 CPUTIM: .BLKW 1 TIMUSD: .BLKW JOBMAX * 2 CYCLES: .BLKW JOBMAX * 2 DETMSG: .ASCII \BigBro detaching...\<15><12> MSGLEN = .-DETMSG FILNAM: .ASCII/[1,28]Files2.Opn/ ;Adjust [P,Pn] here so BIGBRO can FNLEN = .-FILNAM ; find its list of files to open SKIPS: .ASCII <15><12><40><0> ;Delimiting characters between file ; names in FILES2.OPN .EVEN BUFFER: .BLKB 512. ;The FILES2.OPN buffer .END BIGBRO BIGBROMAC[.050001]BIGBRO.MAC[.050001]   X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>