SlideShare a Scribd company logo
1 of 33
Download to read offline
第一次自幹作業系統核心
          就上手!



Jim Huang ( 黃敬群 ) <jserv@0xlab.org>
Developer, 0xlab / JuluOSDev - http://www.juluos.org/

                                      Aug 19, 2012 / COSCUP
作為 LXDE/PCManFM 的開發者,我
    也好想去聽隔壁的議程
          ~>_<~



                     2
「是個正常人,做正常人能做的事情」
        PCMan 自介 (2006)
    http://www.openfoundry.org/en/os-people/629




                                              3
設計與實做一套新的作業系統 ( 核
心 ) 絕對是正常人能作的事情,而且
對生活有益




                     4
Agenda   (1) 開發 OS Kernel 的動機
         (2) 以微核心來建構 OS Kernel
         (3) 立馬體驗




                                 5
開發 OS Kernel 的動機




                   6
動機
每年寫一套 ( 玩具 )
作業系統當作業
JK (2001; NCKU homework)
Orz Microkernel (2006)
RT nanokernel (2007; OSDC.tw)
Jamei RTOS (2007; COSCUP)
CuRT (2009; COSCUP)
TMK (2010; ICOS)
??? (2012; Assign homework to NCKU students)    7
Show Me the Robot!




                8
等等,開發作業系統核心有意義嗎?




               9
明明就有,
 明明就有,
但你沒看清楚
但你沒看清楚




         10
現在更需要開發作業系統核心的技能

• 許多 Web/Application Framework 師法先進
  作業系統的效能技巧
• 虛擬化技術
  – Hypervisor, Resource Kernel (KVM), ...
  – Intel VT-d / ARM Cortex-A15
• 資訊安全領域
  – 以特製的 VM 作動態分析與追蹤
• 逃離鬼島
 • NASA 需要你!


                                             11
以微核心建構 OS Kernel




                   12
策略: Nested Kernel

     • 直接將 OS Kernel 架構於一個成熟的 microkernel
       之上,避免直接碰觸硬體
     • 回歸「設計」本質
     • 將 microkernel 的 IPC/RPC 服務再進一步抽象




                                             13
L4Ka - http://www.l4ka.org/
MyOS
MyOS
                        L4 Sigma0

       L4 microkernel
       L4 microkernel




                                14
Microkernel 的三個世代

• Mach, Chorus (1985-1994)
  – 將 UNIX pipes 替換為 IPC ( 更通用 )
  – 改善系統穩定度 ( 與 monolithic 相比 )
  – 低劣的執行效能
• L3 & L4 (1990-2001)
  – 針對 IPC 大量的效能改善
  – 以組合語言開發,低可攜性
  – 只提供同步的 (sync) IPC
  – 非常小的實做,大部分的功能移到 userspace

• seL4, Coyotos, Nova (2000- 目前 )
  – 儘量作到與平台無關
  – verification, security, multiple CPUs, etc.
第二代 Microkernel (L4) 典型設計


Device Drivers     User Program       Memory
                                      Managers
                    User Mode


 Address spacing   Thread             Unique
                   Management         Identifiers
                   and IPC

                   Microkernel Mode


                      Hardware

                                                    16
遞迴式的 Address Space
Map
    ( 與其他 AS 分享 page)
        Memory Manager                      Memory Manager

                                                    Page Fault IPC

1
1      L4 microkernel                  2
                                       2   L4 microkernel




                          Page Grant
                              IPC
        Memory Manager   ( 將 page 給予        Memory Manager
                         其他 AS 存取 )



3
3     L4 microkernel                   4
                                       4   L4 microkernel
Map




• 若系統存在兩個不同 address space       Application
                                Application    Pager
                                               Pager
  的執行單元 ( 如 Process) ,而其中
  一者 (userA) 想要存取另一者
  (userB) 的記體體,只要將 userA
  設置為 userB 的 pager ( 記憶體管理
  單元 ) 並提供 userB 的 page fault
  handler 即可
