NeXTBSD aka FreeBSD X

iXsystems
iXsystemsiXsystems
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
1 of 19

Recommended

Pervasive Web Application Architecture by
Pervasive Web Application ArchitecturePervasive Web Application Architecture
Pervasive Web Application ArchitectureUC San Diego
9.5K views21 slides
The internet by
The internetThe internet
The internetCatherine Matias
263 views29 slides
Internet principles of operation by
Internet principles of operationInternet principles of operation
Internet principles of operationInqilab Patel
11.6K views15 slides
File Transfer Protocol by
File Transfer ProtocolFile Transfer Protocol
File Transfer Protocolguest029bcd
122.8K views63 slides
old file system/traditional file sysytem by
old file system/traditional file sysytemold file system/traditional file sysytem
old file system/traditional file sysytemjizaka
2.4K views10 slides
Operating system security by
Operating system securityOperating system security
Operating system securityRamesh Ogania
18.5K views33 slides

More Related Content

What's hot

Communication in client server system.pptx by
Communication in client server system.pptxCommunication in client server system.pptx
Communication in client server system.pptxMSivani
353 views5 slides
Client server model by
Client server modelClient server model
Client server modelGd Goenka University
12.6K views16 slides
REST - Representational State Transfer by
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
10.8K views33 slides
Introduction to Visual Basic 6.0 Fundamentals by
Introduction to Visual Basic 6.0 FundamentalsIntroduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 FundamentalsSanay Kumar
734 views23 slides
Remote Login by
Remote LoginRemote Login
Remote Loginhariprasadnr
4.5K views34 slides
Directory services by
Directory servicesDirectory services
Directory servicesChristalin Nelson
4.8K views53 slides

What's hot(20)

Communication in client server system.pptx by MSivani
Communication in client server system.pptxCommunication in client server system.pptx
Communication in client server system.pptx
MSivani353 views
REST - Representational State Transfer by Peter R. Egli
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
Peter R. Egli10.8K views
Introduction to Visual Basic 6.0 Fundamentals by Sanay Kumar
Introduction to Visual Basic 6.0 FundamentalsIntroduction to Visual Basic 6.0 Fundamentals
Introduction to Visual Basic 6.0 Fundamentals
Sanay Kumar734 views
Network operating systems by Sachin Awasthi
Network operating systems Network operating systems
Network operating systems
Sachin Awasthi2.9K views
Introduction to Web Architecture by Chamnap Chhorn
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web Architecture
Chamnap Chhorn141K views
Distributed computing by shivli0769
Distributed computingDistributed computing
Distributed computing
shivli076929.7K views
Directory Introduction by Aidy Tificate
Directory IntroductionDirectory Introduction
Directory Introduction
Aidy Tificate3.3K views
LDAP - Lightweight Directory Access Protocol by S. Hasnain Raza
LDAP - Lightweight Directory Access ProtocolLDAP - Lightweight Directory Access Protocol
LDAP - Lightweight Directory Access Protocol
S. Hasnain Raza2.8K views
Computer Operating system by Mis bah
Computer Operating systemComputer Operating system
Computer Operating system
Mis bah2.3K views
Android resource by Krazy Koder
Android resourceAndroid resource
Android resource
Krazy Koder2.7K views
Lect 1. introduction to programming languages by Varun Garg
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
Varun Garg235.2K views
Server system architecture by Faiza Hafeez
Server system architectureServer system architecture
Server system architecture
Faiza Hafeez1.1K views

Viewers also liked

FreeBSD: The Next 10 Years (MeetBSD 2014) by
FreeBSD: The Next 10 Years (MeetBSD 2014)FreeBSD: The Next 10 Years (MeetBSD 2014)
FreeBSD: The Next 10 Years (MeetBSD 2014)iXsystems
218.3K views37 slides
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016) by
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)iXsystems
2.4K views20 slides
FreeNAS 10: Challenges of Building a Modern Storage Appliance based on FreeBS... by
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...iXsystems
874 views18 slides
History of ZFS (MeetBSD California 2016) by
History of ZFS (MeetBSD California 2016)History of ZFS (MeetBSD California 2016)
History of ZFS (MeetBSD California 2016)iXsystems
730 views19 slides
BayLISA - FreeNAS 10 by Jordan Hubbard by
BayLISA - FreeNAS 10 by Jordan HubbardBayLISA - FreeNAS 10 by Jordan Hubbard
BayLISA - FreeNAS 10 by Jordan HubbardiXsystems
1.5K views15 slides
CDays14 - CPP05 - Standard Library: STL e boost, la BCL di C++ by
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++Alessio Gogna
890 views26 slides

Viewers also liked(20)

