.title BUILD_MFD Rebuild the volume MFD with the standard files ;+ ; WARNING : use with caution... ; Should be used on a files-11 ODS-2 disk ;- .library /sys$library:lib/ $atrdef $fatdef $fchdef $fibdef .macro errchk, ?l1, ?l2 blbs r0, l1 ret l1: movzwl iosb, r0 blbs r0, l2 ret l2: .endm errchk dirfmt: .ascii <22><0><1><0><0><10>/000000.DIR/<1><0><4><0><4><0><0><0> .ascii <22><0><1><0><0><10>/BACKUP.SYS/<1><0><8><0><8><0><0><0> .ascii <22><0><1><0><0><10>/BADBLK.SYS/<1><0><3><0><3><0><0><0> .ascii <22><0><1><0><0><10>/BADLOG.SYS/<1><0><9><0><9><0><0><0> .ascii <22><0><1><0><0><10>/BITMAP.SYS/<1><0><2><0><2><0><0><0> .ascii <22><0><1><0><0><10>/CONTIN.SYS/<1><0><7><0><7><0><0><0> .ascii <22><0><1><0><0><10>/CORIMG.SYS/<1><0><5><0><5><0><0><0> .ascii <22><0><1><0><0><10>/INDEXF.SYS/<1><0><1><0><1><0><0><0> .ascii <22><0><1><0><0><10>/VOLSET.SYS/<1><0><6><0><6><0><0><0> .byte -1,-1 dirsiz = . - dirfmt .blkb 512-dirsiz channel: .word 0 disknam: .ascid / / Prompt: .ascid /Disk to repair: / fib: .blkb fib$c_length fibdesc:.long fib$c_length .long fib atrlist: .word atr$s_recattr .word atr$c_recattr .long recattr .word atr$s_uchar .word atr$c_uchar .address uchar .long 0 recattr:.blkb atr$s_recattr uchar: .blkb atr$s_uchar iosb: .blkb 8 .entry repair, ^m<> pushab disknam ; retrieve the name of the disk pushab prompt pushab disknam calls #3, g^lib$get_input $assign_s - ; Assign a channel to it devnam=disknam,- chan=channel blbs r0, 10$ ret 10$: movl #^x40004, fib+fib$w_fid ; Get the MFDs FID bisl #fib$m_nowrite!fib$m_write, fib+fib$l_acctl; allow write access $qiow_s chan=channel, - ; Open the file func=#IO$_ACCESS!IO$M_ACCESS, - iosb=iosb, - p1=fibdesc, - p5=#atrlist errchk ; Check for QIO error $qiow_s chan=channel, - ; Writ the first blk with a func=#io$_writevblk, - ; proper MFD format iosb=iosb, - p1=dirfmt, - p2=#512, - P3=#1 errchk ; Check for QIO error clrw recattr+fat$w_efblkh ; reset the EOF movw #2, recattr+fat$w_efblkl movw #0, recattr+fat$w_ffbyte; Directories always have a 0 FFB bisl2 #fch$m_directory, uchar ; Make sure it's a directory $qiow_s chan=channel, - ; Close the file func=#io$_deaccess, - iosb=iosb, - p1=fibdesc, - p5=#atrlist errchk $dassgn_s chan=channel ret .end repair