• Sigma0 RPC 通訊協定是 L4 除了
  FastIPC 外,另一個主要的設計,
  用以處理記憶體管理
• 系統的 initial pager 為 sigma0 ,而
  MyOS 在 L4 的術語叫做 root task /
  server




                                  21
訊息傳遞機制 : Copy Data
•   直接與間接的資料複製
•   UTCB message (special area)
•   Special case: register-only message
•   Pagefaults during user-level memory access possible
Copy               TaskB Copy
            TaskA
                           Data Area
                                                    訊息傳遞
Data Area
                           UTCB
UTCB                       message          Msg
message
                    Msg
Capabilities   ( 執行特定 IPC 的權級單位 )
立馬體驗 :
自幹 MyOS



          26
27
在 OSDC.tw 2012 挑戰失敗,
在 OSDC.tw 2012 挑戰失敗,   28
群群轉戰 COSCUP 繼續自幹
群群轉戰 COSCUP 繼續自幹
MyOS
• 真的能動的 OS!
  – 建構於 L4Ka (Pistachio) 的基礎之上
• 以 CORBA 介面串連個別系統元件
 interface File {
     boolean Read(in Capability_t cap,
                  in unsigned long offset,
                  out byteseq_t buffer,
                  inout unsigned long size);
                  unsigned long Size(in Capability_t cap);
     ...
 }
• Name System
• 實做基本的檔案系統
• 提供 Tiny Ruby 一類的程式語言執行環境




                                                             29
「寫一個 OS 是多麼美好的事,在有
 限的生命中千萬不要遺漏了它」
    王佑中博士 (2009)



                 30
31
Reference

Microkernel Construction (SS2012), TU Dresden Operating
System Group

將 CuRT 用作大學作業系統教材 :
http://sites.google.com/site/embedded2009/introduction-to-curt-v1

Write Your Own Operating System [FAQ]:
http://www.superfrink.net/athenaeum/OS-FAQ/os-faq.html

SigOPS, How to Write an Operating System:
http://www.acm.uiuc.edu/sigops/roll_your_own/

OSDev Wiki: http://wiki.osdev.org/

                                                                    32
http://0xlab.org




                   33

More Related Content

What's hot

Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
Sasha Goldshtein
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
Brendan Gregg
 

What's hot (20)

Unix v6 Internals
Unix v6 InternalsUnix v6 Internals
Unix v6 Internals
 
New Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using Tracing
 
Process Address Space: The way to create virtual address (page table) of user...
Process Address Space: The way to create virtual address (page table) of user...Process Address Space: The way to create virtual address (page table) of user...
Process Address Space: The way to create virtual address (page table) of user...
 
Staring into the eBPF Abyss
Staring into the eBPF AbyssStaring into the eBPF Abyss
Staring into the eBPF Abyss
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
 
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdsotwlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdso
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
Slab Allocator in Linux Kernel
Slab Allocator in Linux KernelSlab Allocator in Linux Kernel
Slab Allocator in Linux Kernel
 
Improve Android System Component Performance
Improve Android System Component PerformanceImprove Android System Component Performance
Improve Android System Component Performance
 
Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device Drivers
 
Understanding of linux kernel memory model
Understanding of linux kernel memory modelUnderstanding of linux kernel memory model
Understanding of linux kernel memory model
 
Linux Kernel Live Patching
Linux Kernel Live PatchingLinux Kernel Live Patching
Linux Kernel Live Patching
 
NEDIA_SNIA_CXL_講演資料.pdf
NEDIA_SNIA_CXL_講演資料.pdfNEDIA_SNIA_CXL_講演資料.pdf
NEDIA_SNIA_CXL_講演資料.pdf
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
 
2017年11月02日「radare2」トーク/ワークショップAVTokyo 2017
2017年11月02日「radare2」トーク/ワークショップAVTokyo 2017 2017年11月02日「radare2」トーク/ワークショップAVTokyo 2017
2017年11月02日「radare2」トーク/ワークショップAVTokyo 2017
 