FreeBSD: The Next 10 Years (MeetBSD 2014) by iXsystems
FreeBSD: The Next 10 Years (MeetBSD 2014)FreeBSD: The Next 10 Years (MeetBSD 2014)
FreeBSD: The Next 10 Years (MeetBSD 2014)
iXsystems218.3K views
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016) by iXsystems
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)
iXsystems2.4K views
FreeNAS 10: Challenges of Building a Modern Storage Appliance based on FreeBS... by iXsystems
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...
iXsystems874 views
History of ZFS (MeetBSD California 2016) by iXsystems
History of ZFS (MeetBSD California 2016)History of ZFS (MeetBSD California 2016)
History of ZFS (MeetBSD California 2016)
iXsystems730 views
BayLISA - FreeNAS 10 by Jordan Hubbard by iXsystems
BayLISA - FreeNAS 10 by Jordan HubbardBayLISA - FreeNAS 10 by Jordan Hubbard
BayLISA - FreeNAS 10 by Jordan Hubbard
iXsystems1.5K views
CDays14 - CPP05 - Standard Library: STL e boost, la BCL di C++ by Alessio Gogna
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++
Alessio Gogna890 views
Il sistema di gestione documentale e di gestione processi per Drive Service by it Consult
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
it Consult510 views
Create Brand Evangelists with CNAM by Flowroute
Create Brand Evangelists with CNAMCreate Brand Evangelists with CNAM
Create Brand Evangelists with CNAM
Flowroute262 views
02 Modern Customer Service Infographic by Ken Prokopec
02 Modern Customer Service Infographic02 Modern Customer Service Infographic
02 Modern Customer Service Infographic
Ken Prokopec222 views
The 50 best pieces of entrepreneurial advice you will ever hear by WebAble Digital
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 Digital242 views
6 Steps to SIP trunking security by Flowroute
6 Steps to SIP trunking security6 Steps to SIP trunking security
6 Steps to SIP trunking security
Flowroute374 views
Case Study Musei Vaticani by it Consult
Case Study Musei VaticaniCase Study Musei Vaticani
Case Study Musei Vaticani
it Consult532 views
Edgar J Ortiz II Prubea Int. a la Ing. Civil by Edgar Ortiz
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 Ortiz517 views
Presentazione -the postmodern explained to managers by Samuele Molon
  Presentazione -the postmodern explained to managers  Presentazione -the postmodern explained to managers
Presentazione -the postmodern explained to managers
Samuele Molon384 views
Case study Scavolini by it Consult
Case study ScavoliniCase study Scavolini
Case study Scavolini
it Consult514 views

Similar to NeXTBSD aka FreeBSD X

Ospresentation 120112074429-phpapp02 (1) by
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Vivian Vhaves
674 views38 slides
Linux architecture by
Linux architectureLinux architecture
Linux architecturemcganesh
1.5K views29 slides
Linux internal by
Linux internalLinux internal
Linux internalmcganesh
1.6K views29 slides
Linux architecture by
Linux architectureLinux architecture
Linux architecturemcganesh
49.8K views29 slides
ubantu ppt.pptx by
ubantu ppt.pptxubantu ppt.pptx
ubantu ppt.pptxMrGyanprakash
15 views37 slides
Pune-Cocoa: Blocks and GCD by
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPrashant Rane
1.3K views34 slides

Similar to NeXTBSD aka FreeBSD X(20)

Ospresentation 120112074429-phpapp02 (1) by Vivian Vhaves
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
Vivian Vhaves674 views
Linux architecture by mcganesh
Linux architectureLinux architecture
Linux architecture
mcganesh1.5K views
Linux internal by mcganesh
Linux internalLinux internal
Linux internal
mcganesh1.6K views
Linux architecture by mcganesh
Linux architectureLinux architecture
Linux architecture
mcganesh49.8K views
Pune-Cocoa: Blocks and GCD by Prashant Rane
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
Prashant Rane1.3K views
Introduction to linux containers by Google
Introduction to linux containersIntroduction to linux containers
Introduction to linux containers
Google1.4K views
Real Time Operating System by Sharad Pandey
Real Time Operating SystemReal Time Operating System
Real Time Operating System
Sharad Pandey982 views
OpenNebulaConf2017EU: Hyper converged infrastructure with OpenNebula and Ceph... by OpenNebula Project
OpenNebulaConf2017EU: Hyper converged infrastructure with OpenNebula and Ceph...OpenNebulaConf2017EU: Hyper converged infrastructure with OpenNebula and Ceph...
OpenNebulaConf2017EU: Hyper converged infrastructure with OpenNebula and Ceph...
OpenNebula Project871 views
Operating System 4 by tech2click
Operating System 4Operating System 4
Operating System 4
tech2click3.2K views
Operating System 4 1193308760782240 2 by mona_hakmy
Operating System 4 1193308760782240 2Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2
mona_hakmy1.2K views
Processes and Threads in Windows Vista by Trinh Phuc Tho
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows Vista
Trinh Phuc Tho4.9K views
Operating Systems 1 (5/12) - Architectures (Unix) by Peter Tröger
Operating Systems 1 (5/12) - Architectures (Unix)Operating Systems 1 (5/12) - Architectures (Unix)
Operating Systems 1 (5/12) - Architectures (Unix)
Peter Tröger712 views

