Files
LDD-LinuxDeviceDrivers/distro/Apple

2 OpenAnolis cloud-kernel 分析


title: 苹果内核 XNU date: 2021-05-05 18:40 author: gatieme tags: hexo categories: - hexo thumbnail: blogexcerpt: 树莓派使用资料


CSDN GitHub Hexo
Aderstep--紫夜阑珊-青伶巷草 AderXCoding/system/tools gatieme.github.io

知识共享许可协议

本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可, 转载请注明出处, 谢谢合作


1 总体架构


首先一图解百忧:

Apple IOS 总体架构

iOS&mac 系统内核

Kernel Architecture Overview

XNU 简介

Apple 的内核叫做 XNU(XNU's Not UNIX), 这是个混合内核, XNU 包含两个部分, BSD 和 Mach

  1.  BSD 实现了 POSIX, Networking, Filesystem 等
    
  2.  Mach 实现了最为基本的多处理器支持, 虚拟内存, 分页, 调度, IPC, RPC 等.
    
  3.  在 Mach 的基础上, 就是 IOKit 和各类 Kext 了.
    

2 SCHED


2.1 CONFIG_SCHED_EDGE


sched_update_pset_load_average

2.2 CONFIG_SCHED_MULTIQ


2.3 CONFIG_SCHED_CLUTCH


xnu-6153.11.26

The clutch scheduler is enabled only on non-AMP platforms for now

Mach Overview

3 IPC


Using Continuations to Implement Thread Management and Communication in Operating Systems

Interface and Execution Models in the Fluke Kernel

在 Mach3.0 中对系统线程所作的一项改进即称为 continuation, 其动因恰在于避免保留线程堆栈, 希望使用完全无状态的 continuation 函数.(参见 Uresh Vahalia 的经典著作 "UNIX Internals" http://www.china-pub.com/computers/common/info.asp?id=12731).