SlideShare uma empresa Scribd logo
1 de 58
Baixar para ler offline
Genode OS Framework
       Architecture




         Norman Feske
<norman.feske@genode-labs.com>
Outline


1. Why do we need another operating system?

2. Genode entering the picture

3. Architectural principles

4. Core - the root of the process tree

5. Genesis of a new process

6. Simple example setup



                       Genode OS Framework Architecture   2
Outline


1. Why do we need another operating system?

2. Genode entering the picture

3. Architectural principles

4. Core - the root of the process tree

5. Genesis of a new process

6. Simple example setup



                       Genode OS Framework Architecture   3
Myths




        Genode OS Framework Architecture   4
Problem: Complexity



Today’s commodity OSes Exceedingly complex trusted computing
            base (TCB)
TCB of an application on Linux:
    Kernel + loaded kernel modules
    Daemons
    X Server + window manager
    Desktop environment
    All running processes of the user
→ User credentials are exposed to millions of lines of code



                      Genode OS Framework Architecture         5
Problem: Complexity (II)




Implications:
    High likelihood for bugs (need for frequent security updates)
    Huge attack surface for directed attacks
    Zero-day exploits




                      Genode OS Framework Architecture              6
Problem: Global names



Many examples on traditional systems
    UIDs, PIDs
    network interface names
    port numbers
    device nodes
    ...

Leak information

Name is a potential attack vector (ambient authority)




                   Genode OS Framework Architecture     7
Problem: Resource management


Pretension of unlimited resources
Lack of accounting
→ Largely indeterministic behavior
→ Need for complex heuristics, schedulers




                 Genode OS Framework Architecture   8
Key technologies




Microkernels
Decomponentization, kernelization
Capability-based security
Virtualization




                 Genode OS Framework Architecture   9
Tricky questions




How to...
    ...build a system without global names?
    ...trade between parties that do not know each other?
    ...reclaim kidnapped goods from an alien? (without violence)
    ...deal with distributed access-control policies?
    ...transparently monitor communication?
    ...recycle a subsystem without knowing its internal structure?




                      Genode OS Framework Architecture               10
Even more tricky questions




How to...
    ...avoid performance hazards through many indirections?
    ...translate architectural ideas into a real implementation?




                      Genode OS Framework Architecture             11
Outline


1. Why do we need another operating system?

2. Genode entering the picture

3. Architectural principles

4. Core - the root of the process tree

5. Genesis of a new process

6. Simple example setup



                       Genode OS Framework Architecture   12
A bit of history




       Research timeline at TU Dresden


            Genode OS Framework Architecture   13
A new generation of kernels on the horizon




           Genode OS Framework Architecture   14
Unique feature: Cross-kernel portability




When started, no suitable microkernel was available
→ Prototyped on Linux and L4/Fiasco
→ Later ported to other kernels




                      Genode OS Framework Architecture   15
Today: Rich OS construction kit


Support of a variety of kernels
OKL4, L4/Fiasco, L4ka::Pistachio, NOVA, Fiasco.OC, Linux, Codezero

Preservation of special kernel features
     OKLinux on OKL4,
     L4Linux on Fiasco.OC,
     Vancouver on NOVA,
     Real-time priorities on L4/Fiasco

Uniform API → kernel-independent components

Many ready-to-use device drivers, protocol stacks, and
3rd-party libraries


                   Genode OS Framework Architecture                  16
Outline


1. Why do we need another operating system?

2. Genode entering the picture

3. Architectural principles

4. Core - the root of the process tree

5. Genesis of a new process

6. Simple example setup



                       Genode OS Framework Architecture   17
Object capabilities




Delegation of rights
    Each process lives in a virtual environment
    A process that possesses a right (capability) can
         Use it (invoke)
         Delegate it to acquainted processes




                       Genode OS Framework Architecture   18
Recursive system structure




           Genode OS Framework Architecture   19
Service announcement




          Genode OS Framework Architecture   20
Session creation




            Genode OS Framework Architecture   21
Session creation




            Genode OS Framework Architecture   22
This works recursively




    → Application-specific TCB
            Genode OS Framework Architecture   23
Combined with virtualization




           Genode OS Framework Architecture   24
Resource management



Explicit assignment of physical resources to processes




                Genode OS Framework Architecture         25
Resource management (II)



     Resources can be attached to sessions




             Genode OS Framework Architecture   26
