PiDP-8/I Software

Hex Artifact Content
Log In

Artifact 75579e781e51c66cbfeddb29ff9a99bfb3063677:


0000: 23 20 6f 73 38 2d 63 70 3a 20 41 20 74 6f 6f 6c  # os8-cp: A tool
0010: 20 74 6f 20 63 6f 70 79 20 66 69 6c 65 73 20 74   to copy files t
0020: 6f 20 61 6e 64 20 66 72 6f 6d 20 4f 53 2f 38 20  o and from OS/8 
0030: 72 75 6e 6e 69 6e 67 20 69 6e 20 53 49 4d 48 0a  running in SIMH.
0040: 0a 23 23 20 4d 6f 74 69 76 61 74 69 6f 6e 0a 0a  .## Motivation..
0050: 54 68 65 72 65 20 68 61 76 65 20 62 65 65 6e 20  There have been 
0060: 76 61 72 69 6f 75 73 20 74 6f 6f 6c 73 20 66 6f  various tools fo
0070: 72 20 63 6f 70 79 69 6e 67 20 66 69 6c 65 73 20  r copying files 
0080: 62 65 74 77 65 65 6e 20 4f 53 2f 38 0a 64 65 76  between OS/8.dev
0090: 69 63 65 20 69 6d 61 67 65 20 66 69 6c 65 73 20  ice image files 
00a0: 61 6e 64 20 74 68 65 20 70 6c 61 74 66 6f 72 6d  and the platform
00b0: 20 68 6f 73 74 69 6e 67 20 74 68 6f 73 65 20 69   hosting those i
00c0: 6d 61 67 65 20 66 69 6c 65 73 2e 0a 46 6f 72 20  mage files..For 
00d0: 65 78 61 6d 70 6c 65 2c 20 74 68 65 20 67 72 61  example, the gra
00e0: 70 68 69 63 61 6c 20 5b 4f 53 38 56 69 65 77 20  phical [OS8View 
00f0: 62 79 20 49 61 6e 20 53 63 68 6f 66 69 65 6c 64  by Ian Schofield
0100: 5d 5b 6f 73 38 76 69 65 77 2d 66 6f 72 75 6d 5d  ][os8view-forum]
0110: 2e 0a 0a 54 68 69 73 20 74 6f 6f 6c 20 77 61 73  ...This tool was
0120: 20 64 65 73 69 67 6e 65 64 20 74 6f 20 62 65 20   designed to be 
0130: 63 61 6c 6c 65 64 20 66 72 6f 6d 20 74 68 65 20  called from the 
0140: 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 69 6e 20  command line in 
0150: 74 68 65 20 50 4f 53 49 58 0a 65 6e 76 69 72 6f  the POSIX.enviro
0160: 6e 6d 65 6e 74 2c 20 61 6e 64 20 74 6f 20 69 6e  nment, and to in
0170: 74 65 72 66 61 63 65 20 62 65 74 77 65 65 6e 20  terface between 
0180: 74 68 65 20 50 4f 53 49 58 20 66 69 6c 65 73 79  the POSIX filesy
0190: 73 74 65 6d 20 61 6e 64 20 4f 53 2f 38 0a 72 75  stem and OS/8.ru
01a0: 6e 6e 69 6e 67 20 75 6e 64 65 72 69 20 53 49 4d  nning underi SIM
01b0: 48 2e 0a 0a 54 68 65 20 73 65 6d 61 6e 74 69 63  H...The semantic
01c0: 73 20 61 72 65 20 6c 69 6b 65 20 74 68 65 20 50  s are like the P
01d0: 4f 53 49 58 20 60 63 70 60 20 70 72 6f 67 72 61  OSIX `cp` progra
01e0: 6d 2c 20 65 78 63 65 70 74 20 74 68 61 74 20 61  m, except that a
01f0: 20 73 6f 75 72 63 65 20 6f 72 0a 64 65 73 74 69   source or.desti
0200: 6e 61 74 69 6f 6e 20 63 6f 6e 74 61 69 6e 69 6e  nation containin
0210: 67 20 61 20 63 6f 6c 6f 6e 20 69 73 20 69 6e 74  g a colon is int
0220: 65 72 70 72 65 74 65 64 20 74 6f 20 72 65 66 65  erpreted to refe
0230: 72 20 74 6f 20 66 69 6c 65 73 20 77 69 74 68 69  r to files withi
0240: 6e 0a 4f 53 2f 38 2e 0a 0a 41 64 64 69 74 69 6f  n.OS/8...Additio
0250: 6e 61 6c 20 61 72 67 75 6d 65 6e 74 73 20 61 6c  nal arguments al
0260: 6c 6f 77 20 66 6f 72 20 73 70 65 63 69 66 79 69  low for specifyi
0270: 6e 67 20 68 6f 77 20 74 68 65 20 73 69 6d 75 6c  ng how the simul
0280: 61 74 69 6f 6e 20 69 73 20 63 6f 6e 66 69 67 75  ation is configu
0290: 72 65 64 0a 61 6e 64 20 62 6f 6f 74 65 64 2e 20  red.and booted. 
02a0: 49 2e 45 2e 20 76 61 72 69 6f 75 73 20 50 4f 53  I.E. various POS
02b0: 49 58 20 66 69 6c 65 73 20 63 6f 6e 74 61 69 6e  IX files contain
02c0: 69 6e 67 20 4f 53 2f 38 20 64 65 76 69 63 65 20  ing OS/8 device 
02d0: 69 6d 61 67 65 73 20 61 72 65 0a 61 74 74 61 63  images are.attac
02e0: 68 65 64 20 74 6f 20 53 49 4d 48 2e 0a 0a 54 68  hed to SIMH...Th
02f0: 65 20 72 65 61 73 6f 6e 20 77 68 79 20 64 69 72  e reason why dir
0300: 65 63 74 20 63 6f 70 79 20 69 6e 74 6f 20 61 6e  ect copy into an
0310: 64 20 6f 75 74 20 6f 66 20 69 6d 61 67 65 20 66  d out of image f
0320: 69 6c 65 73 20 77 61 73 20 6e 6f 74 20 70 75 72  iles was not pur
0330: 73 75 65 64 0a 77 61 73 20 74 68 61 74 20 69 73  sued.was that is
0340: 20 73 65 65 6d 65 64 20 65 61 73 69 65 72 20 74   seemed easier t
0350: 6f 20 75 73 65 20 4f 53 2f 38 20 61 6e 64 20 53  o use OS/8 and S
0360: 49 4d 48 20 74 6f 6f 6c 73 20 74 6f 20 63 6f 70  IMH tools to cop
0370: 79 20 66 69 6c 65 73 20 61 72 6f 75 6e 64 0a 72  y files around.r
0380: 61 74 68 65 72 20 74 68 61 6e 20 6c 65 61 72 6e  ather than learn
0390: 69 6e 67 20 74 68 65 20 6c 6f 77 20 6c 65 76 65  ing the low leve
03a0: 6c 20 64 69 72 65 63 74 6f 72 79 20 66 6f 72 6d  l directory form
03b0: 61 74 73 20 61 6e 64 20 62 69 6e 61 72 79 20 64  ats and binary d
03c0: 61 74 61 0a 72 65 70 72 65 73 65 6e 74 61 74 69  ata.representati
03d0: 6f 6e 73 20 66 6f 72 20 74 68 65 20 76 61 72 69  ons for the vari
03e0: 6f 75 73 20 4f 53 2f 38 20 69 6d 61 67 65 20 66  ous OS/8 image f
03f0: 69 6c 65 73 2e 20 20 41 6e 79 74 68 69 6e 67 20  iles.  Anything 
0400: 74 68 61 74 20 63 61 6e 0a 62 65 20 6d 6f 76 65  that can.be move
0410: 64 20 61 72 6f 75 6e 64 20 62 79 20 60 50 49 50  d around by `PIP
0420: 60 20 75 6e 64 65 72 20 4f 53 2f 38 20 69 73 20  ` under OS/8 is 
0430: 66 61 69 72 20 67 61 6d 65 20 66 6f 72 20 60 6f  fair game for `o
0440: 73 38 2d 63 70 60 2e 0a 0a 54 68 65 20 74 6f 6f  s8-cp`...The too
0450: 6c 20 69 73 20 77 72 69 74 74 65 6e 20 69 6e 20  l is written in 
0460: 50 79 74 68 6f 6e 20 61 6e 64 20 75 74 69 6c 69  Python and utili
0470: 7a 65 73 20 74 68 65 20 70 65 78 70 65 63 74 20  zes the pexpect 
0480: 6c 69 62 72 61 72 79 20 66 6f 72 0a 73 74 61 72  library for.star
0490: 74 69 6e 67 20 75 70 20 61 6e 64 20 63 6f 6d 6d  ting up and comm
04a0: 75 6e 69 63 61 74 69 6f 6e 20 77 69 74 68 20 53  unication with S
04b0: 49 4d 48 2e 0a 0a 23 23 20 43 61 70 61 62 69 6c  IMH...## Capabil
04c0: 69 74 69 65 73 0a 0a 2a 20 43 6f 70 79 20 66 69  ities..* Copy fi
04d0: 6c 65 73 20 66 72 6f 6d 20 61 6e 64 20 74 6f 20  les from and to 
04e0: 4f 53 2f 38 20 62 6f 6f 74 65 64 20 75 70 20 75  OS/8 booted up u
04f0: 6e 64 65 72 20 53 49 4d 48 2e 0a 2a 20 49 6e 20  nder SIMH..* In 
0500: 41 53 43 49 49 20 74 65 78 74 20 6d 6f 64 65 2c  ASCII text mode,
0510: 20 63 6f 6e 76 65 72 74 20 62 65 74 77 65 65 6e   convert between
0520: 20 4f 53 2f 38 20 61 6e 64 20 50 4f 53 49 58 20   OS/8 and POSIX 
0530: 6e 65 77 6c 69 6e 65 20 63 6f 64 69 6e 67 73 2e  newline codings.
0540: 0a 2a 20 41 6c 6c 6f 77 20 61 74 74 61 63 68 69  .* Allow attachi
0550: 6e 67 20 6f 66 20 61 72 62 69 74 72 61 72 79 20  ng of arbitrary 
0560: 69 6d 61 67 65 20 66 69 6c 65 73 20 74 6f 20 61  image files to a
0570: 72 62 69 74 72 61 72 79 20 64 65 76 69 63 65 73  rbitrary devices
0580: 2e 0a 2a 20 43 6f 70 79 20 66 69 6c 65 73 20 77  ..* Copy files w
0590: 69 74 68 69 6e 20 4f 53 2f 38 20 69 66 20 62 6f  ithin OS/8 if bo
05a0: 74 68 20 73 6f 75 72 63 65 20 61 6e 64 20 64 65  th source and de
05b0: 73 74 69 6e 61 74 69 6f 6e 20 73 70 65 63 69 66  stination specif
05c0: 79 20 4f 53 2f 38 20 72 61 74 68 65 72 20 74 68  y OS/8 rather th
05d0: 61 6e 20 50 4f 53 49 58 20 6e 61 6d 65 73 2e 0a  an POSIX names..
05e0: 2a 20 46 6f 72 20 50 4f 53 49 58 20 66 69 6c 65  * For POSIX file
05f0: 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 73 20   specifications 
0600: 65 78 70 61 6e 64 20 64 69 72 65 63 74 6f 72 69  expand directori
0610: 65 73 20 74 6f 20 6c 69 73 74 73 20 6f 66 20 66  es to lists of f
0620: 69 6c 65 73 2c 20 61 6e 64 20 75 73 65 20 50 4f  iles, and use PO
0630: 53 49 58 0a 73 74 79 6c 65 20 67 6c 6f 62 62 69  SIX.style globbi
0640: 6e 67 20 74 6f 20 65 78 70 61 6e 64 20 77 69 6c  ng to expand wil
0650: 64 20 63 61 72 64 73 2e 0a 2a 20 46 6f 72 20 4f  d cards..* For O
0660: 53 2f 38 20 66 69 6c 65 20 73 70 65 63 69 66 69  S/8 file specifi
0670: 63 61 69 74 6f 6e 73 2c 20 61 6c 6c 6f 77 20 61  caitons, allow a
0680: 70 70 72 6f 70 72 69 61 74 65 20 77 69 6c 64 20  ppropriate wild 
0690: 63 61 72 64 69 6e 67 20 61 73 20 77 65 6c 6c 2e  carding as well.
06a0: 0a 0a 23 23 20 4c 69 6d 69 74 61 74 69 6f 6e 73  ..## Limitations
06b0: 0a 0a 54 68 65 20 61 72 63 68 69 74 65 63 74 75  ..The architectu
06c0: 72 65 20 6f 66 20 4f 53 2f 38 20 6d 61 6b 65 73  re of OS/8 makes
06d0: 20 69 74 20 69 6d 70 6f 73 73 69 62 6c 65 20 74   it impossible t
06e0: 6f 20 6f 70 65 72 61 74 65 20 77 69 74 68 20 61  o operate with a
06f0: 20 77 72 69 74 65 2d 6c 6f 63 6b 65 64 0a 62 6f   write-locked.bo
0700: 6f 74 20 64 65 76 69 63 65 2e 20 20 28 4d 61 6e  ot device.  (Man
0710: 79 20 77 6f 75 6c 64 20 61 72 67 75 65 20 74 68  y would argue th
0720: 61 74 20 74 68 69 73 20 69 73 20 61 20 73 65 72  at this is a ser
0730: 69 6f 75 73 20 64 65 66 65 63 74 2c 20 61 6e 64  ious defect, and
0740: 20 49 20 61 67 72 65 65 2e 0a 48 6f 77 65 76 65   I agree..Howeve
0750: 72 20 74 68 69 73 20 69 73 20 74 68 65 20 72 65  r this is the re
0760: 61 6c 69 74 79 20 77 65 20 61 72 65 20 64 65 61  ality we are dea
0770: 6c 69 6e 67 20 77 69 74 68 2e 29 0a 0a 54 68 69  ling with.)..Thi
0780: 73 20 6d 65 61 6e 73 20 74 68 61 74 20 74 68 65  s means that the
0790: 72 65 20 72 65 61 6c 6c 79 20 73 68 6f 75 6c 64  re really should
07a0: 20 6f 6e 6c 79 20 62 65 20 6f 6e 65 20 69 6e 73   only be one ins
07b0: 74 61 6e 63 65 20 6f 66 20 60 6f 73 38 2d 63 70  tance of `os8-cp
07c0: 60 0a 6d 61 6e 69 70 75 6c 61 74 69 6e 67 20 61  `.manipulating a
07d0: 20 70 61 72 74 69 63 75 6c 61 72 20 62 6f 6f 74   particular boot
07e0: 61 62 6c 65 20 69 6d 61 67 65 20 61 74 20 61 20  able image at a 
07f0: 74 69 6d 65 2e 0a 0a 57 68 65 6e 20 74 68 69 73  time...When this
0800: 20 74 6f 6f 6c 20 77 61 73 20 75 73 65 64 20 69   tool was used i
0810: 6e 20 61 20 4d 61 6b 65 66 69 6c 65 2c 20 63 61  n a Makefile, ca
0820: 72 65 20 68 61 64 20 74 6f 20 62 65 20 74 61 6b  re had to be tak
0830: 65 6e 20 77 69 74 68 20 64 65 70 65 6e 64 65 6e  en with dependen
0840: 63 69 65 73 0a 73 6f 20 74 68 61 74 20 61 20 70  cies.so that a p
0850: 61 72 61 6c 6c 65 6c 20 6d 61 6b 65 20 77 6f 75  arallel make wou
0860: 6c 64 20 6e 65 76 65 72 20 72 75 6e 20 6d 6f 72  ld never run mor
0870: 65 20 74 68 61 6e 20 61 20 73 69 6e 67 6c 65 20  e than a single 
0880: 69 6e 73 74 61 6e 63 65 20 6f 66 0a 60 6f 73 38  instance of.`os8
0890: 2d 63 70 60 2e 0a 0a 54 68 65 72 65 20 61 72 65  -cp`...There are
08a0: 20 61 20 63 6f 75 70 6c 65 20 77 61 79 73 20 74   a couple ways t
08b0: 68 61 74 20 74 68 69 73 20 63 6f 75 6c 64 20 62  hat this could b
08c0: 65 20 64 65 61 6c 74 20 77 69 74 68 3a 0a 0a 2a  e dealt with:..*
08d0: 20 43 72 65 61 74 65 20 61 20 73 63 72 61 74 63   Create a scratc
08e0: 68 20 69 6d 61 67 65 20 66 6f 72 20 74 68 65 20  h image for the 
08f0: 72 75 6e 6e 69 6e 67 20 62 6f 6f 74 20 69 6d 61  running boot ima
0900: 67 65 3a 20 20 54 68 65 20 70 72 6f 62 6c 65 6d  ge:  The problem
0910: 20 77 69 74 68 20 74 68 69 73 0a 69 73 20 74 68   with this.is th
0920: 61 74 20 6f 66 74 65 6e 20 6f 73 38 2d 63 70 20  at often os8-cp 
0930: 69 73 20 75 73 65 64 20 69 6e 20 74 68 65 20 6d  is used in the m
0940: 61 6e 69 70 75 6c 61 74 69 6f 6e 20 6f 66 20 61  anipulation of a
0950: 20 62 6f 6f 74 20 69 6d 61 67 65 20 74 6f 20 62   boot image to b
0960: 65 20 75 73 65 64 0a 6c 61 74 65 72 20 62 79 20  e used.later by 
0970: 6f 74 68 65 72 73 2e 20 20 41 20 73 63 72 61 74  others.  A scrat
0980: 63 68 20 69 6d 61 67 65 20 77 6f 75 6c 64 20 63  ch image would c
0990: 61 72 65 66 75 6c 6c 79 20 74 68 72 6f 77 20 61  arefully throw a
09a0: 77 61 79 20 61 6e 79 20 73 75 63 68 20 77 6f 72  way any such wor
09b0: 6b 2e 0a 0a 2a 20 4d 61 6e 61 67 65 20 61 20 6c  k...* Manage a l
09c0: 6f 63 6b 20 66 69 6c 65 20 74 68 61 74 20 77 6f  ock file that wo
09d0: 75 6c 64 20 62 65 20 63 68 65 63 6b 65 64 20 61  uld be checked a
09e0: 74 20 72 75 6e 2d 74 69 6d 65 3a 20 54 68 69 73  t run-time: This
09f0: 20 77 6f 75 6c 64 20 61 63 74 75 61 6c 6c 79 20   would actually 
0a00: 77 6f 72 6b 2e 0a 49 6e 64 65 65 64 20 61 20 6c  work..Indeed a l
0a10: 6f 63 6b 20 66 69 6c 65 20 77 69 74 68 20 61 20  ock file with a 
0a20: 6e 61 6d 65 20 62 61 73 65 64 20 6f 6e 20 74 68  name based on th
0a30: 65 20 70 61 74 68 20 74 6f 20 74 68 65 20 62 6f  e path to the bo
0a40: 6f 74 20 69 6d 61 67 65 20 77 6f 75 6c 64 20 61  ot image would a
0a50: 6c 6c 6f 77 0a 6d 75 6c 74 69 70 6c 65 20 69 6e  llow.multiple in
0a60: 73 74 61 6e 63 65 73 20 6f 66 20 6f 73 38 2d 63  stances of os8-c
0a70: 70 20 61 63 74 69 6e 67 20 6f 6e 20 64 69 66 66  p acting on diff
0a80: 65 72 65 6e 74 20 62 6f 6f 74 20 69 6d 61 67 65  erent boot image
0a90: 73 20 74 6f 20 72 75 6e 20 73 69 6d 75 6c 74 61  s to run simulta
0aa0: 6e 65 6f 75 73 6c 79 2e 0a 54 68 65 20 64 6f 77  neously..The dow
0ab0: 6e 73 69 64 65 20 69 73 20 63 6f 6d 70 6c 65 78  nside is complex
0ac0: 69 74 79 2e 20 20 4c 6f 63 6b 20 66 69 6c 65 73  ity.  Lock files
0ad0: 20 69 6e 20 50 79 74 68 6f 6e 20 61 72 65 20 70   in Python are p
0ae0: 6c 61 74 66 6f 72 6d 20 73 70 65 63 69 66 69 63  latform specific
0af0: 2c 20 73 6f 0a 4c 69 6e 75 78 2c 20 57 69 6e 64  , so.Linux, Wind
0b00: 6f 77 73 2c 20 42 53 44 2c 20 65 74 63 20 70 6c  ows, BSD, etc pl
0b10: 61 74 66 6f 72 6d 73 20 6d 69 67 68 74 20 72 65  atforms might re
0b20: 71 75 69 72 65 20 73 70 65 63 69 66 69 63 20 63  quire specific c
0b30: 6f 64 65 2e 20 20 43 6c 65 61 6e 75 70 20 6f 66  ode.  Cleanup of
0b40: 0a 74 68 65 20 6c 6f 63 6b 20 66 69 6c 65 20 6f  .the lock file o
0b50: 6e 20 61 6e 79 20 6b 69 6e 64 20 6f 66 20 61 62  n any kind of ab
0b60: 6e 6f 72 6d 61 6c 20 65 78 69 74 20 77 6f 75 6c  normal exit woul
0b70: 64 20 68 61 76 65 20 74 6f 20 62 65 20 6d 61 6e  d have to be man
0b80: 61 67 65 64 2e 20 20 41 6e 64 0a 64 65 73 69 67  aged.  And.desig
0b90: 6e 20 6f 66 20 77 68 61 74 20 74 6f 20 64 6f 20  n of what to do 
0ba0: 77 68 65 6e 20 77 61 69 74 69 6e 67 20 66 6f 72  when waiting for
0bb0: 20 74 68 65 20 6c 6f 63 6b 2e 0a 0a 55 6c 74 69   the lock...Ulti
0bc0: 6d 61 74 65 6c 79 20 74 68 65 20 69 6d 70 6c 65  mately the imple
0bd0: 6d 65 6e 74 61 74 69 6f 6e 20 64 65 63 69 73 69  mentation decisi
0be0: 6f 6e 20 77 61 73 3a 20 20 42 65 20 63 61 72 65  on was:  Be care
0bf0: 66 75 6c 20 6e 6f 74 20 74 6f 20 72 75 6e 0a 6d  ful not to run.m
0c00: 75 6c 74 69 70 6c 65 20 69 6e 73 74 61 6e 63 65  ultiple instance
0c10: 73 20 6f 73 38 2d 63 70 20 69 6e 20 70 61 72 61  s os8-cp in para
0c20: 6c 6c 65 6c 20 61 67 61 69 6e 73 74 20 74 68 65  llel against the
0c30: 20 73 61 6d 65 20 62 6f 6f 74 20 69 6d 61 67 65   same boot image
0c40: 20 66 69 6c 65 2e 0a 0a 23 23 20 55 73 61 67 65   file...## Usage
0c50: 0a 0a 3e 20 60 6f 73 38 2d 63 70 60 20 5b 60 2d  ..> `os8-cp` [`-
0c60: 64 68 76 71 60 5d 20 5b 2d 3c 5f 64 65 76 5f 3e  dhvq`] [-<_dev_>
0c70: 3c 5f 75 6e 69 74 5f 3e 5b 60 73 60 5d 20 5f 69  <_unit_>[`s`] _i
0c80: 6d 61 67 65 5f 5d 20 2e 2e 2e 20 5b 5b 60 2d 61  mage_] ... [[`-a
0c90: 62 69 79 7a 60 5d 20 3c 5f 73 72 63 5f 3e 5d 20  biyz`] <_src_>] 
0ca0: 2e 2e 2e 20 3c 5f 64 65 73 74 5f 3e 0a 3e 20 60  ... <_dest_>.> `
0cb0: 6f 73 38 2d 63 70 60 20 5b 60 2d 64 68 76 71 60  os8-cp` [`-dhvq`
0cc0: 5d 20 5b 60 2d 2d 61 63 74 69 6f 6e 2d 66 69 6c  ] [`--action-fil
0cd0: 65 60 20 5f 61 63 74 69 6f 6e 2d 66 69 6c 65 5f  e` _action-file_
0ce0: 5d 0a 0a 7c 20 3c 5f 64 65 76 5f 3e 20 20 20 7c  ]..| <_dev_>   |
0cf0: 20 2a 2a 44 65 76 69 63 65 2a 2a 3a 20 6f 6e 65   **Device**: one
0d00: 20 6f 66 20 60 72 6b 60 2c 20 60 74 64 60 2c 20   of `rk`, `td`, 
0d10: 60 64 74 60 2c 20 60 72 78 60 2c 20 63 6f 72 72  `dt`, `rx`, corr
0d20: 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 53 49 4d  esponding to SIM
0d30: 48 20 50 44 50 2d 38 20 64 65 76 69 63 65 73 0a  H PDP-8 devices.
0d40: 7c 20 3c 5f 75 6e 69 74 5f 3e 20 20 7c 20 2a 2a  | <_unit_>  | **
0d50: 55 6e 69 74 2a 2a 3a 20 6d 75 73 74 20 62 65 20  Unit**: must be 
0d60: 61 20 76 61 6c 69 64 20 75 6e 69 74 20 6e 75 6d  a valid unit num
0d70: 62 65 72 20 66 6f 72 20 74 68 65 20 64 65 76 69  ber for the devi
0d80: 63 65 20 69 6e 20 62 6f 74 68 20 53 49 4d 48 20  ce in both SIMH 
0d90: 61 6e 64 0a 7c 20 20 20 20 20 20 20 20 20 20 20  and.|           
0da0: 7c 20 74 68 65 20 62 6f 6f 74 65 64 20 4f 53 2f  | the booted OS/
0db0: 38 20 73 79 73 74 65 6d 2e 20 41 20 75 6e 69 74  8 system. A unit
0dc0: 20 6e 75 6d 62 65 72 20 69 73 20 72 65 71 75 69   number is requi
0dd0: 72 65 64 2e 20 20 46 6f 6c 6c 6f 77 69 6e 67 0a  red.  Following.
0de0: 7c 20 20 20 20 20 20 20 20 20 20 20 7c 20 74 68  |           | th
0df0: 65 20 75 6e 69 74 20 77 69 74 68 20 61 6e 20 22  e unit with an "
0e00: 73 22 20 6e 61 6d 65 73 20 74 68 65 20 73 79 73  s" names the sys
0e10: 74 65 6d 20 64 65 76 69 63 65 20 74 6f 20 62 6f  tem device to bo
0e20: 6f 74 2e 20 20 54 68 65 0a 7c 20 20 20 20 20 20  ot.  The.|      
0e30: 20 20 20 20 20 7c 20 73 79 73 74 65 6d 20 69 6d       | system im
0e40: 61 67 65 20 66 69 6c 65 20 6d 75 73 74 20 65 78  age file must ex
0e50: 69 73 74 2c 20 61 6e 64 20 63 6f 6e 74 61 69 6e  ist, and contain
0e60: 20 61 20 77 6f 72 6b 69 6e 67 20 62 6f 6f 74 0a   a working boot.
0e70: 7c 20 20 20 20 20 20 20 20 20 20 20 7c 20 69 6d  |           | im
0e80: 61 67 65 2e 20 20 4f 6e 6c 79 20 6f 6e 65 20 64  age.  Only one d
0e90: 65 73 69 67 6e 61 74 65 64 20 73 79 73 74 65 6d  esignated system
0ea0: 20 64 65 76 69 63 65 20 69 73 20 61 6c 6c 6f 77   device is allow
0eb0: 65 64 2e 0a 7c 20 3c 5f 73 72 63 5f 3e 20 20 20  ed..| <_src_>   
0ec0: 7c 20 2a 2a 53 6f 75 72 63 65 2a 2a 3a 20 69 73  | **Source**: is
0ed0: 20 61 20 73 6f 75 72 63 65 20 66 69 6c 65 20 6f   a source file o
0ee0: 72 20 77 69 6c 64 20 63 61 72 64 20 73 70 65 63  r wild card spec
0ef0: 69 66 69 63 61 74 69 6f 6e 2e 0a 7c 20 3c 5f 64  ification..| <_d
0f00: 65 73 74 5f 3e 20 20 7c 20 2a 2a 44 65 73 74 69  est_>  | **Desti
0f10: 6e 61 74 69 6f 6e 2a 2a 3a 20 69 73 20 61 20 64  nation**: is a d
0f20: 65 73 74 69 6e 61 74 69 6f 6e 20 66 69 6c 65 20  estination file 
0f30: 69 66 20 61 20 73 69 6e 67 6c 65 20 5f 73 72 63  if a single _src
0f40: 5f 20 66 69 6c 65 20 69 73 20 73 70 65 63 69 66  _ file is specif
0f50: 69 65 64 3b 0a 7c 20 20 20 20 20 20 20 20 20 20  ied;.|          
0f60: 20 7c 20 69 66 20 6d 75 6c 74 69 70 6c 65 20 3c   | if multiple <
0f70: 5f 73 72 63 5f 3e 20 66 69 6c 65 73 20 61 72 65  _src_> files are
0f80: 20 67 69 76 65 6e 2c 20 69 74 20 69 73 20 65 69   given, it is ei
0f90: 74 68 65 72 20 61 20 50 4f 53 49 58 0a 7c 20 20  ther a POSIX.|  
0fa0: 20 20 20 20 20 20 20 20 20 7c 20 64 69 72 65 63           | direc
0fb0: 74 6f 72 79 20 6f 72 20 61 6e 20 4f 53 2f 38 20  tory or an OS/8 
0fc0: 64 65 76 69 63 65 20 6e 61 6d 65 2e 0a 0a 20 53  device name... S
0fd0: 70 65 63 69 66 79 69 6e 67 20 61 6e 20 61 63 74  pecifying an act
0fe0: 69 6f 6e 20 66 69 6c 65 20 6f 76 65 72 72 69 64  ion file overrid
0ff0: 65 73 20 61 6e 79 20 64 65 76 69 63 65 20 6f 72  es any device or
1000: 20 66 69 6c 65 20 61 72 67 75 6d 65 6e 74 0a 20   file argument. 
1010: 70 72 65 76 69 6f 75 73 6c 79 20 73 70 65 63 69  previously speci
1020: 66 69 65 64 20 6f 6e 20 74 68 65 20 63 6f 6d 6d  fied on the comm
1030: 61 6e 64 20 6c 69 6e 65 2e 0a 0a 20 45 78 61 6d  and line... Exam
1040: 70 6c 65 3a 0a 20 0a 20 20 20 20 6f 73 38 2d 63  ple:. .    os8-c
1050: 70 20 2d 72 6b 30 73 20 6f 73 38 76 33 64 2d 70  p -rk0s os8v3d-p
1060: 61 74 63 68 65 64 2e 72 6b 30 35 20 2d 64 74 30  atched.rk05 -dt0
1070: 20 73 63 72 61 74 63 68 2e 74 75 35 36 20 2d 61   scratch.tu56 -a
1080: 20 70 72 6f 67 2e 70 61 20 44 54 41 30 3a 50 52   prog.pa DTA0:PR
1090: 4f 47 2e 50 41 20 0a 0a 23 23 23 20 46 75 72 74  OG.PA ..### Furt
10a0: 68 65 72 20 44 65 74 61 69 6c 73 0a 0a 54 68 65  her Details..The
10b0: 20 63 6f 70 79 69 6e 67 20 64 69 72 65 63 74 69   copying directi
10c0: 6f 6e 20 69 73 20 64 65 74 65 72 6d 69 6e 65 64  on is determined
10d0: 20 62 79 20 77 68 69 63 68 20 66 69 6c 65 20 6e   by which file n
10e0: 61 6d 65 20 61 72 67 75 6d 65 6e 74 73 20 68 61  ame arguments ha
10f0: 76 65 20 61 20 63 6f 6c 6f 6e 20 69 6e 20 74 68  ve a colon in th
1100: 65 6d 3a 0a 0a 2a 20 63 6f 70 79 2d 77 69 74 68  em:..* copy-with
1110: 69 6e 3a 20 54 68 65 20 73 6f 75 72 63 65 20 61  in: The source a
1120: 6e 64 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 66  nd destination f
1130: 69 6c 65 20 61 72 67 75 6d 65 6e 74 73 20 68 61  ile arguments ha
1140: 76 65 0a 63 6f 6c 6f 6e 73 2c 20 73 6f 20 63 6f  ve.colons, so co
1150: 70 79 20 77 69 74 68 69 6e 20 74 68 65 20 4f 53  py within the OS
1160: 2f 38 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 66  /8 environment f
1170: 72 6f 6d 20 6f 6e 65 20 76 6f 6c 75 6d 65 20 74  rom one volume t
1180: 6f 0a 61 6e 6f 74 68 65 72 2e 0a 0a 2a 20 63 6f  o.another...* co
1190: 70 79 2d 69 6e 74 6f 3a 20 4f 6e 6c 79 20 74 68  py-into: Only th
11a0: 65 20 64 65 73 74 20 61 72 67 75 6d 65 6e 74 20  e dest argument 
11b0: 68 61 73 20 61 20 63 6f 6c 6f 6e 2c 20 73 6f 20  has a colon, so 
11c0: 61 73 73 75 6d 65 20 74 68 65 0a 73 6f 75 72 63  assume the.sourc
11d0: 65 20 66 69 6c 65 20 6e 61 6d 65 73 20 61 72 65  e file names are
11e0: 20 50 4f 53 49 58 2d 73 69 64 65 20 61 6e 64 20   POSIX-side and 
11f0: 63 6f 70 79 20 74 68 6f 73 65 20 66 69 6c 65 73  copy those files
1200: 20 69 6e 74 6f 20 74 68 65 0a 53 49 4d 48 20 4f   into the.SIMH O
1210: 53 2f 38 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e  S/8 environment.
1220: 0a 0a 2a 20 63 6f 70 79 2d 66 72 6f 6d 3a 20 54  ..* copy-from: T
1230: 68 65 20 64 65 73 74 20 61 72 67 75 6d 65 6e 74  he dest argument
1240: 20 68 61 73 20 6e 6f 20 63 6f 6c 6f 6e 20 62 75   has no colon bu
1250: 74 20 74 68 65 20 73 6f 75 72 63 65 20 66 69 6c  t the source fil
1260: 65 0a 6e 61 6d 65 73 20 64 6f 2c 20 73 6f 20 63  e.names do, so c
1270: 6f 70 79 20 74 68 65 20 6e 61 6d 65 64 20 4f 53  opy the named OS
1280: 2f 38 20 66 69 6c 65 73 20 6f 75 74 20 66 72 6f  /8 files out fro
1290: 6d 20 74 68 65 20 73 69 6d 75 6c 61 74 69 6f 6e  m the simulation
12a0: 2e 0a 0a 49 66 20 6e 6f 6e 65 20 6f 66 20 74 68  ...If none of th
12b0: 65 20 66 69 6c 65 20 61 72 67 75 6d 65 6e 74 73  e file arguments
12c0: 20 68 61 73 20 61 20 63 6f 6c 6f 6e 20 69 6e 20   has a colon in 
12d0: 69 74 20 61 6e 64 20 79 6f 75 20 67 69 76 65 20  it and you give 
12e0: 65 78 61 63 74 6c 79 0a 74 77 6f 20 73 75 63 68  exactly.two such
12f0: 20 61 72 67 75 6d 65 6e 74 73 2c 20 77 65 20 6f   arguments, we o
1300: 70 65 72 61 74 65 20 69 6e 20 61 20 73 70 65 63  perate in a spec
1310: 69 61 6c 20 63 61 73 65 20 6f 66 20 63 6f 70 79  ial case of copy
1320: 2d 77 69 74 68 69 6e 0a 6d 6f 64 65 3a 20 74 68  -within.mode: th
1330: 65 20 73 6f 75 72 63 65 20 61 6e 64 20 64 65 73  e source and des
1340: 74 69 6e 61 74 69 6f 6e 20 76 6f 6c 75 6d 65 73  tination volumes
1350: 20 61 72 65 20 61 73 73 75 6d 65 64 20 74 6f 20   are assumed to 
1360: 62 65 20 44 53 4b 3a 2c 20 73 6f 0a 74 68 65 20  be DSK:, so.the 
1370: 66 69 6c 65 20 69 73 20 73 69 6d 70 6c 79 20 63  file is simply c
1380: 6f 70 69 65 64 20 77 69 74 68 69 6e 20 74 68 65  opied within the
1390: 20 4f 53 2f 38 20 44 53 4b 3a 20 76 6f 6c 75 6d   OS/8 DSK: volum
13a0: 65 20 66 72 6f 6d 20 6f 6e 65 20 6e 61 6d 65 0a  e from one name.
13b0: 74 6f 20 74 68 65 20 6f 74 68 65 72 2e 20 20 49  to the other.  I
13c0: 66 20 79 6f 75 20 67 69 76 65 20 67 72 65 61 74  f you give great
13d0: 65 72 20 74 68 61 6e 20 74 77 6f 20 66 69 6c 65  er than two file
13e0: 20 6e 61 6d 65 20 61 72 67 75 6d 65 6e 74 73 0a   name arguments.
13f0: 77 69 74 68 6f 75 74 20 61 20 63 6f 6c 6f 6e 20  without a colon 
1400: 69 6e 20 61 6e 79 20 6f 66 20 74 68 65 6d 2c 20  in any of them, 
1410: 69 74 20 69 73 20 6e 6f 74 20 70 6f 73 73 69 62  it is not possib
1420: 6c 65 20 74 6f 20 6d 61 6b 65 20 73 65 6e 73 65  le to make sense
1430: 20 6f 66 0a 74 68 65 20 63 6f 6d 6d 61 6e 64 20   of.the command 
1440: 73 69 6e 63 65 20 77 65 20 64 6f 20 6e 6f 74 20  since we do not 
1450: 69 6e 74 65 6e 64 20 74 6f 20 74 72 79 20 61 6e  intend to try an
1460: 64 20 72 65 70 6c 61 63 65 20 79 6f 75 72 20 70  d replace your p
1470: 65 72 66 65 63 74 6c 79 0a 67 6f 6f 64 20 50 4f  erfectly.good PO
1480: 53 49 58 20 63 70 20 69 6d 70 6c 65 6d 65 6e 74  SIX cp implement
1490: 61 74 69 6f 6e 2c 20 73 6f 20 69 74 20 65 72 72  ation, so it err
14a0: 6f 72 73 20 6f 75 74 2e 0a 0a 49 66 20 79 6f 75  ors out...If you
14b0: 20 67 69 76 65 20 6f 6e 6c 79 20 6f 6e 65 20 66   give only one f
14c0: 69 6c 65 20 6e 61 6d 65 20 61 72 67 75 6d 65 6e  ile name argumen
14d0: 74 2c 20 74 68 65 20 70 72 6f 67 72 61 6d 20 61  t, the program a
14e0: 6c 77 61 79 73 20 65 72 72 6f 72 73 0a 6f 75 74  lways errors.out
14f0: 3a 20 69 74 20 72 65 71 75 69 72 65 73 20 61 74  : it requires at
1500: 20 6c 65 61 73 74 20 6f 6e 65 20 73 6f 75 72 63   least one sourc
1510: 65 20 61 6e 64 20 6f 6e 65 20 64 65 73 74 69 6e  e and one destin
1520: 61 74 69 6f 6e 2e 0a 0a 54 68 65 20 60 2d 61 60  ation...The `-a`
1530: 2c 20 60 2d 62 60 2c 20 60 2d 69 60 2c 20 60 2d  , `-b`, `-i`, `-
1540: 79 60 2c 20 61 6e 64 20 60 2d 7a 60 20 66 6c 61  y`, and `-z` fla
1550: 67 73 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 6f  gs correspond to
1560: 20 74 68 65 20 4f 53 2f 38 20 50 49 50 20 6f 70   the OS/8 PIP op
1570: 74 69 6f 6e 73 3a 0a 0a 7c 20 66 6c 61 67 20 7c  tions:..| flag |
1580: 20 60 50 49 50 60 20 7c 20 44 65 73 63 72 69 70   `PIP` | Descrip
1590: 74 69 6f 6e 0a 7c 2d 2d 2d 2d 2d 2d 7c 2d 2d 2d  tion.|------|---
15a0: 2d 2d 2d 2d 7c 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----|-----------
15b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
15e0: 7c 20 60 2d 61 60 20 7c 20 60 2f 41 60 20 7c 20  | `-a` | `/A` | 
15f0: 41 53 43 49 49 20 66 6f 72 6d 61 74 2e 20 20 4f  ASCII format.  O
1600: 53 2f 38 20 61 6e 64 20 50 4f 53 49 58 20 6e 65  S/8 and POSIX ne
1610: 77 6c 69 6e 65 73 20 61 72 65 20 74 72 61 6e 73  wlines are trans
1620: 6c 61 74 65 64 2e 0a 7c 20 20 20 20 20 20 7c 20  lated..|      | 
1630: 20 20 20 20 20 7c 20 53 75 63 68 20 74 72 61 6e       | Such tran
1640: 73 66 65 72 73 20 61 72 65 20 6c 6f 73 73 6c 65  sfers are lossle
1650: 73 73 20 69 66 20 6c 69 6e 65 20 65 6e 64 69 6e  ss if line endin
1660: 67 73 20 61 72 65 20 20 77 65 6c 6c 2d 66 6f 72  gs are  well-for
1670: 6d 65 64 2e 0a 7c 20 60 2d 62 60 20 7c 20 60 2f  med..| `-b` | `/
1680: 42 60 20 7c 20 42 69 6e 61 72 79 20 4f 53 2f 38  B` | Binary OS/8
1690: 20 41 42 53 4c 44 52 20 66 6f 72 6d 61 74 20 77   ABSLDR format w
16a0: 69 74 68 20 6c 65 61 64 65 72 2f 74 72 61 69 6c  ith leader/trail
16b0: 65 72 20 61 6e 64 20 6f 74 68 65 72 0a 7c 20 20  er and other.|  
16c0: 20 20 20 20 7c 20 20 20 20 20 20 7c 20 73 70 65      |      | spe
16d0: 63 69 66 69 63 20 66 6f 72 6d 61 74 74 69 6e 67  cific formatting
16e0: 20 74 68 61 74 20 69 73 20 64 65 74 65 63 74 65   that is detecte
16f0: 64 20 61 6e 64 20 65 6e 66 6f 72 63 65 64 20 62  d and enforced b
1700: 79 20 50 49 50 2e 0a 7c 20 60 2d 69 60 20 7c 20  y PIP..| `-i` | 
1710: 60 2f 49 60 20 7c 20 49 6d 61 67 65 20 6d 6f 64  `/I` | Image mod
1720: 65 2e 20 20 46 69 6c 65 73 20 61 72 65 20 63 6f  e.  Files are co
1730: 70 69 65 64 20 62 79 74 65 20 66 6f 72 20 62 79  pied byte for by
1740: 74 65 20 76 65 72 62 61 74 69 6d 2e 0a 7c 20 60  te verbatim..| `
1750: 2d 7a 60 20 7c 20 60 2f 5a 60 20 7c 20 5a 45 52  -z` | `/Z` | ZER
1760: 4f 20 64 69 72 65 63 74 6f 72 79 20 6f 66 20 64  O directory of d
1770: 65 73 74 69 6e 61 74 69 6f 6e 20 4f 53 2f 38 20  estination OS/8 
1780: 64 65 76 69 63 65 2e 0a 7c 20 60 2d 79 60 20 7c  device..| `-y` |
1790: 20 60 2f 59 60 20 7c 20 59 61 6e 6b 20 73 79 73   `/Y` | Yank sys
17a0: 74 65 6d 20 61 72 65 61 20 66 72 6f 6d 20 73 6f  tem area from so
17b0: 75 72 63 65 20 74 6f 20 64 65 73 74 69 6e 61 74  urce to destinat
17c0: 69 6f 6e 2e 0a 0a 49 66 20 6e 6f 20 66 6f 72 6d  ion...If no form
17d0: 61 74 20 66 6c 61 67 20 69 73 20 73 65 74 2c 20  at flag is set, 
17e0: 74 68 65 20 64 65 66 61 75 6c 74 20 74 72 61 6e  the default tran
17f0: 73 66 65 72 20 66 6f 72 6d 61 74 20 69 73 20 60  sfer format is `
1800: 2f 49 60 2e 0a 0a 28 54 68 69 73 20 70 72 69 6f  /I`...(This prio
1810: 67 72 61 6d 20 63 75 72 72 65 6e 74 6c 79 20 75  gram currently u
1820: 73 65 73 20 50 49 50 20 61 73 20 69 74 73 20 70  ses PIP as its p
1830: 72 69 6d 61 72 79 20 68 61 6e 64 6c 65 72 20 66  rimary handler f
1840: 6f 72 20 74 68 65 0a 4f 53 2f 38 20 73 69 64 65  or the.OS/8 side
1850: 20 6f 66 20 74 68 65 20 77 6f 72 6b 2e 29 20 20   of the work.)  
1860: 54 68 65 79 20 6d 75 73 74 20 62 65 20 66 6f 6c  They must be fol
1870: 6c 6f 77 65 64 20 62 79 20 61 74 20 6c 65 61 73  lowed by at leas
1880: 74 20 6f 6e 65 20 73 6f 75 72 63 65 0a 66 69 6c  t one source.fil
1890: 65 20 6e 61 6d 65 2c 20 61 6e 64 20 74 68 65 79  e name, and they
18a0: 20 61 66 66 65 63 74 20 61 6c 6c 20 73 75 62 73   affect all subs
18b0: 65 71 75 65 6e 74 20 73 6f 75 72 63 65 20 66 69  equent source fi
18c0: 6c 65 20 6e 61 6d 65 73 20 75 6e 74 69 6c 0a 61  le names until.a
18d0: 6e 6f 74 68 65 72 20 73 75 63 68 20 6f 70 74 69  nother such opti
18e0: 6f 6e 20 69 73 20 66 6f 75 6e 64 2e 20 20 46 6f  on is found.  Fo
18f0: 72 20 65 78 61 6d 70 6c 65 3a 0a 0a 20 20 20 20  r example:..    
1900: 24 20 6f 73 38 2d 63 70 20 2d 61 20 66 6f 6f 20  $ os8-cp -a foo 
1910: 62 61 72 20 2d 62 20 71 75 78 20 73 79 73 3a 0a  bar -b qux sys:.
1920: 0a 46 69 6c 65 73 20 66 6f 6f 20 61 6e 64 20 62  .Files foo and b
1930: 61 72 20 61 72 65 20 63 6f 70 69 65 64 20 74 6f  ar are copied to
1940: 20 53 59 53 3a 20 69 6e 20 41 53 43 49 49 20 6d   SYS: in ASCII m
1950: 6f 64 65 2c 20 6f 76 65 72 72 69 64 69 6e 67 20  ode, overriding 
1960: 74 68 65 0a 64 65 66 61 75 6c 74 20 62 69 6e 61  the.default bina
1970: 72 79 20 6d 6f 64 65 2c 20 74 68 65 6e 20 62 69  ry mode, then bi
1980: 6e 61 72 79 20 6d 6f 64 65 20 69 73 20 72 65 73  nary mode is res
1990: 74 6f 72 65 64 20 66 6f 72 20 74 68 65 20 63 6f  tored for the co
19a0: 70 79 20 6f 66 0a 66 69 6c 65 20 71 75 78 20 74  py of.file qux t
19b0: 6f 20 74 68 65 20 53 59 53 3a 20 76 6f 6c 75 6d  o the SYS: volum
19c0: 65 2e 0a 0a 42 65 77 61 72 65 20 74 68 61 74 20  e...Beware that 
19d0: 2d 69 20 6d 65 61 6e 73 20 73 6f 6d 65 74 68 69  -i means somethi
19e0: 6e 67 20 76 65 72 79 20 64 69 66 66 65 72 65 6e  ng very differen
19f0: 74 20 74 6f 20 74 68 69 73 20 70 72 6f 67 72 61  t to this progra
1a00: 6d 20 74 68 61 6e 0a 69 74 20 6d 65 61 6e 73 20  m than.it means 
1a10: 74 6f 20 50 4f 53 49 58 20 63 70 3a 20 64 65 73  to POSIX cp: des
1a20: 74 69 6e 61 74 69 6f 6e 20 66 69 6c 65 73 20 77  tination files w
1a30: 69 6c 6c 20 62 65 20 75 6e 63 65 72 65 6d 6f 6e  ill be unceremon
1a40: 69 6f 75 73 6c 79 0a 6f 76 65 72 77 72 69 74 74  iously.overwritt
1a50: 65 6e 21 0a 0a 4d 6f 72 65 20 61 62 6f 75 74 20  en!..More about 
1a60: 69 6d 61 67 65 20 66 69 6c 65 20 6d 6f 75 6e 74  image file mount
1a70: 73 3a 0a 0a 69 6d 61 67 65 20 66 69 6c 65 73 20  s:..image files 
1a80: 66 6f 72 20 6e 6f 6e 2d 62 6f 6f 74 20 64 65 76  for non-boot dev
1a90: 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 73 2c   specifications,
1aa0: 20 69 66 20 74 68 65 79 20 64 6f 20 6e 6f 74 0a   if they do not.
1ab0: 61 6c 72 65 61 64 79 20 65 78 69 73 74 2c 20 61  already exist, a
1ac0: 72 65 20 63 72 65 61 74 65 64 2e 20 54 68 65 69  re created. Thei
1ad0: 72 20 64 69 72 65 63 74 6f 72 69 65 73 20 61 72  r directories ar
1ae0: 65 20 69 6e 69 74 61 6c 69 7a 65 64 0a 77 69 74  e initalized.wit
1af0: 68 20 74 68 65 20 5a 45 52 4f 20 63 6f 6d 6d 61  h the ZERO comma
1b00: 6e 64 2e 20 4d 75 6c 74 69 2d 70 61 72 74 69 74  nd. Multi-partit
1b10: 69 6f 6e 20 64 65 76 69 63 65 73 20 69 6e 69 74  ion devices init
1b20: 69 61 6c 69 7a 65 20 61 6c 6c 2e 0a 0a 41 20 66  ialize all...A f
1b30: 75 74 75 72 65 20 76 65 72 73 69 6f 6e 20 77 69  uture version wi
1b40: 6c 6c 20 69 6e 63 6c 75 64 65 20 61 20 64 65 66  ll include a def
1b50: 61 75 6c 74 20 73 79 73 74 65 6d 20 64 65 76 69  ault system devi
1b60: 63 65 20 69 66 0a 6e 6f 20 64 65 76 20 73 79 73  ce if.no dev sys
1b70: 74 65 6d 20 6d 6f 75 6e 74 20 69 73 20 6d 61 64  tem mount is mad
1b80: 65 2e 0a 0a 45 78 61 6d 70 6c 65 73 3a 0a 0a 20  e...Examples:.. 
1b90: 20 20 20 24 20 6f 73 38 2d 63 70 20 2d 74 64 30     $ os8-cp -td0
1ba0: 73 20 6d 79 2e 74 75 35 36 20 2d 72 6b 30 20 6d  s my.tu56 -rk0 m
1bb0: 79 2e 72 6b 30 35 20 66 6f 6f 20 44 53 4b 3a 0a  y.rk05 foo DSK:.
1bc0: 0a 2e 2e 2e 77 69 6c 6c 20 62 6f 6f 74 20 66 72  ....will boot fr
1bd0: 6f 6d 20 6d 79 2e 74 75 35 36 2c 20 77 68 69 63  om my.tu56, whic
1be0: 68 20 69 73 20 70 72 65 73 75 6d 65 64 20 74 6f  h is presumed to
1bf0: 20 62 65 20 61 20 62 6f 6f 74 61 62 6c 65 20 4f   be a bootable O
1c00: 53 2f 38 0a 44 45 43 74 61 70 65 20 61 74 74 61  S/8.DECtape atta
1c10: 63 68 65 64 20 74 6f 20 53 49 4d 48 20 64 65 76  ched to SIMH dev
1c20: 69 63 65 20 54 44 30 2e 20 20 54 68 65 20 52 4b  ice TD0.  The RK
1c30: 30 35 20 64 69 73 6b 20 69 6d 61 67 65 20 6d 79  05 disk image my
1c40: 2e 72 6b 30 35 0a 77 69 6c 6c 20 62 65 20 61 74  .rk05.will be at
1c50: 74 61 63 68 65 64 20 74 6f 20 52 4b 30 2c 20 73  tached to RK0, s
1c60: 69 6e 63 65 20 74 68 65 20 64 65 66 61 75 6c 74  ince the default
1c70: 20 62 6f 6f 74 20 64 69 73 6b 20 69 73 20 6e 6f   boot disk is no
1c80: 74 20 61 74 74 61 63 68 65 64 0a 74 68 65 72 65  t attached.there
1c90: 20 69 6e 20 74 68 69 73 20 65 78 61 6d 70 6c 65   in this example
1ca0: 2e 20 20 49 74 20 77 69 6c 6c 20 63 6f 70 79 20  .  It will copy 
1cb0: 50 4f 53 49 58 2d 73 69 64 65 20 66 69 6c 65 20  POSIX-side file 
1cc0: 66 6f 6f 20 74 6f 20 44 53 4b 3a 46 4f 4f 0a 77  foo to DSK:FOO.w
1cd0: 68 69 63 68 20 77 69 6c 6c 20 70 72 6f 62 61 62  hich will probab
1ce0: 6c 79 20 62 65 20 69 6e 74 65 72 70 72 65 74 65  ly be interprete
1cf0: 64 20 61 73 20 44 54 41 30 3a 46 4f 4f 20 62 79  d as DTA0:FOO by
1d00: 20 74 68 65 20 74 79 70 69 63 61 6c 20 42 55 49   the typical BUI
1d10: 4c 44 0a 6f 70 74 69 6f 6e 73 20 66 6f 72 20 61  LD.options for a
1d20: 20 62 6f 6f 74 61 62 6c 65 20 4f 53 2f 38 20 54   bootable OS/8 T
1d30: 55 35 36 20 44 45 43 74 61 70 65 2e 20 20 42 65  U56 DECtape.  Be
1d40: 77 61 72 65 20 74 68 65 72 65 66 6f 72 65 20 6f  ware therefore o
1d50: 66 20 75 73 69 6e 67 0a 74 68 65 20 67 65 6e 65  f using.the gene
1d60: 72 69 63 20 53 59 53 3a 20 61 6e 64 20 44 53 4b  ric SYS: and DSK
1d70: 3a 20 64 65 76 69 63 65 20 6e 61 6d 65 73 21 20  : device names! 
1d80: 20 59 6f 75 20 77 6f 75 6c 64 20 62 65 20 62 65   You would be be
1d90: 74 74 65 72 20 61 64 76 69 73 65 64 0a 74 6f 20  tter advised.to 
1da0: 75 73 65 20 44 54 41 30 3a 2c 20 52 4b 41 30 3a  use DTA0:, RKA0:
1db0: 20 6f 72 20 52 4b 42 30 3a 20 61 73 20 74 68 65   or RKB0: as the
1dc0: 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 69 6e 20   destination in 
1dd0: 74 68 69 73 20 65 78 61 6d 70 6c 65 2e 0a 0a 20  this example... 
1de0: 20 20 20 24 20 6f 73 38 2d 63 70 20 2d 74 64 30     $ os8-cp -td0
1df0: 73 20 6d 79 2e 74 75 35 36 20 2d 72 78 31 20 6d  s my.tu56 -rx1 m
1e00: 79 2e 72 78 30 31 20 66 6f 6f 20 52 58 41 31 3a  y.rx01 foo RXA1:
1e10: 0a 0a 54 68 69 73 20 66 69 78 65 73 20 74 68 65  ..This fixes the
1e20: 20 61 6c 6d 6f 73 74 2d 63 65 72 74 61 69 6e 6c   almost-certainl
1e30: 79 20 69 6e 63 6f 72 72 65 63 74 20 75 73 65 20  y incorrect use 
1e40: 6f 66 20 44 53 4b 3a 20 69 6e 20 74 68 65 20 70  of DSK: in the p
1e50: 72 69 6f 72 20 0a 65 78 61 6d 70 6c 65 2e 0a 0a  rior .example...
1e60: 54 68 65 20 2d 64 74 20 61 6e 64 20 2d 74 64 20  The -dt and -td 
1e70: 6f 70 74 69 6f 6e 73 20 61 72 65 20 68 61 6e 64  options are hand
1e80: 6c 65 64 20 73 69 6d 69 6c 61 72 6c 79 20 74 6f  led similarly to
1e90: 20 74 68 65 20 2d 72 2a 20 6f 70 74 69 6f 6e 73   the -r* options
1ea0: 2c 0a 64 69 66 66 65 72 69 6e 67 20 6f 6e 6c 79  ,.differing only
1eb0: 20 69 6e 20 77 68 65 74 68 65 72 20 77 65 20 75   in whether we u
1ec0: 73 65 20 74 68 65 20 53 49 4d 48 20 44 54 20 6f  se the SIMH DT o
1ed0: 72 20 54 44 20 50 44 50 2d 38 20 64 65 76 69 63  r TD PDP-8 devic
1ee0: 65 73 2c 0a 77 68 69 63 68 20 63 6f 72 72 65 73  es,.which corres
1ef0: 70 6f 6e 64 20 74 6f 20 74 68 65 20 54 43 30 38  pond to the TC08
1f00: 20 6f 72 20 54 44 38 45 20 44 45 43 74 61 70 65   or TD8E DECtape
1f10: 20 63 6f 6e 74 72 6f 6c 6c 65 72 73 2e 20 20 57   controllers.  W
1f20: 68 69 63 68 20 6f 6e 65 0a 79 6f 75 20 67 69 76  hich one.you giv
1f30: 65 20 64 65 70 65 6e 64 73 20 6f 6e 20 74 68 65  e depends on the
1f40: 20 64 65 76 69 63 65 20 73 75 70 70 6f 72 74 20   device support 
1f50: 62 75 69 6c 74 20 69 6e 74 6f 20 74 68 65 20 4f  built into the O
1f60: 53 2f 38 20 6d 65 64 69 61 0a 79 6f 75 27 76 65  S/8 media.you've
1f70: 20 62 6f 6f 74 65 64 20 66 72 6f 6d 2e 0a 0a 23   booted from...#
1f80: 23 23 20 4d 6f 72 65 20 61 62 6f 75 74 20 5f 73  ## More about _s
1f90: 72 63 5f 20 61 6e 64 20 5f 64 65 73 74 5f 20 73  rc_ and _dest_ s
1fa0: 70 65 63 69 66 69 63 61 74 69 6f 6e 73 3a 0a 0a  pecifications:..
1fb0: 57 68 65 6e 20 6f 6e 6c 79 20 61 20 64 65 73 74  When only a dest
1fc0: 69 6e 61 74 69 6f 6e 20 64 65 76 69 63 65 2c 20  ination device, 
1fd0: 64 69 72 65 63 74 6f 72 79 2c 20 6f 72 20 76 6f  directory, or vo
1fe0: 6c 75 6d 65 20 6e 61 6d 65 20 69 73 20 67 69 76  lume name is giv
1ff0: 65 6e 2c 0a 66 69 6c 65 20 6e 61 6d 65 73 20 61  en,.file names a
2000: 72 65 20 6e 6f 72 6d 61 6c 69 7a 65 64 20 77 68  re normalized wh
2010: 65 6e 20 63 6f 70 69 6e 67 20 62 65 74 77 65 65  en coping betwee
2020: 6e 20 50 4f 53 49 58 20 61 6e 64 20 4f 53 2f 38  n POSIX and OS/8
2030: 0a 73 79 73 74 65 6d 73 2e 20 20 46 69 6c 65 20  .systems.  File 
2040: 6e 61 6d 65 73 20 61 72 65 20 75 70 70 65 72 63  names are upperc
2050: 61 73 65 64 20 61 6e 64 20 74 72 75 6e 63 61 74  ased and truncat
2060: 65 64 20 74 6f 20 36 2e 32 20 6c 69 6d 69 74 73  ed to 6.2 limits
2070: 20 77 68 65 6e 0a 63 6f 70 79 69 6e 67 20 69 6e   when.copying in
2080: 74 6f 20 4f 53 2f 38 2e 20 20 46 69 6c 65 20 6e  to OS/8.  File n
2090: 61 6d 65 73 20 61 72 65 20 6c 6f 77 65 72 63 61  ames are lowerca
20a0: 73 65 64 20 6f 6e 20 63 6f 70 79 69 6e 67 20 66  sed on copying f
20b0: 72 6f 6d 20 4f 53 2f 38 0a 75 6e 6c 65 73 73 20  rom OS/8.unless 
20c0: 79 6f 75 20 67 69 76 65 20 74 68 65 20 2a 73 6f  you give the *so
20d0: 75 72 63 65 2a 20 66 69 6c 65 20 6e 61 6d 65 20  urce* file name 
20e0: 69 6e 20 61 6c 6c 2d 75 70 70 65 72 63 61 73 65  in all-uppercase
20f0: 2e 0a 54 68 65 6e 20 66 69 6c 65 20 6e 61 6d 65  ..Then file name
2100: 20 63 61 73 65 20 69 73 20 70 72 65 73 65 72 76   case is preserv
2110: 65 64 2e 20 20 54 68 69 73 20 62 65 68 61 76 69  ed.  This behavi
2120: 6f 72 20 69 73 20 6f 76 65 72 72 69 64 64 65 6e  or is overridden
2130: 0a 69 66 20 79 6f 75 20 67 69 76 65 20 61 20 63  .if you give a c
2140: 6f 6d 70 6c 65 74 65 20 66 69 6c 65 20 6e 61 6d  omplete file nam
2150: 65 20 66 6f 72 20 74 68 65 20 64 65 73 74 69 6e  e for the destin
2160: 61 74 69 6f 6e 3a 0a 0a 20 20 20 20 24 20 6f 73  ation:..    $ os
2170: 38 2d 63 70 20 6d 79 2d 6c 6f 6e 67 2d 66 69 6c  8-cp my-long-fil
2180: 65 2d 6e 61 6d 65 2e 74 78 74 20 44 53 4b 3a 4d  e-name.txt DSK:M
2190: 4c 46 2e 46 44 0a 0a 49 66 20 79 6f 75 20 67 61  LF.FD..If you ga
21a0: 76 65 20 22 44 53 4b 3a 22 20 61 73 20 74 68 65  ve "DSK:" as the
21b0: 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 69 6e 73   destination ins
21c0: 74 65 61 64 2c 20 79 6f 75 20 77 6f 75 6c 64 20  tead, you would 
21d0: 68 61 76 65 20 67 6f 74 74 65 6e 0a 22 4d 59 2d  have gotten."MY-
21e0: 4c 4f 4e 2e 54 58 22 20 61 73 20 74 68 65 20 64  LON.TX" as the d
21f0: 65 73 69 6e 74 61 74 69 6f 6e 20 66 69 6c 65 20  esintation file 
2200: 6e 61 6d 65 20 69 6e 73 74 65 61 64 2e 0a 0a 23  name instead...#
2210: 23 23 20 52 75 6e 2d 74 69 6d 65 20 4f 70 74 69  ## Run-time Opti
2220: 6f 6e 73 3a 0a 0a 7c 20 60 2d 64 60 20 20 20 20  ons:..| `-d`    
2230: 7c 20 72 75 6e 20 69 6e 20 64 65 62 75 67 20 6d  | run in debug m
2240: 6f 64 65 2e 0a 7c 20 60 2d 76 60 20 20 20 20 7c  ode..| `-v`    |
2250: 20 65 6e 61 62 6c 65 20 76 65 72 62 6f 73 65 20   enable verbose 
2260: 73 74 61 74 75 73 20 72 65 70 6f 72 74 69 6e 67  status reporting
2270: 2e 0a 7c 20 60 2d 68 20 2d 76 60 20 7c 20 70 72  ..| `-h -v` | pr
2280: 69 6e 74 20 64 65 74 61 69 6c 65 64 20 75 73 61  int detailed usa
2290: 67 65 20 6d 65 73 73 61 67 65 2e 0a 0a 0a 5b 6f  ge message....[o
22a0: 73 38 76 69 65 77 2d 66 6f 72 75 6d 5d 3a 20 68  s8view-forum]: h
22b0: 74 74 70 3a 2f 2f 67 72 6f 75 70 73 2e 67 6f 6f  ttp://groups.goo
22c0: 67 6c 65 2e 63 6f 6d 2f 66 6f 72 75 6d 2f 23 21  gle.com/forum/#!
22d0: 74 6f 70 69 63 2f 70 69 64 70 2d 38 2f 31 68 6f  topic/pidp-8/1ho
22e0: 6a 71 41 41 54 75 6d 34 0a 0a 23 23 20 54 4f 44  jqAATum4..## TOD
22f0: 4f 73 0a 0a 2a 20 4e 6f 20 54 4f 44 4f 73 20 61  Os..* No TODOs a
2300: 73 20 6f 66 20 79 65 74 2e 0a 0a 23 23 20 4e 6f  s of yet...## No
2310: 74 65 73 0a 0a 2a 20 4e 6f 20 6e 6f 74 65 73 20  tes..* No notes 
2320: 61 73 20 6f 66 20 79 65 74 2e 0a 0a 23 23 23 20  as of yet...### 
2330: 3c 61 20 69 64 3d 22 6c 69 63 65 6e 73 65 22 3e  <a id="license">
2340: 3c 2f 61 3e 4c 69 63 65 6e 73 65 0a 0a 43 6f 70  </a>License..Cop
2350: 79 72 69 67 68 74 20 c2 a9 20 32 30 31 38 20 62  yright © 2018 b
2360: 79 20 42 69 6c 6c 20 43 61 74 74 65 79 20 61 6e  y Bill Cattey an
2370: 64 20 57 61 72 72 65 6e 20 59 6f 75 6e 67 2e 20  d Warren Young. 
2380: 4c 69 63 65 6e 73 65 64 20 75 6e 64 65 72 20 74  Licensed under t
2390: 68 65 0a 74 65 72 6d 73 20 6f 66 20 5b 74 68 65  he.terms of [the
23a0: 20 53 49 4d 48 20 6c 69 63 65 6e 73 65 5d 5b 73   SIMH license][s
23b0: 6c 5d 2e 0a 0a 5b 73 6c 5d 3a 20 68 74 74 70 73  l]...[sl]: https
23c0: 3a 2f 2f 74 61 6e 67 65 6e 74 73 6f 66 74 2e 63  ://tangentsoft.c
23d0: 6f 6d 2f 70 69 64 70 38 69 2f 64 6f 63 2f 74 72  om/pidp8i/doc/tr
23e0: 75 6e 6b 2f 53 49 4d 48 2d 4c 49 43 45 4e 53 45  unk/SIMH-LICENSE
23f0: 2e 6d 64 0a                                      .md.