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
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
.\"     $NetBSD: intro.9,v 1.24.2.2 2019/09/05 08:19:41 martin Exp $
.\"
.\" Copyright (c) 1997, 2007 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Jeremy Cooper, and Mindaugas Rasiukevicius.
.\"
.\" 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.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
.\"
.Dd July 14, 2018
.Dt INTRO 9
.Os
.Sh NAME
.Nm intro
.Nd introduction to kernel internals
.Sh DESCRIPTION
This section contains information related to the internal operation of the
system kernel.
It describes function interfaces and variables of use to the systems and device
driver programmer.
.Pp
In addition to the normal man page format, the kernel pages include an
additional section:
.Bl -tag -width "CODE REFERENCES"
.It "CODE REFERENCES"
Contains the pathname(s) of the source file(s) which contain the definition
and/or source code of the variables or functions being documented.
Any paths are relative to the top level of the source tree (traditionally
.Pa /usr/src ) .
.El
.Sh MEMORY MANAGEMENT
Introduction to kernel memory allocators.
See
.Xr memoryallocators 9 .
.Pp
Machine-dependent portion of the virtual memory system.
See
.Xr pmap 9 .
.Pp
Virtual memory system external interface.
See
.Xr uvm 9 .
.Sh I/O SUBSYSTEM
Buffer cache interfaces.
See
.Xr buffercache 9 .
.Pp
Device buffer queues.
See
.Xr bufq 9 .
.Pp
Initiate I/O on raw devices.
See
.Xr physio 9 .
.Pp
I/O descriptor allocation interface.
See
.Xr getiobuf 9 .
.Sh PROCESS CONTROL
Idle CPU while waiting for work.
See
.Xr cpu_idle 9 .
.Pp
Finish a fork operation.
See
.Xr cpu_lwp_fork 9 .
.Pp
Switch to another light weight process.
See
.Xr mi_switch 9 .
.Pp
Current process and processor.
See
.Xr curproc 9 .
.Pp
Set process uid and gid.
See
.Xr do_setresuid 9 .
.Pp
New processes and kernel threads.
See
.Xr fork1 9 ,
.Xr kthread 9 .
.Pp
Context switch notification.
See
.Xr cpu_need_resched 9 .
.Pp
Common scheduler framework.
See
.Xr csf 9 .
.Pp
Software signal facilities.
See
.Xr signal 9 .
.Pp
Suspend the scheduler.
See
.Xr suspendsched 9 .
.Pp
Return path to user-mode execution.
See
.Xr userret 9 .
.Sh FILE SYSTEM
High-level file operations.
See
.Xr dofileread 9 .
.Pp
Convert an extended attribute namespace identifier to a string and
vice versa.
See
.Xr extattr 9 .
.Pp
Operations on file entries.
See
.Xr file 9 .
.Pp
In-kernel, file system independent, file-meta data association.
See
.Xr fileassoc 9 .
.Pp
File descriptor tables and operations.
See
.Xr filedesc 9 .
.Pp
File descriptor owner handling functions.
See
.Xr fsetown 9 .
.Pp
File system suspension helper subsystem.
See
.Xr fstrans 9 .
.Pp
Pathname lookup, cache and management.
See
.Xr namei 9 ,
.Xr namecache 9 .
.Pp
Kernel interface to file systems.
See
.Xr vfs 9 .
.Pp
Kernel representation of a file or directory and vnode attributes.
See
.Xr vnode 9 ,
.Xr vattr 9 .
.Sh NETWORKING
Kernel interfaces for manipulating output queues on network interfaces.
See
.Xr altq 9 .
.Pp
Externally visible ARP functions.
See
.Xr arp 9 .
.Pp
Ethernet and FDDI driver support functions and macros.
See
.Xr ethersubr 9 .
.Pp
Core 802.11 network stack functions and rate adaptation based on
received signal strength.
See
.Xr ieee80211 9 ,
.Xr rssadapt 9 .
.Pp
Compute Internet checksum.
See
.Xr in_cksum 9 .
.Pp
Look up the IPv4 source address best matching an IPv4 destination.
See
.Xr in_getifa 9 .
.Pp
Functions and macros for managing memory used by networking code.
See
.Xr mbuf 9 .
.Pp
Packet filter interface.
See
.Xr pfil 9 .
.Pp
Route callout functions.
See
.Xr rt_timer 9 .
.Pp
TCP congestion control API.
See
.Xr tcp_congctl 9 .
.Sh LOCKING AND INTERRUPT CONTROL
See
.Xr locking 9
for an overview.
.Pp
Condition variables.
See
.Xr condvar 9 .
.Pp
Kernel lock functions.
See
.Xr lock 9 .
.Pp
Memory barriers.
See
.Xr membar_ops 3 .
.Pp
Mutual exclusion primitives.
See
.Xr mutex 9 .
.Pp
Restartable atomic sequences.
See
.Xr ras 9 .
.Pp
Reader / writer lock primitives.
See
.Xr rwlock 9 .
.Pp
Machine-independent software interrupt framework.
See
.Xr softint 9 .
.Pp
Functions to modify system interrupt priority level.
See
.Xr spl 9 .
.Pp
Functions to raise the system priority level.
See
.Xr splraiseipl 9 .
.Sh SECURITY
Kernel authorization framework.
See
.Xr kauth 9 .
.Pp
API for cryptographic services in the kernel.
See
.Xr opencrypto 9 .
.Pp
Security model development guidelines.
See
.Xr secmodel 9 .
.Sh SYSTEM TIME CONTROL
Execute a function after a specified length of time.
See
.Xr callout 9 .
.Pp
Microsecond delay.
See
.Xr delay 9 .
.Pp
Real-time timer.
See
.Xr hardclock 9 .
.Pp
System clock frequency.
See
.Xr hz 9 .
.Pp
Initialization of system time and time-of-day clock support.
See
.Xr inittodr 9 ,
.Xr todr 9 .
.Pp
Check that a timeval value is valid, and correct.
See
.Xr itimerfix 9 .
.Pp
System time variables.
See
.Xr timecounter 9 .
.Pp
Realtime system clock.
See
.Xr microtime 9 .
.Pp
Get the time elapsed since boot.
See
.Xr microuptime 9 .
.Pp
Convert milliseconds to system clock ticks.
See
.Xr mstohz 9 .
.Pp
Function to help implement rate-limited actions.
See
.Xr ppsratecheck 9 .
.Pp
Function to help implement rate-limited actions.
See
.Xr ratecheck 9 .
.Pp
Set battery-backed clock from system time.
See
.Xr resettodr 9 .
.Pp
System time variables.
See
.Xr time_second 9 .
.Sh KERNEL AND USER SPACE DATA COPY FUNCTIONS
Kernel space to/from user space copy functions.
See
.Xr copy 9 .
.Pp
Store data to user-space.
See
.Xr ustore 9 .
.Pp
Fetch data from user-space.
See
.Xr ufetch 9 .
.Pp
Move data described by a struct uio.
See
.Xr uiomove 9 .
.Sh MACHINE DEPENDENT KERNEL FUNCTIONS
Machine-dependent clock setup interface.
See
.Xr cpu_initclocks 9 .
.Pp
Machine-dependent process core dump interface.
See
.Xr cpu_coredump 9 .
.Pp
Machine-dependent kernel core dumps.
See
.Xr cpu_dumpconf 9 .
.Pp
Unique CPU identification number
See
.Xr cpu_number 9 .
.Pp
Halt or reboot the system
See
.Xr cpu_reboot 9 .
.Pp
Machine-dependent root file system setup
See
.Xr cpu_rootconf 9 .
.Pp
Machine-dependent CPU startup
See
.Xr cpu_startup 9 .
.Pp
Disk label management routines.
See
.Xr disklabel 9 .
.Sh DEVICE CONFIGURATION
Autoconfiguration frame-work.
See
.Xr autoconf 9 .
.Pp
Description of a device driver.
See
.Xr driver 9 .
.Pp
The autoconfiguration framework ``device definition'' language.
See
.Xr config 9 .
.Pp
Machine-dependent device autoconfiguration.
See
.Xr cpu_configure 9 .
.Sh MI DEVICE DRIVER API
Bus and Machine Independent DMA Mapping Interface.
See
.Xr bus_dma 9 .
.Pp
Bus space manipulation functions.
See
.Xr bus_space 9 .
.Pp
Generic disk framework.
See
.Xr disk 9 .
.Pp
Hardware-assisted data mover interface.
See
.Xr dmover 9 .
Generic event counter framework.
See
.Xr evcnt 9 .
.Pp
Firmware loader API for device drivers.
See
.Xr firmload 9 .
.Pp
How to implement a new ioctl call to access device drivers.
See
.Xr ioctl 9 .
.Pp
Extensible line discipline framework.
See
.Xr linedisc 9 .
.Sh CONSOLE DEVICES
Console magic key sequence management.
See
.Xr cnmagic 9 .
.Pp
Console access interface.
See
.Xr cons 9 .
.Pp
Raster display operations.
See
.Xr rasops 9 .
.Pp
Generic virtual console framework.
See
.Xr vcons 9 .
.Pp
Machine-independent console support.
See
.Xr wscons 9 .
.Sh DEVICE SPECIFIC IMPLEMENTATION
Interface between low and high level audio drivers.
See
.Xr audio 9 .
.Pp
Bluetooth Device/Protocol API.
See
.Xr bluetooth 9 .
.Pp
Support for CardBus PC-Card devices.
See
.Xr cardbus 9 .
.Pp
VESA Display Data Channel V2.
See
.Xr ddc 9 .
.Pp
VESA Extended Display Identification Data.
See
.Xr edid 9 .
.Pp
Inter IC (I2C) bus.
See
.Xr iic 9 .
.Pp
Baseboard I/O control ASIC for DEC TURBOchannel systems.
See
.Xr ioasic 9 .
.Pp
Industry-standard Architecture.
See
.Xr isa 9 .
.Pp
Introduction to ISA Plug-and-Play support.
See
.Xr isapnp 9 .
.Pp
MicroChannel Architecture bus.
See
.Xr mca 9 .
.Pp
PPBUS microseqencer developer's guide.
See
.Xr microseq 9 .
.Pp
Peripheral Component Interconnect.
See
.Xr pci 9 .
.Pp
Perform PCI bus configuration.
See
.Xr pci_configure_bus 9 .
.Pp
PCI bus interrupt manipulation functions.
See
.Xr pci_intr 9 .
.Pp
PC keyboard port interface.
See
.Xr pckbport 9 .
.Pp
Support for PCMCIA PC-Card devices.
See
.Xr pcmcia 9 .
.Pp
Interface between low and high level radio drivers.
See
.Xr radio 9 .
.Pp
Functions to make a device available for entropy collection.
See
.Xr rnd 9 .
.Pp
SCSI/ATAPI middle-layer interface.
See
.Xr scsipi 9 .
.Pp
TURBOchannel bus.
See
.Xr tc 9 .
.Pp
USB tty support.
See
.Xr ucom 9 .
.Pp
USB device drivers interface.
See
.Xr usbdi 9 .
.Pp
Versa Module Euroboard bus.
See
.Xr vme 9 .
.Pp
Machine-independent IDE/ATAPI driver.
See
.Xr wdc 9 .
.Sh KERNEL EVENT
Functions to add or remove kernel event filters.
See
.Xr kfilter_register 9 .
.Pp
Functions to raise kernel event.
See
.Xr knote 9 .
.Pp
Record and wakeup select requests.
See
.Xr selrecord 9 .
.Pp
Simple do-it-in-thread-context framework.
See
.Xr workqueue 9 .
.Sh KERNEL HELPER FUNCTIONS
Kernel expression verification macros.
See
.Xr KASSERT 9 .
.Pp
Convert a single byte between (unsigned) packed bcd and binary.
See
.Xr bcdtobin 9 .
.Pp
Bitmask output conversion.
See
.Xr snprintb 3 .
.Pp
General purpose extent manager.
See
.Xr extent 9 .
.Pp
Compare integers.
See
.Xr imax 9 .
.Pp
Kernel formatted output conversion.
See
.Xr kprintf 9 .
.Pp
Data comparing, moving, copying, setting and cleaning.
See
.Xr memcmp 9 ,
.Xr memmove 9 ,
.Xr memcpy 9 ,
.Xr memset 9 ,
.Xr bcmp 9 ,
.Xr bcopy 9 ,
.Xr bzero 9 ,
.Xr kcopy 9 .
.Pp
Log a message from the kernel through the /dev/klog device.
See
.Xr log 9 .
.Pp
Bring down system on fatal error.
See
.Xr panic 9 .
.Sh MISC
Power management and inter-driver messaging.
See
.Xr pmf 9 .
.Pp
Run all shutdown hooks.
See
.Xr pmf_system_shutdown 9 .
.Pp
Kernel internal error numbers.
See
.Xr errno 9 .
.Pp
Kernel hash functions, hash table construction and destruction.
See
.Xr hash 9 ,
.Xr hashinit 9 .
.Pp
Format a number into a human readable form.
See
.Xr humanize_number 9 .
.Pp
Options string management.
See
.Xr optstr 9 .
.Pp
Performs pattern matching on strings.
See
.Xr pmatch 9 .
.Pp
Add or remove a shutdown hook.
See
.Xr pmf 9 .
.Pp
Non-local jumps.
See
.Xr setjmp 9 .
.Pp
System variable control interfaces.
See
.Xr sysctl 9 .
.Sh HISTORY
The
.Nx
kernel internals section first appeared in
.Nx 1.2 .