Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
.\"	$NetBSD: prep,v 1.15 2015/05/09 08:13:34 snj Exp $
.
First and foremost, before beginning the installation process,
.Em make sure you have a reliable backup
of any data on your hard disk that you
wish to keep.
Repartitioning your hard disk is an excellent way to destroy important data.
.Ss2 Software requirements
You will need the following RISC OS software:
.Bl -bullet
.It
A program that will unpack sparchives.
We recommend that you get David Pilling's !SparkPlug.
A self-extracting version of this
can be found in the distribution directory at
.Pa installation/misc/splug.bas
or at David Pilling's website:
.Lk http://www.davidpilling.net/free.html
.It
A program to report your disk's geometry:
.Bl -bullet
.It
Not really needed, as you can simply boot the installation
kernel and look for the geometry in the boot messages.
.It
Sergio Monesi's fsck suite (a good thing to have around
anyway).
Available from:
.Lk http://www.monesi.com/sergio/fsck.html
.It
!Zap (The read disk facility).
Available from:
.Lk http://zap.tartarus.org/
.It
The partition software/formatter for your desired installation
target:
.Bl -bullet
.It
IDE disks on motherboard interface: !HForm
.It
IDE disks on Simtec interface: UNKNOWN
.It
IDE disks on ICS interface: UNKNOWN
.It
IDE disks on RapIDE interface: UNKNOWN
.It
Acorn SCSI cards: ScsiDM
.It
Power-tec SCSI cards: !PowerMgr
.It
Cumana SCSI-2: !SCSIMgr
.It
oak SCSI-1 card: UNKNOWN
.It
MCS Connect32 SCSI: UNKNOWN
.It
Morley SCSI: UNKNOWN
.El
.El
.It
An installation kernel for your platform:
.Pp
RiscPC/A7000(+)/NC's  : INSTALL kernel
.It
The Bootloader and RISC OS tools:
.Pa BtNetBSD.spk
as found in the
.Pa installation/misc
directory.
(This should be pre-extracted if you're installing from CD-ROM).
.It
The
.Nx*M
distribution sets (Will be on the CD-ROM, or
available from your nearest
.Nx
ftp site).
.It
A hardcopy of this document
.El
.Ss2 Preliminary steps
Unpack your BtNetBSD archive in whatever way.
.Ss2 Preparing your hard disk
Terms:
.Bl -tag -width "File system"
.It Device
The actual physical hard disk
.It Partition
A section of a device.
.It File system
A structured partition that is able to hold files.
.It Disc
A RISC OS file system in a partition.
There can be more than one Disc per Device.
.El
.Pp
You will have to decide which device you wish to install
.Nx
on.
You will also have to decide whether you want to split the device
between one or more RiscOS Discs and
.Nx
or dedicate a whole
Device for
.Nx .
.Pp
In making this decision you should consider the possibility that if
.Nx
is incorrectly configured on a shared device then your shared
data is at risk.
.Pp
It is still recommended that if you decide to dedicate a device to
.Nx
that you set aside a small RISC OS partition at the beginning
of the device.
This is a useful place to store the RISC OS side of
.Nx ,
and will make the use of UnixFS easier to configure.
If you do decide to create a minimal RISC OS partition at the beginning of
the device, a size of 10-20 MB is recommended (some partitioning
software has problems with partitions smaller than this).
.Pp
The point is that you will have to repartition your device to make
room for a separate partition after the RISC OS one for
.Nx .
This
means backing up your device, re-partitioning it and then copying all
the data back afterwards.
We recommend that you only copy the needed
data back and put off installing the rest until you have
.Nx
up
and running.
This way you will save yourself a lot of work if
something goes wrong and you have to start all over again.
.Ss2 Sharing your device
2.1.1 Acorn IDE
.Pp
Use !HForm for this interface.
This is a program that is delivered with your computer and is located in the
.Pa Utilities
directory on your
hard disk.
.Pp
With this software you only have the possibility of using one
partition for RISC OS, so you have to set the rest aside for
.Nx .
.Pp
Use this procedure to set up your device:
.Bl -bullet
.It
Start !HForm by double-clicking on its icon.
.It
Choose the "custom" or "other" option when prompted (usually
the last).
.It
Use the default values for the geometry but do not enter the
full number of cylinders.
Just enter the number you want to use for RISC OS.
Make a note of this number.
.It
Continue to accept the default answers until you're asked
whether you want to format or initialize, choose initialize.
.It
Go to the section about running
.Ic bb_riscbsd .
.El
.Pp
2.1.2 Cumana SCSI-2 card
.Pp
It is recommended that you use a newer version of !SCSIMgr (newer
than v1.55) since this will be easier to use when you want to leave
part of the device unused by RISC OS.
You should check for the latest version of this software at the following URL:
.Lk http://www.cumana.demon.co.uk
.Pp
You need to create one or more RISC OS partitions, and you do it in
in the following way:
.Bl -bullet
.It
Run !SCSIMgr by double-clicking on it.
.It
Select the device you wish to repartition.
.It
Click on the clear icon in the partitions subwindow.
.It
This will give you a dialogue box where you can specify the
size of the RISC OS partitions.
Do not select all since you want to use part of it for
.Nx .
.It
Enter the amount of the device you wish to reserve for RiscOS.
This will be the whole device size less the amount you want to reserve for
.Nx .
Make a note of this number.
.It
If you like, split the RISC OS portion of the device into
several partition (you should only "see" the RiscOS portion).
.It
Click on Execute when you are happy with the partitions.
This will create your partitions, and wipe your device.
.It
Go to the section about running
.Ic bb_riscbsd .
.El
.Pp
2.1.3 Alsystems Power-tec SCSI-2 card
.Pp
You must use the !PowerMgr program to partition the device.
.Pp
The RISC OS partitions should be called
.Ql RiscOs: ,
and the
.Nx
one should be called
.Ql Empty: .
.Pp
Here is the procedure you should use:
.Bl -bullet
.It
Start !PowerMgr by double-clicking on its icon.
.It
Click on advanced in the main window
.It
Click on Define/create partitions
.Bl -bullet
.It
Click on the device you want to set up for NetBSD.
.It
Set up the RISC OS partitions as
.Ql RiscOs:
and the	remaining one as
.Ql Empty: .
.It
Click on each figure and press RETURN.
.It
Click on partition drive.
.It
Click on yes to warning as you really want to wipe
the device.
.It
Click on yes to proceed, this will lead you to the
partition init.
.El
.It
Partition init
.Bl -bullet
.It
Set a tick on all
.Ql RiscOs:
partitions, give them a name and set LFAU to auto.
.It
Unset the tick on your
.Ql Empty:
partition.
.It
Click on Initialize selected partitions.
.It
Click on yes to proceed init as you want to wipe the
selected partitions.
.It
Click on yes to proceed to configure.
.El
.It
Configure
.Bl -bullet
.It
Here you should set up the RISC OS partitions as you like them.
Normally the default will be ok.
.It
Click on configure.
This will configure your computer and give you access to the Discs.
.El
.It
You
.Em must not
run
.Ic bb_riscbsd .
.El
.Pp
2.1.4 Acorn SCSI card
.Pp
You can only have one RISC OS partition with this card.
The rest has to be set aside for
.Nx .
This card does not have a friendly WIMP-based interface on the SCSI
management program, but the command line version is very good.
You should run this in a task window (press
.Key CTRL-F12 ) :
.Bd -ragged
.Li *dir Ar location_of_scsidm
.br
.Li *scsidm
.Ed
You will get the following prompt:
.Dl scsidm\*[Gt]
Now you should enter the following commands:
.Bl -tag -width Ic
.It Ic probe
(to see which devices are available)
.It Ic device Ar no
(replace
.Ar no
with the no of your device)
.It Ic section
(to divide the device between RISC OS and
.Nx )
.Bl -bullet
.It
Answer yes to the question:
.Dl Include RISCiX partitions?
.It
Enter the size of the RISC OS area in blocks
(sectors)
.It
SCSIDM will round this up to the nearest cylinder
boundary.
.It
Answer yes to the question:
.Bd -ragged -offset indent
.Li "Do you really want to section device" Ar no Ns Li "?"
.Ed
.It
This will section the device into two partitions.
.El
.It Ic quit
.El
.Pp
Go to the section on running
.Ic bb_riscbsd .
.Pp
2.1.5 Other interfaces
.Pp
It may not be possible to partition devices on other interface.
If you are using a different interface you have 2 options:
.Bl -bullet
.It
Try to work out how to partition devices on it
.It
Use the entire device for
.Nx
.El
.Ss2 Using a whole device for NetBSD
.Pp
As a safety precaution
.Nx*M
looks for a filecore bootblock
at the beginning of any device it labels.
If it finds one and it looks as though it is in use then
.Nx*M
will not touch it.
.Pp
Because of this, if you've ever used your device for RiscOS, you will
need to invalidate this bootblock.
.Pp
To do this you need to:
.Bl -bullet
.It
Be absolutely sure you want to do this.
.It
Run
.Ic bb_trash
and follow the instructions.
.El
.Pp
Ensure that this device is now not configured for RiscOS.
.Pp
You are now ready to boot
.Nx
and continue the installation.
.Ss2 Running bb_riscbsd
.Pp
When you run this program, you will first be asked whether you are
installing to an ADFS drive or a SCSI drive.
You can just press
.Ql A
or
.Ql S
respectively.
(The
.Ic bb_riscbsd
program assumes that you are using a
non-Acorn SCSI card, so if you are using an Acorn card, then you may
have to edit this program and replace
.Ql SCSI_DiscOp
with
.Ql SCSIFS_DiscOp . )
.Pp
Then you will be asked which Disc you want to install
.Nx
on.
This
.Em must
be the first Disc on the device.
.Ic bb_riscbsd
will now scrutinize the device and see how it has been laid out.
.Pp
It will then tell you how much of the device is occupied by RiscOS in
cylinders, and you will then be asked for the
.Nx
starting cylinder.
Normally you should just enter the number given to you
since the RISC OS starting cylinder is 0 and therefore the last
cylinder in use is one less than the figure given.
If no figure is displayed, then your partitioning software failed to
fill in the bootblock completely
(it doesn't have to do this for you but most do)
or you selected the wrong device.
If you are convinced that this is the correct device then you must
calculate a cylinder offset using the numbers noted down during
partitioning (if it is not a whole number
.Em always
round up, you might waste a little of the device but
it'll be safer).
.Pp
Make a note of this number.
.Pp
.Ic bb_riscbsd
will make a backup of the original bootblock, but it
can be non-trivial to put it back.
.Ss2 Booting
.Pp
Now that your device is ready for the installation you need to
unpack the bootloader archive,
.Pa BtNetBSD.spk ,
(If you're installing from CD-ROM then this should be unpacked already) and
copy the directory to your hard disk.
In the archive you'll find the tools
mentioned in this document as well as the bootloader
.Pa !BtNetBSD
itself.
.Ss2 Configuring the !BtNetBSD bootloader before installation
Open the
.Pa !BtNetBSD
application and edit the
.Pa fastboot
file.
.Pp
You can set details like tweaking with the amount of memory in
the WimpSlot of the bootloader when this is too much.
Remember however that this shouldn't be set too low for it can crash
the bootloader.
.Pp
When you think you've filled in the proper details save the file again
and proceed.
.Ss2 Booting the installation kernel
.Pp
Double click on the InstKern icon to start it
up.
.Pp
.Nx
should now start to boot, install
.Nx
as per the
.Nx
installation notes.
.Pp
When you finish the installation you can restarted the computer as
instructed.
.Ss2 Configuring !BtNetBSD after installation
.Pp
Open the
.Pa !BtNetBSD
application again and edit the
.Pa fastboot
file to fill in the normal kernel name.
.Pp
Specify the device
.Nx
should be looking for its kernel in.
This is the
.Ql "Run \*[Lt]BtNetBSD$Dir\*[Gt].native.mountufs ADFS 4"
line that is there by default.
See this document for other names.
.Pp
Set the kernel as
.Pa UnixFS:$.netbsd .
.Pp
Save the file and run !BtNetBSD again (see above).
.Pp
Finally, when you are happy with your
.Nx
installation, do whatever
is necessary to restore order to the partition you took space away from.
This will most likely involve restoring files, but might involve some
other
.Dq house-work .
.Pp
Your hard disk is now prepared to have
.Nx
installed on it, and you should proceed with the installation instructions.