Resource management (III)

      Intermediation of resource requests




            Genode OS Framework Architecture   27
Resource management (IV)


         Virtualization of resources




           Genode OS Framework Architecture   28
Resource management (V)



        Server-side heap partitioning




           Genode OS Framework Architecture   29
Parent interface




void exit(exit_value)
void announce(service_name, root_capability)
session_capability session(service_name, session_args)
void upgrade(to_session_capability, quantum)
void close(session_capability)
                 Genode OS Framework Architecture        30
Root interface




session_capability session(session_args)

void upgrade(session_capability, upgrade_args)

void close(session_capability)


                 Genode OS Framework Architecture   31
Outline


1. Why do we need another operating system?

2. Genode entering the picture

3. Architectural principles

4. Core - the root of the process tree

5. Genesis of a new process

6. Simple example setup



                       Genode OS Framework Architecture   32
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL




 Debug output

  amount write(string)




                   Genode OS Framework Architecture   33
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL
 Physical memory

  ram_dataspace_capability alloc(size, cached)

  void free(ram_dataspace_capability)

  void ref_account(ram_session_capability)

  void transfer_quota(ram_session_capability, amount)

  amount quota()

  amount used()

                   Genode OS Framework Architecture     34
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL



 Object identities

  capability alloc(entrypoint_capability)

  void free(capability)




                     Genode OS Framework Architecture   35
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL


 Threads

  thread_capability create_thread(name)

  void kill_thread(thread_capability)

  void start(thread_capability, ip, sp)




                   Genode OS Framework Architecture   36
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL



 Memory-mapped I/O
 Session arguments base, size, write-combined

  io_mem_dataspace_capability dataspace()




                     Genode OS Framework Architecture   37
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL

 Port-based I/O
 Session arguments base, size

  value inb(address)
  value inw(address)
  value inl(address)

  void outb(address, value)
  void outw(address, value)
  void outl(address, value)




                       Genode OS Framework Architecture   38
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL



 Device interrupts
 Session argument irq number

  void wait_for_irq()




                     Genode OS Framework Architecture   39
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL



 Protection domain

  void bind_thread(thread_capability)

  void assign_parent(parent_capability)




                     Genode OS Framework Architecture   40
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL



 Access to boot modules
 Session argument filename

  rom_dataspace_capability dataspace()




                      Genode OS Framework Architecture   41
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL
 Address-space management

  local_addr attach(dataspace_capability, size, offset,
                    use_local_addr, local_addr,
                    executable)

  void detach(local_addr)

  void add_client(thread_capability thread)

  /* managed dataspaces */
  dataspace_capability dataspace()
  void fault_handler(signal_context_capability)
  state state()


                    Genode OS Framework Architecture      42
Core services

LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL


 Asynchronous signal delivery

  signal_context_capability alloc_context(imprint)

  void free_context(signal_context_capability)

  void submit(signal_context_capability, count)

  signal wait_for_signal()




                       Genode OS Framework Architecture   43
Outline


1. Why do we need another operating system?

2. Genode entering the picture

3. Architectural principles

4. Core - the root of the process tree

5. Genesis of a new process

6. Simple example setup



                       Genode OS Framework Architecture   44
Ingredients




Process environment set up by the parent:
      RAM    session   for   BSS and heap,
      ROM    session   for   executable binary,
      CPU    session   for   main thread,
       RM    session   for   address-space layout,
       PD    session   for   protection domain




                        Genode OS Framework Architecture   45
Parent: Obtain executable ELF binary




Rom_connection rom("init");
Rom_dataspace_capability ds_cap = rom.dataspace();
void *elf_addr = env()->rm_session()->attach(ds_cap);




                 Genode OS Framework Architecture       46
Parent: ELF binary decoding

1. Create a new region map using the RM service:
    Rm_connection rm;

2. Attach read-only parts of dataspace
    rm.attach(ds_cap, size, offset, true, addr);

3. Create RAM session, assign memory quantum
    Ram_connection ram;
    ram.ref_account(env()->ram_session_cap());
    env()->ram_session()->transfer_quota(ram, RAM_QUOTA);

4. Use RAM dataspaces for writable sections (DATA, BSS)
    rw_cap = ram.alloc(section_size);
    void *sec_addr = env()->rm_session()->attach(rw_cap);
     ... /* write to buffer at sec_addr */
    env()->rm_session()->detach(sec_addr);
    rm.attach(rw_cap, section_size, offset, true, addr);

                    Genode OS Framework Architecture        47
