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