Free Electrons. Kernel, Drivers And Embedded Linux .

2y ago
44 Views
5 Downloads
1.12 MB
47 Pages
Last View : 21d ago
Last Download : 3m ago
Upload by : Angela Sonnier
Transcription

Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com1/47

Thomas PetazzoniICTO and Embedded Linux engineer at Free ElectronsIIIIContributionsIIIEmbedded Linux development: kernel and driverdevelopment, system integration, boot time and powerconsumption optimization, consulting, etc.Embedded Linux training, Linux driver development trainingand Android system development training, with materialsfreely available under a Creative Commons license.http://free-electrons.comKernel support for the Marvell Armada ARM SoCs fromMarvellMajor contributor to Buildroot, an open-source, simple andfast embedded Linux build systemLiving in Toulouse, south west of FranceFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com2/47

AgendaIUser perspective: booting with the Device TreeIBasic Device Tree syntax and compilationISimple example of Device Tree fragmentIOverall organization of a Device TreeIExamples of Device Tree usageIGeneral considerations about the Device Tree in LinuxFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com3/47

User perspective: before the Device TreeIIThe kernel contains the entire description of the hardware.The bootloader loads a single binary, the kernel image, andexecutes it.IIuImage or zImageThe bootloader prepares some additional information, calledATAGS, which address is passed to the kernel through registerr2IContains information such as memory size and location, kernelcommand line, etc.IThe bootloader tells the kernel on which board it is beingbooted through a machine type integer, passed in register r1.IU-Boot command: bootm kernel img addr IBarebox variable: bootm.imageFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com4/47

User perspective: before the Device TreeFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com5/47

User perspective: booting with a Device TreeIIThe kernel no longer contains the description of the hardware,it is located in a separate binary: the device tree blobThe bootloader loads two binaries: the kernel image and theDTBIIKernel image remains uImage or zImageDTB located in arch/arm/boot/dts, one per boardIThe bootloader passes the DTB address through r2. It issupposed to adjust the DTB with memory information, kernelcommand line, and potentially other info.INo more machine type.IU-Boot command:boot[mz] kernel img addr - dtb addr IBarebox variables: bootm.image, bootm.oftreeFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com6/47

User perspective: booting with a Device TreeFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com7/47

User perspective: compatibility mode for DT bootingIISome bootloaders have no specific support for the DeviceTree, or the version used on a particular device is too old tohave this support.To ease the transition, a compatibility mechanism was added:CONFIG ARM APPENDED DTB.IIIt tells the kernel to look for a DTB right after the kernelimage.There is no built-in Makefile rule to produce such kernel, soone must manually do:cat arch/arm/boot/zImage arch/arm/boot/dts/myboard.dtb my-zImagemkimage . -d my-zImage my-uImageIIn addition, the additional optionCONFIG ARM ATAG DTB COMPAT tells the kernel to read theATAGS information from the bootloader, and update the DTusing them.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com8/47

What is the Device Tree ?IQuoted from the Power.org Standard for Embedded PowerArchitecture Platform Requirements (ePAPR)IIIThe ePAPR specifies a concept called a device tree to describesystem hardware. A boot program loads a device tree into aclient program’s memory and passes a pointer to the devicetree to the client.A device tree is a tree data structure with nodes that describethe physical devices in a system.An ePAPR-compliant device tree describes device informationin a system that cannot be dynamically detected by a clientprogram.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com9/47

Basic Device Tree syntaxFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com10/47

From source to binaryIOn ARM, all Device Tree Source files (DTS) are for nowlocated in arch/arm/boot/dtsIII.dts files for board-level definitions.dtsi files for included files, generally containing SoC-leveldefinitionsA tool, the Device Tree Compiler compiles the source into abinary form.ISource code located in scripts/dtcIThe Device Tree Blob is produced by the compiler, and isthe binary that gets loaded by the bootloader and parsed bythe kernel at boot time.Iarch/arm/boot/dts/Makefile lists which DTBs should begenerated at build time.dtb- (CONFIG ARCH MVEBU) armada-370-db.dtb \armada-370-mirabox.dtb \.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com11/47