Parent: Creating the first thread




1. Create CPU session
    Cpu_connection cpu;

2. Create main thread
    Thread_capability thread_cap =
        cpu.create_thread("noname");

3. Associate thread with the address space layout of the process
    rm.add_client(thread_cap);




                    Genode OS Framework Architecture               48
Parent: Creating the protection domain



1. Create PD session
    Pd_connection pd;

2. Assign parent capability
    pd.assign_parent(parent_cap);

3. Associate main thread to PD
    pd.bind_thread(thread_cap);

4. Start main thread at instruction pointer and stack pointer
    cpu.start(thread_cap, ip, sp);




                     Genode OS Framework Architecture           49
Child: Execute startup code




1. C++ runtime initialization
       Exception handling
       Execute global constructors
2. Request process environment (env) capabilities from parent
3. Call main() function




                     Genode OS Framework Architecture           50
Outline


1. Why do we need another operating system?

2. Genode entering the picture

3. Architectural principles

4. Core - the root of the process tree

5. Genesis of a new process

6. Simple example setup



                       Genode OS Framework Architecture   51
Default demo scenario




           Genode OS Framework Architecture   52
Configuration

<config>
  <parent-provides>
    <service name="ROM"/>     <service name="RAM"/>     <service name="IRQ"/>
    <service name="IO_MEM"/> <service name="IO_PORT"/> <service name="CAP"/>
    <service name="PD"/>      <service name="RM"/>      <service name="CPU"/>
    <service name="LOG"/>
  </parent-provides>
  <default-route> <any-service> <parent/> <any-child/> </any-service> </default-route>
  <start name="pci_drv">
    <resource name="RAM" quantum="1M"/>
    <provides><service name="PCI"/></provides> </start>
  <start name="vesa_drv">
    <resource name="RAM" quantum="1M"/>
    <provides><service name="Framebuffer"/></provides> </start>
  <start name="ps2_drv">
    <resource name="RAM" quantum="1M"/>
    <provides><service name="Input"/></provides> </start>
  <start name="timer">
    <resource name="RAM" quantum="1M"/>
    <provides><service name="Timer"/></provides> </start>
  <start name="nitpicker">
    <resource name="RAM" quantum="1M"/>
    <provides><service name="Nitpicker"/></provides> </start>
  <start name="launchpad">
    <resource name="RAM" quantum="32M"/> </start>
</config>



                               Genode OS Framework Architecture                          53
Screenshot




             Genode OS Framework Architecture   54
Sessions




           Genode OS Framework Architecture   55
Virtualized framebuffer




           Genode OS Framework Architecture   56
Sessions including virtualized framebuffer




            Genode OS Framework Architecture   57
Thank you


What we covered today                     Coming up next...
Architecture                              Programming environment
 1. Why do we need another                  1.   Source tree overview
    operating system?                       2.   Build system
 2. Genode entering the picture             3.   Run scripts
 3. Architectural principles                4.   Inter-process communication
 4. Genesis of a new process                5.   Client-server example
 5. Simple example setup


                  More information and resources:
                      http://genode.org


                       Genode OS Framework Architecture                        58

Mais conteúdo relacionado

Mais procurados

Проведение криминалистической экспертизы и анализа руткит-программ на примере...
Проведение криминалистической экспертизы и анализа руткит-программ на примере...Проведение криминалистической экспертизы и анализа руткит-программ на примере...
Проведение криминалистической экспертизы и анализа руткит-программ на примере...
Alex Matrosov
 
VxWorks - Holistic Security (Art of Testing)
VxWorks - Holistic Security (Art of  Testing)VxWorks - Holistic Security (Art of  Testing)
VxWorks - Holistic Security (Art of Testing)
Aditya K Sood
 
Kernel init
Kernel initKernel init
Kernel init
gowell
 
Modern Bootkit Trends: Bypassing Kernel-Mode Signing Policy
Modern Bootkit Trends: Bypassing Kernel-Mode Signing PolicyModern Bootkit Trends: Bypassing Kernel-Mode Signing Policy
Modern Bootkit Trends: Bypassing Kernel-Mode Signing Policy
Alex Matrosov
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
Nalin Sharma
 

Mais procurados (20)

101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
[ArabBSD] Unix Basics
[ArabBSD] Unix Basics[ArabBSD] Unix Basics
[ArabBSD] Unix Basics
 
