字節跳動首發雲固件,成功實現服務器 LinuxBoot 產品化落地

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"9月15日,字節跳動宣佈開發出第一代雲固件 (Cloud Firmware)。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"該雲固件引入 LinuxBoot,並順利投入業務應用,"},{"type":"text","marks":[{"type":"strong"}],"text":"是全球第一個在服務器中產品化 LinuxBoot 的固件方案。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"本文將和大家分享字節跳動 STE 團隊,在開發第一代雲固件上,是如何思考和一一落地的。"}]},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"服務器固件生態問題衆多"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"固件是系統上最先啓動的軟件,其主要目的是初始化硬件,啓動操作系統。固件存在於各種電子設備中,小到手錶,大到數據中心服務器,今天我們重點聊聊服務器固件。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"目前服務器均採用 UEFI\/Tiano(uefi.org\/tianocore.org) 方案。UEFI\/Tiano 是開源的固件方案,代碼繁重,社區活躍度低,幾乎沒有廠商能基於 UEFI\/Tiano 的開源方案直接產品化。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"絕大部分系統廠商採用的是 "},{"type":"link","attrs":{"href":"https:\/\/xie.infoq.cn\/article\/70fc3dd8a328183937db424db","title":"xxx","type":null},"content":[{"type":"text","text":"BIOS"}]},{"type":"text","text":" 廠商的方案,固件工程師也大多從事主板適配、平臺功能開發等工作。"},{"type":"text","marks":[{"type":"strong"}],"text":"這使得衆多功能\/核心模塊掌控在 BIOS 廠商手裏,系統廠商和用戶無法高效迅速地解決問題。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"綜上所述,目前固件生態存在的主要問題包括:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"1. 與 Linux 社區相比,UEFI 社區活躍度低,較難招聘到合適人才;"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"2. 服務器固件與 SOC、板卡固件軟件生態不同 (UEFI vs. Linux),人才無法靈活複用;"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"3. UEFI 固件很多功能模塊由 BIOS 廠商把控,線上問題無法快速解決;"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"4. 使用方、芯片廠商和系統廠商無法保持代碼同步,影響迭代和解決問題的速度。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"當前的合作模式爲芯片廠商發佈相關的芯片代碼到 BIOS 廠商,BIOS 廠商整合後,再給到系統廠商同步開發。雲固件的合作方式則是以字節爲中心,系統代碼和芯片廠商、系統廠商同源。"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/35\/35ff34151fec55a66c1da8ab8d56ab88.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#888888","name":"user"}}],"text":"不同方案的合作模式"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"顯然,"},{"type":"text","marks":[{"type":"strong"}],"text":"雲固件的合作方式更能快速迭代同步芯片、系統平臺問題。"}]},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"尋找適合服務器固件的 Bootloader"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在服務器固件領域,目前可行的固件方案有 UEFI\/Tiano、Min Platform、LinuxBoot 及 Coreboot,目前生態比較成熟正在被採用的是 UEFI,但是其在社區活躍度、啓動速度和開發難易度上都存在問題。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Min Platform、LinuxBoot 和 CoreBoot 都是近幾年針對 UEFI 缺點推出的固件方案,LinuxBoot 和 CoreBoot 直接引入了 Linux 生態,特點尤爲突出,但是生態上有待共建。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"通過收集比較,我們得出以下結論:"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/5a\/5a4ba188ea8544f5d47e8b9ce24fde1d.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","marks":[{"type":"color","attrs":{"color":"#888888","name":"user"}}],"text":"適配服務器固件的各種 Bootloader 狀態對比圖"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"固件 Boot 基本流程圖:"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/bb\/bbf8a025925f236a410aa8b51b21f1bd.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"落地 LinuxBoot,構建簡單易用的新固件生態"}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"路線選擇"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Linux 是當下最活躍的技術社區之一,"},{"type":"text","marks":[{"type":"strong"}],"text":"字節跳動 STE 團隊也開發了穩定可靠的 veLinux 操作系統。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"能否將 Linux 下沉到固件,利用 Linux 良好的生態來快速解決固件問題?LinuxBoot 正好符合我們的想法。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"固件的芯片和平臺部分,我們選擇用 CoreBoot\/U-Boot (Universal Boot Loader) 完全替換 UEFI\/Tiano。"},{"type":"text","marks":[{"type":"strong"}],"text":"這樣可以直接打通服務器和各自板卡、嵌入式的固件生態,人力也可以靈活複用。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"固件方案的改造推進,離不開生態以及各廠商的支持。根據目前固件生態情況,我們制定了以下路線圖:"}]},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/infoq\/4f\/4faec49e82050d92708c4dcb63703a96.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"1. 雲固件 1.0:"},{"type":"text","text":"基於 Minimun Platform 和 LinuxBoot,精簡傳統固件方案,將一些功能移至生態更佳的 LinuxBoot 裏實現;重點適配,迭代 LinuxBoot,使其達到產品化質量。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"2. 雲固件 2.0:"},{"type":"text","text":"基於 CoreBoot 和 LinuxBoot,與社區和廠商共同打造 CoreBoot 生態和環境,使 LinuxBoot 和 CoreBoot 均迭代到產品化程度。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"3. 雲固件 3.0:"},{"type":"text","text":"基於不同的 Platform 和架構迭代,使其適配於不同架構的平臺。"}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"開發方式"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"精簡 UEFI 平臺 (Minimum Platform) 開發:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"• 在 Minimum Platform 開發上,我們制定了非常明確高效的合作方式:"},{"type":"text","marks":[{"type":"strong"}],"text":"芯片部分與芯片廠商 Intel 直接合作開發測試,Platform 部分則與系統廠商浪潮直接合作開發測試。"},{"type":"text","text":"最終我們在人力和時間均一半的情況下,高效可靠地完成了 Minimum Platform 開發。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"LinuxBoot 開發:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"• 基於字節跳動系統部 veLinux 開發團隊研發的穩定內核,快速裁剪出適用的 LinuxBoot 模塊。"}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"成果梳理"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"第一代雲固件首批 200+ 服務器已順利完成生產上線,並穩定支持了字節跳動部分業務的持續運行。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"此外,我們和社區廠商也在緊密合作開發第二代雲固件。目前 CoreBoot 已經完成開機,其他相關工作也在有序推進中。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"雲固件的順利運行,同樣離不開 Intel、浪潮的共建參與和支持,我們期待在後繼開發中,繼續推進技術創新合作,同時也期待更多有志之士、公司參與到整個生態的建設中來,攜手打造簡單易用的新固件生態。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"參考資料"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"1. UEFI: https:\/\/uefi.org\/"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"2. Tiano: https:\/\/www.tianocore.org\/"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"3. LinuxBoot: https:\/\/www.linuxboot.org\/"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"4. CoreBoot: https:\/\/www.coreboot.com\/"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"5. Minimum Platform: https:\/\/software.intel.com\/content\/www\/us\/en\/develop\/articles\/minimum-platform-architecture-open-source-uefi-firmware-for-intel-based-platforms.html"}]}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章