SlideShare a Scribd company logo
1 of 12
Architecture Porting



 © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>
                All Rights Reserved.
What to Expect?
Porting Linux for a new Architecture




        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   2
                       All Rights Reserved.
Architecture Branch
20+ architectures supported in Linux
Each typically contains
  Makefile, Kconfig
  kernel (Arch specific Kernel code)
  mm (Arch specific MM code)
  boot (for specific bootable target)
  mach-* (LSPs)
  configs (default configs)

         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   3
                        All Rights Reserved.
Porting to a New CPU
Create a similar directory structure
Do all the architecture specific implementations
for
  Kernel interfaces
  Memory Management interfaces
Create/Modify Makefile & Kconfig, as required
LSPs & configs would be added as & when the
porting for the specific board is done
Significantly challenging, if totally afresh
Typically, start from a closer reference
           © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   4
                          All Rights Reserved.
Pre-requisites & Assumptions
System RAM is already initialized
System Memory Map is already initialized
Optionally, Serial port is configured
  For early kernel boot messages
Have a closest baseline Kernel




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   5
                        All Rights Reserved.
Starting Point
Modify the Architecture specific code
  For example
    For PPC, it is under arch/ppc/platforms
    For MPC5200, the file is lite5200.c
  A typical set would include few structures & functions
  Typical Functions
    *show_cpuinfo – CPU info texts
    *map_irq – Hardware specific interrupt logic routing
    *setup_cpu – CPU specific init
    *setup_arch – Architecture specific init
    platform_init – Board-specific init


            © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   6
                           All Rights Reserved.
Recall the Startup Flow
machine_init
  Called from arch/<arch>/kernel/head*.S
  Parameter Setup / Passing before calling machine_init
    These are typically setup by the bootloader
  Called before MMU init. So, calls from it are memory restricted
  Code is in arch/<arch>/kernel/setup.c
  Calls platform_init with the parameters as is
platform_init
  Sets up Board Information Structure (BIS)
  If initrd, Start & End addresses of ramdisk image are saved
  Store the Kernel Command Line parameters
  This code should be taking care of “Early Variable Access”
              © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>     7
                             All Rights Reserved.
Early Variable Access
Kernel statically linked to well known, user
configured base address
  KERNELBASE (Typically, 0xC0000000)
Kernel is relocated to RAM (usually to 0)
After MMU is enabled, this works all fine
But before that, it should be relocatable, and
access to symbols should be fixed up
And, hence calls for a particular way of for the
early variable access
  By subtracting the offset KERNELBASE
          © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   8
                         All Rights Reserved.
Setting up BIS
Usual ways
  struct bd_info (From U-boot)
    Address in r3 on PPC
  struct bi_record (Attempt to unify)
    Found by looking for a special tag
Contains stuff like
  Command Line Arguments
  Start & End address of initrd image
  Machine Type
  Memory Info
  Optionally, many more hardware information
May or may not be used by the LSP
              © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   9
                             All Rights Reserved.
Final Steps
Other Generic Architecture specific Functions
needed, could be
  machine_restart
  machine_power_off
  machine_halt
Modify the preocessor / architecture specific C file
& header file as per
  Hardware specifications
  Schematics
  Any other relevant hardware platform data
Update the Kconfig & Makefile, as appropriate
           © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   10
                          All Rights Reserved.
What all have we learnt?
Porting Linux for a new Architecture
  In particular, for a new CPU




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   11
                        All Rights Reserved.
Any Queries?




© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   12
               All Rights Reserved.

More Related Content

What's hot (20)

Kernel Programming
Kernel ProgrammingKernel Programming
Kernel Programming
 
Embedded Software Design
Embedded Software DesignEmbedded Software Design
Embedded Software Design
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
 
Toolchain
ToolchainToolchain
Toolchain
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
 
Signals
SignalsSignals
Signals
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Cache Management
Cache ManagementCache Management
Cache Management
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
Linux DMA Engine
Linux DMA EngineLinux DMA Engine
Linux DMA Engine
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
Processes
ProcessesProcesses
Processes
 

Viewers also liked (17)

Embedded I/O Management
Embedded I/O ManagementEmbedded I/O Management
Embedded I/O Management
 
Interrupts
InterruptsInterrupts
Interrupts
 
File Systems
File SystemsFile Systems
File Systems
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Embedded Applications
Embedded ApplicationsEmbedded Applications
Embedded Applications
 
Timers
TimersTimers
Timers
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 
Embedded C
Embedded CEmbedded C
Embedded C
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
System Calls
System CallsSystem Calls
System Calls
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Threads
ThreadsThreads
Threads
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 

Similar to Architecture Porting

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docxLynellBull52
 
Preparing BitVisor for Supporting Multiple Architectures
Preparing BitVisor for Supporting Multiple ArchitecturesPreparing BitVisor for Supporting Multiple Architectures
Preparing BitVisor for Supporting Multiple ArchitecturesAke Koomsin
 