Проведение криминалистической экспертизы и анализа руткит-программ на примере...
Проведение криминалистической экспертизы и анализа руткит-программ на примере...Проведение криминалистической экспертизы и анализа руткит-программ на примере...
Проведение криминалистической экспертизы и анализа руткит-программ на примере...
 
VxWorks - Holistic Security (Art of Testing)
VxWorks - Holistic Security (Art of  Testing)VxWorks - Holistic Security (Art of  Testing)
VxWorks - Holistic Security (Art of Testing)
 
Linux Timer device driver
Linux Timer device driverLinux Timer device driver
Linux Timer device driver
 
Kernel init
Kernel initKernel init
Kernel init
 
Modern Bootkit Trends: Bypassing Kernel-Mode Signing Policy
Modern Bootkit Trends: Bypassing Kernel-Mode Signing PolicyModern Bootkit Trends: Bypassing Kernel-Mode Signing Policy
Modern Bootkit Trends: Bypassing Kernel-Mode Signing Policy
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Linux SD/MMC device driver
Linux SD/MMC device driverLinux SD/MMC device driver
Linux SD/MMC device driver
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
LCA13: Android Kernel Upstreaming: Overview & Status
LCA13: Android Kernel Upstreaming: Overview & StatusLCA13: Android Kernel Upstreaming: Overview & Status
LCA13: Android Kernel Upstreaming: Overview & Status
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
 
Linux Internals Part - 3
Linux Internals Part - 3Linux Internals Part - 3
Linux Internals Part - 3
 
Lecture2 process structure and programming
Lecture2   process structure and programmingLecture2   process structure and programming
Lecture2 process structure and programming
 
Signature verification of kernel module and kexec
Signature verification of kernel module and kexecSignature verification of kernel module and kexec
Signature verification of kernel module and kexec
 
EFI Secure Key
EFI Secure KeyEFI Secure Key
EFI Secure Key
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports Development
 
VM Forking and Hypervisor-based fuzzing
VM Forking and Hypervisor-based fuzzingVM Forking and Hypervisor-based fuzzing
VM Forking and Hypervisor-based fuzzing
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 

Destaque

Особенности Национального RnD
Особенности Национального RnDОсобенности Национального RnD
Особенности Национального RnD
Vasily Sartakov
 
Защита памяти при помощи NX-bit в среде L4Re
Защита памяти при помощи NX-bit в среде L4ReЗащита памяти при помощи NX-bit в среде L4Re
Защита памяти при помощи NX-bit в среде L4Re
Vasily Sartakov
 
Сетевая подсистема в L4Re и Genode
Сетевая подсистема в L4Re и GenodeСетевая подсистема в L4Re и Genode
Сетевая подсистема в L4Re и Genode
Vasily Sartakov
 

Destaque (8)

Genode Components
Genode ComponentsGenode Components
Genode Components
 
Особенности Национального RnD
Особенности Национального RnDОсобенности Национального RnD
Особенности Национального RnD
 
Защита памяти при помощи NX-bit в среде L4Re
Защита памяти при помощи NX-bit в среде L4ReЗащита памяти при помощи NX-bit в среде L4Re
Защита памяти при помощи NX-bit в среде L4Re
 
Сетевая подсистема в L4Re и Genode
Сетевая подсистема в L4Re и GenodeСетевая подсистема в L4Re и Genode
Сетевая подсистема в L4Re и Genode
 
Intro
IntroIntro
Intro
 
Genode OS Framework
Genode OS FrameworkGenode OS Framework
Genode OS Framework
 
RnD Collaborations in Asia-Pacific Region
RnD Collaborations in Asia-Pacific RegionRnD Collaborations in Asia-Pacific Region
RnD Collaborations in Asia-Pacific Region
 
System Integrity
System IntegritySystem Integrity
System Integrity
 

Semelhante a Genode Architecture

Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
DefCamp
 
Readactor-Practical Code Randomization Resilient to Memory Disclosure
Readactor-Practical Code Randomization Resilient to Memory DisclosureReadactor-Practical Code Randomization Resilient to Memory Disclosure
Readactor-Practical Code Randomization Resilient to Memory Disclosure
ch0psticks
 
Why kernelspace sucks?
Why kernelspace sucks?Why kernelspace sucks?
Why kernelspace sucks?
OpenFest team
 
