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