SlideShare a Scribd company logo
1 of 19
NeXTBSD
AKA FreeBSD X
Basic Architecture
FreeBSD-current kernel
+ Mach IPC
Common Object Runtime (create/delete/retain/release)
Libdispatch / ASL / Libnotify
launchd
launchctl legacy rc system cooperating daemons
json
config
files
Basic Architecture
FreeBSD-current kernel
+ Mach IPC
Common Object Runtime (create/delete/retain/release)
Libdispatch / ASL / Libnotify
launchd
launchctl legacy rc system cooperating daemons
json
config
files
Introduction to Mach
IPC
A Sympathetic Glance
Mach Kernel Abstractions
• Tasks. The units of resource ownership; each task consists of a virtual address space, a port
right namespace, and one or more threads. (Implemented as an extension to a process.)
• Threads. The units of CPU execution within a task. Simple extension to kthreads.
• Address space. In conjunction with memory managers, Mach implements the notion of a
sparse virtual address space and shared memory. (No modifications)
• Memory objects. The internal units of memory management. Memory objects include named
entries and regions; they are representations of potentially persistent data that may be mapped
into address spaces. (Unsupported)
• Ports. Secure, simplex communication channels, accessible only via send and receive
capabilities (known as port rights).
• IPC. Message queues, remote procedure calls, notifications, semaphores, and lock sets.
(Mach semaphores and lock sets are not supported).
• Time. Clocks, timers, and waiting - (rudimentary shims).
What is a port?
• A port is an endpoint of a unidirectional communication channel between a client who requests
a service and a server who provides the service.
• If a reply is to be provided to such a service request, a second port must be used.
• Tasks have permissions to access ports in certain ways (send, receive, send-once); these are
called port rights.
• A port can be accessed only via a right. (Akin to a file descriptor).
• Port rights can be copied and moved between tasks via IPC. Doing so, in effect, passes
capabilities to some object or server.
• Ports and port rights do not have systemwide names that allow arbitrary ports or rights to be
manipulated directly.
• Ports can be manipulated by a task only if the task has a port right in its port namespace.
• A port right is specified by a port name, an integer index into a 32-bit port namespace. Each
task has associated with it a single port namespace.
What can Mach ports do that
Unix domain sockets can’t?
• Separate namespace for services (doesn’t rely on file system naming or permissions)
• Message boundaries
• Kernel as peer
• Pre-existing well defined RPC interface
• Receive messages directly in call to kevent()
• OOL (out of line) messages (arbitrarily sized with zero copy for large messages)
• Port send rights - can only send to a port for which the process has explicitly received
the right to send
• Provenance - Yes, PROVENANCE, receiver can have the kernel append an audit
trailer containing full set of credentials of sender
Basic Architecture
FreeBSD-current kernel
+ Mach IPC
Common Object Runtime (create/delete/retain/release)
Libdispatch / ASL / Libnotify
launchd
launchctl legacy rc system cooperating daemons
json
config
files
Common Runtime Benefits
• Internal objects in multi-threaded world to share some
common semantics (retain / release)
• Examples: dispatch_object_t, asl_object_t,
xpc_object_t, etc
• Provides a rendezvous point for higher-level languages
like ObjC and C++ (which also have objects they
would like to share across language boundaries)
• One reason why “this stuff can’t just be in ports”
Basic Architecture
FreeBSD-current kernel
+ Mach IPC
Common Object Runtime (create/delete/retain/release)
Libdispatch / ASL / Libnotify
launchd
launchctl legacy rc system cooperating daemons
json
config
files
• An intelligent thread pool (with optional
cooperative thread resource management
between multiple tasks)
• Task-parallelism made easy: Everything is a
queue, and queues can be arbitrarily nested
• Used by many other parts of the system (ASL,
notify, etc) and provides “common runloop for
unix processes” (this is actually a really big deal)
• Apache licensed and highly portable (Linux,
BSD, Windows, etc)
Libdispatch: What the hell is it?
• All objects use common runtime (so retain/release
controls object lifetimes and thread safety)
• Queues, sources, semaphores and groups
provide basic building blocks
• Data objects provide higher-level memory
management semantics for allocating / passing
and managing data between processes
• Way too much functionality to go into here; many
tutorials on the net, many thousands of OS X / iOS
apps using it
Libdispatch: Types of functionality
• Structured Log Output: Everything is a key/value
pair, and highly extensible
• Supports multi-threaded logging out of the box
• Unifies character encoding (UTF-8 everywhere),
event sources and post-processing plug-ins, etc.
etc.
• Can be used as a building-block for telemetry
and higher-level logging / debugging needs
ASL: What the hell is it?
• Global asynchronous event management system
(publish / subscribe)
• Supports many different “notification delivery”
methods (fds, mach ipc, signals, shared
memory)
• Cooperates nicely with libdispatch (events can
cause automatic enqueuing of handler
blocks/functions on queues)
• Very useful for light-weight cache invalidation
Libnotify: What the hell is it?
Basic Architecture
FreeBSD-current kernel
+ Mach IPC
Common Object Runtime (create/delete/retain/release)
Libdispatch / ASL / Libnotify
launchd
launchctl legacy rc system cooperating daemons
json
config
files
• A merger of init, mach_init (which FreeBSD never
had), [x]inetd, cron, and rc/rc.d
• Provides a clear chain of custody for all
processes and a single point of control for
security policy implementation and debugging
• Handles dependencies implicitly through
communication requests / events (both HW and
SW)
• Provides per system / session / application
service management for XPC (when present)
Launchd: What the hell is it?
• Launchd speaks XML fluently (and will force you to
as well)
• Launchd’s implementation is really complicated
• Launchd clubs UNIX’s “keep it simple” philosophy
like a baby harp seal
Launchd: Popular Myths
Hint: The world has changed!
Resources & Next Steps
• https://github.com/kmacy/NextBSD
• Fork of FreeBSD -current with all this stuff
added. Builds under FreeBSD 10.1 or later.
• Nightly builds coming soon, but for now
http://www.optimcloud.com/disc1.iso is
installable image
• Merging HardenedBSD work as well
Q&A

