SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
NetBSD and Linux for Embedded Systems




Mahendra M
Mahendra_M@infosys.com
http://www.infosys.com


This work is licensed under a Creative Commons License
http://creativecommons.org/licenses/by-sa/2.5/
About the talk

   This talk is NOT about to compare NetBSD and Linux and
    find out which is better.
    –   We shall compare – but not criticize !!
   We shall try to understand both systems in their own merit
   It is about sharing our experiences with both the systems –
    more from a embedded & telecom OS perspective.
   We hope to help you choose.
Agenda
   A short introduction to NetBSD and Linux based systems
   Suitability for embedded systems
   Introduction to the features available in NB and Linux
    –   Specifically for Embedded Systems
   Feature wise comparison of the two kernels
    –   Core architecture, Threading model, Real time capabilities,
        modularity, performance, ease of deployment, portability
   Linux capabilities.
   NetBSD Capabilities
    –   Kqueue : Event notification framework
   Availability of Code for future needs
   Feasibility and time to market along with License issues.
About the Systems
   Linux
    –   Refers only to the kernel
    –   Distributions are built around it. ( distros available for
        embedded systems )
    –   Has a history of around 15 years
    –   Is under the GPL license ( v2.0 ) and supports binary modules.
   NetBSD
    –   A BSD “ distribution” targeted at portability.
    –   Includes a kernel, libraries, config tools, scripts and build
        systems.
    –   Targeted at portability
    –   The BSD systems have had a history of around 25 years.
    –   Is under a BSD license.
Common stuff ...
   Highly portable – ports exist for a large number of
    architectures and reference boards.
   Both are POSIX compliant
   Good VM, Networking, Threading subsystems
   Both have been time tested in the market
   Active development happening
    –   Directly on Linux kernel – on multiple trees maintained by
        different people.
    –   NetBSD tend to let features stabilize on FreeBSD/OpenBSD
        and then pick it up :-)
   Let us get on with the differences....
Memory foot print
   Linux is slowly getting bloated.
    –   There are projects that are working on reducing the size of
        Linux kernel
    –   “ Linux Tiny” project provides a set of patches that can be
         applied to the Linux kernel to reduce the kernel size (built
         image and run time memory requirements)
   NetBSD projects boast of reduced kernel size.
    –   TINY configuration file is distributed along with the source.
   Both kernels can be easily reduced to a size of less than
    1MB ( uncompressed : ~900k, compressed : ~400k )
   With sufficient hacking around, it can be reduced even
    further.
Process Scheduling
   Both OS follow a similar model in running user space
    processes.
    –   Time slice based – and O(1) in nature.
    –   They have priority based levels and processes are placed on
        these levels based on their priority
    –   Both support dynamic priority modification based on
        interactiveness of a process
            Not needed for embedded systems – and can be turned off at
             compile time.
    –   Both support the same user space priorities (40)
   Linux has two run-queues : An active and an expired run-
    queue.
   Linux also has a run-queue per CPU – for SMP boxes.
Process Run-queue


RunQueue
                     Doubly linked lists of tasks
           Active
                     Task 1   Task 2   ...      Task N   [Priority:   1]

                                                              ...
                     Task 1   Task 2   Task M            [Priority:140]

           Expired
                              ...

                      ...
           Migration Thread
                                             From kernel/sched.c
Other stuff ...
   Kernel pre-emption.
    –   Linux kernel supports kernel pre-emption, but only at pre-
        emptible points inside in the kernel.
    –   There are still areas within the kernel which cannot be pre-
        empted.
    –   NetBSD does not support kernel pre-emption.
            Hence real-time support is pretty poor on NetBSD systems
   SMP Support ( not really critical in embedded systems )
    –   Very good in Linux.
    –   Worked upon in NetBSD.
