Уффф.. GetOpt допилил (у него встроенный help на основе определения опций - с его методами долго возился).
Первый запуск Null reference exception Ну... в принципе ожидаемо

- - - Добавлено - - -

Удобная вещь в VS - можно редактировать исходники прямо во время отладки и продолжать отлаживать Поправил первые ошибки и

Код:
NAME

tu58fs - DEC TU58 tape emulator with File Sharing v1.3.0
(compile 27.03.2022 on 03:57:12)

(c) 2022 Hunta <some@where.on.net
(C) 2017 Joerg Hoppe <j_hoppe@t-online.de>
(C) 2005-2017 Don North <ak6dn@mindspring.com>,
(C) 1984 Dan Ts'o <Rockefeller University>


SYNOPSIS

Command line options are processed strictly left-to-right.

TU58fs  --help --version --debug --verbose --mrsp --nosync --vax --background 
          --timing <parameter> --baudrate <baudrate> --format <bits_parity_stop> 
          --port <serial_device> --xxdp --rt11 --size <size> 
          --device <unit> <read_write_create> <filename> 
          --shareddevice <unit> <read_write_create> <directory> 
          --synctimeout <seconds> --unpack <filename> <dirname> <devicetype> 
          --pack <dirname> <filename> <devicetype> --boot <monitor> [ <keep>] 
          --usbdelay <milliseconds>
          --usbdelay <milliseconds>
-?    | --help
          Print help.
-V    | --version
          Output version string.
-dbg  | --debug
          Enable debug output to console.
-v    | --verbose
          Enable verbose output to terminal.
-m    | --mrsp
          Disable sending INIT at initial startup.
-n    | --nosync
          enable standard MRSP mode (byte-level handshake).
-x    | --vax
          Remove delays for aggressive timeouts of VAX console.
-bk   | --background
          Run in background mode, no console I/O except errors.
-t    | --timing <parameter>
          timing 1: add timing delays to spoof diagnostic into passing.

          timing 2: add timing delays to mimic a real TU58.
-b    | --baudrate <baudrate>
          Set serial line speed to 300..3000000 baud. Default: "38400"
-f    | --format <bits_parity_stop>
          Set format parameters for serial line as a 3 char string <bitcount><parity><stopbits>

          <bitcount> maybe 7 or 8, <parity> is n (no), e (even) or o (odd), <stopbits> is 1 or 2.

          Set to special console params for --boot operation. leave default for device emulation.
           Default: "8N1"
          Simple example:  -f 7e2
              Set for 7 bit even parity with 2 stop bits (--boot)
-p    | --port <serial_device>
          Select serial port: "COM<serial_device>:" or <serial_device> is a node like "/dev/ttyS1"
-xx   | --xxdp
          Select XXDP file system for following --device or --shareddevice options.

          New image files are create with an empty XXDP file system.
-rt   | --rt11
          Same as --xxdp, but RT11 file system is selected.
-s    | --size <size>
          Override size of TU58 imagefile. 

          <size> is number of bytes; suffix "K": * 1024, suffix "M": * K * K.

          Smaller images are enlarged, greater are trunc'd if possible.

          Devices and file system try to adapt.

          Works for XXDP non-boot-tapes, and RT-11 with patched DD.SYS driver.

          "--size std" clears overriden size.
          Simple example:  -s 10M
              image is 10 Megabytes = RL02 sized.
-d    | --device <unit> <read_write_create> <filename>
          Open image file for a TU58 drive

          <unit>: File is mounted in this drive (0..7).

          <read_write_create>: "r" = device is read-only, "w" = writable,

          "c" = writable and file is created if not existent.

          Also the --xxdp, --rt11 and --size options are evaluated.

          A missing file is created and initialized with 0s or empty XXDP or RT11 filesystem.
          Simple example:  -d 0 r 11XXDP.DSK
              mount image file XXDP.DSK into slot #0.
-sd   | --shareddevice <unit> <read_write_create> <directory>
          same as --device, but image is filled with files from a host directory.

          -xxdp or -rt11 must be specified. <directory> must be writable and

          must not contain subdirs, it is created only with "c" option.
          Simple example:  -sd 1 w /home/user/tu58/data.dir
              fill image with files in a directory.
-st   | --synctimeout <seconds>
          An image changed by PDP is written to disk after this idle period.
           Default: "3"
-up   | --unpack <filename> <dirname> <devicetype>
          Read a binary disk/tape image, and extract files into directory

          A filesystem type must be specified (like -xxdp)

          <device_type> can specify a different device geometry for the image,

          allowed: TU58,RP0456,RK035,RL01,RL02,RK067,RM03,RS034,TU56,RX01,RX02
-pk   | --pack <dirname> <filename> <devicetype>
          Read files from a directory and pack into binary disk/tape image

          <device_type> can specify a different device geometry for the image,

          allowed: TU58,RP0456,RK035,RL01,RL02,RK067,RM03,RS034,TU56,RX01,RX02