7496_Hall 070204 Research Faculty Summit
7496_Hall 070204 Research Faculty Summit7496_Hall 070204 Research Faculty Summit
7496_Hall 070204 Research Faculty Summit
webuploader
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Anil Kumar Pugalia
 
Oleksyk applied-anti-forensics
Oleksyk   applied-anti-forensicsOleksyk   applied-anti-forensics
Oleksyk applied-anti-forensics
DefconRussia
 

Semelhante a Genode Architecture (20)

Genode Programming
Genode ProgrammingGenode Programming
Genode Programming
 
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
 
[2007 CodeEngn Conference 01] dual5651 - Windows 커널단의 후킹
[2007 CodeEngn Conference 01] dual5651 - Windows 커널단의 후킹[2007 CodeEngn Conference 01] dual5651 - Windows 커널단의 후킹
[2007 CodeEngn Conference 01] dual5651 - Windows 커널단의 후킹
 
Readactor-Practical Code Randomization Resilient to Memory Disclosure
Readactor-Practical Code Randomization Resilient to Memory DisclosureReadactor-Practical Code Randomization Resilient to Memory Disclosure
Readactor-Practical Code Randomization Resilient to Memory Disclosure
 
Skiron - Experiments in CPU Design in D
Skiron - Experiments in CPU Design in DSkiron - Experiments in CPU Design in D
Skiron - Experiments in CPU Design in D
 
Developing a Windows CE OAL.ppt
Developing a Windows CE OAL.pptDeveloping a Windows CE OAL.ppt
Developing a Windows CE OAL.ppt
 
Linux Kernel , BSP, Boot Loader, ARM Engineer - Satish profile
Linux Kernel , BSP, Boot Loader, ARM Engineer - Satish profileLinux Kernel , BSP, Boot Loader, ARM Engineer - Satish profile
Linux Kernel , BSP, Boot Loader, ARM Engineer - Satish profile
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution Toolkit
 
Find your own iOS kernel bug
Find your own iOS kernel bugFind your own iOS kernel bug
Find your own iOS kernel bug
 
Why kernelspace sucks?
Why kernelspace sucks?Why kernelspace sucks?
Why kernelspace sucks?
 
7496_Hall 070204 Research Faculty Summit
7496_Hall 070204 Research Faculty Summit7496_Hall 070204 Research Faculty Summit
7496_Hall 070204 Research Faculty Summit
 
Christchurch Embedded .NET User Group - Introduction to Microsoft Embedded pl...
Christchurch Embedded .NET User Group - Introduction to Microsoft Embedded pl...Christchurch Embedded .NET User Group - Introduction to Microsoft Embedded pl...
Christchurch Embedded .NET User Group - Introduction to Microsoft Embedded pl...
 
Creating user-mode debuggers for Windows
Creating user-mode debuggers for WindowsCreating user-mode debuggers for Windows
Creating user-mode debuggers for Windows
 
2015 10-30 面試心得分享
2015 10-30 面試心得分享2015 10-30 面試心得分享
2015 10-30 面試心得分享
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
 
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
 
Building
BuildingBuilding
Building
 
Oleksyk applied-anti-forensics
Oleksyk   applied-anti-forensicsOleksyk   applied-anti-forensics
Oleksyk applied-anti-forensics
 
TMPA-2017: A Survey of High-Performance Computing for Software Verification
TMPA-2017: A Survey of High-Performance Computing for Software VerificationTMPA-2017: A Survey of High-Performance Computing for Software Verification
TMPA-2017: A Survey of High-Performance Computing for Software Verification
 

Mais de Vasily Sartakov

Operating Systems Hardening
Operating Systems HardeningOperating Systems Hardening
Operating Systems Hardening
Vasily Sartakov
 
Разработка встраиваемой операционной системы на базе микроядерной архитектуры...
Разработка встраиваемой операционной системы на базе микроядерной архитектуры...Разработка встраиваемой операционной системы на базе микроядерной архитектуры...
Разработка встраиваемой операционной системы на базе микроядерной архитектуры...
Vasily Sartakov
 

Mais de Vasily Sartakov (13)

Мейнстрим технологии шифрованной памяти
Мейнстрим технологии шифрованной памятиМейнстрим технологии шифрованной памяти
Мейнстрим технологии шифрованной памяти
 
Hardware Errors and the OS
Hardware Errors and the OSHardware Errors and the OS
Hardware Errors and the OS
 
