home *** CD-ROM | disk | FTP | other *** search
/ Amiga GigaPD 3 / Amiga_GigaPD_v3_3of3.iso / netbsd / docs / netbsd.install.744 < prev    next >
Text File  |  1993-06-25  |  38KB  |  1,017 lines

  1. How To Get NetBSD Going on Your Amiga - A Beginner's Guide
  2. ----------------------------------------------------------
  3.  
  4. v0.05 (Draft) 1 Feb 1994 - kernel version vmunix.744
  5.  
  6. This is a short note I wrote to help other people installing NetBSD
  7. for the first time: I am no expert, I am a beginner too, and hopefully
  8. this will be beneficial to the simplicity of this note. I would
  9. appreciate any comments by e-mail to dcc@dcs.ed.ac.uk, or by post to
  10. 12 West Savile Tr, Edinburgh, SCOTLAND EH9 3DZ.
  11.  
  12. Additions to this note by Alan Bair <abair@amcu-tx.sps.mot.com>
  13.  
  14. Please note that NetBSD for the Amiga is under continual development,
  15. and any documentation inevitably goes out of date as soon as it is
  16. written - so don't take this as absolute truth!
  17.  
  18.  
  19. 1. What is NetBSD?
  20.  
  21. NetBSD is a copyrighted but freely distributable version of the BSD
  22. variant of the Unix operating system - in layman's terms, it's Unix.
  23. When it runs on an Amiga, it takes over the entire machine, turning it
  24. into a Unix workstation. You cannot run AmigaOS (Workbench) at the
  25. same time.
  26.  
  27.  
  28. 2. What kind of Amiga do I need?
  29.  
  30. You will need an Amiga with:
  31.  
  32.     a. An MMU (i.e. 68020+68851, 68030 (not EC), or 68040 (not EC/LC))
  33.        and FPU (i.e. 68881/68882, or built into 68040 as above)
  34.  
  35. In particular, this rules out standard A1200's and A4000/030's, and
  36. most A1200 accelerator cards. Currently, all 68040-based Amiga systems
  37. (A4000, PPI, Fusion, etc.) have full MMU and FPU.
  38.  
  39.     b. A supported hard disk controller
  40.  
  41. Currently, supported controllers include the A3000 builtin, A2091, PPI
  42. Zeus and GVP Series II. Support for other controllers is being worked
  43. on; in particular, someone should be supporting the A1200/A4000
  44. builtin IDE fairly soon. You CAN currently use an A4000/040 provided
  45. you have a supported SCSI controller (i.e. on a Zorro card) and enough
  46. disk space for NetBSD on the SCSI side. The AmigaOS support stuff can
  47. be kept on your IDE drive(s).
  48.  
  49.     c. Enough memory 
  50.  
  51. 4Mb of FastRAM is a minimum, and at least 8Mb is strongly recommended.
  52. You will need at least 1Mb of ChipRAM due to the way the kernel is
  53. loaded.
  54.  
  55. People are already running NetBSD successfully on a wide variety of
  56. Amigas; the traditional A3000's, A4000's with SCSI add-ons, and
  57. heavily expanded A2000's and even A500's. I used to have an A1000
  58. setup which would run it :-)
  59.  
  60.  
  61. 3. How much disk space will it take?
  62.  
  63. A lot. As much as you can spare and then some :-) Realistically, you
  64. need around 100Mb to install a useable system, before you do anything
  65. with it. Read the rest of this note to help you decide what your
  66. requirements will be.
  67.  
  68. Many people purchase another hard disk specifically for NetBSD -
  69. naturally, you should get the largest one you can justify ;-), but it
  70. should be at least 200Mb in size.
  71.  
  72.  
  73. 4. How can I find out more?
  74.  
  75. a. Join the NetBSD mailing list - send an e-mail message to
  76. majordomo@cbmuucp.commodore.com with the *body* (not subject line)
  77. "subscribe netbsd-amiga". Note that NetBSD is not a Commodore product
  78. and is in no way associated with any of their companies.
  79.  
  80. b. Subscribe to the Usenet News group comp.unix.amiga
  81.  
  82.  
  83.  
  84. Installing NetBSD
  85. -----------------
  86.  
  87. Installation is best done in two phases:
  88.  
  89.    1. Obtain the AmigaDOS bootstrap tools and root filesystem image
  90.       and install and test them
  91.  
  92.    2. Set up partitions and install the system software and 
  93.       applications you need
  94.  
  95. Before describing these procedures, I will briefly discuss the Amiga's
  96. RDB hard disk paritioning mechanism and the Unix file system.
  97.  
  98. Before you install anything, read through the entire procedure
  99. carefully and think about how you want to divide up your disk space.
  100.  
  101.  
  102.  
  103. The Unix File System
  104. --------------------
  105.  
  106. Unlike most operating systems, in which the file system is a
  107. collection of separate devices with a tree of directories on each,
  108. Unix views the file system as one big tree - like all good computer
  109. trees, it is upside down, with the root at the top. Distinct trees of
  110. files (e.g. different disks or partitions, or even file systems from
  111. another computer on a network) are plugged in at various points in
  112. the tree (this action is called "mounting").
  113.  
  114. When choosing how to partition your system, remember that Unix file
  115. systems have soft links - this allows directories or even individual
  116. files to be placed elsewhere in the file system (e.g. in another
  117. partition) with a link pointing to the real location. So accurate
  118. partitioning isn't as crucial as with other operating systems. In the
  119. final event you can always back up your files, repartition and
  120. reinstall once you have used NetBSD for a while and get to know your
  121. needs better.
  122.  
  123.  
  124.  
  125. The Amiga RDB System
  126. --------------------
  127.  
  128. The Rigid Disk Block (RDB) is the mechanism the Amiga uses to store
  129. information about hard disk partitions. The first cylinder of any hard
  130. disk (or similar device on a SCSI bus) is reserved for this
  131. information. When you partition a disk (with HDToolBox, FaastPrep,
  132. etc.) the partitioning program will write this data on the disk - when
  133. the computer boots under AmigaOS, it reads this to determine what the
  134. partitions of the disk are, what filing systems they have, whether or
  135. not it should mount them automatically, and whether they can be used
  136. to boot the system.
  137.  
  138. NetBSD also uses the RDB information to locate its partitions on the
  139. hard disk(s); however, it ignores the AmigaOS partition names, and
  140. instead uses the DosType designator to identify the different BSD
  141. partitions.
  142.  
  143. The DosType is a four byte field; the AmigaOS filing system types are
  144. given by the characters "DOS" followed by a number (currently from 0
  145. to 3, e.g. OFS is 0, FFS is 1, DCFFS is 3). In hexadecimal, the code
  146. for FFS is "0x444F5301".
  147.  
  148. NetBSD partitions use this field to identify the partition name; the
  149. root partition is named ASCII "BSDR", i.e. 0x42534452, swap is "BSDS"
  150. (0x42534453) and other partitions are "BSDD", "BSDE" etc. (0x42534444,
  151. 0x42534445 etc.)
  152.  
  153.  
  154.  
  155. NetBSD Partition Types
  156. ----------------------
  157.  
  158. You will need these at various points in the installation procedure.
  159. When entering them into a partitioning program like HDToolBox, use the
  160. hex versions.
  161.  
  162.     Purpose            ASCII Type       Hex Type     NetBSD Device*
  163.     -------            ----------       --------     -------------
  164.  
  165.     Root Partition        BSDR         0x42534452      /dev/sd?a
  166.     (One only)
  167.  
  168.     Swap Partition        BSDS         0x42534453      /dev/sd?b
  169.     (One only)
  170.  
  171.     Data Partitions       BSDD         0x42534444      /dev/sd?d
  172.     (Max. 5 per disk)     BSDE         0x42534445      /dev/sd?e
  173.                           BSDF         0x42534446      /dev/sd?f
  174.                           BSDG         0x42534447      /dev/sd?g
  175.                           BSDH         0x42534448      /dev/sd?h
  176.  
  177.   * The ? in the device name is the SCSI id of the disk the partition
  178.     is on, e.g. the swap partition on drive 6 is /dev/sd6b. There are
  179.     two /dev nodes for each partition, e.g. /dev/sd1d and /dev/rsd1d. 
  180.     The latter should be used when high-level formatting with the mkfs
  181.     command.
  182.  
  183.  
  184. Phase I - Installing Root and Booting NetBSD
  185. --------------------------------------------
  186.  
  187. *******************************************************************
  188. * It is STRONGLY recommended that you back up all your hard disks *
  189. * before attempting to install NetBSD                             *
  190. *******************************************************************
  191.  
  192. You will need to obtain the relevant files from ftp.eunet.ch or one of
  193. the mirror sites. At eunet the files are in directory
  194. "pub/NetBSD-Amiga", the kernel binaries are in
  195. "pub/NetBSD-Amiga/kernel", and some tools are in
  196. "pub/NetBSD-Amiga/contrib/ados". Some of the utilities you may already
  197. have, and some may be available from other places which do not carry
  198. NetBSD. All filenames will henceforth assume the NetBSD-Amiga directory.
  199. Also check "pub/NetBSD-Amiga/incoming" for recent updates.
  200.  
  201. Disk space: You'll need about 15-20Mb as a minimum on the AmigaDOS side
  202. for tools and bits and pieces; temporary space to unpack stuff is
  203. virtually essential as well (unless you have loads and loads of RAM).
  204. You will need to make two of the NetBSD hard disk partitions; one for
  205. the rootfs (10Mb for the 720 version, 8Mb for the old version), and one
  206. for the swap (at least twice the size of your FastRAM).
  207.  
  208. The swap partition serves two purposes - it acts as backing store for
  209. the virtual memory system, and it is also used for the /tmp directory
  210. (which stores temporary files like the T: directory in AmigaOS). If
  211. you have a lot of programs running simultaneously you will need more
  212. virtual memory; if it runs out you will have problems. It is
  213. recommended that the size of the swap partition is (a) at least twice
  214. the RAM size and (b) at least 32Mb.
  215.  
  216. Before doing this part of the installation, read the rest of this note
  217. and decide what you want your final disk partitions to look like.
  218.  
  219. In the rest of this note, commands to by typed in to the computer
  220. appear like this:
  221.  
  222.    dir
  223.  
  224. Where output is also shown, a prompt will also be shown with the
  225. commands: if it ends in "$", it is a NetBSD shell prompt; a ">"
  226. indicates the AmigaOS shell:
  227.  
  228.    1.SYS:NetBSD> dir                          ; AmigaOS
  229.  
  230.    root(6)$ ls                                ! NetBSD
  231.  
  232.  
  233. Software you will need:
  234.  
  235. 1. gzip (GNUzip) - this is the GNU file compression utility. available
  236. from Aminet and elsewhere. All the NetBSD stuff is compressed with it.
  237.  
  238. 2. filetodev - this (dangerous toy) writes blocks of data to a disk
  239. "in the raw". You will use to lay down the rootfs image. It is
  240. provided with BFFS in the file "contrib/ados/bffs11.lzh". (Once you
  241. have NetBSD up and running, BFFS allows you to read files in NetBSD
  242. partitions while using AmigaDOS).
  243.  
  244. An alternative to this is DCP which allows you to specify partitions
  245. rather than block numbers. It is in the file dcp1.1.lha. There is also
  246. the streamtodev program which again allows the use of partition names.
  247. It is in the file device-streams.tar.gz.
  248.  
  249. 3. loadbsd - this AmigaOS program boots NetBSD. Get the newest version
  250. in NetBSD-Amiga/bin (currently named "loadbsd")
  251.  
  252. 4. A kernel image, from the subdirectory "kernel". The current version
  253. is "vmunix.744". Earlier kernels had distinct versions for use with
  254. the 68040, e.g. "vmunix.713-040". If you will be using the current,
  255. shared library binaries you will need kernel version vmunix.720 or
  256. later.
  257.  
  258. 5. A root file system image. The latest one, dated 18-Dec-93, which is 
  259. 20480 blocks (10Mb) when unpacked, is called "rootfs_720.gz". This
  260. image contains the vmunix.720 kernel. The old version, dated 13-Jun-93, 
  261. which is 16448 blocks (about 8Mb) when unpacked, is called
  262. "rootfs.gz". 
  263.  
  264. You should get the latest version you can irrespective of what kernel
  265. you will be using.
  266.  
  267. You will also need a suitable AmigaDOS hard disk partitioning utility;
  268. it is recommended that you use Commodore's own HDToolBox, as certain
  269. 3rd party products (notably GVP's "FaastPrep") will not allow you to
  270. make the settings you need.
  271.  
  272.  
  273. Doing the installation:
  274.  
  275. 1. Download and unpack the files mentioned above and have them ready
  276. to use on your Amiga. e.g. to unpack rootfs.gz, "gzip -d rootfs.gz".
  277. The AmigaOS utilities will be packed with things like LhA. Note the
  278. size in blocks of the rootfs you have downloaded - this can be
  279. calculated by getting the size in bytes of the unpacked version from
  280. the AmigaOS "list" command and dividing by 512:
  281.  
  282.    size in blocks = size in bytes / 512
  283.  
  284. The 720 rootfs is 20480 blocks in size, and the old one was 16448
  285. blocks; wherever you see the number 20480, substitute the size you
  286. have calculated.
  287.  
  288. 2. Start up HDToolBox - if you have a GVP or other non-Commmodore
  289. controller, you will need to start it from the shell (CLI) and give it
  290. the name of the device driver (e.g. for GVP II "hdtoolbox gvpscsi.device")
  291.  
  292. Note the SCSI unit numbers of the various devices (disks, tapes,
  293. etc.). NetBSD assumes disks will be devices 0-3 and 6, and tapes (if
  294. any) 4 & 5. If your system doesn't fit into this, it is suggested that
  295. you change it (AmigaDOS won't care). If you just have one hard disk to
  296. be used with NetBSD, make it unit 6 if possible (some people have
  297. reported problems when using other unit numbers). The unit number of a
  298. SCSI device can usually be changed using a set of 3 jumpers found on
  299. the device, or in the case of pre-boxed units by a dial on the back.
  300.  
  301. You need to know the number of blocks per cylinder for the drive on
  302. which you will make the root partition. You can find this out from the
  303. drive type editor in HDToolBox:
  304.  
  305.    - From the main screen, select the drive in question
  306.    - Click "Change Drive Type"
  307.    - Click to select the type matching the drive
  308.    - Click on "Edit Old Drive Type" or if none are listed, click on
  309.      "Define new drive type", "Read Configuration From Drive" then
  310.      "CONTINUE" to get the selected drives characteristics.
  311.    - Note the number of heads and blocks per track
  312.    - Click "Quit" etc. to get out of this mode
  313.  
  314. The number of blocks per cylinder is the number of heads multiplied by
  315. the number of blocks per track. 
  316.  
  317. Note: This drive "geometry" is imaginary; most hard disks put a
  318. variable number of blocks on a track depending on its radius, and SCSI
  319. devices talk in block numbers, but AmigaDOS likes to have cylinder,
  320. head and block. Therefore you can have different geometries for
  321. different drives of the same type depending on how they were first
  322. partitioned, what controller you have, etc. DO NOT trust values from a
  323. leaflet that came with the drive, find out from HDToolBox.
  324.  
  325. 3. You will create the BSD partitions on the respective disks using
  326. the following procedure - instructions refer to the HDToolBox supplied
  327. with AmigaOS 2.04; other versions or other RDB editors may be slightly
  328. different:
  329.  
  330.    - Select the drive by clicking on it
  331.    - Click on "Partition Drive" (HDToolBox partition mode)
  332.    - Click on "Advanced Options" to turn them on
  333.    - Click on "New Partition"
  334.    - Click on the empty space where the partition will go
  335.    - Grab the arrow under the partition and adjust the size
  336.    - Grab the partition box (black rectangle) and move it if need be
  337.    - Change the "Bootable?" option to "No"
  338.    - Click in the device name box (marked "CHANGE_ME") and alter it
  339.      to something sensible (NetBSD doesn't care)
  340.    - Click on "Change File System for Partition" (HDToolBox File
  341.      System Menu). You will find the default setup (usually FFS)
  342.    - Click on "Custom File System"
  343.    - Change "Blocks Reserved" and "PreAlloc" to 0 
  344.    - Change "Auto mount this partition?" to "No"
  345.    - Change "Use Custom boot code?" to "No"
  346.    - The "Identifier" or "DosType" box will show something like
  347.      0x444F5301 (FFS). Change this to the BSD partition identifier
  348.      (e.g. for the Root Partition, 0x42534452, "BSDR")
  349.    - Click "OK" to return to partition mode
  350.    - Note the "Start Cylinder", "End Cylinder" and "Total Cylinder"
  351.      numbers for the partition, and note the SCSI device number 
  352.      (usually 0 to 6) of the disk it is on
  353.    - If all partitions for this drive are done, click "Ok" to return
  354.      to the main screen. Click "Save Changes to Drive". If you are
  355.      overwriting old partitions you will get a warning - if you're
  356.      not sure what you've done is right, think again, but if you are, 
  357.      click "Continue".
  358.  
  359. 4. Create a partition for the rootfs using the method above; it should
  360. be exactly or just over the size of the rootfs you downloaded (i.e.
  361. Total Cylinders * Blocks Per Cylinder >= 20480 Blocks for 720 version)
  362. any extra space will be wasted for the moment, but once you have NetBSD 
  363. running it is possible to rebuild the rootfs, so if you want to leave a 
  364. bigger space for it, that's OK. The partition type should be 0x42534452 
  365. (ASCII "BSDR").
  366.  
  367. 5. Create a swap partition - this will be used as swap space for
  368. NetBSD's virtual memory, and for scratch space (the /tmp directory).
  369. It should be at least TWICE the size of the Amiga's RAM. The partition
  370. type should be 0x42534453 ("BSDS"). NetBSD only uses swap space when
  371. running (no permanent files are stored on it), so you can use it as
  372. scratch space for AmigaDOS in between NetBSD sessions (e.g. as swap
  373. space for GigaMem) if you like.
  374.  
  375. 6. You are now finished with HDToolBox - if you have overwritten old
  376. partitions, it will force you to reboot when you quit.
  377.  
  378. 7. Now we will put the rootfs image in the partition we reserved for
  379. it. 
  380.  
  381. ********************************************************************
  382. * You are reminded again of the advice to back up the rest of your *
  383. * system. This stage is highly dangerous and one mistake could     *
  384. * trash the contents of your hard disk(s)!                         *
  385. ********************************************************************
  386.  
  387. We need to know which block number the partition starts at, which
  388. we calculate as:
  389.  
  390.    Start Block = Start Cylinder * Blocks Per Cylinder
  391.  
  392. using the values for the drive you noted in stage 2, and the cylinder
  393. numbers for the partition from stage 3. If you forgot to note this, go 
  394. back into HDToolBox and check the values.
  395.  
  396. Calculate the size in blocks, using:
  397.  
  398.    Size = (End Cylinder - Start Cylinder + 1) * Blocks Per Cylinder
  399.  
  400. This size should be at least as large as the rootfs image (20480 or
  401. more blocks). If it isn't, go back to stage 4 and make it bigger.
  402.  
  403. Ensure that the image is uncompressed, e.g. that you have an AmigaDOS
  404. file "rootfs_720" of size 10485760 and not "rootfs_720.gz".
  405.  
  406. We will use the filetodev program to write the image to the disk; it
  407. takes 6 parameters:
  408.  
  409.    - the start block number
  410.    - the image size (i.e. 20480 or whatever, not the partition size)
  411.    - the name of the file (e.g. "rootfs_720")
  412.    - the AmigaDOS device name for your controller
  413.         (e.g. "gvpscsi.device")
  414.    - the device number of the disk
  415.    - the number of buffers to use (e.g. 1000)
  416.  
  417. Example: I have an A3000, and I am placing my NetBSD partitions on a
  418. Maxtor 7345SR which is unit 6 (using the built-in SCSI controller).
  419.  
  420. Geometry for the Maxtor, from HDToolBox:
  421.  
  422.    Unit = 6
  423.    Cylinders = 3518
  424.    Heads = 1 (not true in reality; see stage 2)
  425.    Blocks Per Track = 192
  426.  
  427. I calculate Blocks Per Cylinder = 1 * 192 = 192
  428.  
  429. The BSDR partition:
  430.  
  431.    Start Cylinder = 3408
  432.    End Cylinder = 3517
  433.    Total Cylinders = 110
  434.  
  435. Start block: 3408 * 192 = 654336
  436.  
  437. I check the size: (3517 - 3408 + 1) * 192 = 21120   (bigger than 20480)
  438.  
  439. I use the following command:
  440.  
  441.    filetodev 654336 20480 rootfs_720 scsi.device 6 1000
  442.  
  443. Note: If filetodev scares the willies out of you (I have trashed my
  444. AmigaDOS system partition more than once with it), some kindly person
  445. (Chris Hooper) has written a slightly less dangerous tool, called
  446. "dcp". Another possiblity is devtostream, written by Chris Hopps.
  447. Get one of them from the ftp site and use it instead if you like.
  448.  
  449. 8. If there are any patches you know are *definitely* required to run
  450. the kernel you have on your system, you may as well apply them at this
  451. stage. See the section below on how to use binpatch.
  452.  
  453. e.g. if you are using an A4000, you need kernel version vmunix.720 or
  454. later, which has a flag to tell it you are using an A4000 (it's
  455. actually very difficult for the kernel to determine automagically
  456. which Amiga you have), and you need to patch it thus:
  457.  
  458.    binpatch -s _a4000_flag -r 1 vmunix.720
  459.  
  460. 9. You are now ready to test NetBSD in single user mode. Use the 
  461. versions of loadbsd and vmunix that you got (ensure that they have
  462. been decompressed first), e.g.
  463.  
  464.    loadbsd vmunix.714
  465.  
  466. If all goes well, the Amiga will go through a soft reboot, and you
  467. should see a plain screen with something like:
  468.  
  469.    (C) ....... Regents of the University of California
  470.    ..... godzilla.eunet.ch....
  471.    AMIGA A3000 (68030, 68882 25MHz FPU)
  472.    ....
  473.    sd6: Maxtor 7345 rev. 9.60
  474.    ....
  475.    root device /dev/sd6a
  476.    ...
  477.  
  478.    root(1)$ _
  479.  
  480. NetBSD is running in single user mode, and the prompt is from the
  481. shell (bash). Try a few simple commands (e.g. "ls -l"). When bored,
  482. use the command "reboot".
  483.  
  484. If it doesn't work, look for suggestions below, and ask for help on the
  485. News and mailing list forums.
  486.  
  487.  
  488. Problems With Booting NetBSD 
  489. ----------------------------
  490.  
  491. Getting the kernel to boot into single-user mode is 90% of the battle
  492. in getting NetBSD to work. A few common problems are:
  493.  
  494. 1. NetBSD boots but hangs shortly after recognising the hard disk
  495. types. This can be caused by NetBSD turning on drive sync and/or
  496. trying to do DMA to non-DMAable areas. Obtain the program "binpatch"
  497. from the ftp site (see below).
  498.  
  499. a. Drive sync - there is a table (an array of bytes) in the kernel
  500. which tells it not to enable synchronous transfers for individual SCSI
  501. devices; it is called "_inhibit_sync". The bytes are set to 1 to
  502. inhibit sync, 0 to allow sync. To turn off sync for drives 0-3:
  503.  
  504.    1.SYS:NetBSD> binpatch -s _inhibit_sync -r 0x01010101 vmunix.714
  505.    0x1426c: 0 (0x0)
  506.  
  507. for drives 4-7, calculate the address of the next word, using the base
  508. address of _inhibit_sync returned by binpatch, e.g. 0x1426c + 4 =
  509. 0x14270 (hexadecimal):
  510.  
  511.    1.SYS:NetBSD> binpatch -a 0x14270 -r 0x01010101 vmunix.714
  512.  
  513. However, if a drive is already set to synchronous mode by AmigaDOS, it
  514. may lock up the SCSI bus if sync is not enabled in NetBSD. To patch
  515. the value for a single drive, calculate the address of it's byte flag
  516. (base address of _inhibit_sync + unit number) and patch it, e.g. drive 6
  517.  
  518.    1.SYS:NetBSD> binpatch -a 0x14272 -b -r 0 vmunix.714
  519.  
  520. b. DMA - on some systems you might have a DMA SCSI controller, but
  521. have some FastRAM to which it cannot do DMA transfers, e.g. an
  522. accelerated A2000 with 32-bit FastRAM and a Zorro-II controller. If
  523. NetBSD tries to DMA directly to the 32-bit RAM it will crash. To turn
  524. off SCSI DMA, simply:
  525.  
  526.    1.SYS:NetBSD> binpatch -s _scsi_no_dma -r 1 vmunix.714
  527.  
  528. Note: the system will run much slower with DMA off, so only do it if
  529. you have to!
  530.  
  531. 2. The message "no suitable root" - this means the kernel couldn't
  532. find the root partition. You may have installed it incorrectly, like
  533. setting the "DOSType" hex value for "BSDR", but this message can also 
  534. appear if there are drive sync problems, etc. Check your installation 
  535. and apply the treatment above.
  536.  
  537. 3. The monitor goes crazy - some kernels may be set up to use default
  538. screen modes your monitor can't handle; try the following patch:
  539.  
  540.    1.SYS:NetBSD> binpatch -s _ite_default_height -r 200 vmunix.714
  541.  
  542.  
  543. How to Use "binpatch"
  544. ---------------------
  545.  
  546. The binpatch program allows you to change constants (statics) in the
  547. NetBSD kernel without recompiling it. It is capable of reading and
  548. using the symbol table (list of variable names) in the kernel binary,
  549. e.g.
  550.  
  551.    1.SYS:NetBSD> binpatch -s _scsi_no_dma -r 1 vmunix.714
  552.    0x1436ba: 0 (0x0)
  553.  
  554. Here, binpatch reports the address of the variable _scsi_no_dma and the old
  555. value (0), and replaces it with the new value given (1). The options
  556. to binpatch include:
  557.  
  558.       -a <address>         Patch the variable at address given
  559.       -b                   Patch a single byte (as opposed to 32-bit word)
  560.       -r <value>           Replace with given value
  561.       -s <name>            Patch the variable with the given symbolic name
  562.       
  563.  
  564.  
  565. Phase II - Installing the Software and Setting Up Multi-User Mode
  566. -----------------------------------------------------------------
  567.  
  568. Read the whole section before proceeding.
  569.  
  570. You should now have a minimal NetBSD installation with rootfs and swap
  571. partitions. We will now create additional partitions to install the
  572. operating system and other software. To calculate the size(s) needed,
  573. use the following rough formula:
  574.  
  575.   HDToolBox size (Mb) = (Installed blocks / 2048) * 1.2
  576.  
  577. The reason for the 1.2 scaling factor (apart from a safety margin and
  578. allowing for formatting) is that NetBSD reserves part of each
  579. partition: a partition will be reported as being 100% full when it
  580. still has some space left - root and other superusers will be allowed
  581. to write to the partition, but ordinary users will not.
  582.  
  583. The following table gives the installed size in 512 byte blocks for
  584. each of the bin-...gz archives (make sure you get the ones that go
  585. with the kernel you are using, the 720 ones are currently in the
  586. ".../NetBSD-Amiga/incoming" subdirectory). There are two sizes given:
  587. the first size is for the executables that use shared libraries, and
  588. these need vmunix.720 or later to work. The size in brackets is for
  589. the old statically linked executables which are larger but work with
  590. any kernel.
  591.  
  592.  
  593.    Archive                       Unpacks to   Installed Size (old)
  594.    -------                       ----------   --------------------
  595.  
  596.    These files are essential for proper operation of NetBSD:
  597.    
  598.    bin-bin.tar.gz                /bin   (Included in new rootfs)
  599.    bin-sbin.tar.gz               /sbin  (Included in new rootfs)
  600.  
  601.    bin-usr.sbin.tar.gz           /usr/sbin      3108  (10960)
  602.    bin-usr.bin.tar.gz            /usr/bin      13174  (25686)
  603.    bin-usr.lib.tar.gz            /usr/lib       5184  ( 2416)
  604.    bin-usr.libexec.tar.gz        /usr/libexec   3766  ( 3882)
  605.    bin-usr.share.tar.gz          /usr/share    25038  (25038)
  606.  
  607.    Total:                                      50270  (67982)
  608.  
  609.  
  610.    Not essential, but useful:
  611.  
  612.  
  613.    For building code -
  614.  
  615.    bin-usr.include.tar.gz        /usr/include   2274? ( 2258)
  616.  
  617.  
  618.    GCC, Emacs, etc. (compiling and editing) - 
  619.  
  620.    bin-usr.gnu.tar.gz            /usr/gnu      61156? (61156)
  621.  
  622.  
  623.    For a little break -
  624.  
  625.    bin-usr.games.tar.gz          /usr/games     6172? ( 6172?)
  626.  
  627.  
  628.    Total:                                      69602? (69586?)
  629.  
  630.  
  631.    Current X11R5 (lib, libs, bin, include)     46170?
  632.  
  633.    
  634.  
  635. To begin with, I decided to make a 100Mb partition for /usr, and to
  636. make a 70Mb partition to be mounted as /home, for the NetBSD users' home
  637. directories. Since I used the old rootfs, I left an 11Mb space for the
  638. partition and later rebuilt it to get a root partition 11Mb in size.
  639.  
  640. Decide what partitions you want; you could just rebuild the rootfs
  641. (see below) onto one enormous partition and keep everything there, but
  642. the usual caveats about backups etc. apply to NetBSD as much as to
  643. AmigaDOS. In the instructions that follow I assume my system with the
  644. partitions I detailed above; vary them according to what you have set
  645. out.
  646.  
  647. Now decide how you are going to get the bin-...gz files into NetBSD -
  648. basically, you need a temporary space to copy them to. If you are
  649. lucky enough to have a SCSI tape drive you can use that, otherwise the
  650. easiest way is to create an extra NetBSD partition, which we will
  651. leave unformatted, and to use that.
  652.  
  653.  
  654. 1. Set the partitions up with HDToolBox, using the same method as
  655. before. The partitions should be given types 0x42534444 ("BSDD"),
  656. 0x42534445 ("BSDE") etc. up to 0x42534448 ("BSDH") If you are using
  657. more than one drive, reuse the names (i.e. start from "BSDD" with each
  658. drive). If you will be using a scratch partition (rather than tape) to
  659. install the files, create it too. It will have to accommodate the
  660. largest file (uncompressed), so I would suggest one of at least 30Mb
  661. in size to cope with "bin-usr.gnu.tar.gz".  Keep in mind the following
  662. rules:
  663.  
  664.    - Only one each of "BSDD" etc. per disk
  665.    - Only one rootfs on the whole system
  666.    -  "    "  swap   "   "    "     "
  667.  
  668. I made "BSDD" for /usr, "BSDE" for /home and a 30Mb scratch partition
  669. which I called 0x42534447 ("BSDG").
  670.  
  671. 2. We will now boot NetBSD and format the partitions. You will need to
  672. know the relation between partition types (in HDToolBox) and the
  673. special file names on the NetBSD side; the special file name
  674. incorporates the drive number (SCSI device number) and the partition
  675. type, e.g. on my system:
  676.  
  677.     Partition       Partition Type ID         NetBSD Special File
  678.     ---------       -----------------         -------------------
  679.  
  680.     root            0x42534452 "BSDR"         /dev/sd6a
  681.     swap            0x42534453 "BSDS"         /dev/sd6b
  682.     /usr            0x42534444 "BSDD"         /dev/sd6d
  683.     /home           0x42534445 "BSDE"         /dev/sd6e
  684.  
  685. If I put a "BSDE" partition on my Quantum (SCSI ID 0), it would be
  686. /dev/sd0e
  687.  
  688. 3. Boot NetBSD into single user mode as before.
  689.  
  690. 4. Format each of your new partitions (but NOT rootfs nor swap) using
  691. the newfs command. If you will be using a scratch partition to install
  692. the bin-...gz files, don't bother formatting it. In my case, the
  693. commands are:
  694.  
  695.     newfs /dev/rsd6d
  696.     newfs /dev/rsd6e
  697.  
  698. Note the "r" - the device used is /dev/rsd6d and not /dev/sd6d. Ignore
  699. any "Can't write disklabel" messages.
  700.  
  701. 5. When NetBSD starts up in single user mode, the rootfs is mounted as
  702. a read-only file system. To make it writable, we have to remount it,
  703. e.g.:
  704.  
  705.    mount -u /dev/sd6a /     
  706.  
  707. (Substitute the appropriate device name for your disk in place of "sd6a")
  708.  
  709. 6. We will now create the mount points for these partitions. A mount
  710. point is the place on the filing system where a partition is attached,
  711. and it merely consists of an empty directory. Again, following my
  712. example:
  713.  
  714.    mkdir /usr ; chmod 755 /usr
  715.    mkdir /home ; chmod 755 /home
  716.  
  717. You will find the two in this example already exist in the rootfs you
  718. are given, but you may need to create others.
  719.  
  720. 7. Now we need to create a table listing the partitions. Since we
  721. don't have an editor installed yet we'll just have to type it in. 
  722. ( Actually you can use "ed" if you know its command syntax ) You
  723. can use TABs instead of spaces, and the alignment isn't important.
  724. Here I have shown the prompt as it doesn't appear while you're typing
  725. the file in. Here is how it looks on my system:
  726.  
  727.    root(26)$ cat > /etc/fstab
  728.    /dev/sd6a       /       ufs     rw      1       1
  729.    /dev/sd6b       /tmp    mfs     rw      1       1
  730.    /dev/sd6d       /usr    ufs     rw      1       1
  731.    /dev/sd6e       /home   ufs     rw      1       1
  732.    <Ctrl-D>
  733.  
  734. Note that /tmp is mfs while the others are ufs. If you make a mistake,
  735. exit with Ctrl-D and start again.
  736.  
  737. 8. Now look at the file system; the "df" command shows all mounted
  738. partitions and their size:
  739.  
  740.    df
  741.  
  742. It should show just the root partition.
  743.  
  744. 9. Now we tell mount to mount all the partitions listed in /etc/fstab:
  745.  
  746.    mount -av 
  747.  
  748. and try df again:
  749.  
  750.    df
  751.  
  752. All of your partitions should appear. If there are any problems, use
  753. the command "umount -av" to unmount the partitions and go back and do
  754. /etc/fstab again.
  755.  
  756. 10. Now we will shut down NetBSD and get the files ready to install.  
  757. Unmount the partitions:
  758.  
  759.    umount -av
  760.  
  761. and then flush the file system buffers:
  762.  
  763.    sync ; sync ; sync
  764.  
  765. and then:
  766.  
  767.    reboot
  768.  
  769. You should follow a similar procedure every time you shut down NetBSD
  770. to avoid corrupting the file system; however, to shut down from
  771. multi-user mode you should use the "shutdown now" command.
  772.  
  773.  
  774. 11. The procedure for installing a bin-...gz archive is as follows:
  775.  
  776.    - from AmigaOS, put it on your temporary space
  777.        (i.e. tape or scratch partition)
  778.    - Boot NetBSD and mount the partitions
  779.    - Unpack it into the NetBSD filesystem
  780.    - Shutdown NetBSD, reboot AmigaOS and do the next one
  781.  
  782. Of course, if you have more than one scratch partition, or more than
  783. one blank tape, you can do several in one NetBSD cycle.
  784.  
  785. *********************************************************************
  786. * Use a tape drive if you can since it is quicker, easier and safer *
  787. * than using a scratch partition.                                   *
  788. *********************************************************************
  789.  
  790. The procedure for a scratch partition is:
  791.  
  792. a. Calculate its start block and size as you did with rootfs; my
  793. scratch partition starts at cylinder 541 and ends at 861, so I
  794. calculated:
  795.  
  796.    start block = 541 * 192 = 103872
  797.  
  798.    size = (861 - 541 + 1) * 192 = 61632
  799.  
  800. b. In AmigaOS, uncompress the archive, e.g.
  801.  
  802.    gzip -d bin-usr.bin.tar.gz
  803.  
  804. c. Calculate the tar file's size in blocks, by:
  805.  
  806.    Blocks = File size / 512
  807.  
  808.    e.g.
  809.  
  810.    Size of bin-usr.bin.tar = 12892160 / 512 = 25180
  811.  
  812. d. Use filetodev to put it on the scratch partition, e.g.
  813.  
  814.    filetodev 103872 25180 bin-usr.bin.tar scsi.device 6 1000
  815.  
  816. e. Boot up NetBSD, mount the partitions, and unpack the file into the
  817. root directory, e.g.
  818.  
  819.    mount -av
  820.    cd /
  821.    tar xvfp /dev/sd6g
  822.  
  823. It should be possible to just dump the compressed archive onto the
  824. partition and decompress it on the fly (using "tar xvzfp /dev/sd6g")
  825. but I couldn't get this to work with filetodev. ( The current tar
  826. does not support gzip compressed files. Try the command sequence:
  827. gzip -d </dev/rsd6g | tar xvfp - )
  828.  
  829.  
  830. The procedure for tape is slightly easier. Just put the compressed
  831. file on the tape, e.g.
  832.  
  833.    copy bin-usr.bin.tar.gz tape:
  834.  
  835. ( For the tape: device support, pick up the dtape10.lzh package. )
  836.  
  837. Then boot NetBSD and unpack it:
  838.  
  839.    mount -av
  840.    cd /
  841.    gzip -d </dev/rst0 | tar xvfp -
  842.  
  843. The current tar does not support gziped files, but when it does, the
  844. command to use will be: tar xzvfp /dev/rst0. 
  845.  
  846. When shutting down NetBSD, remember to unmount the partitions and
  847. flush the file system buffers:
  848.  
  849.    umount -av
  850.    sync ; sync ; sync
  851.    reboot
  852.  
  853. Once you have it installed, the command "fastboot" has the same effect
  854. (unmounting etc.) as the above sequence of commands.
  855.  
  856.  
  857. 12. After a few repetitions, you should have all the software
  858. installed. We can now configure NetBSD for single user mode. Boot up
  859. NetBSD, and use the following commands:
  860.  
  861.    mount -av                  (as always)
  862.    export TERM=vt200          (needed by the editors)
  863.  
  864. If you used the old rootfs, edit /etc/gettytab (with vi, emacs or
  865. whatever) and change ":ap:" to ":np:" in the entry for default (around
  866. line 20), e.g.
  867.  
  868.   vi /etc/gettytab
  869.  
  870. Most generic Unix books have a chapter on using "vi", but here is a
  871. minimum to get you started:
  872.  
  873. Vi is a "modal editor", i.e. the keys work differently depending on
  874. the mode.
  875.  
  876. Normal Mode:
  877.  
  878.   h        Left
  879.   l        Right
  880.   j        Down
  881.   Return   Down
  882.   k        Right
  883.   Space    Right
  884.   i        Enter insert mode, starting before the current character
  885.   a        (Append) Enter insert mode, starting after current char.
  886.   x        Delete current character
  887.   :d       Delete a line                  |
  888.   :x       Exit and save the file         | Press return after any
  889.   :quit!   Abort the edit                 | of these commands
  890.   
  891. Insert Mode:
  892.  
  893.   Type text to insert it, press ESC to end. You can only edit the
  894.   line you are currently typing.
  895.  
  896. You may now want to change the list of users. Edit the password file
  897. with:
  898.  
  899.   vipw 
  900.  
  901. The file consists of lines like this:
  902.  
  903.   fred:k%56Fj:234:567::0:0:Fred Bloggs:/home/fred:/bin/bash
  904.  
  905. Each represents a user. The colons (":") separate the fields. The
  906. important ones are the 2nd one (their password, encrypted), the 3rd
  907. and 4th (user and group id's), the 8th (real name), 9th (login
  908. directory) and 10th (login program).
  909.  
  910. Make sure that root has no encrypted password (for now), and that
  911. there is a user to log in as. Make one for yourself if you like.
  912.  
  913. Exit vi, and the user database will be updated. If you have added
  914. users, create their home directories as follows:
  915.  
  916.    mkdir /home/fred ; chown fred /home/fred
  917.  
  918. If you used the old rootfs, edit /etc/rc and comment out the line
  919. which starts the program "named".
  920.  
  921. 13. To start multi user mode, exit the single user mode shell:
  922.  
  923.    exit
  924.  
  925. If all is well, after a few messages you should see a prompt like:
  926.  
  927.    BSD 4.3 on amy.domain.domain (console)
  928.  
  929.    login: _
  930.  
  931. To shut down from multi user mode, log in as root (or use "su") and
  932. use the command:
  933.  
  934.    shutdown -r now
  935.  
  936.  
  937. Rebuilding the Root Partition
  938. -----------------------------
  939.  
  940. When you received it, the rootfs image you got was a canned copy of a
  941. fully formatted partition, and there was no way you could alter the
  942. size. If you installed NetBSD using the old 16448 block rootfs and are
  943. updating the binaries, or for other reasons of your own, you may find
  944. there is insufficient space in the root partition and you may wish to
  945. rebuild it to create one of a larger size.
  946.  
  947. Restructuring other partitions is fairly easy, as you can archive
  948. them, etc., but the root partition requires a bit of trickery as
  949. detailed below.
  950.  
  951. If you want to expand the root partition to occupy a larger space you
  952. reserved for it earlier, repeat this procedure twice, copying it away
  953. and back again.
  954.  
  955. 1. Create the new partition for root, but give it a partition type which
  956. makes it an ordinary partition, e.g. 0x42534448 "BSDH"
  957.  
  958. 2. Start up NetBSD
  959.  
  960. 3. Format the new partition, make a mount point and mount it, e.g.
  961.  
  962.    newfs /dev/rsd6h
  963.    mkdir /newroot
  964.    mount /dev/sd6h /newroot
  965.    
  966. 4. Use the following commands to copy the partition. Note the l option
  967. to tar (local file system only) which stops it trying to copy other
  968. partitions which may be mounted to the root one, and from incestuously
  969. trying to copy /newroot.
  970.  
  971.    cd /
  972.    tar clfp - | (cd /newroot ; tar xvlfp - )
  973.  
  974. 5. Shut down and return to AmigaOS, e.g.
  975.  
  976.    umount -av
  977.    umount /newroot
  978.    sync ; sync ; sync
  979.    reboot
  980.  
  981. 6. When AmigaOS boots, enter HDToolBox and alter the partition types,
  982. changing the "newroot" partition to root (0x42534452 "BSDR") and
  983. removing the "BSDR" label from the old root partition.
  984.  
  985. 7. Boot NetBSD and check that your new root partition is working.
  986.  
  987.  
  988. NetBSD FTP Sites
  989. ----------------
  990.  
  991. The NetBSD files are available from a number of places. Please use the
  992. site nearest you. I have not given numeric addresses as these are
  993. subject to change; if you can't use symbolic addresses at your site,
  994. hassle your site admin :-)
  995.  
  996.   Site Name                 Location     NetBSD-Amiga Top Directory
  997.   ---------                 --------     --------------------------
  998.  
  999.   ftp.eunet.ch *            Switzerland  pub/NetBSD-Amiga/
  1000.   ftp.luth.se               Sweden       pub/NetBSD/NetBSD-Amiga/
  1001.   ftp.hrz.uni-kassel.de     Germany      pub/machines/amiga/NetBSD/
  1002.   ftp.uni-regensburg.de     Germany      pub/os/NetBSD/NetBSD-Amiga/
  1003.   ftp.funet.fi              Finland      pub/amiga/unix/NetBSD-Amiga/
  1004.   att2.cs.mankato.msus.edu  USA **       pub/mirrors/ftp.eunet.ch/NetBSD-Amiga/
  1005.  
  1006. * ftp.eunet.ch should only be used outside office hours, Swiss time
  1007. (2 hours ahead of GMT, 8 hours ahead of USA's EST)
  1008.  
  1009. ** The administrators of att2... request that you use fsp rather than
  1010. ftp if at all possible.
  1011.  
  1012. The "home" of NetBSD in general is sun-lamp.cs.berkeley.edu
  1013.  
  1014. 1-Feb-94
  1015.  
  1016. ----
  1017.