Linux kernel TLV meetup, 21.09.2015 Kfir Gollan. What is hardware probing? Different approaches for detecting hardware Probing in the linux kernel.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Note: Third Party Brands and Trademarks are Property of Their Respective Owners. ACPI Overview.
OS Components and Structure
Operating System.
BIOS Data for OS Booting Outline Necessary Data for OS Booting System Information APM OS ACPI OS DOS Service Routines Conclusions.
USERSPACE I/O Reporter: R 張凱富.
The Assembly Language Level
Operating System Structure
3: OS Structures 1 OPERATING SYSTEM STRUCTURES PROCESS MANAGEMENT A process is a program in execution: (A program is passive, a process active.) A process.
File Management Systems
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
Chapter 5: Memory Management Dhamdhere: Operating Systems— A Concept-Based Approach Slide No: 1 Copyright ©2005 Memory Management Chapter 5.
1 Software Testing and Quality Assurance Lecture 31 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Operating systems.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Operating Systems Operating System
Computer Organization
Host and Application Security Lesson 4: The Win32 Boot Process.
Real-time Systems Lab, Computer Science and Engineering, ASU Linux Input Systems (ESP – Fall 2014) Computer Science & Engineering Department Arizona State.
CHAPTER Windows NT Server Installation. Chapter Objectives Give an overview of the installation process Outline the pre-installation and post- installation.
Intro to Architecture – Page 1 of 22CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: Introduction Reading: Chapter 1.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Chapter 1 : The Linux System Part 1 Lecture 1 10/21/
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 2 (Part II) Operating System Overview.
UDI Tutorial & Driver Walk-Through Part 1 Kurt Gollhardt SCO Core OS Architect
CS 346 – Chapter 2 OS services –OS user interface –System calls –System programs How to make an OS –Implementation –Structure –Virtual machines Commitment.
Computer organization Practical 1. Administrative Issues The course requirements are: –To be nice and open minded –To pass the exam (there is a boolean.
Full and Para Virtualization
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 8- 0 Lesson 8 Secondary Management.
POST and The Boot Process
Lesson 2 Component Overview Core Hardware Fundamentals.
Cloud Computing – UNIT - II. VIRTUALIZATION Virtualization Hiding the reality The mantra of smart computing is to intelligently hide the reality Binary->
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Computer Technician POST and The Boot Process ©UNT in Partnership with TEA1.
OPERATING SYSTEMS DO YOU REQUIRE AN OPERATING SYSTEM IN YOUR SYSTEM?
RealTimeSystems Lab Jong-Koo, Lim
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Operating Systems Concepts
Computer System Structures
OPERATING SYSTEM CONCEPTS AND PRACTISE
Advanced Computer Systems
Hardware and OS Design and Layout.
Interrupts and Interrupts Handling
Chapter 12: File System Implementation
Semester Review Chris Gill CSE 422S - Operating Systems Organization
The PCI bus (Peripheral Component Interconnect ) is the most commonly used peripheral bus on desktops and bigger computers. higher-level bus architectures.
KERNEL ARCHITECTURE.
Chapter 3: Windows7 Part 1.
Operation System Program 4
Chapter 2: System Structures
Mid Term review CSC345.
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
Outline Operating System Organization Operating System Examples
OPERATING SYSTEMS STRUCTURES
System calls….. C-program->POSIX call
Implementing Processes, Threads, and Resources
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

Linux kernel TLV meetup, Kfir Gollan

What is hardware probing? Different approaches for detecting hardware Probing in the linux kernel

Have you ever wondered how does the OS know what hardware components are available on a given machine? Basically, someone needs to tell the OS what is available. The process of detecting all the hardware components and pairing them up with the matching drivers in the OS is called hardware probing, or just probing for short.

Hardcode the details of the hardware into the kernel Static configuration Device trees Dynamic configuration ACPI Bus based detection PCI

Formal definition: “The Device Tree is a data structure for describing hardware. Rather than hard coding every detail of a device into an operating system, many aspect of the hardware can be described in a data structure that is passed to the operating system at boot time.” devicetree.org

Device tree source (DTS) Device tree bindings Device tree blob (DTB) Flattened Device Tree (FDT) Device tree compiler (DTC)

{ compatible = "nvidia,harmony", "nvidia,tegra20"; #address-cells = ; #size-cells = ; interrupt-parent = ; memory { device_type = "memory"; reg = ; };... };

{ …. sound { compatible = "nvidia,harmony-sound"; i2s-controller = ; i2s-codec = ; };

chosen { bootargs = "console=ttyS0, loglevel=8"; initrd-start = ; initrd-end = ; };

Xillybus Device tree tutorial Device trees for Dummies! Documentation/devicetree/ usage-model.txt booting-without-of.txt

Advanced configuration and power interface Originally created by Intel, Toshiba & Microsoft Currently maintained by the UEFI forum Current last revision of the spec was released at May 2015 (Revision 6.0) Replaces APM (Advanced Power Management) Allows the kernel/user to control power features without going into BIOS configuration It’s complex! (Revision 6.0 is 1056 pages long)

The fact that it takes more code to parse and interpret ACPI than it does to route traffic on the internet backbones should be a hint something is badly wrong either in ACPI the spec, ACPI the implementation or both. Alan Cox ACPI is a complete design disaster in every way Linus Torvalds Basically, it is just complex.

Divided to three major components ACPI registers ACPI BIOS ACPI tables AML – ACPI Machine Language Requires a full-fledged interpreter to be implemented in the kernel.

Motherboard devices are described in an hierarchical format called the ACPI namespace. ACPI definition blocks Differentiated System Description Table (DSDT) Secondary System Description Table (SSDT) The operating system is simply required to iterate over the ACPI namespace and load the proper drivers for each device that is listed there.

Device (BT) { Name (_HID, "TOS6205") Method (_STA, 0, NotSerialized) { If (BTEN) { Return (0x00) } Else { Return (0x0F) }... }

Device (BT) { … Method (DUSB, 0, NotSerialized) { Store (0x00, \_SB.PCI0.LPC0.EC0.BTDT) } … }

ACPI Component Architecture (OS)-independent reference implementation of the Advanced Configuration and Power Interface Specification (ACPI). Divided into a few major components OS services layer ACPI core subsystem device drivers

A collection of modules that implement the core logic of ACPI. AML interpreter Execution of the AML bytecode ACPI table management Validation, parsing, installation and removal Resource management Dependencies between resources IRQ routing tables Namespace management Providing simple access to the full ACPI device hierarchy Many others

Intermediate layer between the ACPI core and the rest of the system Translate syscall to a matching ACPI method Standard set of interfaces that perform OS dependenet functions Memory allocation Hardware access Threading and synchronization Needs to be implemented by each operating system that wishes to use ACPICA.

Platform devices Platform devices are devices that typically appear as autonomous entities in the system. No bus initialization and management required Directly probe the hardware – implementing.probe function struct platform_driver { int (*probe)(struct platform_device *); int (*remove)(struct platform_device *);... };

PCI devices Drivers are registered to the PCI subsystem of the kernel. When a device is detected the matching drivers probe function is invoked. struct pci_driver {... int (*probe) (struct pci_dev *dev,..); void (*remove) (struct pci_dev *dev);... };