{
 "Kernel 原始碼結構與 Kconfig 設定#3": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "目錄",
   "內容"
  ],
  "rows": [
   [
    "arch/",
    "各 CPU 架構、defconfig、dts"
   ],
   [
    "drivers/",
    "驅動程式"
   ],
   [
    "fs/",
    "檔案系統"
   ]
  ],
  "widths": [
   2,
   4
  ]
 },
 "Kernel 原始碼結構與 Kconfig 設定#4": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "head": [
   "目錄",
   "內容"
  ],
  "rows": [
   [
    "kernel/ mm/",
    "排程、記憶體管理"
   ],
   [
    "net/",
    "網路協定"
   ],
   [
    "include/",
    "標頭檔"
   ],
   [
    "Documentation/",
    "文件,含 devicetree/bindings"
   ],
   [
    "scripts/",
    "建置腳本(menuconfig、dtc)"
   ]
  ],
  "widths": [
   2,
   4
  ]
 },
 "Kernel 原始碼結構與 Kconfig 設定#6": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   3
  ],
  "cards": [
   {
    "title": "=y",
    "points": [
     "編進 kernel 映像檔",
     "built-in"
    ]
   },
   {
    "title": "=m",
    "points": [
     "編成可載入模組",
     "副檔名 .ko"
    ]
   },
   {
    "title": "is not set",
    "points": [
     "註解形式",
     "表示沒有啟用"
    ]
   }
  ]
 },
 "Kernel 原始碼結構與 Kconfig 設定#7": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   ".config 內容",
   "意思"
  ],
  "rows": [
   [
    "CONFIG_GPIO_SYSFS=y",
    "編進 kernel"
   ],
   [
    "CONFIG_I2C_CHARDEV=m",
    "編成模組"
   ],
   [
    "# CONFIG_BT is not set",
    "藍牙未啟用"
   ]
  ],
  "widths": [
   4,
   2
  ]
 },
 "編譯 Kernel 與產出檔案#2": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "export",
    "points": [
     "設好 ARCH",
     "與交叉編譯器前綴"
    ]
   },
   {
    "title": "-j$(nproc)",
    "points": [
     "依 CPU 核心數",
     "平行編譯"
    ]
   },
   {
    "title": "三個目標",
    "points": [
     "Image",
     "dtbs",
     "modules"
    ]
   }
  ]
 },
 "編譯 Kernel 與產出檔案#3": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "nodes": [
   {
    "label": "cd",
    "sub": "Linux 原始碼目錄",
    "color": 0
   },
   {
    "label": "ARCH",
    "sub": "arm64",
    "color": 1
   },
   {
    "label": "CROSS_COMPILE",
    "sub": "aarch64-linux-gnu-",
    "color": 2
   },
   {
    "label": "make defconfig",
    "sub": "預設設定",
    "color": 0
   },
   {
    "label": "make",
    "sub": "Image modules dtbs",
    "color": 1,
    "kind": "end"
   }
  ]
 },
 "編譯 Kernel 與產出檔案#4": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "項目",
   "ARM64",
   "ARM32"
  ],
  "rows": [
   [
    "ARCH",
    "arm64",
    "arm"
   ],
   [
    "前綴",
    "aarch64-linux-gnu-",
    "arm-linux-gnueabihf-"
   ],
   [
    "設定",
    "defconfig",
    "multi_v7_defconfig"
   ],
   [
    "映像目標",
    "Image",
    "zImage"
   ]
  ],
  "widths": [
   1,
   2,
   2
  ]
 },
 "編譯 Kernel 與產出檔案#6": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "檔案",
   "說明"
  ],
  "rows": [
   [
    "arch/arm64/boot/Image",
    "未壓縮的 kernel 映像"
   ],
   [
    "arch/arm64/boot/Image.gz",
    "壓縮版"
   ],
   [
    "arch/arm64/boot/dts/<廠商>/*.dtb",
    "裝置樹"
   ],
   [
    "vmlinux",
    "含符號的 ELF,供除錯"
   ]
  ],
  "widths": [
   4,
   3
  ]
 },
 "編譯 Kernel 與產出檔案#7": {
  "type": "table",
  "reveal": [
   0,
   1,
   2
  ],
  "head": [
   "檔案",
   "說明"
  ],
  "rows": [
   [
    "System.map",
    "符號與位址對照"
   ],
   [
    "arch/arm/boot/zImage",
    "ARM32 的映像"
   ]
  ],
  "widths": [
   3,
   3
  ]
 },
 "撰寫與載入核心模組#2": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "module_init / exit",
    "points": [
     "註冊載入與卸載",
     "要呼叫的函式"
    ]
   },
   {
    "title": "pr_info",
    "points": [
     "printk 的分級包裝",
     "用 dmesg 查看"
    ]
   },
   {
    "title": "MODULE_LICENSE",
    "points": [
     "一定要寫,通常 GPL",
     "否則 kernel 被標記 tainted"
    ]
   }
  ]
 },
 "驅動程式如何與裝置樹配對#1": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   0,
   4
  ],
  "nodes": [
   {
    "label": "裝置樹節點",
    "sub": "status = okay",
    "color": 0
   },
   {
    "label": "platform device",
    "sub": "kernel 自動建立",
    "color": 1
   },
   {
    "label": "比對 compatible",
    "color": 2
   },
   {
    "label": "呼叫 probe",
    "sub": "驅動綁定",
    "color": 0,
    "kind": "end"
   }
  ]
 },
 "驅動程式如何與裝置樹配對#2": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "cards": [
   {
    "title": "of_device_id",
    "points": [
     "列出支援的 compatible",
     "最後放空項目收尾"
    ]
   },
   {
    "title": "module_platform_driver",
    "points": [
     "自動產生",
     "註冊與反註冊"
    ]
   },
   {
    "title": "platform device",
    "points": [
     "okay 的節點",
     "kernel 自動建立"
    ]
   },
   {
    "title": "probe",
    "points": [
     "of_property_read_*",
     "dev_info 自動加前綴"
    ]
   }
  ]
 },
 "驅動程式如何與裝置樹配對#7": {
  "type": "table",
  "reveal": [
   0,
   0,
   2,
   4
  ],
  "head": [
   "位置",
   "內容"
  ],
  "rows": [
   [
    "驅動配對表",
    "{ .compatible = \"acme,demo-led\" }"
   ],
   [
    "裝置樹節點",
    "compatible = \"acme,demo-led\""
   ],
   [
    "自訂屬性",
    "demo,blink-ms = <500>"
   ],
   [
    "啟用",
    "status = \"okay\""
   ]
  ],
  "widths": [
   2,
   5
  ]
 }
}