home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Distributions / ucb / 2.9-derivatives / 2.9BSD-MSCP / Older / 2.9BSD-MSCP.txt next >
Text File  |  2001-08-24  |  14KB  |  357 lines

  1. Introduction
  2. ------------
  3.  
  4. This describes a port of 2.9BSD that includes support for MSCP hard
  5. disks and VTserver. It will run on a very minimal PDP-11/23.
  6.  
  7. I developed this using simh on a PC, debugged it under Ersatz-11 and
  8. tested it on a real PDP-11/23 consisting of the following configuration:
  9.   - KDF11-AA CPU
  10.   - MSV11-L 256 Kbyte RAM
  11.   - Andromeda UDC11 MSCP hard drive controller (including boot ROM)
  12.   - a custom 3M board including 2 SLU and LTC
  13.   - a 20 megabyte Seagate ST-225 hard drive
  14.   - a dual-sided 5 1/4" floppy
  15.  
  16. While I have many years experience in C and assembly programming,
  17. embedded firmware, and operating systems, this is my first experience
  18. with porting or modifying UNIX, or working intimately with a PDP-11. I
  19. seem to have gotten this working, but there is no guarantee that I've
  20. done it right. I welcome any suggestions for improvements, and will make
  21. neccessary corrections. On the other hand, I do not want maintenance of
  22. 2.9BSD to become a major continuing project. I have several small
  23. PDP-11/23 systems in my collection. My main motivation for doing this
  24. was to have a decent and interesting operating system for these
  25. machines, a legal operating system for those I wish to dispose of, and 
  26. to make UNIX available to others who have or want to build similar
  27. PDP-11/23s. After this project I would like to turn my attention to the
  28. PDP-11/53 and 2.11BSD.
  29.  
  30.  
  31. Differences
  32. -----------
  33.  
  34. This version of 2.9BSD UNIX is the same as the standard distribution on
  35. the PUPS archive, with the following changes:
  36.  
  37. - the MSCP (ra) hard disk driver from the pro350 release has been ported
  38.   in. The block device number is 2, the character number is 6. The
  39.   autoconfig probe routine in uprobe1 is hardwired to always return
  40.   "device present". If you recompile this system with a different disk
  41.   as root, and then try to access a non-existant ra drive, the system
  42.   will panic.
  43.  
  44. - only the ra (4 units), rl (4 units), and xp (3 units) disk drivers
  45.   have been compiled in. The other drivers have been commented out in
  46.   dtab. One reason is to save space. Another is that simh seemed to get
  47.   confused while autoconfiging xp disks if certain other devices were
  48.   compiled in. I included the rl mainly for the simulators, for
  49.   compatibility with released disk images. I have no idea what an xp is, I
  50.   just needed a large hard drive for the simulator.
  51.  
  52. - The system boots from ra0, and ra0a is the root.
  53.  
  54. - the partitions are as follows:
  55.     ra0a: 3200 1K blocks (/)
  56.     ra0b: 1920 1K blocks (swap)
  57.     ra0c: the remainder (/usr)
  58.     ra0h: the entire disk
  59.   There are other partitions defined, that I left as found, but I've
  60.   never used them.  The pro350 version of the partition table had a bug:
  61.   the virtual cylinder size in rareg.h and the partition table disagreed.
  62.   It has been consistantly set to 64 disk (512 byte) blocks. 3200 might
  63.   be rather smalll for a root partition, but it was neccessary in order
  64.   to fit a sysgenable system onto a 20 meg hard drive. I have not tested
  65.   this with a second drive.
  66.  
  67. - The standalone ra driver has been built into the standalones. I had to
  68.   modify this slightly to make it work.
  69.  
  70. - The standalone vt driver (for VTserver) has been built into the
  71.   standalones.
  72.  
  73. - a new ra boot block has been written, based on the 2.11 version of
  74.   rauboot.s. The boot program must be named "boot", and must be located
  75.   in the root directory. This boot block prints characters on the terminal
  76.   to report its progress:
  77.     I         Initializing the MSCP device
  78.     B         reading a block of the root directory
  79.     -<name>   checking a filename. Only the characters checked are printed.
  80.     .         reading a block of "boot"
  81.     S         starting the boot program
  82.     F         failed to find the boot program
  83.  
  84. - a debug boot block, testboot, has been written. It implements two
  85.   terminal commands:
  86.     d <addr> <size>      -- dump memory
  87.     m <addr> <data> ...  -- modify memory
  88.  
  89.  
  90. Distribution
  91. ------------
  92.  
  93. The distribution is setup to be loaded onto a clean PDP-11/23 using
  94. VTserver. The following files are included:
  95.  
  96. - boot: the boot program. It can load programs from several devices,
  97.   including ra and vt.
  98.  
  99. - testboot: a standalone debug program that can be loaded from the boot
  100.   sector or via boot.
  101.  
  102. - mkfs: initialize a partition with a file system
  103.  
  104. - icheck: check a partition
  105.  
  106. - restor: restore a dump file onto a partition
  107.  
  108. - root.dump: dump of the root partition
  109.  
  110. - usrsmall.dump: a dump of /usr that will fit onto a 17 megabyte
  111.   partition. Many  files and directories have been stripped in order to
  112.   get this to fit, including:
  113.      /usr/70
  114.      /usr/ingres
  115.      /usr/src except what is neccessary to rebuild unix
  116.      /usr/man/cat*/*
  117.      /usr/contrib
  118.      /usr/net
  119.      /usr/lib/learn
  120.      and probably some other stuff
  121.  
  122. - usrmid.dump: a dump of /usr that will fit onto a 37 megabyte
  123.   partition. It is missing only /usr/ingres and the "learn" package.
  124.  
  125. - usrfull.dump: the entire contents of the original usr.tar in dump
  126.   format. A df of a full /usr reports 38398 blocks used.
  127.  
  128. - vtserver.exe: this is a PC executable of VTserver that has been
  129. modified to work with a PDP-11/23. The regular VTserver for some reason
  130. doesn't work with the 11/23. I had to add initialization of SP, PS, and
  131. PC, then send "p", rather than "140000g" to start the bootstrap. This
  132. version will probably go away once Fred van Kempen releases the next
  133. official version of VTserver.
  134.  
  135. - .vtrc: a sample Vtserver init file.
  136.  
  137. - vtserver.c: the source code for vtserver.
  138.  
  139. - vtserver.dsw and vtserver.dsp: Visual Studio project files.
  140.  
  141. - vtreadme.txt: Warren Toomey's vtserver documentation.
  142.  
  143. - 2.9BSD-MSCP.txt: this document.
  144.  
  145. I have tested usrsmall.dump, but not  usrmid and usrfull.
  146.  
  147. The original pro350 patches have been added under /usr/src/sys/pro350.
  148.  
  149.  
  150. How to load 2.9BSD onto your PDP-11/23
  151. --------------------------------------
  152.  
  153. I assume that you have a PDP-11/23 with a Seagate ST-225 hard drive, and
  154. a PC acting as host. If you have a larger hard drive, the procedure is
  155. much the same, except you will have more space left over, and you might
  156. be able to load a larger /usr image.
  157.  
  158. It might be best if you can first use some other software, such as
  159. RT-11, to make sure your hardware, including the disk subsystem, is
  160. setup and working. So far I have only used the Andromeda UDC11
  161. controller. The UDC11 stores the hard drive configuration in an onboard
  162. non-volatile memory. The setup and formatting utilities run under RT-11.
  163. I have several RQDX3s that I eventually have to conquer. I understand
  164. that these need to be set up using a standalone diagnostic system called
  165. XXDP.
  166.  
  167. The UDC11 can partition a hard drive into several logical drives. For
  168. 2.9BSD, it is best to setup the disk as a single logical drive, and let
  169. UNIX handle the partitioning. 2.9BSD uses a more primitive hard drive
  170. partitioning scheme than 2.11: the partition table is hard-coded into
  171. UNIX, as ra_sizes in ioconf.c. If you want to change it, you will have
  172. to recompile.
  173.  
  174. Configure, format, and qualify the hard drive. THe UDC11 utilities setup
  175. the controller to reserve the last track for a transparent bad block
  176. replacement scheme, so UNIX will see an ST-225 as having only 614
  177. cylinders. The ST-255 has a good reputation for robustnes and longevity.
  178. I have found quite a few that are 15 years old and still work well.
  179. After formatting I run the qualify routine overnight (about 200 passes).
  180. Do not use a disk that generates many errors.
  181.  
  182. If you are using the RQDX3 or another controller, you are on you own
  183. for now.
  184.  
  185. I assume you have Kermit or another terminal emulator on your PC.
  186.  
  187. Unpack the distribution into its own directory on the PC.
  188.  
  189. Run VTserver. Make sure that any other program that might allocate COM1:
  190. is closed. I have found that if you have run Kermit in a DOS box, and
  191. then run Vtserver, VTserver will not be able to allocate COM1:. You will
  192. have to close the DOS box and open a new one.
  193.  
  194. My flavor of VTserver implements a couple control characters: ^B sends a
  195. break, and ^A resends the VT boot block. Once you have the PDP-11's
  196. attention by sending break hit ^A and return. VTserver should transmit
  197. the boot block, then load "boot" from file 0. If you are not familar
  198. with VTserver, read Warren's document, vtreadme.txt.
  199.  
  200. Boot will ask you what program you want to load. The standalone programs
  201. (boot, mkfs, icheck, and restor) use device names of the form dd(a,b) or
  202. dd(a,b)name, where dd is a device name, such as "ra" or "vt", a is a unit
  203. number, and b is an offset. For vt, the offset is the index of the file
  204. in .vtrc. For ra, the offset is the number of the first 512 byte disk
  205. block of the partition.
  206.  
  207. The default .vtrc organizes the distribution files like this:
  208.  0: boot
  209.  1: testboot
  210.  2: mkfs
  211.  3: restor
  212.  4: icheck
  213.  5: root.dump
  214.  6: usrsmall.dump
  215.  7: usrmid.dump
  216.  8: usrfull.dump
  217.  
  218. First, load mkfs from vt(0,2). Initalize ra0a as ra(0,0) with a size of
  219. 3200. Mkfs (and the rest of the standalone programs) use 512 byte disk
  220. blocks to locate partitions, but 1K blocks for the rest of their logic. I
  221. have not experimented with different interleave factors yet, I just
  222. accept the defaults. When mkfs is complete, it should return to the boot
  223. program. If not, hit ^B, ^A, and "return" to reload boot.
  224.  
  225. Next load restor from vt(0,3). Restore root.dump from vt(0,5) to ra(0,0).
  226.  
  227. At this point you can boot unix via VTserver. Tell boot to load
  228. "ra(0,0)unix". At this point you may have to quickly quit VTserver and
  229. switch to Kermit, because UNIX will soon set the terminal to 7 bits even
  230. parity. You should see the UNIX banner and the autoconfig report. When
  231. you see a # prompt, you will be at a UNIX shell prompt.
  232.  
  233. The next task is to copy the boot block using:
  234.  "dd if=/mdec/rauboot of=/dev/rra0a count=1"
  235.  
  236. Sync and restart the system. The PDP-11 should now boot UNIX on it's
  237. own without help from Vtserver.
  238.  
  239. Next, create a file system on /dev/ra0c using the regular (not
  240. standalone) mkfs. The size calculation is as follows for an ST-225:
  241.  
  242. cylinders: 615
  243. tracks/cyl: 4
  244. sectors per track: 18
  245. controller reserved area: 1 cyl
  246.  
  247. total 1K blocks = (615-1)*4*18/2 = 22104
  248.  
  249. blocks for ra0a: 3200
  250. blocks for ra0b: 1920
  251. blocks for ra0c: 22104-3200-1920 = 16984
  252.  
  253. standalone offset for ra0c: (3200+1920)*2 = 10240
  254.  
  255. The command to init ra0c would be:
  256.  mkfs /dev/ra0c 16984
  257.  
  258. Sync and reboot VTserver. Double check the disk formatting by running
  259. icheck from vt(0,4). Check both ra(0,0) a.k.a. ra0a, and ra(0,10240)
  260. a.k.a. ra0c.
  261.  
  262. Load restor from vt(0,3). Restore usrsmall.dump from vt(0,6) to ra0c at
  263. ra(0,10240). If you have a larger hard drive, you can load usrmid or
  264. usrfull instead. The destination address will be the same. This will
  265. take several hours.
  266.  
  267. When this restor is complete, reboot. When you get the # prompt, hit ^D.
  268. The next prompt should be "User:". Log in as "root" and you should get a
  269. shell prompt. UNIX installation should now be complete.
  270.  
  271. To verify a correct installation, you can cd to /usr/src/sys/RA, and
  272. recomplile the system by typing "make unix". This will take a while.
  273. When complete, "diff unix /unix". They should be the same.
  274.  
  275.  
  276. To rebuild UNIX
  277. ---------------
  278.  
  279. This unix is built in /usr/src/sys/RA. Do not reconfig from conf: I've
  280. edited files in RA by hand.
  281.  
  282. cd /usr/sys/src/RA                      # unix
  283. make unix
  284. cp unix /unix
  285.  
  286. cd /usr/src/sys/stand                   # boot program
  287. make
  288. cp boot /boot
  289.  
  290. cd /usr/src/sys/mdec                    # boot block
  291. sh -v mkra
  292. cp rauboot /mdec
  293. dd if=/mdec/rauboot of=/dev/ra0a count=1
  294.  
  295. Note that if you regen boot for VTserver, you will have to strip the
  296. header from the copy of boot that VTserver uses via "dd if=boot
  297. of=boot.vt bs=16 skip=1".
  298.  
  299.  
  300. How to set the correct year
  301. --------------------------- 
  302.  
  303. This software probably has Y2K bugs in it. UNIX will keep the right year
  304. if you can get it set. The "date" command can't handle dates outside
  305. 19xx. To set the year to (for example) 2001, do this:
  306.  
  307. date 9912312359
  308. wait for a minute until the year rools over to 2000.
  309. date 12312359
  310. wait until it rolls over to 2001
  311. set the correct date, omitting the year.
  312.  
  313. After that, every time you boot, you will have to set MMDDHHMM again, but
  314. the year will be correct, since UNIX evidently remembers this somehow.
  315.  
  316.  
  317. Hints for developing UNIX software using simh and E11
  318. -----------------------------------------------------
  319.  
  320. If you cannot boot UNIX after installing it, you will have to do some
  321. debug. I debugged the boot block, boot, and unix "main" by pepperring
  322. them with printfs and recompiling. I edited and managed files on the PC
  323. using normal PC tools, compiled on an rl and xp based 2.9BSD system
  324. running under simh, and debugged the ra drivers using E11. I transferred
  325. files between the PC and simh as tar files via /dev/xp2h. Files were
  326. transferred between simh and E11 via disk images.
  327.  
  328. You can gather files on the PC and send them to a running simh like so:
  329.  emacs whatever.c                           # microemacs
  330.  fix whatever.c                             # utility to strip \r
  331.  tar cvf \pdp-11\simh\xfer.tar whatever.c   # MKS or Cygwin tar program
  332.            # xfer.tar is attached to rp2 and available in UNIX as /dev/xp2h
  333.  
  334. Then unpack them from UNIX under simh by typing
  335.  tar xvf /dev/xp2h
  336.  
  337. Going from UNIX to PC, under simh:
  338.  tar cvf /dev/xp2h whatever.c
  339.  sync
  340.  
  341. and on the PC
  342.  tar xvf \pdp-11\simh\xfer.tar
  343.  
  344. When transfering files from simh to E11, the only sure way to make sure
  345. that the changes are flushed to the hard drive is to sync UNIX, then ^E
  346. to break to the simh command shell, and detach the disk image that will
  347. be transferred to E11: "det rl3".
  348.  
  349.  
  350. --
  351. Jonathan Engdahl             Rockwell Automation
  352. Principal Research Engineer  24800 Tungsten Road
  353. Advanced Technology          Euclid, OH 44117  USA
  354. Euclid Labs                  engdahl@cle.ab.com
  355.  
  356. http://users.safeaccess.com/engdahl
  357.