Real-time performance
   Hard real-time performance
    –   Not available in both kernels by default.
    –   FSM labs provides patches to the Linux kernel ( under GPL )
        and commercial patches to NetBSD.
            Works by running Linux/NetBSD kernel as low priority tasks
             under a real time kernel.
   Soft real-time performance.
    –   Linux is pretty good in providing soft real time facilities.
    –   In addition to the 40 user land priorities, Linux provides an
        additional 100 real-time priorities
    –   Linux supports two soft real time scheduling options
            SCHED_FIFO – First in first out
            SCHED_RR – Round robin
    –   Real time tasks cannot be pre-empted.
Threading models
   Both kernels are thread aware and are POSIX compliant
   They support different threading models
    –   This is where the difference starts and things get interesting..
   Linux
    –   Supports 1:1 model of threading ( NPTL )
    –   The kernel does not distinguish between threads and
        processes
            A process is a group of thread ids – thats it.
    –   All threads in a process are visible as tasks to the kernel and
        active threads are allocated time-slices for scheduling.
            All active threads will get their time-slices
    –   Can set real time priorities to tasks.
    –   APIs are available for real time threads handling
Threading models ( contd .. )
   NetBSD
    –   Treats threads (lwp) and processes differently
    –   Supports Scheduler Activations.
            m:n model of threading
    –   Not all threads are visible to the kernel scheduler. User space
        code takes part in telling the kernel which thread to schedule.
    –   The threads in a process have co-operative scheduling.
            A thread can keep running for most of the time – careful
             programing required.
   Both groups had debated the models before taking up their
    approaches. Both methods are “ claimed” to be better than
    the other.
   Today, Linux seems to have better thread/process creation,
    spawning and context switching times.
Debugging support
   NetBSD has much better debugging support.
    –   DDB – an in-kernel debugger
    –   Supports kernel crash dumps
    –   Supports KGDB (source level debug) – remote debugging.
   Linux
    –   Patches available for crash dumps and KDB & KGDB (not
        available for all architectures)
    –   Linux Trace Toolkit, UML etc. are also available methods.
    –   Has “ Kernel Hacking” Option in kernel configuration
            Allows debugging using “ Magic SysRQs” , Debugging of actions
             like memory allocations, file systems, highmem, stack overflows,
             page allocations etc.
            Also allows stats collection for some modules.
    –   Also, early printk() support is pretty recent.
Flash Devices and File Systems
   Support is poor in NetBSD
   Linux supports
    –   Advanced MTD support ( device concatenation, FTL, NFTL )
    –   JFFS2 ( JFFS3 is being worked on )
    –   RAM file systems and ramdisk support
    –   Supports initrd
   In NetBSD
    –   OpenSource implementations of the above are not available.
        ( Commercial products are available )
    –   Results in considerable lead time in development.
    –   Supports MFS ( not memory efficient ) : tmpfs is being worked
        upon
    –   For boot time, it allows embedding a file-system into the kernel
KQueue : Event notification mechanism
   NetBSD supports a generic event notification framework –
    kqueues.
   Excellent replacement for select() / poll() APIs.
    –   No need to pass entire descriptor set to each call.
    –   On return, applications need not check all file descriptors for
        updates.
    –   Reduces data copying ( fd list from kernel to user space and
        vice-versa )
   Can handle multiple types of events.
    –   Signals, Vnode/Process monitoring, Timer events etc.
   Can club multiple occurrences of an event into a single event
   New event types can be easily added.
   All with just two system calls !!
Build systems and configuration
   NetBSD is better
    –   The entire system : kernel, compilers and tools, libraries and
        applications can be compiled ( native or cross platform ) using
        a single script – build.sh
    –   The same script can build distributions, tarballs, archives and
        can also update existing systems and install fresh systems.
    –   Adding new components to the build framework is extremely
        easy.
   Linux – Such systems exist but it is not as flexible as BSD
   Both NetBSD and Linux provide different configuration
    mechanisms.
    –   NetBSD builds a device tree format.
    –   Linux provides a GUI interface for configuring the kernel...