Exploring the DT on the targetIIn /sys/firmware/devicetree/base, there is adirectory/file representation of the Device Tree contents# ls -l /sys/firmware/devicetree/base/total 0-r--r--r-1 rootroot4 Jan-r--r--r-1 rootroot4 Jandrwxr-xr-x2 rootroot0 Jandrwxr-xr-x3 rootroot0 Jan-r--r--r-1 rootroot34 Jan[.]-r--r--r-1 rootroot1 Jandrwxr-xr-x10 rootroot0 ize-cellschosenclockscompatible1 00:00 name1 00:00 socIf dtc is available on the target, possible to ”unpack” theDevice Tree using:dtc -I fs /sys/firmware/devicetree/baseFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com12/47

A simple example, DT sideFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com13/47

A simple example, driver side (1)The compatible string used to bind a device with the driverstatic struct of device id mxs auart dt ids[] {{.compatible "fsl,imx28-auart",.data &mxs auart devtype[IMX28 AUART]}, {.compatible "fsl,imx23-auart",.data &mxs auart devtype[IMX23 AUART]}, { /* sentinel */ }};MODULE DEVICE TABLE(of, mxs auart dt ids);[.]static struct platform driver mxs auart driver {.probe mxs auart probe,.remove mxs auart remove,.driver {.name "mxs-auart",.of match table mxs auart dt ids,},};Code from drivers/tty/serial/mxs-auart.cFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com14/47

A simple example, driver side (2)Iof match device allows to get the matching entry in themxs auart dt ids table.IUseful to get the driver-specific data field, typically used toalter the behavior of the driver depending on the variant ofthe detected device.static int mxs auart probe(struct platform device *pdev){const struct of device id *of id of match device(mxs auart dt ids, &pdev- dev);if (of id) {/* Use of id- data here */[.]}[.]}Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com15/47

A simple example, driver side (3)IIIIGetting a reference to the clockIdescribed by the clocks propertyIs- clk clk get(&pdev- dev, NULL);Getting the I/O registers resourceIdescribed by the reg propertyIr platform get resource(pdev, IORESOURCE MEM, 0);Getting the interruptIdescribed by the interrupts propertyIs- irq platform get irq(pdev, 0);Get a DMA channelIdescribed by the dmas propertyIs- rx dma chan dma request slave channel(s- dev, "rx");s- tx dma chan dma request slave channel(s- dev, "tx");IICheck some custom propertyIstruct device node *np pdev- dev.of node;Iif (of get property(np, "fsl,uart-has-rtscts", NULL))Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com16/47

Device Tree inclusionIDevice Tree files are not monolithic, they can be split inseveral files, including each other.I.dtsi files are included files, while .dts files are final DeviceTreesITypically, .dtsi will contain definition of SoC-levelinformation (or sometimes definitions common to severalalmost identical boards).IThe .dts file contains the board-level information.IThe inclusion works by overlaying the tree of the includingfile over the tree of the included file.IInclusion using the DT operator /include/, or since a fewkernel releases, the DTS go through the C preprocessor, so#include is recommended.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com17/47

Device Tree inclusion exampleFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com18/47

Device Tree inclusion example (2)Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com19/47

Concept of Device Tree bindingIQuoting the ePAPR:IIIThis chapter contains requirements, known as bindings, forhow specific types and classes of devices are representedin the device tree.The compatible property of a device node describes thespecific binding (or bindings) to which the node complies.When creating a new device tree representation for a device, abinding should be created that fully describes therequired properties and value of the device. This set ofproperties shall be sufficiently descriptive to provide devicedrivers with needed attributes of the device.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com20/47

