home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Distributions / ucb / 2.9-derivatives / 2.9BSD-MSCP / 2.9BSD-MSCP.txt < prev   
Text File  |  2001-11-09  |  17KB  |  415 lines

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