Linux Binary Exploitation - Stack buffer overflow
Linux Binary Exploitation - Stack buffer overflowLinux Binary Exploitation - Stack buffer overflow
Linux Binary Exploitation - Stack buffer overflow
 
from Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Worksfrom Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Works
 
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedKernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
 
DPDK KNI interface
DPDK KNI interfaceDPDK KNI interface
DPDK KNI interface
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernel
 

Viewers also liked

Viewers also liked (20)

Build Your Own Android Toolchain from scratch
Build Your Own Android Toolchain from scratchBuild Your Own Android Toolchain from scratch
Build Your Own Android Toolchain from scratch
 
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
 
Faults inside System Software
Faults inside System SoftwareFaults inside System Software
Faults inside System Software
 
Open Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to EcosystemOpen Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to Ecosystem
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation Systems
 
Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and Implementation
 
Hints for L4 Microkernel
Hints for L4 MicrokernelHints for L4 Microkernel
Hints for L4 Microkernel
 
Implement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVMImplement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVM
 
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
 
Construct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoTConstruct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoT
 
Embedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile DevicesEmbedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile Devices
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM Boards
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
The Internals of "Hello World" Program
The Internals of "Hello World" ProgramThe Internals of "Hello World" Program
The Internals of "Hello World" Program
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
 
Priority Inversion on Mars
Priority Inversion on MarsPriority Inversion on Mars
Priority Inversion on Mars
 
Hardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for AndroidHardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for Android
 
Xvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisorXvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisor
 

Similar to Develop Your Own Operating System

Erlang分布式系统的的领域语言
Erlang分布式系统的的领域语言Erlang分布式系统的的领域语言
Erlang分布式系统的的领域语言
Feng Yu
 
Java线上应用问题排查方法和工具(空望)
Java线上应用问题排查方法和工具(空望)Java线上应用问题排查方法和工具(空望)
Java线上应用问题排查方法和工具(空望)
ykdsg
 
基于MySQL开放复制协议的同步扩展
基于MySQL开放复制协议的同步扩展基于MySQL开放复制协议的同步扩展
基于MySQL开放复制协议的同步扩展
Sky Jian
 
Lvs在大规模网络环境下的应用pukong
Lvs在大规模网络环境下的应用pukongLvs在大规模网络环境下的应用pukong
Lvs在大规模网络环境下的应用pukong
Michael Zhang
 
MySQL新技术探索与实践
MySQL新技术探索与实践MySQL新技术探索与实践
MySQL新技术探索与实践
Lixun Peng
 
MySQL新技术探索与实践
MySQL新技术探索与实践MySQL新技术探索与实践
MySQL新技术探索与实践
Lixun Peng
 
0911 juluosdev a_journey_of_filesystem_on_jos
0911 juluosdev a_journey_of_filesystem_on_jos0911 juluosdev a_journey_of_filesystem_on_jos
0911 juluosdev a_journey_of_filesystem_on_jos
Waylin Ch
 
20030623 linuxbasic and-security
20030623 linuxbasic and-security20030623 linuxbasic and-security
20030623 linuxbasic and-security
建融 黃
 
Baidu LSP and DISQL for Log Analysis
Baidu LSP and DISQL for Log AnalysisBaidu LSP and DISQL for Log Analysis
Baidu LSP and DISQL for Log Analysis
Xiaoming Chen
 

Similar to Develop Your Own Operating System (20)

Erlang分布式系统的的领域语言
Erlang分布式系统的的领域语言Erlang分布式系统的的领域语言
Erlang分布式系统的的领域语言
 
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
開發人員必須知道的 Kubernetes 核心技術 - Kubernetes Summit 2018
 
豆瓣网技术架构变迁
豆瓣网技术架构变迁豆瓣网技术架构变迁
豆瓣网技术架构变迁
 
Java线上应用问题排查方法和工具(空望)
Java线上应用问题排查方法和工具(空望)Java线上应用问题排查方法和工具(空望)
Java线上应用问题排查方法和工具(空望)
 
Godson x86
Godson x86Godson x86
Godson x86
 