More Related Content

What's hot

Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
chapter-1-introduction-to-linux.ppt
chapter-1-introduction-to-linux.pptchapter-1-introduction-to-linux.ppt
chapter-1-introduction-to-linux.ppt
shivushivu20
 

What's hot (20)

Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)Red hat enterprise linux 7 (rhel 7)
Red hat enterprise linux 7 (rhel 7)
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamal
 
Linux power management: are you doing it right?
Linux power management: are you doing it right?Linux power management: are you doing it right?
Linux power management: are you doing it right?
 
Linux
LinuxLinux
Linux
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
 
Learn C Programming Language by Using GDB
Learn C Programming Language by Using GDBLearn C Programming Language by Using GDB
Learn C Programming Language by Using GDB
 
chapter-1-introduction-to-linux.ppt
chapter-1-introduction-to-linux.pptchapter-1-introduction-to-linux.ppt
chapter-1-introduction-to-linux.ppt
 
Kali linux os
Kali linux osKali linux os
Kali linux os
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
 
Power Management from Linux Kernel to Android
Power Management from Linux Kernel to AndroidPower Management from Linux Kernel to Android
Power Management from Linux Kernel to Android
 
Less17 moving data
Less17 moving dataLess17 moving data
Less17 moving data
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 

Viewers also liked

02 Modern Customer Service Infographic
02 Modern Customer Service Infographic02 Modern Customer Service Infographic
02 Modern Customer Service Infographic
Ken Prokopec
 
The 50 best pieces of entrepreneurial advice you will ever hear
The 50 best pieces of entrepreneurial advice you will ever hear The 50 best pieces of entrepreneurial advice you will ever hear
The 50 best pieces of entrepreneurial advice you will ever hear
WebAble Digital
 
Edgar J Ortiz II Prubea Int. a la Ing. Civil
Edgar J Ortiz II Prubea Int. a la Ing. CivilEdgar J Ortiz II Prubea Int. a la Ing. Civil
Edgar J Ortiz II Prubea Int. a la Ing. Civil
Edgar Ortiz
 

Viewers also liked (20)

