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
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
.\" $NetBSD: boot.8,v 1.16 2017/07/03 21:31:00 wiz Exp $
.\"
.\" Copyright (c) 1999 Christopher G. Demetriou
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"          This product includes software developed for the
.\"          NetBSD Project.  See http://www.NetBSD.org/ for
.\"          information about NetBSD.
.\" 4. The name of the author may not be used to endorse or promote products
.\"    derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
.\"
.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Systems Programming Group of the University of Utah Computer
.\" Science Department.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)boot_hp300.8        8.2 (Berkeley) 4/19/94
.\"
.Dd February 17, 2017
.Dt BOOT 8 alpha
.Os
.Sh NAME
.Nm boot
.Nd Alpha system bootstrapping procedures
.Sh DESCRIPTION
.Tn DEC
.Tn Alpha
systems can have either of two different firmware systems:
.Tn ARC
.Pq a.k.a. Tn AlphaBIOS ,
and
.Tn SRM .
Some
.Tn Alpha
systems have both in their flash
.Tn RAM
and can switch between them on command.
.Tn ARC
is used to bootstrap Microsoft Windows NT for
.Tn Alpha .
.Tn SRM
is used to bootstrap
.Tn OpenVMS
and
.Tn Ultrix .
.Nx
requires
.Tn SRM .
.Pp
.Tn SRM
can bootstrap from supported local storage devices, e.g.,
.Tn IDE
disks or
.Tn CD-ROM
drives,
.Tn SCSI
disks or
.Tn CD-ROM
drives, and floppy drives.
.Tn SRM
can also network bootstrap via supported
.Tn Ethernet
interfaces, using
.Tn BOOTP
or
.Tn MOP .
The particular capabilities of
.Tn SRM
will vary from system to system.
.Pp
When
.Tn SRM
boots the system, it performs a Power On Self Test
.Pq Tn POST ,
probes the system busses to identify devices, and initializes them.
.Tn SRM
includes an x86 instruction emulator in order to run the
.Tn BIOS
initialization routines found in the
.Tn PROM
of any video cards found.
In this way, most generic
.Tn PCI
video cards can work in
.Tn Alpha
systems that have
.Tn PCI
bus slots.
.Pp
.Tn SRM
then examines the state of one of several variables:
.Ev auto_action .
If the value of
.Ev auto_action
is
.Qq halt
then
.Tn SRM
will stop, print its prompt:
.Qq >>>
and wait for commands to be entered on the console.
If the value of
.Ev auto_action
is
.Qq boot
then
.Tn SRM
will automatically bootstrap the operating system specified by
various non-volatile environment variables.
.Pp
.Tn SRM
device names are not the same as in
.Nx ,
e.g.,
.Sy ewa0
is a
.Tn DEC
.Qq tulip
.Tn Ethernet
interface,
.Sy dka0
is a
.Tn SCSI
disk on a recognized controller,
.Sy dqa0
is an
.Tn IDE
disk on a recognized controller.
The
.Ic show device
command will list all the devices that
.Tn SRM
can bootstrap from.
.Ss SRM Commands
.Tn SRM
is somewhat
.Ux Ns No -like
in that it incorporates a simple pipe and I/O redirection,
which allows command sequences like:
.Pp
.Bd -literal -offset indent
show config | more
show * | more
.Ed
.Pp
An essential but incomplete list of
.Tn SRM
commands follows:
.\" .Pp
.\" .Bl -tag -width "boot [-file filename] [-flags value] [-protocols enet_protocol] [device]"
.\" .It Ic boot Oo Fl file Ar filename Oc Oo Fl flags Ar value Oc Oo Fl protocols Ar enet_protocol Oc Op Ar device
.Pp
.Ic boot
.Op Fl file Ar filename
.Op Fl flags Ar value
.\" .Op Fl protocols Ar enet_protocol
.Op Ar device
.Pp
Boot an operating system.
The default arguments for this command are taken from the
.Tn SRM
environment variables:
.Pp
.Bl -tag -compact -width "boot_osflags" -offset indent
.It Ev boot_file
file name to bootstrap.
.It Ev boot_osflags
flags to pass to the secondary bootstrap program.
.It Ev bootdef_dev
default bootstrap device.
.El
.\" .It Ic help Op Ar command
.Pp
.Ic help Op Ar command
.Pp
Invoke the
.Tn SRM
help system.
.\" .It Ic set Ar variable Ar value
.Pp
.Ic init
.Pp
Reset the
.Tn SRM
console, and take actions as specified by
.Tn SRM
variables.
.Pp
.Ic set Ar variable Ar value Op Fl default
.Pp
Set an
.Tn SRM
variable, e.g.,
.Bd -literal -offset indent
set auto_action boot
set bootdef_dev dka0
set ewa0_mode auto
.Ed
.Pp
If the
.Fl default
flag is used, the variable will be set to its default value.
.\" .It Ic show Ar variable or subsystem
.Pp
.Ic show Ar variable or subsystem
.Pp
Show
.Tn SRM
variables and values, or show system state or configuration.
If a wildcard is used, then all matching
.Tn SRM
variables are shown, e.g.,
.Pp
.Bl -tag -width "show device" -compact -offset indent
.It Ic show \&*
will display all
.Tn SRM
variables.
.It Ic show b*
will display all variables whose names begin with
.Em b .
.It Ic show config
will display the complete system configuration.
.It Ic show device
will display all bootable devices.
.It Ic show memory
will display the system's memory configuration.
.El
.\" .El
.Ss SRM Variables
.Bl -tag -width "ew*0_protocols"
.It Ev auto_action
What
.Tn SRM
will do at system startup or reset:
.Bl -tag -width boot
.It Ar boot
automatically bootstrap the operating system.
.It Ar halt
after
.Tn POST ,
prompt the user on the console for commands to execute.
.El
.Pp
Some
.Tn Alpha
systems
.Pq e.g., Tn AlphaServer 800
have a
.Qq halt
switch, which if set, will override the action of this variable, and cause
.Tn SRM
to stop after
.Tn POST
and prompt the user for commands to execute.
.It Ev bootdef_dev
The default bootstrap device, e.g.,
.Sy dka0 ,
.Sy dqa0 ,
.Sy ewa0 .
The
.Ic show device
command will list the available and recognized bootable devices.
.It Ev boot_file
The file to bootstrap from; this is a null string by default.
.It Ev boot_osflags
The flag passed to the secondary bootstrap program, and the
.Nx
kernel:
.Bl -tag -width "XXXX"
.It Sy a
.Pq automatic
multi-user mode bootstrap.
.It Sy c
crash dump immediately after
.Xr autoconf 4 ,
if the
.Nx
kernel is compiled with
.Dv DEBUG ;
See
.Xr options 4 .
.It Sy d
break into the debugger ASAP, if the
.Nx
kernel is compiled with
.Dv DDB
or
.Dv KGDB ;
See
.Xr options 4 .
.It Sy h
on a reboot request from the
.Nx
kernel, halt the system instead of rebooting.
.It Sy i
the
.Nx
secondary bootstrap program will stop and prompt for the
.Nx
kernel file name to bootstrap.
.It Sy n
the
.Nx
kernel will ask for the root file system's device, the kernel core
dump device, and the path to
.Xr init 8 .
.It Sy q
bootstrap quietly.
.It Sy s
single-user mode bootstrap.
.It Sy v
bootstrap verbosely.
.El
.Pp
These may be used in combinations that are not mutually exclusive.
These options are case-insensitive to be compatible with
.Tn DEC
operating systems.
.It Ev console
What type of console device
.Tn SRM
and
.Nx
will use:
.Bl -tag -width "graphics"
.It Ar graphics
use a video card for output, and a
.Tn PC
keyboard for input.
.It Ar serial
use the first serial port for console.
.El
.Pp
Just as with
.Tn Sun
systems,
.Tn Alpha
systems will use the first serial port as a console if there is no
keyboard plugged into the keyboard port, even if
.Ev console
is set to
.Qq graphics .
.It Ev ew*0_mode
The media and speed for
.Tn DEC
.Qq tulip
Ethernet interfaces
.Po
e.g.,
.Tn DECchip
21040, 21140, 21143
.Pc ;
possible values are:
.Ic auto
.Po
.Tn IEEE
802.3u
.Qq Nway
negotiation
.Pc ,
.Ic BNC ,
.Ic AUI ,
.Ic Twisted-Pair ,
.Ic FastFD
.Pq Fast Full Duplex .
.It Ev ew*0_protocols
The protocol to use when netbooting, i.e.,
.Tn MOP
.Pq Maintenance Operations Protocol ,
or
.Tn BOOTP
.Pq Bootstrap Protocol .
.Pp
The
.Tn Alpha
.Tn SRM
firmware is picky about
.Tn BOOTP
responses; the
.Xr dhcpd.conf 5
on the server needs the
.Pp
.Bd -literal -offset indent
always-reply-rfc1048 on;
.Ed
.Pp
directive in the section for netbooting
.Tn Alpha
systems.
.It Ev os_type
This determines which system firmware will be used after the next
power-cycle, if both
.Tn ARC
and
.Tn SRM
are present in
.Tn Flash RAM .
This should be set to any of
.Qq Ux ,
.Qq osf ,
or
.Qq vms
to select the
.Tn SRM
console required for
.Nx .
.Tn OSF
refers to the Open Software Foundation.
.El
.Ss After bootstrap
Once the
.Nx Ns Tn /alpha
kernel is booted normally
it initializes itself and proceeds to start the system.
An automatic consistency check of the file systems takes place,
and unless this fails, the system comes up to multi-user operation.
.Pp
The proper way to shut the system down is with the
.Xr shutdown 8
command.
.Pp
If the system crashes, it will enter the kernel debugger,
.Xr ddb 4 ,
if it is configured in the kernel.
If the crash occurred during initialization and the debugger is
not present or is exited, the kernel will halt the system.
.Pp
If the crash occurred during normal operation and the debugger
is not present or is exited, the system will attempt a dump to the
configured dump device (which will be automatically recovered with
.Xr savecore 8
during the next bootstrap cycle), and after the dump is complete (successful
or not) the kernel will attempt a reboot.
.Sh FILES
.Bl -tag -width /usr/mdec/bootxx_cd9660 -compact
.It Pa /boot
.Nx
secondary bootstrap program
.Pq installed
.It Pa /netbsd
default
.Nx
system kernel
.It Pa /usr/mdec/bootxx_cd9660
primary bootstrap for
.Dq cd9660
.Pq Tn ISO 9660
file system
.It Pa /usr/mdec/bootxx_ffs
primary bootstrap for
.Dq ffs
file system
.Pq Berkeley Fast File System
.It Pa /usr/mdec/boot
secondary bootstrap
.It Pa /usr/mdec/netboot
network bootstrap
.It Pa /usr/mdec/ustarboot
.Dq ustar
disk and tape bootstrap
.El
.Sh SEE ALSO
.Xr ddb 4 ,
.Xr alpha/mkbootimage 8 ,
.Xr alpha/setnetbootinfo 8 ,
.Xr diskless 8 ,
.Xr init 8 ,
.Xr installboot 8 ,
.Xr rc 8 ,
.Xr reboot 8 ,
.Xr savecore 8 ,
.Xr shutdown 8
.Rs
.%T "Alpha Architecture Reference Manual Third Edition"
.%Q "Alpha Architecture Committee"
.%I "Digital Press"
.%D 1998
.Re
.Sh BUGS
The device names used by
.Nx Ns Tn /alpha
and the
.Tn SRM Console
often have no relation to each other.