Big Java, Big Data
Big Java, Big DataBig Java, Big Data
Big Java, Big Data
 
Tilera和fos的学习
Tilera和fos的学习Tilera和fos的学习
Tilera和fos的学习
 
基于MySQL开放复制协议的同步扩展
基于MySQL开放复制协议的同步扩展基于MySQL开放复制协议的同步扩展
基于MySQL开放复制协议的同步扩展
 
Tcfsh bootcamp day2
 Tcfsh bootcamp day2 Tcfsh bootcamp day2
Tcfsh bootcamp day2
 
Some tips
Some tipsSome tips
Some tips
 
Lvs在大规模网络环境下的应用pukong
Lvs在大规模网络环境下的应用pukongLvs在大规模网络环境下的应用pukong
Lvs在大规模网络环境下的应用pukong
 
MySQL新技术探索与实践
MySQL新技术探索与实践MySQL新技术探索与实践
MySQL新技术探索与实践
 
MySQL新技术探索与实践
MySQL新技术探索与实践MySQL新技术探索与实践
MySQL新技术探索与实践
 
0911 juluosdev a_journey_of_filesystem_on_jos
0911 juluosdev a_journey_of_filesystem_on_jos0911 juluosdev a_journey_of_filesystem_on_jos
0911 juluosdev a_journey_of_filesystem_on_jos
 
20030623 linuxbasic and-security
20030623 linuxbasic and-security20030623 linuxbasic and-security
20030623 linuxbasic and-security
 
Baidu LSP and DISQL for Log Analysis
Baidu LSP and DISQL for Log AnalysisBaidu LSP and DISQL for Log Analysis
Baidu LSP and DISQL for Log Analysis
 
CKAN 技術介紹 (基礎篇)
CKAN 技術介紹 (基礎篇)CKAN 技術介紹 (基礎篇)
CKAN 技術介紹 (基礎篇)
 
Linux Container Introduction
Linux Container IntroductionLinux Container Introduction
Linux Container Introduction
 
Exadata training
Exadata trainingExadata training
Exadata training
 