Documentation of Device Tree bindingsIAll Device Tree bindings recognized by the kernel aredocumented in Documentation/devicetree/bindings.IEach binding documentation described which properties areaccepted, with which values, which properties are mandatoryvs. optional, etc.IAll new Device Tree bindings must be reviewed by the DeviceTree maintainers, by being posted todevicetree@vger.kernel.org. This ensures correctnessand consistency across bindings.OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGSM:Rob Herring rob.herring@calxeda.com M:Pawel Moll pawel.moll@arm.com M:Mark Rutland mark.rutland@arm.com M:Stephen Warren swarren@wwwdotorg.org M:Ian Campbell ijc devicetree@hellion.org.uk L:devicetree@vger.kernel.orgFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com21/47

Device Tree binding documentation example* Freescale MXS Application UART (AUART)Required properties:- compatible : Should be "fsl, soc -auart". The supported SoCs includeimx23 and imx28.- reg : Address and length of the register set for the device- interrupts : Should contain the auart interrupt numbers- dmas: DMA specifier, consisting of a phandle to DMA controller nodeand AUART DMA channel ID.Refer to dma.txt and fsl-mxs-dma.txt for details.- dma-names: "rx" for RX channel, "tx" for TX channel.Example:auart0: serial@8006a000 {compatible "fsl,imx28-auart", "fsl,imx23-auart";reg 0x8006a000 0x2000 ;interrupts 112 ;dmas &dma apbx 8 , &dma apbx 9 ;dma-names "rx", "tx";};Note: Each auart port should have an alias correctly numbered in bindings/tty/serial/fsl-mxs-auart.txtFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com22/47

Device Tree organization: top-level nodesUnder the root of the Device Tree, one typically finds the followingtop-level nodes:IA cpus node, which sub-nodes describing each CPU in thesystem.IA memory node, which defines the location and size of theRAM.IA chosen node, which defines parameters chosen or definedby the system firmware at boot time. In practice, one of itsusage is to pass the kernel command line.IA aliases node, to define shortcuts to certain nodes.IOne or more nodes defining the buses in the SoC.IOne or mode nodes defining on-board devices.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com23/47

Device Tree organization: imx28.dtsiarch/arm/boot/dts/imx28.dtsi/ {aliases { . };cpus { . };apb@80000000 {apbh@80000000 {/* Some devices */};apbx@80040000 {/* Some devices */};};ahb@80080000 {/* Some devices */};};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com24/47

i.MX28 buses organizationFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com25/47

Device Tree organization: imx28-evk.dtsarch/arm/boot/dts/imx28-evk.dts/ {model "Freescale i.MX28 Evaluation Kit";compatible "fsl,imx28-evk", "fsl,imx28";memory {reg 0x40000000 0x08000000 ;};apb@80000000 {apbh@80000000 { . };apbx@80040000 { . };};ahb@80080000 { . };sound { . };leds { . };backlight { . };};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com26/47

Top-level compatible propertyIIIThe top-level compatible property typically defines acompatible string for the board, and then for the SoC.Values always given with the most-specific first, toleast-specific last.Used to match with the dt compat field of the DT MACHINEstructure:static const char *mxs dt compat[] initdata {"fsl,imx28","fsl,imx23",NULL,};DT MACHINE START(MXS, "Freescale MXS (Device Tree)").dt compat mxs dt compat,[.]MACHINE ENDICan also be used within code to test the machine:if (of machine is compatible("fsl,imx28-evk"))imx28 evk init();Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com27/47

Bus, address cells and size cellsInside a bus, one typically needs to define the following properties:IA compatible property, which identifies the bus controller (incase of I2C, SPI, PCI, etc.). A special valuecompatible "simple-bus" means a simplememory-mapped bus with no specific handling or driver. Childnodes will be registered as platform devices.IThe #address-cells property indicate how many cells (i.e32 bits values) are needed to form the base address part in thereg property.IThe #size-cells is the same, for the size part of the regproperty.IThe ranges property can describe an address translationbetween the child bus and the parent bus. When simplydefined as ranges;, it means that the translation is anidentity translation.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com28/47

