《李枫-2023RustChinaConf__Sparrow__FengLi-20230614a-official-template.pptx》由会员分享,可在线阅读,更多相关《李枫-2023RustChinaConf__Sparrow__FengLi-20230614a-official-template.pptx(68页珍藏版)》请在三个皮匠报告上搜索。
1、第三届中国第三届中国Rust开发者大会开发者大会THE FIRST EXPLORATION OF PROJECT SPARROWFeng Li(李枫李枫) Jun 18,2023An indie developer from ChinauThe main translator of the book Gray Hat Hacking The Ethical Hackers Handbook,Fourth Edition(ISBN:9787302428671)&Linux Hardening in Hostile Networks,First Edition(ISBN:9787115544384
2、)u Pure software developmement for 15 years(11 years on Mobile dev)u Actively participating Open Source Communities:https:/ Recently,focus on infrastructure of Cloud/Edge Computing,AI,IoT,Programming Languages&Runtimes,Network,Virtualization,RISC-V,EDA,5G/6GWho Am I AgendaI.BackgroundTech StackProje
3、ct Sparrow TestbedII.Practicing SparrowCantripOS(KataOS)Rust support in seL4 userspaceIII.Sparrow developmentDevelop with RenodeIV.Wrap-up1)Tech Stack1.1 MicrokernelOverviewI.Backgrounduhttps:/en.wikipedia.org/wiki/Microkernel SecurityI.BackgrounduDifference Between Microkernel and Monolithic Kernel
4、:Source:https:/ 1.2 L4OverviewI.Backgrounduhttps:/en.wikipedia.org/wiki/L4_microkernel_family I.Background L4 family tree:1.2.1 seL4OverviewI.Backgroundu https:/en.wikipedia.org/wiki/L4_microkernel_family#High_assurance:_seL4uhttps:/sel4.systems I.Backgroundu.Source:“The seL4 Report”,Gernot Heiser,F
5、osdem 2021.I.BackgrounduSrc1.2.1.1 CAmkESI.Backgroundu https:/docs.sel4.systems/projects/camkes/https:/ https:/ ADL Source:https:/sel4.systems/About/seL4-whitepaper.pdfI.Background Source:https:/sel4.systems/About/seL4-whitepaper.pdf1.2.1.2 VirtualizationI.Backgroundu seL4 is also a hypervisor Sourc
6、e:https:/sel4.systems/About/seL4-whitepaper.pdfI.BackgrounduseL4 virtualization support with usermode VMMs Source:https:/sel4.systems/About/seL4-whitepaper.pdf1.2.1.3 Provable SecurityI.Backgroundu .uhttps:/docs.sel4.systems/projects/l4v/https:/ Source:https:/sel4.systems/About/seL4-whitepaper.pdfI.
7、BackgrounduCapability Distribution Language tools for seL4 https:/ I.Backgrounduhttps:/sel4.systems/Info/FAQ/proof.pmluseL4s proof toolchain Status https:/docs.sel4.systems/projects/sel4/status.htmlMathematical Proof Source:https:/sel4.systems/About/seL4-whitepaper.pdfI.BackgrounduFunctional correct
8、ness e.g.:Source:https:/www.tbrk.org/I.BackgrounduTranslation validation Source:https:/sel4.systems/About/seL4-whitepaper.pdfI.Background e.g.:Source:https:/www.tbrk.org/1.3 FOSS EDAOverviewI.Backgroundhttps:/en.wikipedia.org/wiki/Comparison_of_EDA_softwarehttps:/ uhttps:/sel4.systems 1.3.1 Evolutio
9、n of HDLsI.Background 1.4 RISC-VI.Background https:/en.wikipedia.org/wiki/RISC-V https:/riscv.org/Development https:/riscv.org/exchange/https:/ https:/ https:/riscv.org/exchange/cores-socs/Source:https:/ Ecosystem I.Backgroundu https:/community.riscv.org/events/details/risc-v-foundation-bay-area-ris
10、c-v-group-presents-2021-risc-v-ecosystem-updates/Source:https:/cacm.acm.org/magazines/2019/2/234352-a-new-golden-age-for-computer-architecture/fulltextSource:https:/ Source:https:/ lowRISCOverviewI.Backgroundu https:/lowrisc.org/uhttps:/ 1.4.2.1 Project OpenTitanOverviewI.Backgroundu https:/opentita
11、n.org/u .Source:https:/lowrisc.orgI.Backgrounduhttps:/ uWorkflow Source:https:/opentitan.org/guides/getting_started/index.html1.5 RenodeOverviewI.Backgroundu https:/renode.io/Antmicros virtual development framework for complex embedded systems.uhttps:/ I.BackgrounduKey features:uhttps:/renode.io/abo
12、ut/1.5.1 Src I.Backgroundu https:/ u https:/ 1.5.2 Co-simulating by Renode I.Backgroundu Source:https:/ Renode for RISC-V developmentOfficialI.Backgroundu u https:/riscv.org/announcements/2021/12/risc-v-celebrates-incredible-year-of-growth-and-progress-ratifying-multiple-technical-specifications-lau
13、nching-new-education-programs-and-accelerating-broad-industry-adoption/u https:/riscv.org/blog/2021/06/antmicro-open-source-portal-launched/u https:/riscv.org/blog/2021/03/bringing-the-benefits-of-risc-v-and-renode-to-the-very-efficient-deep-learning-in-iot-project/u 2)Project Sparrow2.1 OverviewI.B
14、ackgroundu https:/renohttps:/ Software repositories:2.2 CantripOS(KataOS)OverviewI.Backgroundu https:/ I.Backgroundu.Rust cratesSource:https:/ Intel NUC X15 LAPAC71H(32GB DDR5)with Fedora 38 I.Backgroundu HW http:/ SWI.Background 3.2 Raspberry PiRPi4(8GB LPDDR4)with Fedora 37I.Backgroundu HWu SWI.Ba
15、ckgrounduhttps:/ RPi3 B+(1G LPDDR2)1)CantripOS(KataOS)1.1 Getting startedII.Practicing Sparrowu https:/ Testing on LAPAC71H II.Practicing Sparrowu repou procedure:II.Practicing Sparrow 2)Rust support in seL4 userspaceOverviewII.Practicing Sparrowu A good summary from Rust support in seL4 userspace:P
16、resent and future,Nick Spinale,seL4 Summit 2022:2.1 Rust-centric Pop!_OS2.1.1 Rust-Written DesktopII.Practicing Sparrowu https:/ System76-Scheduler II.Practicing Sparrowu https:/ Auto-configure CFS and process priorities for improved desktop responsiveness.u https:/ Rust for Cloud Native II.Practici
17、ng Sparrowu https:/rust-cloud-native.github.io/u Our new talk Rust-based Container Runtimes is coming soon.2.3 Unified runtime for eBPF and Wasm SummaryII.Practicing SparrowuOur previous talks GraalVM-based unified runtime for eBPF&Wasm at GOTC 2021 (Shenzhen)&Revisiting GraalVM-based unified runtim
18、e for eBPF&Wasm at OpenInfra Days China 2021(Beijing),and the third-round discussion of this topic will come in this year,which includes more update for Rust related experiments2.4 Replace C+with Rust in AI frameworksII.Practicing SparrowIdeasu Today,most of the main stream AI frameworks such like T
19、ensorflow,PyTorch and MXNet embrace Python+C+for their software layers design.u While Rust is coming!https:/ A reimplementation of project Ray(the distributed training framework that behinds many LLMs)by leveraging Python+Rust to instead of Python+C+within current implementation;u For some initial d
20、esign,you may refer to our previous talk Ray A Swiss Army Knife for Distributed Computing&AI at COSCon 2022(Online);Our new talk The first exploration of Ray.Rust will come soon.1)Develop with Renode1.1 Rust peripheral supportIII.Sparrow Developmentu It has been possible to design Renode peripheral
21、models in a variety of languages such as C#,Python and C.u Adding Rust peripherals in Renode now:https:/ POC sample of Rust UART peripheral.https:/ Development Take a look at how the reading from RECEIVE_DATA and writing to TRANSMIT_DATA were implemented in Rust:III.Sparrow Development Take a look a
22、t how the reading from RECEIVE_DATA and writing to TRANSMIT_DATA were implemented in Rust:III.Sparrow Development build the Renode Rust UART peripheral example:cargo build-target wasm32-unknown-unknown-release-libIII.Sparrow Development on branch 26999-rust_uart:https:/ Development III.Sparrow Devel
23、opment apply the above patch to master branch and build Renode from source:https:/renode.readthedocs.io/en/latest/advanced/building_from_sources.htmlIII.Sparrow Development add a WebAssembly-license file to$SRC_RENODE/lib/resources/libraries/and rebuild:III.Sparrow Development III.Sparrow Developmen
24、t simulating:III.Sparrow Development This will run a Zephyr RTOS shell example on RISC-V based SiFive FE310 with a Rust implementation of UART:1.2 renode-run crateIII.Sparrow Developmentu https:/ A custom Cargo runner that runs Rust firmware in the Renode emulator.u InstallationIII.Sparrow Developme
25、ntu an example of ConfigurationIV.Wrap-upu Rust is playing an more and more important role in HW-SW collaboration!You may look forward to our upcoming follow-ups The first exploration of Rust for HW-SW collaboration,Rust for Formal Verification,Coq and SMT and Revisiting Renode-a Swiss Army Knife fo
26、r RISC-V based HW-SW co-developed system.u Our third-round and perhaps the forth-round discussion of The eBPF-centric new approach for Hyper-Converged Infrastructure&Edge Computing will be divided into two series:ARM+xPython+Rust+Lua+GraalVM+and RISC-V+xPython+Zig+Lua+SmartRuntime according to different technology roadmap.Q&AThank you!