[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階
 

More from National Cheng Kung University

More from National Cheng Kung University (12)

PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtime
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
從線上售票看作業系統設計議題
從線上售票看作業系統設計議題從線上售票看作業系統設計議題
從線上售票看作業系統設計議題
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
 
Summer Project: Microkernel (2013)
Summer Project: Microkernel (2013)Summer Project: Microkernel (2013)
Summer Project: Microkernel (2013)
 

Develop Your Own Operating System

  • 1. 第一次自幹作業系統核心 就上手! Jim Huang ( 黃敬群 ) <jserv@0xlab.org> Developer, 0xlab / JuluOSDev - http://www.juluos.org/ Aug 19, 2012 / COSCUP
  • 2. 作為 LXDE/PCManFM 的開發者,我 也好想去聽隔壁的議程 ~>_<~ 2
  • 3. 「是個正常人,做正常人能做的事情」 PCMan 自介 (2006) http://www.openfoundry.org/en/os-people/629 3
  • 4. 設計與實做一套新的作業系統 ( 核 心 ) 絕對是正常人能作的事情,而且 對生活有益 4
  • 5. Agenda (1) 開發 OS Kernel 的動機 (2) 以微核心來建構 OS Kernel (3) 立馬體驗 5
  • 6. 開發 OS Kernel 的動機 6
  • 7. 動機 每年寫一套 ( 玩具 ) 作業系統當作業 JK (2001; NCKU homework) Orz Microkernel (2006) RT nanokernel (2007; OSDC.tw) Jamei RTOS (2007; COSCUP) CuRT (2009; COSCUP) TMK (2010; ICOS) ??? (2012; Assign homework to NCKU students) 7
  • 8. Show Me the Robot! 8
  • 11. 現在更需要開發作業系統核心的技能 • 許多 Web/Application Framework 師法先進 作業系統的效能技巧 • 虛擬化技術 – Hypervisor, Resource Kernel (KVM), ... – Intel VT-d / ARM Cortex-A15 • 資訊安全領域 – 以特製的 VM 作動態分析與追蹤 • 逃離鬼島 • NASA 需要你! 11
  • 13. 策略: Nested Kernel • 直接將 OS Kernel 架構於一個成熟的 microkernel 之上,避免直接碰觸硬體 • 回歸「設計」本質 • 將 microkernel 的 IPC/RPC 服務再進一步抽象 13 L4Ka - http://www.l4ka.org/
  • 14. MyOS MyOS L4 Sigma0 L4 microkernel L4 microkernel 14
  • 15. Microkernel 的三個世代 • Mach, Chorus (1985-1994) – 將 UNIX pipes 替換為 IPC ( 更通用 ) – 改善系統穩定度 ( 與 monolithic 相比 ) – 低劣的執行效能 • L3 & L4 (1990-2001) – 針對 IPC 大量的效能改善 – 以組合語言開發,低可攜性 – 只提供同步的 (sync) IPC – 非常小的實做,大部分的功能移到 userspace • seL4, Coyotos, Nova (2000- 目前 ) – 儘量作到與平台無關 – verification, security, multiple CPUs, etc.
  • 16. 第二代 Microkernel (L4) 典型設計 Device Drivers User Program Memory Managers User Mode Address spacing Thread Unique Management Identifiers and IPC Microkernel Mode Hardware 16
  • 17.
  • 19. Map ( 與其他 AS 分享 page) Memory Manager Memory Manager Page Fault IPC 1 1 L4 microkernel 2 2 L4 microkernel Page Grant IPC Memory Manager ( 將 page 給予 Memory Manager 其他 AS 存取 ) 3 3 L4 microkernel 4 4 L4 microkernel
  • 20. Map • 若系統存在兩個不同 address space Application Application Pager Pager 的執行單元 ( 如 Process) ,而其中 一者 (userA) 想要存取另一者 (userB) 的記體體,只要將 userA 設置為 userB 的 pager ( 記憶體管理 單元 ) 並提供 userB 的 page fault handler 即可
  • 21. • Sigma0 RPC 通訊協定是 L4 除了 FastIPC 外,另一個主要的設計, 用以處理記憶體管理 • 系統的 initial pager 為 sigma0 ,而 MyOS 在 L4 的術語叫做 root task / server 21
  • 22. 訊息傳遞機制 : Copy Data • 直接與間接的資料複製 • UTCB message (special area) • Special case: register-only message • Pagefaults during user-level memory access possible
  • 23. Copy TaskB Copy TaskA Data Area 訊息傳遞 Data Area UTCB UTCB message Msg message Msg
  • 24.
  • 25. Capabilities ( 執行特定 IPC 的權級單位 )
  • 27. 27
  • 28. 在 OSDC.tw 2012 挑戰失敗, 在 OSDC.tw 2012 挑戰失敗, 28 群群轉戰 COSCUP 繼續自幹 群群轉戰 COSCUP 繼續自幹
  • 29. MyOS • 真的能動的 OS! – 建構於 L4Ka (Pistachio) 的基礎之上 • 以 CORBA 介面串連個別系統元件 interface File { boolean Read(in Capability_t cap, in unsigned long offset, out byteseq_t buffer, inout unsigned long size); unsigned long Size(in Capability_t cap); ... } • Name System • 實做基本的檔案系統 • 提供 Tiny Ruby 一類的程式語言執行環境 29
  • 30. 「寫一個 OS 是多麼美好的事,在有 限的生命中千萬不要遺漏了它」 王佑中博士 (2009) 30
  • 31. 31
  • 32. Reference Microkernel Construction (SS2012), TU Dresden Operating System Group 將 CuRT 用作大學作業系統教材 : http://sites.google.com/site/embedded2009/introduction-to-curt-v1 Write Your Own Operating System [FAQ]: http://www.superfrink.net/athenaeum/OS-FAQ/os-faq.html SigOPS, How to Write an Operating System: http://www.acm.uiuc.edu/sigops/roll_your_own/ OSDev Wiki: http://wiki.osdev.org/ 32