FreeBSD: The Next 10 Years (MeetBSD 2014)
FreeBSD: The Next 10 Years (MeetBSD 2014)FreeBSD: The Next 10 Years (MeetBSD 2014)
FreeBSD: The Next 10 Years (MeetBSD 2014)
 
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
 
FreeNAS 10: Challenges of Building a Modern Storage Appliance based on FreeBS...
FreeNAS 10: Challenges of Building a Modern Storage Appliance based on FreeBS...FreeNAS 10: Challenges of Building a Modern Storage Appliance based on FreeBS...
FreeNAS 10: Challenges of Building a Modern Storage Appliance based on FreeBS...
 
History of ZFS (MeetBSD California 2016)
History of ZFS (MeetBSD California 2016)History of ZFS (MeetBSD California 2016)
History of ZFS (MeetBSD California 2016)
 
BayLISA - FreeNAS 10 by Jordan Hubbard
BayLISA - FreeNAS 10 by Jordan HubbardBayLISA - FreeNAS 10 by Jordan Hubbard
BayLISA - FreeNAS 10 by Jordan Hubbard
 
CDays14 - CPP05 - Standard Library: STL e boost, la BCL di C++
CDays14 - CPP05 - Standard Library: STL e boost, la BCL di C++CDays14 - CPP05 - Standard Library: STL e boost, la BCL di C++
CDays14 - CPP05 - Standard Library: STL e boost, la BCL di C++
 
Il sistema di gestione documentale e di gestione processi per Drive Service
Il sistema di gestione documentale e di gestione processi per Drive ServiceIl sistema di gestione documentale e di gestione processi per Drive Service
Il sistema di gestione documentale e di gestione processi per Drive Service
 
Presentation chief minister part ii
Presentation chief minister part iiPresentation chief minister part ii
Presentation chief minister part ii
 
Create Brand Evangelists with CNAM
Create Brand Evangelists with CNAMCreate Brand Evangelists with CNAM
Create Brand Evangelists with CNAM
 
02 Modern Customer Service Infographic
02 Modern Customer Service Infographic02 Modern Customer Service Infographic
02 Modern Customer Service Infographic
 
The 50 best pieces of entrepreneurial advice you will ever hear
The 50 best pieces of entrepreneurial advice you will ever hear The 50 best pieces of entrepreneurial advice you will ever hear
The 50 best pieces of entrepreneurial advice you will ever hear
 
Fitria utami redhat
Fitria utami redhatFitria utami redhat
Fitria utami redhat
 
6 Steps to SIP trunking security
6 Steps to SIP trunking security6 Steps to SIP trunking security
6 Steps to SIP trunking security
 
Case Study Musei Vaticani
Case Study Musei VaticaniCase Study Musei Vaticani
Case Study Musei Vaticani
 
Staying on Target
Staying on TargetStaying on Target
Staying on Target
 
March 2015
March 2015March 2015
March 2015
 
Edgar J Ortiz II Prubea Int. a la Ing. Civil
Edgar J Ortiz II Prubea Int. a la Ing. CivilEdgar J Ortiz II Prubea Int. a la Ing. Civil
Edgar J Ortiz II Prubea Int. a la Ing. Civil
 
Presentazione -the postmodern explained to managers
  Presentazione -the postmodern explained to managers  Presentazione -the postmodern explained to managers
Presentazione -the postmodern explained to managers
 
Cara membuat email dengan gmail
Cara membuat email dengan gmailCara membuat email dengan gmail
Cara membuat email dengan gmail
 
Case study Scavolini
Case study ScavoliniCase study Scavolini
Case study Scavolini
 

Similar to NeXTBSD aka FreeBSD X

Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
Vivian Vhaves
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Linux internal
Linux internalLinux internal
Linux internal
mcganesh
 
Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2
mona_hakmy
 
Operating System 4
Operating System 4Operating System 4
Operating System 4
tech2click
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows Vista
Trinh Phuc Tho
 

Similar to NeXTBSD aka FreeBSD X (20)

Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Linux internal
Linux internalLinux internal
Linux internal
 
ubantu ppt.pptx
ubantu ppt.pptxubantu ppt.pptx
ubantu ppt.pptx
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
 