Operating Systems Meet Fault Tolerance
Operating Systems Meet Fault ToleranceOperating Systems Meet Fault Tolerance
Operating Systems Meet Fault Tolerance
 
Operating Systems Hardening
Operating Systems HardeningOperating Systems Hardening
Operating Systems Hardening
 
Trusted Computing Base
Trusted Computing BaseTrusted Computing Base
Trusted Computing Base
 
Intro
IntroIntro
Intro
 
Memory, IPC and L4Re
Memory, IPC and L4ReMemory, IPC and L4Re
Memory, IPC and L4Re
 
Introduction to Microkernels
Introduction to MicrokernelsIntroduction to Microkernels
Introduction to Microkernels
 
Advanced Components on Top of L4Re
Advanced Components on Top of L4ReAdvanced Components on Top of L4Re
Advanced Components on Top of L4Re
 
Применение Fiasco.OC
Применение Fiasco.OCПрименение Fiasco.OC
Применение Fiasco.OC
 
Прикладная Информатика 6 (36) 2011
Прикладная Информатика 6 (36) 2011Прикладная Информатика 6 (36) 2011
Прикладная Информатика 6 (36) 2011
 
Разработка встраиваемой операционной системы на базе микроядерной архитектуры...
Разработка встраиваемой операционной системы на базе микроядерной архитектуры...Разработка встраиваемой операционной системы на базе микроядерной архитектуры...
Разработка встраиваемой операционной системы на базе микроядерной архитектуры...
 
Образование, наука, бизнес. Сегодня, завтра, послезавтра
Образование, наука, бизнес. Сегодня, завтра, послезавтраОбразование, наука, бизнес. Сегодня, завтра, послезавтра
Образование, наука, бизнес. Сегодня, завтра, послезавтра
 

