{
 "交叉編譯的概念與工具鏈#1": {
  "type": "cards",
  "reveal": [
   0,
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "Build 建置機",
    "points": [
     "執行編譯器的機器",
     "例如你的 PC"
    ]
   },
   {
    "title": "Host 執行機",
    "points": [
     "程式要跑的機器",
     "例如 ARM64 板子"
    ]
   },
   {
    "title": "Target",
    "points": [
     "編譯編譯器時才有意義",
     "寫應用程式可先不管"
    ]
   }
  ]
 },
 "交叉編譯的概念與工具鏈#2": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "cards": [
   {
    "title": "編譯器",
    "points": [
     "GCC 或 clang",
     "binutils:objdump、readelf、strip"
    ]
   },
   {
    "title": "C 函式庫",
    "points": [
     "glibc",
     "musl",
     "uClibc-ng"
    ]
   },
   {
    "title": "Kernel headers",
    "points": [
     "系統呼叫的介面"
    ]
   },
   {
    "title": "GDB",
    "points": [
     "搭配 gdbserver",
     "遠端除錯"
    ]
   }
  ]
 },
 "交叉編譯的概念與工具鏈#3": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   4,
   4
  ],
  "nodes": [
   {
    "label": "架構",
    "color": 0
   },
   {
    "label": "廠商",
    "color": 1
   },
   {
    "label": "作業系統",
    "color": 2
   },
   {
    "label": "ABI",
    "color": 0,
    "kind": "end"
   }
  ]
 },
 "交叉編譯的概念與工具鏈#4": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "前綴",
   "目標"
  ],
  "rows": [
   [
    "arm-linux-gnueabihf-gcc",
    "ARM 32 位元,glibc,硬浮點"
   ],
   [
    "aarch64-linux-gnu-gcc",
    "ARM 64 位元,glibc"
   ],
   [
    "riscv64-linux-gnu-gcc",
    "RISC-V 64 位元,glibc"
   ]
  ],
  "widths": [
   3,
   3
  ]
 },
 "交叉編譯的概念與工具鏈#6": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "cards": [
   {
    "title": "發行版套件",
    "points": [
     "Debian / Ubuntu 用 APT"
    ]
   },
   {
    "title": "預先建好",
    "points": [
     "Arm 官方版本",
     "Bootlin toolchains"
    ]
   },
   {
    "title": "建置系統產生",
    "points": [
     "Buildroot、Yocto",
     "最推薦"
    ]
   },
   {
    "title": "crosstool-NG",
    "points": [
     "自己調整參數"
    ]
   }
  ]
 },
 "實際交叉編譯 Hello World 並檢查結果#4": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "目標",
   "指令"
  ],
  "rows": [
   [
    "x86",
    "gcc hello.c -o hello-x86"
   ],
   [
    "ARM64",
    "aarch64-linux-gnu-gcc hello.c -o hello-arm64"
   ],
   [
    "ARM32",
    "arm-linux-gnueabihf-gcc hello.c -o hello-arm32"
   ]
  ],
  "widths": [
   1,
   4
  ]
 },
 "實際交叉編譯 Hello World 並檢查結果#5": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   1,
   2,
   2,
   3
  ],
  "nodes": [
   {
    "label": "file",
    "sub": "看架構",
    "color": 0
   },
   {
    "label": "readelf -h",
    "sub": "Class、Machine",
    "color": 1
   },
   {
    "label": "readelf -d",
    "sub": "NEEDED 函式庫",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "QEMU 系統模擬與 virt 機型#2": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   2,
   2
  ],
  "head": [
   "位元",
   "程式",
   "機型",
   "CPU"
  ],
  "rows": [
   [
    "64",
    "qemu-system-aarch64",
    "virt",
    "cortex-a57"
   ],
   [
    "32",
    "qemu-system-arm",
    "virt",
    "cortex-a15"
   ]
  ],
  "widths": [
   1,
   4,
   1,
   2
  ]
 },
 "QEMU 系統模擬與 virt 機型#4": {
  "type": "table",
  "reveal": [
   0,
   0,
   0,
   0,
   2,
   3
  ],
  "head": [
   "選項",
   "意思"
  ],
  "rows": [
   [
    "-m 512",
    "記憶體 512 MB"
   ],
   [
    "-smp 2",
    "兩個 CPU 核心"
   ],
   [
    "-nographic",
    "不開圖形視窗,序列埠接終端機"
   ]
  ],
  "widths": [
   2,
   4
  ]
 },
 "QEMU 系統模擬與 virt 機型#5": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "選項",
   "意思"
  ],
  "rows": [
   [
    "-kernel / -append",
    "直接載入 kernel / 傳命令列"
   ],
   [
    "-drive + virtio-blk",
    "磁碟映像,系統內為 /dev/vda"
   ],
   [
    "-netdev user",
    "使用者模式網路,hostfwd 2222→22"
   ],
   [
    "-device virtio-net",
    "virtio 網路卡"
   ]
  ],
  "widths": [
   3,
   4
  ]
 },
 "QEMU 系統模擬與 virt 機型#7": {
  "type": "table",
  "reveal": [
   0,
   2
  ],
  "head": [
   "組合鍵",
   "作用"
  ],
  "rows": [
   [
    "Ctrl-A 再按 X",
    "結束 QEMU"
   ],
   [
    "Ctrl-A 再按 C",
    "進入 QEMU monitor"
   ]
  ],
  "widths": [
   2,
   3
  ]
 },
 "序列主控台:UART 連線與 console 設定#2": {
  "type": "table",
  "reveal": [
   0,
   0,
   0,
   1,
   2,
   3
  ],
  "head": [
   "終端程式",
   "離開方式"
  ],
  "rows": [
   [
    "picocom",
    "Ctrl-A 再 Ctrl-X"
   ],
   [
    "screen",
    "Ctrl-A、K、再按 y"
   ],
   [
    "minicom",
    "Ctrl-A 再按 X"
   ]
  ],
  "widths": [
   2,
   3
  ]
 },
 "序列主控台:UART 連線與 console 設定#3": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "head": [
   "步驟",
   "指令"
  ],
  "rows": [
   [
    "列出裝置",
    "ls /dev/ttyUSB*"
   ],
   [
    "確認名稱",
    "dmesg | tail"
   ],
   [
    "安裝",
    "sudo apt install picocom"
   ],
   [
    "連線",
    "picocom -b 115200 /dev/ttyUSB0"
   ],
   [
    "或用 screen",
    "screen /dev/ttyUSB0 115200"
   ]
  ],
  "widths": [
   2,
   5
  ]
 },
 "序列主控台:UART 連線與 console 設定#6": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "console=",
   "適用"
  ],
  "rows": [
   [
    "ttyS0",
    "16550 序列埠(PC、部分 SoC)"
   ],
   [
    "ttyAMA0",
    "ARM PL011(QEMU virt、Pi)"
   ],
   [
    "ttymxc0",
    "NXP i.MX"
   ],
   [
    "tty1",
    "螢幕"
   ]
  ],
  "widths": [
   2,
   4
  ]
 }
}