simple-bus, address cells and size cellsapbh@80000000 {compatible "simple-bus";#address-cells 1 ;#size-cells 1 ;reg 0x80000000 0x3c900 ;ranges;[.]hsadc: hsadc@80002000 {reg 0x80002000 0x2000 ;interrupts 13 ;dmas &dma apbh 12 ;dma-names "rx";status "disabled";};[.]};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com29/47

I2C bus, address cells and size cellsi2c0: i2c@80058000 {#address-cells 1 ;#size-cells 0 ;compatible "fsl,imx28-i2c";reg 0x80058000 0x2000 ;interrupts 111 ;[.]sgtl5000: codec@0a {compatible "fsl,sgtl5000";reg 0x0a ;VDDA-supply ® 3p3v ;VDDIO-supply ® 3p3v ;clocks &saif0 ;};at24@51 {compatible "at24,24c32";pagesize 32 ;reg 0x51 ;};};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com30/47

Interrupt handlingIinterrupt-controller; is a boolean property thatindicates that the current node is an interrupt controller.I#interrupt-cells indicates the number of cells in theinterrupts property for the interrupts managed by theselected interrupt controller.Iinterrupt-parent is a phandle that points to the interruptcontroller for the current node. There is generally a top-levelinterrupt-parent definition for the main interruptcontroller.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com31/47

Interrupt example: imx28.dtsi/ {interrupt-parent &icoll ;apb@80000000 {apbh@80000000 {icoll: interrupt-controller@80000000 {compatible "fsl,imx28-icoll", "fsl,icoll";interrupt-controller;#interrupt-cells 1 ;reg 0x80000000 0x2000 ;};ssp0: ssp@80010000 {[.]interrupts 96 ;};};};};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com32/47

A more complicated example on Tegra 20Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com33/47

Interrupt example: tegra20.dtsi/ {interrupt-parent &intc ;intc: interrupt-controller {compatible "arm,cortex-a9-gic";reg 0x50041000 0x1000 0x50040100 0x0100 ;interrupt-controller;#interrupt-cells 3 ;};i2c@7000c000 {compatible "nvidia,tegra20-i2c";reg 0x7000c000 0x100 ;interrupts GIC SPI 38 IRQ TYPE LEVEL HIGH ;#address-cells 1 ;#size-cells 0 ;[.]};gpio: gpio {compatible "nvidia,tegra20-gpio";reg 0x6000d000 0x1000 ;interrupts GIC SPI 32 IRQ TYPE LEVEL HIGH , GIC SPI 33 IRQ TYPE LEVEL HIGH ,[.], GIC SPI 89 IRQ TYPE LEVEL HIGH ;#gpio-cells 2 ;gpio-controller;#interrupt-cells 2 ;interrupt-controller;};};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com34/47

Interrupt example: tegra20-harmony.dtsi2c@7000c000 {status "okay";clock-frequency 400000 ;wm8903: wm8903@1a {compatible "wlf,wm8903";reg 0x1a ;interrupt-parent &gpio ;interrupts TEGRA GPIO(X, 3) IRQ TYPE LEVEL HIGH ;gpio-controller;#gpio-cells 2 ;micdet-cfg 0 ;micdet-delay 100 ;gpio-cfg 0xffffffff 0xffffffff 0 0xffffffff 0xffffffff ;};};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com35/47

DT is hardware description, not configurationIThe Device Tree is really a hardware description language.IIt should describe the hardware layout, and how it works.IBut it should not describe which particular hardwareconfiguration you’re interested in.As an example:IIIYou may describe in the DT whether a particular piece ofhardware supports DMA or not.But you may not describe in the DT if you want to use DMAor not.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com36/47

DT bindings as an ABIIIIIISince the DT is OS independent, it should also be stable.The original idea is that DTBs can be flashed on some devicesby the manufacturer, so that the user can install whicheveroperating system it wants.Once a Device Tree binding is defined, and used in DTBs, itshould no longer be changed anymore. It can only beextended.This normally means that Device Tree bindings becomepart of the kernel ABI, and it should be handled with thesame care.However, kernel developers are realizing that this is really hardto achieve and slowing down the integration of drivers.IIThe ARM Kernel Mini-summit discussions have relaxed thoserules.There will be additional discussions during the Kernel Summit,with final conclusions published afterwards.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com37/47

Basic guidelines for binding designIA precise compatible string is better than a vague oneIIIYou have a driver that covers both variants T320 and T330 ofyour hardware. You may be tempted to use foo,t3xx as yourcompatible string.Bad idea: what if T340 is slightly different, in an incompatibleway? You’d better use foo,t320 for both T320 and T330.Do not encode too much hardware details in the DTIIWhen two hardware variants are quite similar, some developersare tempted to encode all the differences in the DT, includingregister offsets, bit masks or offsets.Bad idea: it makes the binding more complex, and thereforeless resilient to future changes. Instead, use two differentcompatible strings and handle the differences in the driver.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com38/47

Future directionsIIMore DT bindings for various subsystemsA tool to validate DTS against bindingsIIIICurrently, the DT compiler only makes syntax checks, noconformance checks against bindings.Proposal from Benoit Cousson and Fabien Parent,[RFC 00/15] Device Tree schemas and validationTalk from Tomasz Figa at this ELC.Take out the Device Tree source files from the kerneltreeIIIDTs are OS independent, so they can be used for otherpurposes than just Linux. They are already used by Barebox orU-Boot.Having them outside of the kernel reduces the amount ofchurn in the kernel source.But is IMO likely to cause a huge number of compatibilityissues.Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com39/47

ReferencesIPower.orgTM Standard for Embedded Power ArchitecturePlatform Requirements (ePAPR), http://www.power.org/resources/downloads/Power ePAPR APPROVED v1.0.pdfIDeviceTree.org website, http://www.devicetree.orgIDevice Tree documentation in the kernel sources,Documentation/devicetreeIThe Device Tree kernel mailing list, eFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com40/47

Questions?Thomas Petazzonithomas.petazzoni@free-electrons.comSlides under CC-BY-SA elc/petazzoni-devicetree-dummies/Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com41/47

Backup slidesFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com42/47

Clock tree example, Marvell Armada XPFree Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com43/47

Clock examples: instantiating clockssoc {coreclk: mvebu-sar@18230 {compatible "marvell,armada-xp-core-clock";reg 0x18230 0x08 ;#clock-cells 1 ;};cpuclk: clock-complex@18700 {#clock-cells 1 ;compatible "marvell,armada-xp-cpu-clock";reg 0x18700 0xA0 ;clocks &coreclk 1 ;};gateclk: clock-gating-control@18220 {compatible "marvell,armada-xp-gating-clock";reg 0x18220 0x4 ;clocks &coreclk 0 ;#clock-cells 1 ;};}clocks {/* 25 MHz reference crystal */refclk: oscillator {compatible "fixed-clock";#clock-cells 0 ;clock-frequency 25000000 ;};};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com44/47

Clock examples: consuming clocksCPU, using a cpuclkcpu@0 {device type "cpu";compatible "marvell,sheeva-v7";reg 0 ;clocks &cpuclk 0 ;};Timer, using either a coreclk or refclktimer@20300 {compatible "marvell,armada-xp-timer";clocks &coreclk 2 , &refclk ;clock-names "nbclk", "fixed";};USB, using a gateclkusb@52000 {compatible "marvell,orion-ehci";reg 0x52000 0x500 ;interrupts 47 ;clocks &gateclk 20 ;status "disabled";};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com45/47

pinctrl binding: consumer sideIThe pinctrl subsystem allows to manage pin muxing.IIn the Device Tree, devices that need pins to be muxed in acertain way must declare the pinctrl configuration they need.IThe pinctrl- n properties allow to give the list of pinctrlconfiguration needed for a certain state of the device.IThe pinctrl-names property allows to give a name to eachstate.IWhen a device is probed, its default pinctrl state isrequested automatically.ssp0: ssp@80010000 {pinctrl-names "default";pinctrl-0 &mmc0 8bit pins a&mmc0 cd cfg &mmc0 sck cfg ;[.]};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com46/47

pinctrl configurationsIA pinctrl configuration provides a list of pins and theirconfiguration.ISuch configurations are defined as sub-nodes of the pinctrldevice, either at the SoC-level, or board-level.IThe binding for such configurations is highly dependent onthe specific pinctrl driver being used.i.MX28mmc0 8bit pins a: mmc0-8bit@0 {fsl,pinmux-ids 0x2000 /* MX28 PAD SSP0 DATA0 SSP0 D0 */0x2010 /* MX28 PAD SSP0 DATA1 SSP0 D1 */[.]0x2090 /* MX28 PAD SSP0 DETECT SSP0 . */0x20a0 /* MX28 PAD SSP0 SCK SSP0 SCK */ ;fsl,drive-strength 1 ;fsl,voltage 1 ;fsl,pull-up 1 ;};Marvell Kirkwoodpmx nand: pmx-nand {marvell,pins "mpp0", "mpp1", "mpp2", "mpp3","mpp4", "mpp5", "mpp18","mpp19";marvell,function "nand";};Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com47/47

Thomas Petazzoni I CTO and Embedded Linux engineer at Free Electrons I Embedded Linux development: kernel and driver development, system integration, boot time and power consumption optimization, consulting, etc. I Embedded Linux training, Linux driver development training and Android system development training, with materialsFile Size: 1MB

Related Documents:

Anatomy of a linux kernel development Questions : – How to work kernel code? – How to write C code on the kernel? – How to building and install the kernel on old version linux? – How to release the linux kernel? – How to fixes bugs (patch) on kernel trees? Goal : –

User perspective: before the Device Tree I The kernel contains the entire description of the hardware. I The bootloader loads a single binary, the kernel image, and executes it. I uImage or zImage I The bootloader prepares some additional information, called ATAGS, which address is passed to the kernel through register r2 I Contains information such as memory size and location, kernel

n Linux is a modular, UNIX -like monolithic kernel. n Kernel is the heart of the OS that executes with special hardware permission (kernel mode). n "Core kernel" provides framework, data structures, support for drivers, modules, subsystems. n Architecture dependent source sub -trees live in /arch. CS591 (Spring 2001) Booting and Kernel .

Kernel Boot Command-Line Parameter Reference The majority of this chapter is based on the in-kernel documentation for the ichwerewrittenbythe kernel developers and released under the GPL. There are three ways to pass options to the kernel and thus control its behavior: When building the kernel.

What if Linux Kernel Panics Kexec: system call to load and boot into another kernel from the currently running kernel (4.9.74). crashkernel 128M [normal kernel cmdline] irqpoll, nosmp, reset_devices [crash kernel cmdline] --load-panic option Kdump: Linux mechanism to dump machine memory content on kernel panic.

Valence electrons are free to move between atoms forming a "glue of electrons holding the atoms together 1. Valence electrons are weakly held 2. Forms when the number of electrons that must be shared to form a noble-gas configuration is large (e.g., Na needs 7 electrons) 3. Availability of vacant energy levels where valence electrons can .

examples: 1s2 2s2 2p5 means "2 electrons in the 1s subshell, 2 electrons in the 2s subshell, and 5 electrons in the 2p subshell" 1s2 2s2 2p6 3s2 3p3 is an electron configuration with 15 electrons total; 2 electrons have n

1. Atoms gain, lose, or share electrons. 2. in energy levels outside the nucleus 3. in the outermost energy level 4. six protons, six electrons 5. two 6. six 7. to get a full outermost energy level 8. lose Review 1. Atoms bond by losing electrons to other atoms, gaining electrons from other atoms, or sharing electrons with other atoms.