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