# chuanpen **Repository Path**: lyx521code/chuanpen ## Basic Information - **Project Name**: chuanpen - **Description**: 构建Qemu+UEFI+Linux的编译和运行环境,用于UEFI和Kernel(ACPI)的学习 - **Primary Language**: C - **License**: BSD-2-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2024-12-21 - **Last Updated**: 2025-10-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # chuanpen ## 1 介绍 构建Qemu+UEFI+Linux的编译和运行环境,用于UEFI和Kernel(ACPI)的学习。 可在Ubuntu 22.04上使用,其他操作系统,需要进行一些脚本的改造。 ## 2 软件架构 软件架构说明 ``` ├── LICENSE ├── README.md ├── build-pen │   ├── busybox │   ├── configs #编译所需文件、软件和依赖库安装的脚本等 │   ├── grub │   ├── linux │   ├── output #存放uefi和kernel的输出文件 │   ├── pen_build.sh #编译指定项目,包括UEFI编译,Kerel编译及打包,qemu编译 │   ├── pen_download.sh #下载指定的代码库 │   ├── qemu │   ├── tools │   └── uefi ├── log #日志存放处 │   └── ap.log ├── uefi_gdb #辅助uefi调试的脚本 │   └── stub └── uefi_sh_app #可用于uefi shell和linux shell下运行的一些工具 ├── secureboot1 └── toolsForLinux ``` ## 3 下载和编译使用教程 ### 3.1 下载项目及安装依赖项 下载项目: ``` robin@YBBJ0042:~$ git clone https://gitee.com/chuanpen/chuanpen.git ``` 安装所需软件和依赖库: ``` robin@YBBJ0042:~$ cd chuanpen/build-pen/configs/script/ robin@YBBJ0042:~/chuanpen/build-pen/configs/script$ sudo ./install_prerequisites.sh ``` ### 3.2 下载和编译qemu 主要步骤如下: ``` robin@YBBJ0042:~/chuanpen/build-pen$ ./pen_download.sh qemu robin@YBBJ0042:~/chuanpen/build-pen$ ./pen_build.sh qemu #编译和安装qemu 8.0 robin@YBBJ0042:~/chuanpen/build-pen$ qemu-system-aarch64 --version QEMU emulator version 8.0.0 (v8.0.0-3-g538fc48f71) Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers ``` ### 3.3 下载和编译UEFI 后续给出的例程中,会根据需求自建项目。当前可以直接使用ArmVirtQemu来体会编译过程。 主要步骤如下: ``` robin@YBBJ0042:~/chuanpen/build-pen$ ./pen_download.sh uefi #包含了edk2,edk2-platforms以及相关的编译工具等的下载 robin@YBBJ0042:~/chuanpen/build-pen$ ./pen_build.sh uefi-qemu #编译ArmVirtQemu ``` ### 3.4 下载和编译linux,以及打包 主要步骤如下: ``` robin@YBBJ0042:~/chuanpen/build-pen$ ./pen_download.sh kernel #下载linux,grub,busybox以及相关的编译工具 robin@YBBJ0042:~/chuanpen/build-pen$ ./pen_build.sh kernel #编译linux,并自动打包镜像 ``` ## 4 基础测试说明 TBD ## 参与贡献 1. Robin.Luo uefi_explorer@163.com 2. ## 更新记录 :low_brightness: 20241220 19:33 初步完成了框架,可以自动编译qemu、uefi和kernel,以及kernel的镜像打包