Easing the Path to Network Transformation - Network Transformation Experience...
Easing the Path to Network Transformation - Network Transformation Experience...Easing the Path to Network Transformation - Network Transformation Experience...
Easing the Path to Network Transformation - Network Transformation Experience...Liz Warner
 
Porting_uClinux_CELF2008_Griffin
Porting_uClinux_CELF2008_GriffinPorting_uClinux_CELF2008_Griffin
Porting_uClinux_CELF2008_GriffinPeter Griffin
 
Ex 1 chapter11-configure-network-tony_chen
Ex 1 chapter11-configure-network-tony_chenEx 1 chapter11-configure-network-tony_chen
Ex 1 chapter11-configure-network-tony_chenĐô GiẢn
 
CCNA Discovery 3 - Chapter 2
CCNA Discovery 3 - Chapter 2CCNA Discovery 3 - Chapter 2
CCNA Discovery 3 - Chapter 2Irsandi Hasan
 
Accelerating SDN/NFV with transparent offloading architecture
Accelerating SDN/NFV with transparent offloading architectureAccelerating SDN/NFV with transparent offloading architecture
Accelerating SDN/NFV with transparent offloading architectureOpen Networking Summits
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogicAleem Shariff
 
Developing a Windows CE OAL.ppt
Developing a Windows CE OAL.pptDeveloping a Windows CE OAL.ppt
Developing a Windows CE OAL.pptKundanSingh887495
 
Verification of the QorIQ Communication Platform Containing CoreNet Fabric wi...
Verification of the QorIQ Communication Platform Containing CoreNet Fabric wi...Verification of the QorIQ Communication Platform Containing CoreNet Fabric wi...
Verification of the QorIQ Communication Platform Containing CoreNet Fabric wi...DVClub
 
Fujitsu m10 server features and capabilities
Fujitsu m10 server features and capabilitiesFujitsu m10 server features and capabilities
Fujitsu m10 server features and capabilitiessolarisyougood
 
Oracle Solaris 11.1 New Features
Oracle Solaris 11.1 New FeaturesOracle Solaris 11.1 New Features
Oracle Solaris 11.1 New FeaturesOrgad Kimchi
 
Vortex86 Sx Linux How To
Vortex86 Sx Linux How ToVortex86 Sx Linux How To
Vortex86 Sx Linux How ToRogelio Canedo
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016Kuniyasu Suzaki
 
SESI 7 RouterTroubleshooting.pptx
SESI 7 RouterTroubleshooting.pptxSESI 7 RouterTroubleshooting.pptx
SESI 7 RouterTroubleshooting.pptxFirmanAFauzi1
 

Similar to Architecture Porting (20)

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1.docx
 
Preparing BitVisor for Supporting Multiple Architectures
Preparing BitVisor for Supporting Multiple ArchitecturesPreparing BitVisor for Supporting Multiple Architectures
Preparing BitVisor for Supporting Multiple Architectures
 
Easing the Path to Network Transformation - Network Transformation Experience...
Easing the Path to Network Transformation - Network Transformation Experience...Easing the Path to Network Transformation - Network Transformation Experience...
Easing the Path to Network Transformation - Network Transformation Experience...
 
Porting_uClinux_CELF2008_Griffin
Porting_uClinux_CELF2008_GriffinPorting_uClinux_CELF2008_Griffin
Porting_uClinux_CELF2008_Griffin
 
Ex 1 chapter11-configure-network-tony_chen
Ex 1 chapter11-configure-network-tony_chenEx 1 chapter11-configure-network-tony_chen
Ex 1 chapter11-configure-network-tony_chen
 
CCNA Discovery 3 - Chapter 2
CCNA Discovery 3 - Chapter 2CCNA Discovery 3 - Chapter 2
CCNA Discovery 3 - Chapter 2
 
CCNA Icnd110 s06l02
CCNA Icnd110 s06l02CCNA Icnd110 s06l02
CCNA Icnd110 s06l02
 
Accelerating SDN/NFV with transparent offloading architecture
Accelerating SDN/NFV with transparent offloading architectureAccelerating SDN/NFV with transparent offloading architecture
Accelerating SDN/NFV with transparent offloading architecture
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
 
Less04_Database_Instance.ppt
Less04_Database_Instance.pptLess04_Database_Instance.ppt
Less04_Database_Instance.ppt
 
Week3 1
Week3 1Week3 1
Week3 1
 
Developing a Windows CE OAL.ppt
Developing a Windows CE OAL.pptDeveloping a Windows CE OAL.ppt
Developing a Windows CE OAL.ppt
 
Verification of the QorIQ Communication Platform Containing CoreNet Fabric wi...
Verification of the QorIQ Communication Platform Containing CoreNet Fabric wi...Verification of the QorIQ Communication Platform Containing CoreNet Fabric wi...
Verification of the QorIQ Communication Platform Containing CoreNet Fabric wi...
 