More from iXsystems

The True Story of FreeNAS by
The True Story of FreeNASThe True Story of FreeNAS
The True Story of FreeNASiXsystems
3.1K views29 slides
UCL All of the Things (MeetBSD California 2014 Lightning Talk) by
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)iXsystems
2K views15 slides
Netflix Update (MeetBSD California 2014 Lightning Talk) by
Netflix Update (MeetBSD California 2014 Lightning Talk)Netflix Update (MeetBSD California 2014 Lightning Talk)
Netflix Update (MeetBSD California 2014 Lightning Talk)iXsystems
3.1K views8 slides
600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014) by
600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)
600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)iXsystems
10.2K views32 slides
PBI v10: Application Management Made Easy by Ken Moore by
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 MooreiXsystems
2.1K views18 slides
Introduction to FreeNAS development by John Hixson by
Introduction to FreeNAS development by John HixsonIntroduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John HixsoniXsystems
2.4K views36 slides

More from iXsystems(7)

The True Story of FreeNAS by iXsystems
The True Story of FreeNASThe True Story of FreeNAS
The True Story of FreeNAS
iXsystems3.1K views
UCL All of the Things (MeetBSD California 2014 Lightning Talk) by iXsystems
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)
iXsystems2K views
Netflix Update (MeetBSD California 2014 Lightning Talk) by iXsystems
Netflix Update (MeetBSD California 2014 Lightning Talk)Netflix Update (MeetBSD California 2014 Lightning Talk)
Netflix Update (MeetBSD California 2014 Lightning Talk)
iXsystems3.1K views
600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014) by iXsystems
600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)
600M+ Unsuspecting FreeBSD Users (MeetBSD California 2014)
iXsystems10.2K views
PBI v10: Application Management Made Easy by Ken Moore by iXsystems
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
iXsystems2.1K views
Introduction to FreeNAS development by John Hixson by iXsystems
Introduction to FreeNAS development by John HixsonIntroduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John Hixson
iXsystems2.4K views
Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C... by iXsystems
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...
iXsystems1.8K views

Recently uploaded

Software evolution understanding: Automatic extraction of software identifier... by
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...Ra'Fat Al-Msie'deen
7 views33 slides
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... by
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...Deltares
9 views34 slides
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptxanimuscrm
13 views19 slides
Elevate your SAP landscape's efficiency and performance with HCL Workload Aut... by
Elevate your SAP landscape's efficiency and performance with HCL Workload Aut...Elevate your SAP landscape's efficiency and performance with HCL Workload Aut...
Elevate your SAP landscape's efficiency and performance with HCL Workload Aut...HCLSoftware
6 views2 slides
MariaDB stored procedures and why they should be improved by
MariaDB stored procedures and why they should be improvedMariaDB stored procedures and why they should be improved
MariaDB stored procedures and why they should be improvedFederico Razzoli
8 views32 slides
DevsRank by
DevsRankDevsRank
DevsRankdevsrank786
11 views1 slide

Recently uploaded(20)

Software evolution understanding: Automatic extraction of software identifier... by Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... by Deltares
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
Deltares9 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm13 views
Elevate your SAP landscape's efficiency and performance with HCL Workload Aut... by HCLSoftware
Elevate your SAP landscape's efficiency and performance with HCL Workload Aut...Elevate your SAP landscape's efficiency and performance with HCL Workload Aut...
Elevate your SAP landscape's efficiency and performance with HCL Workload Aut...
HCLSoftware6 views
MariaDB stored procedures and why they should be improved by Federico Razzoli
MariaDB stored procedures and why they should be improvedMariaDB stored procedures and why they should be improved
MariaDB stored procedures and why they should be improved
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports by Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller38 views
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema by Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - GeertsemaDSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
Deltares17 views
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko... by Deltares
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
Deltares11 views
DSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - Parker by Deltares
DSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - ParkerDSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - Parker
DSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - Parker
Deltares9 views
Software testing company in India.pptx by SakshiPatel82
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptx
SakshiPatel827 views
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... by Deltares
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
Deltares6 views
Citi TechTalk Session 2: Kafka Deep Dive by confluent
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
confluent17 views
Advanced API Mocking Techniques by Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary19 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller36 views
Roadmap y Novedades de producto by Neo4j
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de producto
Neo4j50 views

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