1 $NetBSD: prep.RISCOS,v 1.9 2002/03/12 19:33:54 reinoud Exp $ 2 3These instructions are specific to NetBSD/acorn32 on Acorn RISCOS platforms 4(RiscPC/A7000/A7000+/NC's). 5 6Last updated for the BtNetBSD bootloader version 0.99 at 16 February 2002 by 7Reinoud Zandijk (reinoud@netbsd.org), portmaster of NetBSD/acorn32. 8 9For a more detailed acknowledgement and list of contributers see Appendix B 10at the bottom. 11 12 13 140 Before you start 15 16Read this document and one of the INSTALL documents accompanying this 17document completely before continuing. There might be some things mentioned 18double but this document ought to help with the RISCOS installation 19specifically. 20 21 22 231 Requirements 24 25 261.1 Hardware 27 28Refer to the NetBSD installation notes and/or the web site 29http://www.netbsd.org/Ports/Acorn32/ for a list of supported hardware. 30 31 321.2 Software 33 34You will need the following RiscOS software: 35 36 A program that will unpack sparchives. We recommend that you 37 get David Pilling's !SparkPlug. A self-extracting version of this 38 can be found at David Pilling's W3 site 39 (http://www.pilling.demon.co.uk/free.html). 40 41 A program that can uncompress gzip files, because the current bootloader 42 can't read gzip'ed kernels (yet!). 43 44 The included command line gzip program 45 installation/misc/gzip_ff8 (!) which is a mirror a version 46 that Laurent Domisse has patched to work on SA. This is 47 also available from: 48 http://www.users.dircon.co.uk/~arcangel/files/index.html 49 Just set the type of the file to `ff8'. 50 51 SparkFS from David Pilling (commercial) (v1.28 for 52 SA-110). 53 54 !Gzip from HENSA (micros.hensa.ac.uk); is it still alive 55 though? 56 57 A program to report your disk's geometry: 58 59 Not really needed, you can simply boot the installation 60 kernel and look for the geometry in the boot messages. 61 62 Sergio Monesi's fsck suite (a good thing to have around 63 anyway). Available from: 64 http://cdc8g5.cdc.polimi.it/~pel0015/fsck.html 65 66 !Zap (The read disk facility). Available from HENSA. 67 68 The partition software/formatter for your desired installation 69 target: 70 71 IDE disks on motherboard interface: !HForm 72 IDE disks on Simtec interface: UNKNOWN 73 IDE disks on ICS interface: UNKNOWN 74 IDE disks on RapIDE interface: UNKNOWN 75 Acorn SCSI cards: ScsiDM 76 Power-tec SCSI cards: !PowerMgr 77 Cumana SCSI-2: !SCSIMgr 78 oak SCSI-1 card: UNKNOWN 79 MCS Connect32 SCSI: UNKNOWN 80 Morley SCSI: UNKNOWN 81 82Additionally you will require the following : 83 84 An installation kernel for your platform: 85 86 RiscPC/A7000(+)/NC's : INSTALL kernel 87 88 The Bootloader and RiscOS tools: BtNetBSD.tar.gz or BtNetBSD.zip 89 as found in the installation/misc directory. (This should be 90 pre-extracted if you're installing from CD-ROM). 91 92 The NetBSD/acorn32 distribution sets (Will be on the CD-ROM, or 93 available from your nearest NetBSD ftp site). 94 95 A hardcopy of this document, along with a hardcopy of the 96 NetBSD installation instructions "INSTALL"). 97 981.3 Preliminary steps : 99 100 Unpack your BtNetBSD archive in whatever way, set the type of 101 the `Settype' file in the BtNetBSD directory to `Obey' and run 102 it. This will make the files RISC OS typed correctly. this is 103 also explained in a bit more detail in the enclosed README file. 104 1052 Preparing your hard disk 106 107Terms: 108 109Device: The actual physical hard disk 110Partition: A section of a device. 111File system: A structured partition that is able to hold files. 112Disc: A RiscOS file system in a partition. There can be 113 more than one Disc per Device. 114 115You will have to decide which device you wish to install NetBSD on. 116You will also have to decide whether you want to split the device 117between one or more RiscOS discs and NetBSD or dedicate a whole 118Device for NetBSD. 119 120In making this decision you should consider the possibility that if 121NetBSD is incorrectly configured on a shared device then your shared 122data is at risk. 123 124It is still recommended that if you decide to dedicate a device to 125NetBSD that you set aside a small RISC OS partition at the beginning 126of the device. This is a useful place to store the RiscOS side of 127NetBSD, and will make the use of UnixFS easier to configure. If you 128do decide to create a minimal RiscOS partition at the beginning of 129the device, a size of 10-20 MB is recommended (some partitioning 130software has problems with partitions smaller than this). 131 132The point is that you will have to repartition your device to make 133room for a separate partition after the RISC OS one for NetBSD. This 134means backing up your device, re-partitioning it and then copying all 135the data back afterwards. We recommend that you only copy the needed 136data back and put off installing the rest until you have NetBSD up 137and running. This way you will save yourself a lot of work if 138something goes wrong and you have to start all over again. 139 140 1412.1 Sharing your device 142 143 1442.1.1 Acorn IDE 145 146Use !HForm for this interface. This is a program that is delivered 147with your computer and is located in the Utilities directory on your 148hard disk. 149 150With this software you only have the possibility of using one 151partition for RISC OS, so you have to set the rest aside for NetBSD. 152 153Use this procedure to set up your device: 154 155 Start !HForm by double-clicking on its icon. 156 157 Choose the "custom" or "other" option when prompted (usually 158 the last). 159 160 Use the default values for the geometry but do not enter the 161 full number of cylinders. Just enter the number you want to 162 use for RISC OS. Make a note of this number. 163 164 Continue to accept the default answers until you're asked 165 whether you want to format or initialize, choose initialize. 166 167 Go to the section about running bb_riscbsd. 168 169 1702.1.2 Cumana SCSI-2 card 171 172It is recommended that you use a newer version of !SCSIMgr (newer 173than v1.55) since this will be easier to use when you want to leave 174part of the device unused by RISC OS. You should check for the latest 175version of this software at the following URL: 176http://www.cumana.demon.co.uk 177 178You need to create one or more RISC OS partitions, and you do it in 179in the following way: 180 Run !SCSIMgr by double-clicking on it. 181 182 Select the device you wish to repartition. 183 184 Click on the clear icon in the partitions subwindow. 185 186 This will give you a dialogue box where you can specify the 187 size of the RISC OS partitions. Do not select all since you 188 want to use part of it for NetBSD. 189 190 Enter the amount of the device you wish to reserve for 191 RiscOS. This will be the whole device size less the amount 192 you want to reserve for NetBSD. Make a note of this number. 193 194 If you like, split the RISC OS portion of the device into 195 several partition (you should only "see" the RiscOS portion). 196 197 Click on Execute when you are happy with the partitions. This 198 will create your partitions, and wipe your device. 199 200 Go to the section about running bb_riscbsd. 201 202 2032.1.3 Alsystems Power-tec SCSI-2 card 204 205You must use the !PowerMgr program to partition the device. 206 207The RISC OS partitions should be called RiscOs:, and the NetBSD one 208should be called Empty:. 209 210Here is the procedure you should use: 211 Start !PowerMgr by double-clicking on its icon. 212 213 Click on advanced in the main window 214 215 Click on Define/create partitions 216 Click on the device you want to set up for NetBSD. 217 218 Set up the RISC OS partitions as "RiscOs:" and the 219 remaining one as "Empty:". 220 221 Click on each figure and press RETURN. 222 223 Click on partition drive. 224 225 Click on yes to warning as you really want to wipe 226 the device. 227 228 Click on yes to proceed, this will lead you to the 229 partition init. 230 231 Partition init 232 Set a tick on all RiscOs: partitions, give them a name 233 and set LFAU to auto. 234 235 Unset the tick on your Empty: partition. 236 237 Click on Inititialize selected partitions. 238 239 Click on yes to proceed init as you want to wipe the 240 selected partitions. 241 242 Click on yes to proceed to configure. 243 244 Configure 245 Here you should set up the RISC OS partitions as you 246 like them. Normally the default will be ok. 247 248 Click on configure. This will configure your computer 249 and give you access to the Discs. 250 251 You *Must Not* run bb_riscbsd. 252 253 254 2552.1.4 Acorn SCSI card 256 257You can only have one RISC OS partition with this card. The rest has 258to be set aside for NetBSD. 259 260This card does not have a friendly WIMP-based interface on the SCSI 261management program, but the command line version is very good. You 262should run this in a task window (press CTRL-F12): 263 dir <location_of_scsidm> 264 265 scsidm 266 267You will get the following prompt: 268scsidm> 269 270Now you should enter the following commands: 271 probe (to see which devices are available) 272 273 device <no> (replace <no> with the no of your device) 274 275 section (to divide the device between RISC OS and 276 NetBSD) 277 Answer yes to the question: 278 Include RISCiX partitions? 279 280 Enter the size of the RISC OS area in blocks 281 (sectors) 282 283 SCSIDM will round this up to the nearest cylinder 284 boundary. 285 286 Answer yes to the question: 287 Do you really want to section device <no>? 288 289 This will section the device into two partitions. 290 291 quit 292 293 Go to the section on running bb_riscbsd. 294 295 296 2972.1.5 Other interfaces 298 299It may not be possible to partition devices on other interface. If 300you are using a different interface you have 2 options: 301 Try to work out how to partition devices on it 302 303 Use the entire device for NetBSD 304 305 3062.2 Using a whole device for NetBSD 307 308As a safety precaution NetBSD/acorn32 looks for a filecore bootblock 309at the beginning of any device it labels. If it finds one and it 310looks as though it is in use then NetBSD/acorn32 will not touch it. 311 312Because of this, if you've ever used your device for RiscOS, you will 313need to invalidate this bootblock. 314 315To do this you need to: 316 Be absolutely sure you want to do this. 317 318 Run bb_trash and follow the instructions. 319 320Ensure that this device is now not configured for RiscOS. 321 322You are now ready to boot NetBSD and continue the installation. 323 324 325 3263 Running bb_riscbsd 327 328When you run this program, you will first be asked whether you are 329installing to an ADFS drive or a SCSI drive. You can just press A or 330S respectively. (The bb_riscbsd program assumes that you are using a 331non-Acorn SCSI card, so if you are using an Acorn card, then you may 332have to edit this program and replace CSI_DiscOp with SCSIFS_DiscOp.) 333 334Then you will be asked which disc you want to install NetBSD on. This 335*must* be the first disc on the device. bb_riscbsd will now 336scrutinize the device and see how it has been laid out. 337 338It will then tell you how much of the device is occupied by RiscOS in 339cylinders, and you will then be asked for the NetBSD starting 340cylinder. Normally you should just enter the number given to you 341since the RISC OS starting cylinder is 0 and therefore the last 342cylinder in use is one less than the figure given. If no figure is 343displayed, then your partitioning software failed to fill in the 344bootblock completely (it doesn't have to do this for you but most do) 345or you selected the wrong device. If you are convinced that this is 346the correct device then you must calculate a cylinder offset using 347the numbers noted down during partitioning (if it is not a whole 348number *always* round up, you might waste a little of the device but 349it'll be safer). 350 351Make a note of this number. 352 353bb_riscbsd will make a backup of the original bootblock, but it 354can be non-trivial to put it back. 355 356 357 3584 Booting 359 360Now that your device is ready for the installation you need to 361unpack the bootloader archive. Pick either BtNetBSD.tgz or BtNetBSD.zip 362depending on which type of archive you can extract easiest. (if you're 363installing from CD-ROM then this should be unpacked already), copy the 364directory to your hard disk. In the archive you'll find the tools 365mentioned in this document as well as the bootloader !BtNetBSD itself. 366 367 3684.1 Configuring the !BtNetBSD bootloader before installation 369 370Open the !BtNetBSD application and edit the `fastboot' file to specify 371the installation kernel location; an example is already given. 372 373 374You can also set other details like tweaking with the amount of memory in 375the WimpSlot of the bootloader when this is too much. Remember however that 376this shouldn't be set too low for it can crash the bootloader. 377 378When you think you've filled in the proper details save the file again 379and proceed. 380 381 3824.2 Running !BtNetBSD 383 384Double click on the !BtNetBSD icon (or the !Run file in it) to start it 385up. 386 387NetBSD should now start to boot, install NetBSD as per the NetBSD 388installation notes. 389 390When you finish the installation you can restarted the computer as 391instructed. 392 393 3944.3 Configuring !BtNetBSD after installation 395 396Open the !BtNetBSD application again and edit the `fastboot' file again 397to fill in the normal kernel name. 398 399Specify the device NetBSD should be looking for its kernel in. This is 400the `Run <BtNetBSD$Dir>.native.mountufs ADFS 4' line that is there 401by default. See this document for other names. 402 403Set the kernel as UnixFS:$.netbsd. 404 405Save the file and run !BtNetBSD again (see above). 406 407 408 4095 Advanced stuff 410 411 4125.1 Using UnixFS to copy the sets. 413 414Once the required sets are installed and you can boot from your 415newly installed NetBSD setup, you can use UnixFS to copy the 416remaining sets from RiscOS to NetBSD. 417 418In order to be able to use unixfs to transfer the sets you must have 419a certain setup. 420 4211) You must have the RiscOS disc that corresponds to the NetBSD 422 device configured (e.g., *con. IDEdiscs 2) even if it has no RiscOS 423 section. 4242) If you have RISC OS 3.5 without the new FileCore, then you must 425 also have the NetBSD file system *completely* below the 511 MB 426 boundary of the device. 4273) You must know the SWI base of the <filesys>_DiscOp SWI. Here 428 <filesys> is SCSIFS, SCSI or ADFS depending upon which controller 429 type you have you NetBSD device on. 430 Some common ones: 431 Power-tec SCSI-2 card: &40980 432 RapIDE: &4BBC0 433 434 There are small obey files for some interfaces supplied with UnixFS. 4354) Have given the directory you want to write into write permission for 436 everyone. This should have been done above. For example to make 437 /usr/distrib world writable type (as root): 438 chmod 1777 /usr/distrib 439 440To mount a Unix partition: 441 4421) Double-click on the unixfs_res module to load it. 4432) Run a unixfs_mount command to mount the partition. 4443) Open the root directory by double-clicking on the openroot file. 4454) Open the distrib directory and just copy the sets to this. 4465) Shut down unixfs by double-clicking on the kill_unixfs file. 447 THIS STEP IS VERY IMPORTANT as it works like dismount on MS-DOS floppies. 448 449The difficult step here is step number 2). If you are using an 450ADFS IDE disc, then you can just double-click on one of the 451following obey files (always choose the RiscOS disc number that 452corresponds to the *first* disc on the NetBSD device): 453- MountHD4a (ADFS::4 drive, not disc, root file system) 454- MountHD4e (ADFS::4 drive, not disc, /usr file system) 455- MountHD5a (ADFS::5 drive, not disc, root file system) 456- MountHD5e (ADFS::5 drive, not disc, /usr file system) 457 458If you are not using an ADFS IDE device, you need to create such 459an obey file yourself. We recommend that you copy one of the 460above and change that. These files normally only contain a 461unixfs_mount command. If you go to the command line (or a task 462window), and you type *help unixfs_mount you will see that the 463unixfs_mount command has a very incomprehensible syntax. 464 465The unixfs_mount command normally only takes one argument. That 466is composed of the following: 467(discop_swibase + (disc << 3) + partition) 468 469To mount the root partition of third Power-tec SCSI-2 disc the 470following commands can be used in task window (press CTRL-F12) to 471find the argument to unixfs_mount: 472 *basic 473 PRINT ~(&40980 + (6 << 3) + 0) 474 QUIT 475 476The PRINT command calculates the value to use and will in this 477context give the value 409B0 which also is in hexadecimal. The 478interesting things above are: 479- &40980 The SWI base for SCSIFS_DiscOp. 480- 6 The disc number in RISC OS. 481- 0 The RiscBSD partition no. with a=0, b=1 etc. 482- ~ Tell the PRINT command to show the result in hexadecimal. 483- << Shifts the first number with the second number 484 places left. 485 In this case, it shifts 6 with 3 places to the left. 486- & Denotes that the number is in hexadecimal. 487- ( and ) Used to group the sub-expressions. 488 489When you have calculated the figure to give to unixfs_mount you 490just change it in the copy of the file you made above and run it by 491double-clicking on it. 492 493When you have mounted the unixfs file system, you can open the 494directory and copy the sets to it. 495Don't forget to copy the file "checksums" too. As its name suggests, it 496contains checksums to check if the files are OK. 497 498When you are finished with the transfer, run the file 499kill_unixfs to dismount the unixfs file system. 500 501 502 503Appendix A - Device naming 504 505The names of the devices in NetBSD are not at all like the ones 506in RISC OS. We will here try to explain the naming scheme used 507in NetBSD. This is pretty much the same in all UNIXes, but 508there will be some differences. NetBSD is derived from BSD and 509differs from the ones that are derived from System V. Most of 510the dominant operating systems in the UNIX market today are 511based on System V (Sun Solaris, SGI Irix, HP HP-UX 10.xx, Linux 512etc.). Some of them are actually hybrids of both. 513 514The file systems in UNIX use the slash character (/) as the 515directory separator. The top (or bottom if you like) directory 516is called the root and is denoted by a single slash (/). All 517absolute filenames are addressed starting with the root, so the 518temporary directory is called /tmp. 519 520The devices in UNIX are addressed as special files in the 521file system, and they all start with /dev, so e.g. the quadrature 522mouse is called /dev/quadmouse. 523 524Also some devices can be addressed in two different ways; as a 525raw (character by character) or block device. This is especially 526true with discs, and they therefore have two different names. 527The raw device is called the same as the block device except 528that it has an 'r' in front of the name. E.g. the first internal 529hard drive is called /dev/wd0 as a block device, but /dev/rwd0 530as a raw device. See also later. 531 532For now, the only needed devices are the storage devices, so we 533will hereby describe the naming convention used for these. 534Please note that when you have different partitions on a device, 535they will get the same number in NetBSD, but different letters, 536whereas in RISC OS they will get different numbers. See the 537examples at the end of this section. 538 539The (block) device names are mostly composed of 4 characters: 5401. The type 541 - w Winchester drives (i.e. standard ADFS drives) 542 - s SCSI drives 543 - c CD-ROM drives 544 - r RAM drives (obsolete in newer kernels) 545 - m Memory drives (only in newer kernels) 546 - f Floppy drives 5472. A 'd' indicating a disc device 5483. The number of the device of that type starting with 0. 549 - For IDE drives, the master will be 0, and the slave 1. 550 - For SCSI drives, the target ID will be used to 551determine the number. They start on 0 and increase with 552each device found. The drive with the lowest target ID will get 5530, the second lowest target ID will get 1 etc. 554Also, if you have different controllers, all devices on controller 5550 (lowest expansion slot) will be added first. 556 - The CD-ROM drives act the same way as SCSI drives. 557 - The floppy drive is numbered as in RISC OS. 558 - At present you can only have one RAM drive, so it is 0. 5594. The name of the partition. There are eight of these (along with 560 common allocations): 561 - a The root partition 562 - b The swap partition 563 - c The complete and whole disc ; all OS's and partitions 564 - d Part of the disc that is not used by NetBSD; normally RiscOS 565 - e The first additional partition. 566 i.e. if you have only /usr, then this will be /usr 567 if you have both /var and /usr this will be /var 568 - f The second additional partition. 569 i.e. if you have /var and /usr, this will be /usr 570 - g The third ... 571 - h The fourth ... 572 573If you only have one partition on the drive this can normally be 574accessed with either partition a (root partition) or c (whole 575disc). This has not been verified to work. 576 577A couple of examples of how to map RISC OS names to NetBSD ones 578(the partition names have been left out): 579ADFS::0 fd0 580ADFS::1 fd1 581ADFS::4 wd0 582ADFS::5 (same drive as :4) wd0 583ADFS::5 (other drive than :4) wd1 584SCSI::4 sd0 585SCSI::5 (same drive as :4) sd0 586SCSI::5 (other drive than :4) sd1 587 588So, if you have one ADFS IDE drive, and want to install NetBSD 589at the after ADFS::5, you should still use wd0. If on the other 590hand, ADFS::5 is a second drive, then you will have to use wd1. 591 592 593Appendix B - Acknowledgments 594 595This document was based upon the document 596"Installing RiscBSD 1.2-Release" 597(C) 1996 The RiscBSD Documentation Project 598 599That has the following acknowledgement: 600 601This manual has been written from scratch based on version 1.2 602of the installation manual that Mark Brinicombe wrote. 603 604It was mainly written by Kjetil B. Thomassen 605(kjetil@thomassen.priv.no) with contributions from: 606Neil Hoggarth (neil.hoggarth@physiol.ox.ac.uk) 607Markus Baeurle (emw4maba@gp.fht-esslingen.de) 608Jasper Wallace (jasper@ivision.co.uk) 609Mark Brinicombe (amb@physig.ph.kcl.ac.uk) 610Scott Stevens (s.k.stevens@ic.ac.uk) 611and a lot more people posting to the original RiscBSD mailing list. 612 613