Último

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Último (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 

Genode Architecture

  • 1. Genode OS Framework Architecture Norman Feske <norman.feske@genode-labs.com>
  • 2. Outline 1. Why do we need another operating system? 2. Genode entering the picture 3. Architectural principles 4. Core - the root of the process tree 5. Genesis of a new process 6. Simple example setup Genode OS Framework Architecture 2
  • 3. Outline 1. Why do we need another operating system? 2. Genode entering the picture 3. Architectural principles 4. Core - the root of the process tree 5. Genesis of a new process 6. Simple example setup Genode OS Framework Architecture 3
  • 4. Myths Genode OS Framework Architecture 4
  • 5. Problem: Complexity Today’s commodity OSes Exceedingly complex trusted computing base (TCB) TCB of an application on Linux: Kernel + loaded kernel modules Daemons X Server + window manager Desktop environment All running processes of the user → User credentials are exposed to millions of lines of code Genode OS Framework Architecture 5
  • 6. Problem: Complexity (II) Implications: High likelihood for bugs (need for frequent security updates) Huge attack surface for directed attacks Zero-day exploits Genode OS Framework Architecture 6
  • 7. Problem: Global names Many examples on traditional systems UIDs, PIDs network interface names port numbers device nodes ... Leak information Name is a potential attack vector (ambient authority) Genode OS Framework Architecture 7
  • 8. Problem: Resource management Pretension of unlimited resources Lack of accounting → Largely indeterministic behavior → Need for complex heuristics, schedulers Genode OS Framework Architecture 8
  • 9. Key technologies Microkernels Decomponentization, kernelization Capability-based security Virtualization Genode OS Framework Architecture 9
  • 10. Tricky questions How to... ...build a system without global names? ...trade between parties that do not know each other? ...reclaim kidnapped goods from an alien? (without violence) ...deal with distributed access-control policies? ...transparently monitor communication? ...recycle a subsystem without knowing its internal structure? Genode OS Framework Architecture 10
  • 11. Even more tricky questions How to... ...avoid performance hazards through many indirections? ...translate architectural ideas into a real implementation? Genode OS Framework Architecture 11
  • 12. Outline 1. Why do we need another operating system? 2. Genode entering the picture 3. Architectural principles 4. Core - the root of the process tree 5. Genesis of a new process 6. Simple example setup Genode OS Framework Architecture 12
  • 13. A bit of history Research timeline at TU Dresden Genode OS Framework Architecture 13
  • 14. A new generation of kernels on the horizon Genode OS Framework Architecture 14
  • 15. Unique feature: Cross-kernel portability When started, no suitable microkernel was available → Prototyped on Linux and L4/Fiasco → Later ported to other kernels Genode OS Framework Architecture 15
  • 16. Today: Rich OS construction kit Support of a variety of kernels OKL4, L4/Fiasco, L4ka::Pistachio, NOVA, Fiasco.OC, Linux, Codezero Preservation of special kernel features OKLinux on OKL4, L4Linux on Fiasco.OC, Vancouver on NOVA, Real-time priorities on L4/Fiasco Uniform API → kernel-independent components Many ready-to-use device drivers, protocol stacks, and 3rd-party libraries Genode OS Framework Architecture 16
  • 17. Outline 1. Why do we need another operating system? 2. Genode entering the picture 3. Architectural principles 4. Core - the root of the process tree 5. Genesis of a new process 6. Simple example setup Genode OS Framework Architecture 17
  • 18. Object capabilities Delegation of rights Each process lives in a virtual environment A process that possesses a right (capability) can Use it (invoke) Delegate it to acquainted processes Genode OS Framework Architecture 18
  • 19. Recursive system structure Genode OS Framework Architecture 19
  • 20. Service announcement Genode OS Framework Architecture 20
  • 21. Session creation Genode OS Framework Architecture 21
  • 22. Session creation Genode OS Framework Architecture 22
  • 23. This works recursively → Application-specific TCB Genode OS Framework Architecture 23
  • 24. Combined with virtualization Genode OS Framework Architecture 24
  • 25. Resource management Explicit assignment of physical resources to processes Genode OS Framework Architecture 25
  • 26. Resource management (II) Resources can be attached to sessions Genode OS Framework Architecture 26
  • 27. Resource management (III) Intermediation of resource requests Genode OS Framework Architecture 27
  • 28. Resource management (IV) Virtualization of resources Genode OS Framework Architecture 28
  • 29. Resource management (V) Server-side heap partitioning Genode OS Framework Architecture 29
  • 30. Parent interface void exit(exit_value) void announce(service_name, root_capability) session_capability session(service_name, session_args) void upgrade(to_session_capability, quantum) void close(session_capability) Genode OS Framework Architecture 30
  • 31. Root interface session_capability session(session_args) void upgrade(session_capability, upgrade_args) void close(session_capability) Genode OS Framework Architecture 31
  • 32. Outline 1. Why do we need another operating system? 2. Genode entering the picture 3. Architectural principles 4. Core - the root of the process tree 5. Genesis of a new process 6. Simple example setup Genode OS Framework Architecture 32
  • 33. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Debug output amount write(string) Genode OS Framework Architecture 33
  • 34. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Physical memory ram_dataspace_capability alloc(size, cached) void free(ram_dataspace_capability) void ref_account(ram_session_capability) void transfer_quota(ram_session_capability, amount) amount quota() amount used() Genode OS Framework Architecture 34
  • 35. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Object identities capability alloc(entrypoint_capability) void free(capability) Genode OS Framework Architecture 35
  • 36. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Threads thread_capability create_thread(name) void kill_thread(thread_capability) void start(thread_capability, ip, sp) Genode OS Framework Architecture 36
  • 37. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Memory-mapped I/O Session arguments base, size, write-combined io_mem_dataspace_capability dataspace() Genode OS Framework Architecture 37
  • 38. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Port-based I/O Session arguments base, size value inb(address) value inw(address) value inl(address) void outb(address, value) void outw(address, value) void outl(address, value) Genode OS Framework Architecture 38
  • 39. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Device interrupts Session argument irq number void wait_for_irq() Genode OS Framework Architecture 39
  • 40. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Protection domain void bind_thread(thread_capability) void assign_parent(parent_capability) Genode OS Framework Architecture 40
  • 41. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Access to boot modules Session argument filename rom_dataspace_capability dataspace() Genode OS Framework Architecture 41
  • 42. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Address-space management local_addr attach(dataspace_capability, size, offset, use_local_addr, local_addr, executable) void detach(local_addr) void add_client(thread_capability thread) /* managed dataspaces */ dataspace_capability dataspace() void fault_handler(signal_context_capability) state state() Genode OS Framework Architecture 42
  • 43. Core services LOG RAM CAP CPU IO MEM IO PORT IRQ PD ROM RM SIGNAL Asynchronous signal delivery signal_context_capability alloc_context(imprint) void free_context(signal_context_capability) void submit(signal_context_capability, count) signal wait_for_signal() Genode OS Framework Architecture 43
  • 44. Outline 1. Why do we need another operating system? 2. Genode entering the picture 3. Architectural principles 4. Core - the root of the process tree 5. Genesis of a new process 6. Simple example setup Genode OS Framework Architecture 44
  • 45. Ingredients Process environment set up by the parent: RAM session for BSS and heap, ROM session for executable binary, CPU session for main thread, RM session for address-space layout, PD session for protection domain Genode OS Framework Architecture 45
  • 46. Parent: Obtain executable ELF binary Rom_connection rom("init"); Rom_dataspace_capability ds_cap = rom.dataspace(); void *elf_addr = env()->rm_session()->attach(ds_cap); Genode OS Framework Architecture 46
  • 47. Parent: ELF binary decoding 1. Create a new region map using the RM service: Rm_connection rm; 2. Attach read-only parts of dataspace rm.attach(ds_cap, size, offset, true, addr); 3. Create RAM session, assign memory quantum Ram_connection ram; ram.ref_account(env()->ram_session_cap()); env()->ram_session()->transfer_quota(ram, RAM_QUOTA); 4. Use RAM dataspaces for writable sections (DATA, BSS) rw_cap = ram.alloc(section_size); void *sec_addr = env()->rm_session()->attach(rw_cap); ... /* write to buffer at sec_addr */ env()->rm_session()->detach(sec_addr); rm.attach(rw_cap, section_size, offset, true, addr); Genode OS Framework Architecture 47
  • 48. Parent: Creating the first thread 1. Create CPU session Cpu_connection cpu; 2. Create main thread Thread_capability thread_cap = cpu.create_thread("noname"); 3. Associate thread with the address space layout of the process rm.add_client(thread_cap); Genode OS Framework Architecture 48
  • 49. Parent: Creating the protection domain 1. Create PD session Pd_connection pd; 2. Assign parent capability pd.assign_parent(parent_cap); 3. Associate main thread to PD pd.bind_thread(thread_cap); 4. Start main thread at instruction pointer and stack pointer cpu.start(thread_cap, ip, sp); Genode OS Framework Architecture 49
  • 50. Child: Execute startup code 1. C++ runtime initialization Exception handling Execute global constructors 2. Request process environment (env) capabilities from parent 3. Call main() function Genode OS Framework Architecture 50
  • 51. Outline 1. Why do we need another operating system? 2. Genode entering the picture 3. Architectural principles 4. Core - the root of the process tree 5. Genesis of a new process 6. Simple example setup Genode OS Framework Architecture 51
  • 52. Default demo scenario Genode OS Framework Architecture 52
  • 53. Configuration <config> <parent-provides> <service name="ROM"/> <service name="RAM"/> <service name="IRQ"/> <service name="IO_MEM"/> <service name="IO_PORT"/> <service name="CAP"/> <service name="PD"/> <service name="RM"/> <service name="CPU"/> <service name="LOG"/> </parent-provides> <default-route> <any-service> <parent/> <any-child/> </any-service> </default-route> <start name="pci_drv"> <resource name="RAM" quantum="1M"/> <provides><service name="PCI"/></provides> </start> <start name="vesa_drv"> <resource name="RAM" quantum="1M"/> <provides><service name="Framebuffer"/></provides> </start> <start name="ps2_drv"> <resource name="RAM" quantum="1M"/> <provides><service name="Input"/></provides> </start> <start name="timer"> <resource name="RAM" quantum="1M"/> <provides><service name="Timer"/></provides> </start> <start name="nitpicker"> <resource name="RAM" quantum="1M"/> <provides><service name="Nitpicker"/></provides> </start> <start name="launchpad"> <resource name="RAM" quantum="32M"/> </start> </config> Genode OS Framework Architecture 53
  • 54. Screenshot Genode OS Framework Architecture 54
  • 55. Sessions Genode OS Framework Architecture 55
  • 56. Virtualized framebuffer Genode OS Framework Architecture 56
  • 57. Sessions including virtualized framebuffer Genode OS Framework Architecture 57
  • 58. Thank you What we covered today Coming up next... Architecture Programming environment 1. Why do we need another 1. Source tree overview operating system? 2. Build system 2. Genode entering the picture 3. Run scripts 3. Architectural principles 4. Inter-process communication 4. Genesis of a new process 5. Client-server example 5. Simple example setup More information and resources: http://genode.org Genode OS Framework Architecture 58