-boot | --boot <monitor> [ <keep>]
          Deposits a TU58 bootloader over console monitor into PDP-11, then starts it.

          The TU58 emulator must have been started on a different serial port before.

          <port> and <baudrate> of the console are set by "-p" and "-b" options

            left of "--boot".

          <monitor> specifies the implemented console: "odt", "m9312", or "m9301".

            "code" displays the bootloader code as value/address pairs on stdout.

          With <keep>=true the transfer dialog terminal window remains active, so you can

            immediately operate the booted TU58 OS. With <keep>=false connection is terminated and

            you have to start a more comfortable terminal emulator.

          - The serial CONSOLE port is always DIFFERENT from the TU58 port!

          - The PDP-11 must be HALTed and show its monitor prompt,

            with the HALT/RUN switch in RUN position.

          - the bootloader doesn't catch any TRAPs, so turn off the BEVENT/LTC signal.

            The code is loaded at end of first 4k page at address 7000.

-ud   | --usbdelay <milliseconds>
          Specifies extra delay for protocol in "--boot" operation.

          Some USB-RS232 adapters have large delays when polling input (for example FTDIs).

          Other brands (Prolific) and non-USB RS232 ports should never need this.

          Experiment for an optimum between download speed and reliability, recommended range 5-20.

Option names are case sensitive.

EXAMPLES

TU58fs -p COM52 -b 38400 -d 0 r 11XXDP.DSK
    Define device #0: tape image file is 11XXDP.DSK .
    Access to serial line device requires "sudo". Image is readonly.
    If it not exist, an error is signaled.

TU58fs <serial params> -d 0 c 11XXDP.DSK
    Same. If "11XXDP.DSK" does not exists, an unformatted 0-filled image file is created.

TU58fs <serial params> -rt11 -sd 1 w tinyrt11
    Shared device image for device #1, "tinyrt11" is a directory:
    Image is constructed from file content, to a max size of 256kb, else error.
    Can be accessed with "DD1:"

TU58fs <serial params> --size 10M -rt11 -d 1 w bigrt11
    Same, but device image is automatically enlarged to 10MBytes, max 32MB.
    A modified DD.SYS driver must be used on the RT11 system.

TU58fs <serial params> -xxdp -d 0 r 11XXDP.DSK -d 1 w data.dsk -sd 7 w shared.dir
    Define device #0:
    Standard 256kb image, loaded from file "11XXDP.DSK", not created.
    Device #1:
    If "data.dsk" does not exist, a file is create and formatted as empty XXDP
    If "data.dsk" exists, it is opened for read/write
    Device #7:
    contains the files in a sub directory "shared.dir" on the host.
    Can be accessed with "DD0:", "DD1:", "DD7:"

TU58fs -xxdp --unpack 11XXDP.DSK 11xxdp.dir TU58
    Extracts all files from an TU58 image into a directory.
    If image is bootable, pseudofiles for bootloader and monitor are generated.
    The directory is then bootable too.

TU58fs <serial params> -xxdp -sd 0 w 11xxdp.dir
    Define device #0:
    Standard 256kb image, loaded from file "11xxdp.dir", not created.
    Dir is bootable, if it contains the pseudo files for monitor and boot block.
    A bootable dir is can be created by unpacking a bootable image file.

TU58fs <serial params> -rt11 -unpack RT11V53.DSK rt11v53.imgdir TU58 -sd 0 w rt11v53.imgdir
    Combination of exmaples before:
    Extract content of image into shared directory, then run TU58 emulator on that directory.
    Dir is bootable, if the image is bootable.

TU58fs -p /dev/ttyS1 -b 9600 -f 7e2 --boot odt 1
    Deposit TU58 bootloader over serial console port into PDP-11 and try to start it.
    The console is configured for 7 bit, even parity and 2 stop bits.
    A LSI-11 with ODT monitor is assumed, boot loader is dumped into memory at
        address octal 7000 (at end of first 4K page).
    The actual TU58 emulator must have been started on a different serial port before.
    The boot loader will try to boot from TU58 tape.
    After that the terminal window remains active, so you have a primitive
    teletype to operate the booted PDP_11

TU58fs -p 9 -b 115200 --usbdelay 10 --boot odt 1
    Boot under MS-Windows. Console connected to COM9, an USB-RS2323 adapter.
    The console DL11 is tuned for 115200 baudrate, the USB dongle needs 10 ms extra delay (FTDI!)


SEE ALSO

Online docs: www.retrocmp.com/tools/tu58fs
Source version Repository: https://github.com/j-hoppe/tu58fs
Source version Contact: j_hoppe@t-online.de
Есть определённые косяки форматирования, но количество правильно отработанного кода - после редактирования вслепую и по наитию...