Other differences.
   Linux kernel code throws out lot of warnings during
    compilation. NetBSD is very clean in this aspect.
   Linux supports MMU Less operations.
   Loadable kernel modules
    –   Better supported in Linux.
   Better device support in Linux
   With 2.6 kernel, the device driver model has vastly improved
    ( attend other talks at FOSS.in for more details )
   Portability has been a design goal for NetBSD.
   Development models are vastly different :-)
    –   NetBSD is more “ cathedral” like !!
   In Linux, you get answers easily :-)
Business related
   License (violation) is a serious cause of concern
    –   BSD License is very liberal
    –   One of the main reasons why telecom companies go for BSD
        – eg: Juniper ( JUNOS )
   Protocol stacks and third party code
    –   Are available usually for most BSDs and Linux.
    –   To be more portable, they tend to ignore benefits of one OS
   New device support
    –   Vendors of new devices like Network Processors, etc. release
        code only/mainly for Linux ( kernel modules etc. ).
    –   Extra effort is required in such cases to port things to NetBSD.
   In case of Linux, extra time is required in selecting and
    integrating components of the system.
Links
   http://linux-bangalore.org/blug/meetings/200401/scheduler-2.6.pdf
   http://www.netbsd.org/ - One site for all NetBSD stuff
   http://people.freebsd.org/~jlemon/papers/kqueue.pdf       - Kqueue design
   http://camars.kaist.ac.kr/courses/530/97/Readings/scheduler-act.pdf - SA design
   http://josh.trancesoftware.com/linux/ - Details of Linux 2.6 scheduler
   http://www.wasabisystems.com/gpl/linux.htm - A comparison
   http://bulk.fefe.de/scalability/   - Started a Battle and cleanup !!
   http://lkcd.sourceforge.net/
   http://kgdb.sf.net/
   http://oss.sgi.com/projects/kdb/
   http://www.linuxjournal.com/article/3829 - Using Linux Trace Toolkit
   http://www.opersys.com/LTT
   http://netbsd-soc.sourceforge.net/projects/tmpfs/ - TMPFS project page
   http://www.selenic.com/linux-tiny      - Linux Tiny home page
Finally ...
   Questions ??
   Thanks to
    –   Organizers for giving me a chance to speak at FOSS.in
    –   NetBSD and Linux developers who helped me during my work
    –   Linux kernel team for doing a wonderful job !!
   Special thanks to YOU for listening...


                       You can contact me at :
                    Mahendra_M@infosys.com

Weitere ähnliche Inhalte

Andere mochten auch

