" *********************************************************** " * * " * Copyright, (C) Honeywell Information Systems Inc., 1982 * " * * " *********************************************************** " LOADDM - Disk Loader for BOS. " Modified by N. I. Morris for MTC-500 - July 1973. " Modified 8/79 by R.J.C. Kissel to fix a bug, it already can handle expanded BOS. " Modified 6/22/81 by J. A. Bush, to save the bos tape label in command dir " ****************************************************** " * * " * * " * Copyright (c) 1972 by Massachusetts Institute of * " * Technology and Honeywell Information Systems, Inc. * " * * " * * " ****************************************************** include bosequ use toec include bos_toequ use mainc join /text/mainc,toec equ program_base,origpgm bool fvloc,100 location of fault vector equ iom_cow,1 offset in mailbox of COW " stx2 boscom save X2 to indicate in BOS command tsx2 initint init interrupts arg execint tsx2 init_io Setup iom mailbox. tsx2 ttyinit arg ttyrequest ldx2 boscom if entered from bos tnz bos_entry lda com|tapechanno get tape channel and device stz com|tapechanno clear out the word stca com|tapechanno,70 replace channel number only sta tapeno set up for reading rest of tape tra boot_entry execint: ttyrequest: tra 0,2 ignore interrupts patch: lxl7 arg+1 simple patch procedure lda arg+2 .. sta 0,7 patch this program tra cycle .. " bos_entry: lda mem|0,2 get addr of arglist arl 18-2 get character offset in AL mlr (pr,al),() copy the arglist desc9a mem|0,2*(arglen+1)*4 desc9a arg,2*(arglen+1)*4 lcq 1,dl all ones in Q lda darg+1 look at first arg tpnz *+3 if not number, use default lda 1,dl default is 1 tra *+2 .. stq arg+1 remove this arg ana =o17,dl als 12 shift to position ora com|tapechanno insert channel # sta tapeno set up for reading tape cmpc (),(),fill(777) any other args? desc9a *,0 desc9a arg+1,(arglen-1)*4 tze *+2 stc2 selectsw other args - going to select segments lda com|dir get orig of directory sta dirorig lda com|useable and first address not useable sta bostop eaa 32768 make buffer tsx2 makesdw following this program tra exit_loaddm_to_setup staq ds|tmp*2 .. cams stz bos_boot indicate we are bos entry tra rtape now read tape cycle: tsx2 nextline read command from input stream boot_entry: eax2 comtab look up command stc1 bos_boot indicate we are boot entry lda arg rpt ncoms/2,2,tze cmpa 0,2 tze -1,2* tra to command tsx2 erpt acc "^g" arg =h!!???? tra cycle " comtab: bci " warm" tra warm bci " cold" tra cold bci "nlabel" tra cold bci "loaddm" tra cycle bci " patch" tra patch equ ncoms,*-comtab length of command table boslab: bci "boslab" bos_boot: oct 0 " warm: tsx2 getbase move arg info to seg 6 eax7 nsave-1 save some info from common saveloop: ldx6 savelist,7 address in X6 lda com|0,6 grab item sta savebuf,7 place in buffer eax7 -1,7 bump index tpl saveloop and loop until completed lda dirorig read common tsx2 rdsec nop com|0 tra die lda com|dir check if good same info read cmpa dirorig tnz badwarm lda com|useable cmpa bostop tnz badwarm eax7 nsave-1 restore info to common restloop: ldx6 savelist,7 address in X6 lda savebuf,7 get item from buffer sta com|0,6 restore item eax7 -1,7 bump index tpl restloop and loop until completed tra end savelist: arg iom_mxbase arg iom_mbbase arg tapechanno arg rdrchanno arg ttychanno arg inputsw arg quietsw equ nsave,*-savelist savebuf: bss ,nsave " cold: tsx2 getbase get base info from card lda dirorig Save the disk location of bos common sta com|dir in bos_common. ana =o777777770000 Mask out sector length. sta com|used Indicate where the next available sector is. lda bostop Save the sector no. which indicates the end of sta com|useable the bos disk space in bos common. " Reserve space for BOS common on the BOS disk. lda (econf+63)/64,dl Indicate the size of bos common. tsx2 getsec Call the disk space allocator. tra dir_err Error return if out of disk space. cmpa dirorig Was the space allocated at the first sector " useable by bos? tnz dir_err If not, die now. " Reserve space for the Multics core image on the BOS disk. lda coresaved/64,dl Indicate the amount of space needed. tsx2 getsec Call the space allocator. tra die This is executed if out of disk space. sta com|corearea Save the sector no. of the space allocated. " Reserve space for setup on the BOS disk. lda lnsetup/64,dl Indicate the size of setup. tsx2 getsec Call the space allocator. tra die This is executed if out of disk space. sta com|setuparea Save the sector no. of the space allocated. tra rtape " rtape: lda asgetab get address of table sta rtmvt1 and set for MVT instructions sta rtmvt2 .. stz recno reset record number eax1 tbufl reset buffer indices stx1 tbufi stx1 tbufd lca 1,dl set line mark for runcom files sta pagectl .. tsx2 xio_wait rewind tape zero zero tapeno,56 tra *-3 tsx2 itaper initialize tape for reading arg tapeno szn bos_boot entered from BOS? tze rtloop xfer if yes tsx2 xio_wait No, boot entry, rewind tape zero zero tapeno,56 tra *-3 tsx2 xio_wait read in label record vfd 18/thdr,12/tbufl+16,6/0 zero tapeno,5 tra *-3 lda (tbufl+16)*4,dl length to move in AL mlr (rl),(pr,rl) copy the data into disk buffer desc9a thdr,al desc9a tmp|0,al stz dirflag clear dir entry flag bits lda boslab load label file name sta name lda tbufl+16,dl load label file length sta length tra wdisk and go write label record " rtloop: tsx2 readtape read it lda kind check log record kind ana =-1,du tnz endtape if error, quit stz asciisw clear ASCII switch stz dirflag clear directory entry flag bits eax7 0 name offset will be zero unless "fw." tsx2 suffixt test for ".ascii" suffix desc9a .ascii,6 tra setascii tsx2 suffixt test for ".bcd" suffix desc9a .bcd,4 tra setbcd tra not_ascii neither BCD nor ASCII setascii: stc2 asciisw set switch sta temp save length temporarily ldq tmp|slte.bit_count_word get bit count anq =o777777777 mask div 9,dl compute character count stq offlen+1 and save lda temp length of name in A tra getnam go get name and load segment setbcd: ldq =o4000,dl get flags for runcom file stq dirflag and save tra getnam and process segment not_ascii:cmpc (pr),() check for "fw." desc9a tmp|slte_size+2,3 desc9a fw.,3 tnz getlen if not "fw." prefix, use entire name eax7 10 use last component of name ldq =o2000,dl get flag for firmware file stq dirflag and save getlen: lda tmp|slte_size+1 get length of name getnam: cmpa 6,dl more than 6 chars in name? tmoz *+2 can have only 6 lda 6,dl .. mvt (pr,rl,x7),(),fill(040) copy name and translate to BCD desc9a tmp|slte_size+2,al desc6a name,6 rtmvt1: arg * lda name pick up name tsx2 rjust right-justify sta name and save " tsx2 readtape read text of segment lda kind and check kind ana =-1,du cmpa =1,du tnz endtape lxl7 kind get length tze rtloop sxl7 length szn selectsw selecting segments? tze loadit if not, just load it lda name get name eax7 1 search list rpt arglen-1,1,tze cmpa arg,7 ttn rtloop if not correct, ignore segment lcq 1,dl clear out name stq -1,7 .. loadit: szn asciisw ASCII segment? tnz load_ascii if so, go load it " " Create entry in BOS command directory. " The format of each entry is: " " bss name,1 First six characters of name of command in bcd. " vfd 24/sector,3/runcom_switch,9/no_64_word_blocks " Disk location and length of command. wdisk: lda name get command name ldq length get length in words adq 63,dl compute number of sectors needed qrl 6 .. tsx2 makefil make a directory entry for command tra die .. ldq dirflag get directory entry flags orsq com|1,7 and place in directory entry ldq name get name again cmpq =h setup is it setup? tnz *+2 .. sta com|setuparea if so, save disk address of setup cmpq =h util is it utility package? tnz *+2 .. sta com|utilarea if so, save disk address of utility package " Write the text of the command onto the BOS disk. tsx2 wtsec nop tmp|0 Indicate to the i/o routine the place to write from. tra die tra rtloop read next segment load_ascii: stz offlen clear offset tsx2 make_runcom_file build runcom file tra get_ascii_line a line at a time tra rtloop lda name store completed file tsx2 store_runcom_file .. tra die tra rtloop go process next segment " endtape: tsx2 xio_wait if end of tape, rewind zero zero tapeno,56 tra endtape szn selectsw were we selecting segments? tze end if not, all finished eax0 arglen-1 see if any not loaded ststl: lcq 1,dl .. cmpq arg,0 .. tze ststn .. tsx2 erpt announce failure acc "^g not loaded." arg arg,0 ststn: eax0 -1,0 loop tpnz ststl .. tra end " suffixt: lda 0,dl start with zero offset ldq tmp|slte_size+1 get length of name scaname: scd (pr,rl,al),(id) search for suffix desc9a tmp|slte_size+2,ql arg 0,2 arg temp ada temp add to offset sbq temp subtract from length ttn 2,2 tra if not found cmpc (id),(pr,rl,al),fill(040) make sure it's desired suffix arg 0,2 desc9a tmp|slte_size+2,ql tze 1,2 tra if found ada 1,dl bump offset one more sbq 1,dl and decrement length tra scaname go back and search some more get_ascii_line: ldaq offlen offset in A, length in Q scm (pr,rl,al),(du) look for NL desc9a tmp|0,ql aci " " arg temp ttn 0,2 if no more NL's, take EOF return lxl7 temp get count of chars skipped over mvt (pr,rl,al),(),fill(040) copy and translate desc9a tmp|0,x7 desc6a line,84 rtmvt2: arg * ada temp bump offset ada 1,dl include NL sbq temp decrement remaining length sbq 1,dl .. staq offlen save offset and length tra 1,2 return to caller " end: ldx7 com|iom_mbbase check for correctness cmpx7 imbx,du tnz mbxerr ldx7 com|iom_mxbase check interrupt base, too cmpx7 imbx-128,du tnz mbxerr rsw 2 while we're at it, check fault base ana =o7740,du mask the fault base cmpa fvloc,du is it correct? tnz fverr szn com|utilarea check for existence of utility package tze noutil lda com|setuparea load in toehold tze nosetup tsx2 rdsec nop mem|origsetup tra die " Initialize data in kprog, which will reside in the BOS IOM mailbox area. " See also the comments preceding kprog, below. Also put miscellaneous data " into the toehold program, since it can not always use the contents of BOS common. ldq com|bos_dvt Get device ID of BOS disk stq mem|origsetup+devid Save in the BOS toehold anq =o777,du Isolate devide no qls 6 Position device no stcq kprog+pcw,20 Insert device # in PCW. stcq kprog+ksin,20 Insert device no. in each IDCW. stcq kprog+ksin+2,20 stcq kprog+kcout,20 stcq kprog+kcout+2,20 stcq kprog+kcin,20 stcq kprog+kcin+2,20 " Put the sector addr. of the area on the BOS disk reserved for " the Multics core image into the apropos seek data word. ldq com|corearea Get sector addr. of Multics core image. qrl 12 right-justify sector addr. stq kcout+kprog-1 Set seek address. " Also, fill in the seek data word which should point to setup. ldq com|setuparea Add toehold length to setup's starting addr. qrl 12 so that toehold will not be clobbered when adq toelen/64,dl setup is brought into memory. stq ksin+kprog-1 lda com|bos_dvt Get channel number ana =o77000,du .. cmpa =o40000,du Is channel no. too large? (>40) tpl cherr Yes, gripe. sta pcw+kprog+1 Put it in kprog's PCW. lda com|ttychanno save tty channel # sta mem|origsetup+ttychan lda mem|imbx+1 Fill in kprog's COW without clobbering stca cow+kprog,01 the PCW's channel no. which is in the same word. eax7 imbx Save the location of the IOM mailbox in the toehold. stx7 mem|origsetup+mbxloc " Modify the label of the BOS volume. " " lda =v24/label.bos_sector/64,12/1 " tsx2 rdsec read in the BOS volume label " nop tmp|0 " tra die " " lda com|setuparea get sector address of setup " arl 12 make a seek address " sta tmp|label.bos_sector-label.bos_sector/64*64 " " lda com|setuparea get length of setup " ana =o7777,dl .. " als 6 .. " ora origsetup,du make IOTD DCW " sta tmp|label.bos_iotd-label.bos_iotd/64*64 " " lda =v24/label.bos_sector/64,12/1 " tsx2 wtsec write back the volume label " nop tmp|0 " tra die " Move the toehold data into setup. mlr (),(pr) copy the toehold data desc9a kprog,swaplen*4 desc9a mem|origsetup+toelen-swaplen,swaplen*4 lda com|dir make word to read dir sta mem|origsetup+dirbase lda com|iom_mbbase set mailbox base sta mem|origsetup+mbbasesav lda mem|iom_cow,au set cow for setup sta mem|origsetup+cowsav lda com|iom_mxbase set interrupt base sta mem|origsetup+mxbasesav lda com|setuparea tsx2 wtsec nop mem|origsetup tra die lda dirorig rewrite dir tsx2 wtsec nop com|0 tra die exit_loaddm_to_setup: tra mem|origsetup+6 enter setup " die: tra cycle bad_dmodel:tsx2 erpt Indicate invalid card. acc "Invalid disk model specified on warm, cold, or nlabel card." tra cycle bad_daddr: tsx2 erpt acc "Bad disk address on cold or warm card." tra cycle label_err:tsx2 erpt acc "Cannot read volume label." tra cycle bad_label:tsx2 erpt acc "Volume does not have a Multics label." tra cycle part_err: tsx2 erpt acc "BOS partition not defined in volume label." tra cycle badwarm: tsx2 erpt acc "BOS not loaded or bad partition definition." tra cycle dir_err: tsx2 erpt Request more space in the first cyl. acc "Could not fit BOS directory in first cylinder." tra cycle mbxerr: tsx2 erpt acc "IOM mailbox base is incorrect." dis * tra -1,ic fverr: tsx2 erpt acc "Processor fault base is incorrect." dis * tra -1,ic cherr: tsx2 erpt must use channel < 40 because of IOM mailbox acc "Disk channel must be < 40" dis * tra -1,ic nosetup: tsx2 erpt acc "SETUP not loaded from tape." dis * tra -1,ic noutil: tsx2 erpt acc "Utility package not loaded from tape." dis * tra -1,ic " mod 64 " " The BOS toehold disk I/O program. " " This area contains all IOM control words necessary for " the following functions: " 1. saving Multics memory on the disk. " 2. restoring Multics memory from disk. " 3. loading setup (BOS main control) into core. " " When I/O is to be performed, the BOS toehold program swaps the data below " with the Multics IOM mailbox core image and connects to the appropriate " DCW list. " " N.B.: " The data below must fit into the first 40(8) words of the IOM mailbox. " " N.B.: " The offsets of certain words in the data below are defined in " bos_toequ.incl.alm. They may require redefinition if the data " below is modified. " kprog: vfd o6/0,6/0,6/0,o3/7,o3/2,6/2,6/1 PCW Word A oct 0 PCW Word B and COW oct 0,0 Status words. vfd 18/*+1-kprog+imbx,o6/04,12/0 fault channel lpw vfd 18/*+1-kprog+imbx,3/0,o3/1,12/1 fault channel dcw refill oct 0 system fault word vfd 18/*-1-kprog+imbx,3/0,o3/1,12/1 fault channel dcw vfd 18/pcw+imbx,6/4,12/0 Connect channel LPW. vfd 18/kcout+imbx,o6/0,12/0 LPW refill to write core vfd 18/ksin+imbx,o6/0,12/0 LPW to read setup vfd 18/kcin+imbx,o6/0,12/0 LPW to read core vfd 18/statq+imbx,6/0,12/0 Refill SCW. " DCW list for reading setup into memory. vfd o12/3777,6/0,18/0 Seek data word, which points to setup on the bos disk. equ ksin,*-kprog vfd o6/34,6/0,6/0,3/7,3/2,6/0,6/0 Seek IDCW. vfd 18/ksin-1+imbx,3/0,o3/0,12/1 Seek data DCW (IOTD). vfd o6/25,6/0,6/0,o3/7,o3/0,o6/0,6/0 Read IDCW. vfd o18/origsetup+toelen,3/0,o3/0,12/lnsetup-toelen " Data DCW (IOTD). " DCW list for writing Multics memory onto the bos disk. vfd o12/3777,6/0,18/0 Seek data word for transmitting Multics core. equ kcout,*-kprog vfd o6/34,6/0,6/0,3/7,3/2,6/0,6/0 Seek IDCW. vfd 18/kcout-1+imbx,3/0,o3/0,12/1 Seek data DCW (IOTD). vfd o6/31,6/0,6/0,o3/7,o3/0,o6/0,6/0 Write IDCW. vfd 18/kcxfer+imbx,3/0,o3/2,12/0 Transfer DCW to branch into read list. " DCW list for reading Multics memory from the bos disk. equ kcin,*-kprog vfd o6/34,6/0,6/0,3/7,3/2,6/0,6/0 Seek IDCW. vfd 18/kcout+imbx-1,3/0,o3/0,12/1 Seek data DCW (IOTD). vfd o6/25,6/0,6/0,o3/7,o3/0,o6/0,6/0 Read IDCW. " Part of list which is common to both the read and write lists. equ kcxfer,*-kprog vfd 18/0,3/0,o3/1,12/imbx Data DCW (IOTP) to transmit up to " the beginning of the IOM mailbox. vfd 18/origsetup+toelen-swaplen,3/0,o3/1,12/swaplen Data DCW (IOTP) to transmit " the Multics IOM mailbox. vfd 18/imbx+swaplen,3/0,o3/1,12/origsetup-imbx-swaplen Data DCW (IOTP) to " transmit from the end of the IOM mailbox area " to the BOS toehold. vfd 18/origsetup,3/0,o3/3,12/toelen Data DCW (IONTP) to skip the BOS toehold. vfd 18/origsetup+toelen,3/0,o3/1,12/maxw Data DCW (IOTP) to transmit the " maximum amount of words after the bos toehold. vfd 18/origsetup+toelen+maxw,3/0,o3/0,12/toesaved-origsetup-toelen-maxw " Data DCW (IOTD) to transmit the rest of Multics " memory which is to be transmitted. " " Gather information from COLD or WARM card. " " The format of a COLD or WARM card is as follows: " COLD devname iom+chn unit first_rec num_rec " " Where: " devname = name of disk device " iom+chn = 64*IOM number plus channel number (iom 0 only, now) " unit = unit number for disk unit " first_rec = first 1024-wd record number used by BOS " num_rec = number of records in BOS partition " getbase: stx2 getbase.xit Save stz com|bos_dvt This is a "device type word" " in the format (vfd 3/iom,6/chn,9/devno,18/devtype) " Process first argument: disk model number lda arg+1 Get disk model from card. tsx2 lookup_devmodel Get device type from model. tra bad_dmodel Illegal model. Die. sta com|bos_dvt Save the device ID of the Bos disk. " Process second argument: channel number + 64*iom lda arg+2 This is channel number, plus 64*iom ana =o77,dl .. but right now we fail for all but iom 0 als 18+9 .. position orsa com|bos_dvt .. and insert channel and iom " Process third argument: disk drive number lda darg+3 Get drive number in decimal ana =o777,dl .. could die if too big instead als 18 .. position orsa com|bos_dvt .. insert device number " If not NLABEL card, get BOS partition limits from volume label. lda arg Get card name. cmpa =hnlabel NLABEL card? tnz getbase.label If not, read volume label. " getbase.records: " Process fourth argument: first record number lda arg+4 Get first record addr. tsx2 mulbos Convert to BOS address. arg =itp(com,bos_dvt),* tra bad_daddr stca dirorig,74 " Process fifth argument: number of records lda arg+5 Get NREC adla arg+4 Calculate high address. sbla 1,dl .. tsx2 mulbos Convert to BOS address. arg =itp(com,bos_dvt),* tra bad_daddr stca bostop,74 getbase.xit: eax2 * Restore index 2 tra 0,2 Return to caller. " " Read volume label to get frec and nrecs of BOS partition. getbase.label: lda LABEL_ADDR,dl Get record address of volume label. tsx2 mulbos Convert to BOS sector address. arg =itp(com,bos_dvt),* tra bad_daddr ana =o777777770000 Mask sector address. ora 16,dl Going to read 16 sectors. tsx2 rdev Into buffer segment. arg =itp(com,bos_dvt),* arg bf|0 tra label_err cmpc (),(pr) See if real Multics label. desc9a Multics_label,32 desc9a bf|label.Multics,32 tnz bad_label If not, cannot proceed. ldq bf|label.nparts Get number of partitions. qls 2 Multiply by 4. eax7 0,ql Place in X7. lda =4abos " Search for BOS partition. eax7 -4,7 Step partition index. tmi part_err If negative, couldn't find BOS partition. cmpa bf|label.part,7 Test partition name. tnz *-3 If not BOS, look some more. lda bf|label.frec,7 Get first record of BOS partition. sta arg+4 Place in card image. lda bf|label.nrec,7 Likewise with number of records. sta arg+5 .. tsx2 erpt acc "BOS partition at ^d. for ^d." arg arg+4 arg arg+5 tra getbase.records Now, pick up and digest partition limits. " boscom: arg 0 used to hold X2 if BOS command temp: bss ,1 temporary even offlen: bss ,2 length: oct 0 name: oct 0 dirflag: bss ,1 asciisw: bss ,1 .ascii: aci ".ascii" .bcd: aci ".bcd" selectsw: bss ,1 fw.: aci "fw." bostop: oct 0 dirorig: vfd 24/-1,12/econf/64 sector,length of dir Multics_label: aci "Multics Storage System Volume",32 " include readtape include runcom_util " include bos_sdw " include slt include slte " include fs_vol_label include disk_pack include bos_tv include bos_common end " " " ----------------------------------------------------------- " " " " Historical Background " " This edition of the Multics software materials and documentation is provided and donated " to Massachusetts Institute of Technology by Group Bull including Bull HN Information Systems Inc. " as a contribution to computer science knowledge. " This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, " Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell Bull Inc., Groupe Bull " and Bull HN Information Systems Inc. to the development of this operating system. " Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), " renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership " of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for " managing computer hardware properly and for executing programs. Many subsequent operating systems " incorporated Multics principles. " Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., " as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . " " ----------------------------------------------------------- " " Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without " fee is hereby granted,provided that the below copyright notice and historical background appear in all copies " and that both the copyright notice and historical background and this permission notice appear in supporting " documentation, and that the names of MIT, HIS, Bull or Bull HN not be used in advertising or publicity pertaining " to distribution of the programs without specific prior written permission. " Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. " Copyright 2006 by Bull HN Information Systems Inc. " Copyright 2006 by Bull SAS " All Rights Reserved " "