Ubuntu OS Presentation
Ubuntu OS PresentationUbuntu OS Presentation
Ubuntu OS Presentation
 
Driver Programming Report
Driver Programming ReportDriver Programming Report
Driver Programming Report
 
Introduction to linux containers
Introduction to linux containersIntroduction to linux containers
Introduction to linux containers
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
 
olibc: Another C Library optimized for Embedded Linux
olibc: Another C Library optimized for Embedded Linuxolibc: Another C Library optimized for Embedded Linux
olibc: Another C Library optimized for Embedded Linux
 
Chapter 6 os
Chapter 6 osChapter 6 os
Chapter 6 os
 
OpenNebulaConf2017EU: Hyper converged infrastructure with OpenNebula and Ceph...
OpenNebulaConf2017EU: Hyper converged infrastructure with OpenNebula and Ceph...OpenNebulaConf2017EU: Hyper converged infrastructure with OpenNebula and Ceph...
OpenNebulaConf2017EU: Hyper converged infrastructure with OpenNebula and Ceph...
 
Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2
 
Operating System 4
Operating System 4Operating System 4
Operating System 4
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows Vista
 
Operating Systems 1 (5/12) - Architectures (Unix)
Operating Systems 1 (5/12) - Architectures (Unix)Operating Systems 1 (5/12) - Architectures (Unix)
Operating Systems 1 (5/12) - Architectures (Unix)
 
Studies
StudiesStudies
Studies
 
Libra Library OS
Libra Library OSLibra Library OS
Libra Library OS
 
Bglrsession4
Bglrsession4Bglrsession4
Bglrsession4
 
Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)
 

More from iXsystems

More from iXsystems (7)

The True Story of FreeNAS
The True Story of FreeNASThe True Story of FreeNAS
The True Story of FreeNAS
 
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
 
Netflix Update (MeetBSD California 2014 Lightning Talk)
Netflix Update (MeetBSD California 2014 Lightning Talk)Netflix Update (MeetBSD California 2014 Lightning Talk)
Netflix Update (MeetBSD California 2014 Lightning Talk)
 
600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)
600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)
600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)
 
PBI v10: Application Management Made Easy by Ken Moore
PBI v10: Application Management Made Easy by Ken MoorePBI v10: Application Management Made Easy by Ken Moore
PBI v10: Application Management Made Easy by Ken Moore
 
Introduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John HixsonIntroduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John Hixson
 
Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...
Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...
Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