Emotion Economy: Ethnography as Corporate Strategy (Kelly Goto at Enterprise ...
Emotion Economy: Ethnography as Corporate Strategy (Kelly Goto at Enterprise ...Emotion Economy: Ethnography as Corporate Strategy (Kelly Goto at Enterprise ...
Emotion Economy: Ethnography as Corporate Strategy (Kelly Goto at Enterprise ...Rosenfeld Media
 
Embedded Linux Evolution | Turing Techtalk
Embedded Linux Evolution | Turing TechtalkEmbedded Linux Evolution | Turing Techtalk
Embedded Linux Evolution | Turing TechtalkPersistent Systems Ltd.
 
Yocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration InitiativeYocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration InitiativeMarcelo Sanz
 
PyCon India 2012: Celery Talk
PyCon India 2012: Celery TalkPyCon India 2012: Celery Talk
PyCon India 2012: Celery TalkPiyush Kumar
 
Embedded Os [Linux & Co.]
Embedded Os [Linux & Co.]Embedded Os [Linux & Co.]
Embedded Os [Linux & Co.]Ionela
 
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !Piyush Kumar
 
"In love with Open Source : Past, Present and Future" : Keynote OSDConf 2014
"In love with Open Source : Past, Present and Future" : Keynote OSDConf 2014"In love with Open Source : Past, Present and Future" : Keynote OSDConf 2014
"In love with Open Source : Past, Present and Future" : Keynote OSDConf 2014Piyush Kumar
 
A Market Update on Embedded/Real-Time Operating Systems
A Market Update on Embedded/Real-Time Operating SystemsA Market Update on Embedded/Real-Time Operating Systems
A Market Update on Embedded/Real-Time Operating SystemsVDC Research Group
 
Filippa K - Goto Market Strategy 2016
Filippa K - Goto Market Strategy 2016Filippa K - Goto Market Strategy 2016
Filippa K - Goto Market Strategy 2016Thassilo Nowacka
 
Radisys_Wind River_C-RAN Webinar_June 26_14
Radisys_Wind River_C-RAN Webinar_June 26_14Radisys_Wind River_C-RAN Webinar_June 26_14
Radisys_Wind River_C-RAN Webinar_June 26_14Radisys Corporation
 
An Introduction to Celery
An Introduction to CeleryAn Introduction to Celery
An Introduction to CeleryIdan Gazit
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded SystemsAnil Kumar Pugalia
 

Andere mochten auch (14)

Emotion Economy: Ethnography as Corporate Strategy (Kelly Goto at Enterprise ...
Emotion Economy: Ethnography as Corporate Strategy (Kelly Goto at Enterprise ...Emotion Economy: Ethnography as Corporate Strategy (Kelly Goto at Enterprise ...
Emotion Economy: Ethnography as Corporate Strategy (Kelly Goto at Enterprise ...
 
Embedded Linux Evolution | Turing Techtalk
Embedded Linux Evolution | Turing TechtalkEmbedded Linux Evolution | Turing Techtalk
Embedded Linux Evolution | Turing Techtalk
 
Yocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration InitiativeYocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration Initiative
 
PyCon India 2012: Celery Talk
PyCon India 2012: Celery TalkPyCon India 2012: Celery Talk
PyCon India 2012: Celery Talk
 
Embedded Os [Linux & Co.]
Embedded Os [Linux & Co.]Embedded Os [Linux & Co.]
Embedded Os [Linux & Co.]
 
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
 
"In love with Open Source : Past, Present and Future" : Keynote OSDConf 2014
"In love with Open Source : Past, Present and Future" : Keynote OSDConf 2014"In love with Open Source : Past, Present and Future" : Keynote OSDConf 2014
"In love with Open Source : Past, Present and Future" : Keynote OSDConf 2014
 
A Market Update on Embedded/Real-Time Operating Systems
A Market Update on Embedded/Real-Time Operating SystemsA Market Update on Embedded/Real-Time Operating Systems
A Market Update on Embedded/Real-Time Operating Systems
 
Filippa K - Goto Market Strategy 2016
Filippa K - Goto Market Strategy 2016Filippa K - Goto Market Strategy 2016
Filippa K - Goto Market Strategy 2016
 
Iot survey
Iot surveyIot survey
Iot survey
 
Radisys_Wind River_C-RAN Webinar_June 26_14
Radisys_Wind River_C-RAN Webinar_June 26_14Radisys_Wind River_C-RAN Webinar_June 26_14
Radisys_Wind River_C-RAN Webinar_June 26_14
 
An Introduction to Celery
An Introduction to CeleryAn Introduction to Celery
An Introduction to Celery
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
Toolchain
ToolchainToolchain
Toolchain
 

Ähnlich wie NetBSD and Linux for Embedded Systems: A Feature-Wise Comparison

Introduction to NetBSD kernel
Introduction to NetBSD kernelIntroduction to NetBSD kernel
Introduction to NetBSD kernelMahendra M
 
introduction.pdf
introduction.pdfintroduction.pdf
introduction.pdfxiso
 
Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302Boden Russell
 
Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Vivian Vhaves
 
Lightweight Virtualization in Linux
Lightweight Virtualization in LinuxLightweight Virtualization in Linux
Lightweight Virtualization in LinuxSadegh Dorri N.
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and outputSanidhya Chugh
 
Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)Boden Russell
 
Virtual Distro Dispatcher - A costless distributed virtual environment from T...
Virtual Distro Dispatcher - A costless distributed virtual environment from T...Virtual Distro Dispatcher - A costless distributed virtual environment from T...
Virtual Distro Dispatcher - A costless distributed virtual environment from T...Flavio Bertini
 
multi-threading
multi-threadingmulti-threading
multi-threadingEzzat Gul
 
Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systemsVandana Salve
 
Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012EneaSoftware
 
Running Applications on the NetBSD Rump Kernel by Justin Cormack
Running Applications on the NetBSD Rump Kernel by Justin Cormack Running Applications on the NetBSD Rump Kernel by Justin Cormack
Running Applications on the NetBSD Rump Kernel by Justin Cormack eurobsdcon
 

Ähnlich wie NetBSD and Linux for Embedded Systems: A Feature-Wise Comparison (20)

Introduction to NetBSD kernel
Introduction to NetBSD kernelIntroduction to NetBSD kernel
Introduction to NetBSD kernel
 
introduction.pdf
introduction.pdfintroduction.pdf
introduction.pdf
 
Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302Linux Container Brief for IEEE WG P2302
Linux Container Brief for IEEE WG P2302
 
Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Lightweight Virtualization in Linux
Lightweight Virtualization in LinuxLightweight Virtualization in Linux
Lightweight Virtualization in Linux
 
ubantu ppt.pptx
ubantu ppt.pptxubantu ppt.pptx
ubantu ppt.pptx
 
Ubuntu OS Presentation
Ubuntu OS PresentationUbuntu OS Presentation
Ubuntu OS Presentation
 
First steps on CentOs7
First steps on CentOs7First steps on CentOs7
First steps on CentOs7
 
The Linux System
The Linux SystemThe Linux System
The Linux System
 
Chapter 6 os
Chapter 6 osChapter 6 os
Chapter 6 os
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and output
 
Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)
 
Virtual Distro Dispatcher - A costless distributed virtual environment from T...
Virtual Distro Dispatcher - A costless distributed virtual environment from T...Virtual Distro Dispatcher - A costless distributed virtual environment from T...
Virtual Distro Dispatcher - A costless distributed virtual environment from T...
 
multi-threading
multi-threadingmulti-threading
multi-threading
 
Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systems
 
Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012
 
Running Applications on the NetBSD Rump Kernel by Justin Cormack
Running Applications on the NetBSD Rump Kernel by Justin Cormack Running Applications on the NetBSD Rump Kernel by Justin Cormack
Running Applications on the NetBSD Rump Kernel by Justin Cormack
 
.ppt
.ppt.ppt
.ppt
 

Kürzlich hochgeladen

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Kürzlich hochgeladen (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

NetBSD and Linux for Embedded Systems: A Feature-Wise Comparison

  • 1. NetBSD and Linux for Embedded Systems Mahendra M Mahendra_M@infosys.com http://www.infosys.com This work is licensed under a Creative Commons License http://creativecommons.org/licenses/by-sa/2.5/
  • 2. About the talk  This talk is NOT about to compare NetBSD and Linux and find out which is better. – We shall compare – but not criticize !!  We shall try to understand both systems in their own merit  It is about sharing our experiences with both the systems – more from a embedded & telecom OS perspective.  We hope to help you choose.
  • 3. Agenda  A short introduction to NetBSD and Linux based systems  Suitability for embedded systems  Introduction to the features available in NB and Linux – Specifically for Embedded Systems  Feature wise comparison of the two kernels – Core architecture, Threading model, Real time capabilities, modularity, performance, ease of deployment, portability  Linux capabilities.  NetBSD Capabilities – Kqueue : Event notification framework  Availability of Code for future needs  Feasibility and time to market along with License issues.
  • 4. About the Systems  Linux – Refers only to the kernel – Distributions are built around it. ( distros available for embedded systems ) – Has a history of around 15 years – Is under the GPL license ( v2.0 ) and supports binary modules.  NetBSD – A BSD “ distribution” targeted at portability. – Includes a kernel, libraries, config tools, scripts and build systems. – Targeted at portability – The BSD systems have had a history of around 25 years. – Is under a BSD license.
  • 5. Common stuff ...  Highly portable – ports exist for a large number of architectures and reference boards.  Both are POSIX compliant  Good VM, Networking, Threading subsystems  Both have been time tested in the market  Active development happening – Directly on Linux kernel – on multiple trees maintained by different people. – NetBSD tend to let features stabilize on FreeBSD/OpenBSD and then pick it up :-)  Let us get on with the differences....
  • 6. Memory foot print  Linux is slowly getting bloated. – There are projects that are working on reducing the size of Linux kernel – “ Linux Tiny” project provides a set of patches that can be applied to the Linux kernel to reduce the kernel size (built image and run time memory requirements)  NetBSD projects boast of reduced kernel size. – TINY configuration file is distributed along with the source.  Both kernels can be easily reduced to a size of less than 1MB ( uncompressed : ~900k, compressed : ~400k )  With sufficient hacking around, it can be reduced even further.
  • 7. Process Scheduling  Both OS follow a similar model in running user space processes. – Time slice based – and O(1) in nature. – They have priority based levels and processes are placed on these levels based on their priority – Both support dynamic priority modification based on interactiveness of a process  Not needed for embedded systems – and can be turned off at compile time. – Both support the same user space priorities (40)  Linux has two run-queues : An active and an expired run- queue.  Linux also has a run-queue per CPU – for SMP boxes.
  • 8. Process Run-queue RunQueue Doubly linked lists of tasks Active Task 1 Task 2 ... Task N [Priority: 1] ... Task 1 Task 2 Task M [Priority:140] Expired ... ... Migration Thread From kernel/sched.c
  • 9. Other stuff ...  Kernel pre-emption. – Linux kernel supports kernel pre-emption, but only at pre- emptible points inside in the kernel. – There are still areas within the kernel which cannot be pre- empted. – NetBSD does not support kernel pre-emption.  Hence real-time support is pretty poor on NetBSD systems  SMP Support ( not really critical in embedded systems ) – Very good in Linux. – Worked upon in NetBSD.
  • 10. Real-time performance  Hard real-time performance – Not available in both kernels by default. – FSM labs provides patches to the Linux kernel ( under GPL ) and commercial patches to NetBSD.  Works by running Linux/NetBSD kernel as low priority tasks under a real time kernel.  Soft real-time performance. – Linux is pretty good in providing soft real time facilities. – In addition to the 40 user land priorities, Linux provides an additional 100 real-time priorities – Linux supports two soft real time scheduling options  SCHED_FIFO – First in first out  SCHED_RR – Round robin – Real time tasks cannot be pre-empted.
  • 11. Threading models  Both kernels are thread aware and are POSIX compliant  They support different threading models – This is where the difference starts and things get interesting..  Linux – Supports 1:1 model of threading ( NPTL ) – The kernel does not distinguish between threads and processes  A process is a group of thread ids – thats it. – All threads in a process are visible as tasks to the kernel and active threads are allocated time-slices for scheduling.  All active threads will get their time-slices – Can set real time priorities to tasks. – APIs are available for real time threads handling
  • 12. Threading models ( contd .. )  NetBSD – Treats threads (lwp) and processes differently – Supports Scheduler Activations.  m:n model of threading – Not all threads are visible to the kernel scheduler. User space code takes part in telling the kernel which thread to schedule. – The threads in a process have co-operative scheduling.  A thread can keep running for most of the time – careful programing required.  Both groups had debated the models before taking up their approaches. Both methods are “ claimed” to be better than the other.  Today, Linux seems to have better thread/process creation, spawning and context switching times.
  • 13. Debugging support  NetBSD has much better debugging support. – DDB – an in-kernel debugger – Supports kernel crash dumps – Supports KGDB (source level debug) – remote debugging.  Linux – Patches available for crash dumps and KDB & KGDB (not available for all architectures) – Linux Trace Toolkit, UML etc. are also available methods. – Has “ Kernel Hacking” Option in kernel configuration  Allows debugging using “ Magic SysRQs” , Debugging of actions like memory allocations, file systems, highmem, stack overflows, page allocations etc.  Also allows stats collection for some modules. – Also, early printk() support is pretty recent.
  • 14. Flash Devices and File Systems  Support is poor in NetBSD  Linux supports – Advanced MTD support ( device concatenation, FTL, NFTL ) – JFFS2 ( JFFS3 is being worked on ) – RAM file systems and ramdisk support – Supports initrd  In NetBSD – OpenSource implementations of the above are not available. ( Commercial products are available ) – Results in considerable lead time in development. – Supports MFS ( not memory efficient ) : tmpfs is being worked upon – For boot time, it allows embedding a file-system into the kernel
  • 15. KQueue : Event notification mechanism  NetBSD supports a generic event notification framework – kqueues.  Excellent replacement for select() / poll() APIs. – No need to pass entire descriptor set to each call. – On return, applications need not check all file descriptors for updates. – Reduces data copying ( fd list from kernel to user space and vice-versa )  Can handle multiple types of events. – Signals, Vnode/Process monitoring, Timer events etc.  Can club multiple occurrences of an event into a single event  New event types can be easily added.  All with just two system calls !!
  • 16. Build systems and configuration  NetBSD is better – The entire system : kernel, compilers and tools, libraries and applications can be compiled ( native or cross platform ) using a single script – build.sh – The same script can build distributions, tarballs, archives and can also update existing systems and install fresh systems. – Adding new components to the build framework is extremely easy.  Linux – Such systems exist but it is not as flexible as BSD  Both NetBSD and Linux provide different configuration mechanisms. – NetBSD builds a device tree format. – Linux provides a GUI interface for configuring the kernel...
  • 17. Other differences.  Linux kernel code throws out lot of warnings during compilation. NetBSD is very clean in this aspect.  Linux supports MMU Less operations.  Loadable kernel modules – Better supported in Linux.  Better device support in Linux  With 2.6 kernel, the device driver model has vastly improved ( attend other talks at FOSS.in for more details )  Portability has been a design goal for NetBSD.  Development models are vastly different :-) – NetBSD is more “ cathedral” like !!  In Linux, you get answers easily :-)
  • 18. Business related  License (violation) is a serious cause of concern – BSD License is very liberal – One of the main reasons why telecom companies go for BSD – eg: Juniper ( JUNOS )  Protocol stacks and third party code – Are available usually for most BSDs and Linux. – To be more portable, they tend to ignore benefits of one OS  New device support – Vendors of new devices like Network Processors, etc. release code only/mainly for Linux ( kernel modules etc. ). – Extra effort is required in such cases to port things to NetBSD.  In case of Linux, extra time is required in selecting and integrating components of the system.
  • 19. Links  http://linux-bangalore.org/blug/meetings/200401/scheduler-2.6.pdf  http://www.netbsd.org/ - One site for all NetBSD stuff  http://people.freebsd.org/~jlemon/papers/kqueue.pdf - Kqueue design  http://camars.kaist.ac.kr/courses/530/97/Readings/scheduler-act.pdf - SA design  http://josh.trancesoftware.com/linux/ - Details of Linux 2.6 scheduler  http://www.wasabisystems.com/gpl/linux.htm - A comparison  http://bulk.fefe.de/scalability/ - Started a Battle and cleanup !!  http://lkcd.sourceforge.net/  http://kgdb.sf.net/  http://oss.sgi.com/projects/kdb/  http://www.linuxjournal.com/article/3829 - Using Linux Trace Toolkit  http://www.opersys.com/LTT  http://netbsd-soc.sourceforge.net/projects/tmpfs/ - TMPFS project page  http://www.selenic.com/linux-tiny - Linux Tiny home page
  • 20. Finally ...  Questions ??  Thanks to – Organizers for giving me a chance to speak at FOSS.in – NetBSD and Linux developers who helped me during my work – Linux kernel team for doing a wonderful job !!  Special thanks to YOU for listening... You can contact me at : Mahendra_M@infosys.com