" *********************************************************** " * * " * Copyright, (C) Honeywell Information Systems Inc., 1982 * " * * " * Copyright (c) 1972 by Massachusetts Institute of * " * Technology and Honeywell Information Systems, Inc. * " * * " *********************************************************** " FMT - Disk Formatting Program " for DSU181, DSU190, DSU191 " 8/20/74 - David A. Kayden " Modified Novemeber 1981 by C. Hornig to not use IOM rel mode. include bosequ use toec include bos_toequ use mainc join /text/mainc,toec bool disk_seek,34 bool disk_format,17 bool disk_restore,42 bool disk_read_track_header,27 " stx2 x2 save X2 tsx2 init_io initialize IOM package tsx2 ttyinit initialize operator's console package arg ttyrequest ldx2 x2 restore X2 lxl7 mem|0,2 copy the command line eax6 0 odd; rpd 14,1 lda mem|0,7 sta line,6 tsx2 scan scan args eax0 1 initialize argument index eax0 1 Set X0 for arglist scan. tsx2 argmul Go scan command line. tra x2 lda amdvt,* Check for non-removable disks ana =o17,dl mask off all but dev type szn fs_dev.media_removable-1,al tnz fmtcont tsx2 erpt acc 'FMT is not usable on non-removable media.' tra x2 exit fmtcont: lda amfirst,* Get starting point. tsx2 getrack Convert to sector number. sta sector And save. lda amlast,* Get stopping point. tsx2 getrack Convert to sector number. sta last_sector And save. tra arglp1 Examine rest of args now. " argloop: eax0 1,0 increment argument counter arglp1: lda arg,0 grab next argument cmpa =-1 is it a fence? tze ask yes - get started cmpa =hdefect check for "defect" tnz argclear aos defectsw set switch tra argloop argclear: cmpa =h clear check for "clear" tnz argcheck aos clearsw set switch tra argloop argcheck: cmpa =h check check for "check" tnz argerror aos checksw set switch lda 4,dl set "z" flag sta z tra argloop argerror: tsx2 erpt unknown argument acc '^g unknown' arg arg,0 tra x2 exit checksw: dec 0 clearsw: dec 0 defectsw: dec 0 " ask: stc2 disk_brief,* muzzle the error message tsx2 query_disk is this a storage system volume arg amdvt,* tra ask1 tra ask1 if not, ask simple question stz disk_brief,* unmuzzle error messages now tsx2 ask_disk ask if volume should be overwritten tra x2 if not, quit tra yes ask1: stz disk_brief,* allow error messages again tsx2 erpt make sure operator wants to do this acc 'do you wish to proceed with formatting^g' arg =h!!???? tsx2 readtty get answer tra ask ldq line cmpq =hyes " do we continue ? tnz x2 no yes: lda amdvt,* Get device type word. stba pcwa+1,40 Set channel # in PCW. arl 9 Move to AU. stba channo,20 Save channel and IOM #. als 9+6 store into IDCW's stca pcwa,20 .. stca reseek,20 .. stca dcw,20 .. stca dcw+2,20 .. stca restore,20 .. tsx2 connect_iom issue a restore cmmand to the disk unit zero pcwa,restore tsx2 check_status wait for completion arg channo tra *-2 not done tra *+1 ignore errors here " cycle: stz ti clear track indicators lda sector load sector number sta seekaddr set seek address als 12 convert to a BOS address tsx2 bosphy convert to a physical address arg amdvt,* tra addr_error error return eax1 phyadd,* point to physical address data szn defectsw are we marking tracks defective tnz fmtbad yes - go do it szn checksw if formatting all as good tracks tnz rth then skip reading the track headers szn clearsw .. tnz fmtgood .. rth: tsx2 connect issue read track header vfd 6/disk_read_track_header tra unfmted data alert return lda buf check track indicators for a defective track cana 2,dl tnz clearchk track is already marked defective szn checksw are we actually formatting tze fmtgood yes lda 0,1 get cylinder # als 16 position it ora 1,1 add the track # als 4 cmpa buf check the home address & alternate track TI tnz refmt bad - reformat it lda buf+1 now check record 0 ldq buf+2 anq =o776000,du lls 8+4 position it to look like the HA cmpa buf compare with HA tze next format data okay - proceed to next tzeck refmt: aos refmtcnt count these occurances tra fmtgood clearchk: szn clearsw are we forcing all tracks to good ? tze badtrk no tsx2 erpt acc 'fmt: clearing sector ^o' arg sector tra fmtgood badtrk: tsx2 erpt report defective track acc 'fmt: sector ^o is defective' arg sector fmtbad: lda 3,dl set track indicators for sta ti defective track - no alternate assigned als 22 also set TI in seek data orsa seekaddr .. fmtgood: lda 0,1 get cylinder # als 20 sta buf put cylinder # in HA lda 1,1 get track # als 4 ora ti add track indicators ora z add z flag orsa buf put track # and flags into HA mlr (),(),fill(0) clear record 0 desc9a *,0 desc9a buf+1,4*4 szn ti for a bad track - leave R0 zeroed tnz chksum lda 0,1 get cylinder # als 8 position it sta buf+1 put cylinder # into R0 lda 1,1 get track # ldq 0,dl lrl 8 position it orsa buf+1 put track # into R0 stq buf+2 .. chksum: lda ckchrr compute check character sta ckchrt .. ldq 0,du .. erq ckchrt,sc .. ttf *-1 .. qls 12 position check character stcq buf+2,04 store into R0 tsx2 connect issue format command vfd 6/disk_format tra fmt_alert data alert return next: aos 1,1 increment track # tsx2 phybos convert to a BOS address arg amdvt,* tra addr_error arl 12 convert BOS address to sector # sta sector cmpa last_sector are we finished? tmoz cycle if not, continue szn refmtcnt any tracks reformatted ? tze x2 no tsx2 erpt yes acc '^d good tracks reformatted' arg refmtcnt ttyrequest: x2: eax2 * restore X2 lca =1,dl don't chain to any other command tra mem|1,2 back to BOS fmt_alert: szn ti were we formatting a bad track ? tnz next yes - skip it tra badtrk no - go format the track bad addr_error: tsx2 erpt acc 'improper device address' tra x2 unfmted: tsx2 erpt acc 'fmt: sector ^o is unformatted' arg sector tsx2 erpt acc 'use ""clear"" keyword' tra x2 " connect: stx2 cnx2 lca 5,dl set retry counter sta retry .. lda 0,2 get command code stca dcw+2,40 set device command in IDCW arl 30 save it for error messages sta command tsx2 connect_iom start i/o zero pcwa,dcw check: tsx2 check_status wait for completion arg channo tra *-2 not done tra io_error process errors cnx2: eax2 * return tra 2,2 even pcwa: vfd 6/40,6/0,6/0,3/7,3/2,6/2,6/1 PCWA vfd 9/0 PCWB reseek: vfd o6/disk_restore,6/0,6/0,3/7,3/2,6/2,6/1 Restore IDCW and continue dcw: vfd 6/disk_seek,6/0,6/0,3/7,3/2,6/0,6/0 Seek IDCW vfd 18/seekaddr+pgmorg,6/0,12/1 IOTD for seek address vfd 6/0,6/0,6/0,3/7,3/4,6/0,6/0 Format or RTH IDCW vfd 18/buf+pgmorg,6/0,12/5 IOTD for format data restore: vfd o6/disk_restore,6/0,6/0,3/7,3/0,6/2,6/1 Restore IDCW and disconnect seekaddr: bss ,1 buf: bss ,5 " io_error: aos retry count errors tmoz restart retries not exhausted staq stat save status for possible message ana =o370000,du cmpa =o030000,du data alert tnz err_ask no - report error lda stat now check substatus cana =o700,du transfer timing, transmission timing, or inv. seek tnz err_ask yes ldx2 cnx2 take data alert return tra 1,2 err_ask: tsx2 erpt print error message acc 'fmt error: cmd=^o, s=^o, stat=^w ^w, retry^g' arg command arg seekaddr arg stat arg stat+1 arg =h!!???? tsx2 readtty get answer tra restart retry unless he says "no" ldq line cmpq =hno " tze x2 restart: tsx2 connect_iom restart the i/o, preceeded by a restore zero pcwa,reseek tra check rejoin normal processing retry: bss ,1 command: bss ,1 even stat: bss ,2 " getrack: eax1 0,2 save X2 tsx2 mulbos get device address arg amdvt,* did tra addr_error tsx2 bosphy convert to physical address arg amdvt,* did tra addr_error eax6 phyadd,* point to physical address data stz 2,6 zero record # tsx2 phybos back to BOS address arg amdvt,* did tra addr_error eax2 0,1 restore X2 arl 12 convert BOS address to sector # tra 0,2 return " channo: bss ,1 sector: bss ,1 last_sector: bss ,1 refmtcnt: dec 0 ckchrr: vfd 18/buf,12/30,6/0 temp: ckchrt: bss ,1 ti: bss ,1 z: dec 0 include qdisk include config_cards " include fs_vol_label include fs_dev_types 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 " "