Fujitsu m10 server features and capabilities
Fujitsu m10 server features and capabilitiesFujitsu m10 server features and capabilities
Fujitsu m10 server features and capabilities
 
Oracle Solaris 11.1 New Features
Oracle Solaris 11.1 New FeaturesOracle Solaris 11.1 New Features
Oracle Solaris 11.1 New Features
 
Vortex86 Sx Linux How To
Vortex86 Sx Linux How ToVortex86 Sx Linux How To
Vortex86 Sx Linux How To
 
Clear Linux OS - Architecture Overview
Clear Linux OS - Architecture OverviewClear Linux OS - Architecture Overview
Clear Linux OS - Architecture Overview
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
 
SESI 7 RouterTroubleshooting.pptx
SESI 7 RouterTroubleshooting.pptxSESI 7 RouterTroubleshooting.pptx
SESI 7 RouterTroubleshooting.pptx
 
C C N A Day2
C C N A  Day2C C N A  Day2
C C N A Day2
 

More from Anil Kumar Pugalia (12)

File System Modules
File System ModulesFile System Modules
File System Modules
 
Processes
ProcessesProcesses
Processes
 
System Calls
System CallsSystem Calls
System Calls
 
Playing with R L C Circuits
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C Circuits
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
References
ReferencesReferences
References
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
 
Power of vi
Power of viPower of vi
Power of vi
 
"make" system
"make" system"make" system
"make" system
 
Hardware Design for Software Hackers
Hardware Design for Software HackersHardware Design for Software Hackers
Hardware Design for Software Hackers
 
RPM Building
RPM BuildingRPM Building
RPM Building
 

Recently uploaded

Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 

Recently uploaded (20)

Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 

Architecture Porting

  • 1. Architecture Porting © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> All Rights Reserved.
  • 2. What to Expect? Porting Linux for a new Architecture © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2 All Rights Reserved.
  • 3. Architecture Branch 20+ architectures supported in Linux Each typically contains Makefile, Kconfig kernel (Arch specific Kernel code) mm (Arch specific MM code) boot (for specific bootable target) mach-* (LSPs) configs (default configs) © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3 All Rights Reserved.
  • 4. Porting to a New CPU Create a similar directory structure Do all the architecture specific implementations for Kernel interfaces Memory Management interfaces Create/Modify Makefile & Kconfig, as required LSPs & configs would be added as & when the porting for the specific board is done Significantly challenging, if totally afresh Typically, start from a closer reference © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4 All Rights Reserved.
  • 5. Pre-requisites & Assumptions System RAM is already initialized System Memory Map is already initialized Optionally, Serial port is configured For early kernel boot messages Have a closest baseline Kernel © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 5 All Rights Reserved.
  • 6. Starting Point Modify the Architecture specific code For example For PPC, it is under arch/ppc/platforms For MPC5200, the file is lite5200.c A typical set would include few structures & functions Typical Functions *show_cpuinfo – CPU info texts *map_irq – Hardware specific interrupt logic routing *setup_cpu – CPU specific init *setup_arch – Architecture specific init platform_init – Board-specific init © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6 All Rights Reserved.
  • 7. Recall the Startup Flow machine_init Called from arch/<arch>/kernel/head*.S Parameter Setup / Passing before calling machine_init These are typically setup by the bootloader Called before MMU init. So, calls from it are memory restricted Code is in arch/<arch>/kernel/setup.c Calls platform_init with the parameters as is platform_init Sets up Board Information Structure (BIS) If initrd, Start & End addresses of ramdisk image are saved Store the Kernel Command Line parameters This code should be taking care of “Early Variable Access” © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7 All Rights Reserved.
  • 8. Early Variable Access Kernel statically linked to well known, user configured base address KERNELBASE (Typically, 0xC0000000) Kernel is relocated to RAM (usually to 0) After MMU is enabled, this works all fine But before that, it should be relocatable, and access to symbols should be fixed up And, hence calls for a particular way of for the early variable access By subtracting the offset KERNELBASE © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8 All Rights Reserved.
  • 9. Setting up BIS Usual ways struct bd_info (From U-boot) Address in r3 on PPC struct bi_record (Attempt to unify) Found by looking for a special tag Contains stuff like Command Line Arguments Start & End address of initrd image Machine Type Memory Info Optionally, many more hardware information May or may not be used by the LSP © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9 All Rights Reserved.
  • 10. Final Steps Other Generic Architecture specific Functions needed, could be machine_restart machine_power_off machine_halt Modify the preocessor / architecture specific C file & header file as per Hardware specifications Schematics Any other relevant hardware platform data Update the Kconfig & Makefile, as appropriate © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 10 All Rights Reserved.
  • 11. What all have we learnt? Porting Linux for a new Architecture In particular, for a new CPU © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 11 All Rights Reserved.
  • 12. Any Queries? © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 12 All Rights Reserved.