NeXTBSD aka FreeBSD X

  • 2. Basic Architecture FreeBSD-current kernel + Mach IPC Common Object Runtime (create/delete/retain/release) Libdispatch / ASL / Libnotify launchd launchctl legacy rc system cooperating daemons json config files
  • 3. Basic Architecture FreeBSD-current kernel + Mach IPC Common Object Runtime (create/delete/retain/release) Libdispatch / ASL / Libnotify launchd launchctl legacy rc system cooperating daemons json config files
  • 4. Introduction to Mach IPC A Sympathetic Glance
  • 5. Mach Kernel Abstractions • Tasks. The units of resource ownership; each task consists of a virtual address space, a port right namespace, and one or more threads. (Implemented as an extension to a process.) • Threads. The units of CPU execution within a task. Simple extension to kthreads. • Address space. In conjunction with memory managers, Mach implements the notion of a sparse virtual address space and shared memory. (No modifications) • Memory objects. The internal units of memory management. Memory objects include named entries and regions; they are representations of potentially persistent data that may be mapped into address spaces. (Unsupported) • Ports. Secure, simplex communication channels, accessible only via send and receive capabilities (known as port rights). • IPC. Message queues, remote procedure calls, notifications, semaphores, and lock sets. (Mach semaphores and lock sets are not supported). • Time. Clocks, timers, and waiting - (rudimentary shims).
  • 6. What is a port? • A port is an endpoint of a unidirectional communication channel between a client who requests a service and a server who provides the service. • If a reply is to be provided to such a service request, a second port must be used. • Tasks have permissions to access ports in certain ways (send, receive, send-once); these are called port rights. • A port can be accessed only via a right. (Akin to a file descriptor). • Port rights can be copied and moved between tasks via IPC. Doing so, in effect, passes capabilities to some object or server. • Ports and port rights do not have systemwide names that allow arbitrary ports or rights to be manipulated directly. • Ports can be manipulated by a task only if the task has a port right in its port namespace. • A port right is specified by a port name, an integer index into a 32-bit port namespace. Each task has associated with it a single port namespace.
  • 7. What can Mach ports do that Unix domain sockets can’t? • Separate namespace for services (doesn’t rely on file system naming or permissions) • Message boundaries • Kernel as peer • Pre-existing well defined RPC interface • Receive messages directly in call to kevent() • OOL (out of line) messages (arbitrarily sized with zero copy for large messages) • Port send rights - can only send to a port for which the process has explicitly received the right to send • Provenance - Yes, PROVENANCE, receiver can have the kernel append an audit trailer containing full set of credentials of sender
  • 8. Basic Architecture FreeBSD-current kernel + Mach IPC Common Object Runtime (create/delete/retain/release) Libdispatch / ASL / Libnotify launchd launchctl legacy rc system cooperating daemons json config files
  • 9. Common Runtime Benefits • Internal objects in multi-threaded world to share some common semantics (retain / release) • Examples: dispatch_object_t, asl_object_t, xpc_object_t, etc • Provides a rendezvous point for higher-level languages like ObjC and C++ (which also have objects they would like to share across language boundaries) • One reason why “this stuff can’t just be in ports”
  • 10. Basic Architecture FreeBSD-current kernel + Mach IPC Common Object Runtime (create/delete/retain/release) Libdispatch / ASL / Libnotify launchd launchctl legacy rc system cooperating daemons json config files
  • 11. • An intelligent thread pool (with optional cooperative thread resource management between multiple tasks) • Task-parallelism made easy: Everything is a queue, and queues can be arbitrarily nested • Used by many other parts of the system (ASL, notify, etc) and provides “common runloop for unix processes” (this is actually a really big deal) • Apache licensed and highly portable (Linux, BSD, Windows, etc) Libdispatch: What the hell is it?
  • 12. • All objects use common runtime (so retain/release controls object lifetimes and thread safety) • Queues, sources, semaphores and groups provide basic building blocks • Data objects provide higher-level memory management semantics for allocating / passing and managing data between processes • Way too much functionality to go into here; many tutorials on the net, many thousands of OS X / iOS apps using it Libdispatch: Types of functionality
  • 13. • Structured Log Output: Everything is a key/value pair, and highly extensible • Supports multi-threaded logging out of the box • Unifies character encoding (UTF-8 everywhere), event sources and post-processing plug-ins, etc. etc. • Can be used as a building-block for telemetry and higher-level logging / debugging needs ASL: What the hell is it?
  • 14. • Global asynchronous event management system (publish / subscribe) • Supports many different “notification delivery” methods (fds, mach ipc, signals, shared memory) • Cooperates nicely with libdispatch (events can cause automatic enqueuing of handler blocks/functions on queues) • Very useful for light-weight cache invalidation Libnotify: What the hell is it?
  • 15. Basic Architecture FreeBSD-current kernel + Mach IPC Common Object Runtime (create/delete/retain/release) Libdispatch / ASL / Libnotify launchd launchctl legacy rc system cooperating daemons json config files
  • 16. • A merger of init, mach_init (which FreeBSD never had), [x]inetd, cron, and rc/rc.d • Provides a clear chain of custody for all processes and a single point of control for security policy implementation and debugging • Handles dependencies implicitly through communication requests / events (both HW and SW) • Provides per system / session / application service management for XPC (when present) Launchd: What the hell is it?
  • 17. • Launchd speaks XML fluently (and will force you to as well) • Launchd’s implementation is really complicated • Launchd clubs UNIX’s “keep it simple” philosophy like a baby harp seal Launchd: Popular Myths Hint: The world has changed!
  • 18. Resources & Next Steps • https://github.com/kmacy/NextBSD • Fork of FreeBSD -current with all this stuff added. Builds under FreeBSD 10.1 or later. • Nightly builds coming soon, but for now http://www.optimcloud.com/disc1.iso is installable image • Merging HardenedBSD work as well
  • 19. Q&A