Skip to content
프로젝트

QQxiaoming/quard_star_tutorial

GitHub에서 보기

소개

이 프로젝트는 맞춤형 QEMU 시뮬레이터 개발 보드를 기반으로 임베디드 Linux 시스템을 처음부터 구축하고, 칩이 전원이 켜진 뒤 첫 명령을 실행하는 순간부터 시스템 전체가 작동하기까지의 과정을 분석하는 것을 목표로 합니다.

게임 및 에뮬레이션

이 수치를 측정하는 방법

What you can do

  • Customized qemu simulator with Quard Star board support
  • Low-level boot code and mask ROM
  • OpenSBI and U-Boot bootloader
  • Linux kernel and device tree

측정된 스타 증가

in 24h
0
in 7 days
+4
in 15 days
+6
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Linux ci Windows ci Macos ci Android ci IOS ci Documentation Status CodeFactor GitHub tag (latest SemVer) GitHub All Releases GitHub stars GitHub forks Gitee stars Gitee forks discord

Building Embedded Linux System based on QEMU

English | 简体中文

Logo

video.webm

This project aims to build an Embedded Linux System, in order to analyze the chip from the power-on execution of the first instruction to the entire system running, based on a customized qemu simulator development board.

What is Quard Star?

Quard Star is the name of the hardware board that we simulate using qemu. It is a RISC-V processor with various peripherals and controllers. We will use this board to learn how to build and run an embedded Linux system from scratch.

Hardware Architecture

Hardware Architecture

Software Flow

Software Flow

Memory Distribution

Memory Distribution

Features

  • Customized qemu simulator with Quard Star board support
  • Low-level boot code and mask ROM
  • OpenSBI and U-Boot bootloader
  • Linux kernel and device tree
  • Busybox-based root filesystem
  • Qt-based graphical user interface
  • Trusted domain and secure boot
  • Debugging tools and scripts

Pre-requisites

To build and run this project, you will need the following tools:

  • gcc/g++
  • make/cmake
  • git
  • qemu
  • dtc
  • python3

You can install them using your package manager. For example, on Ubuntu 20.04, you can run:

sudo apt-get update
sudo apt install ninja-build pkg-config libglib2.0-dev libpixman-1-dev libgtk-3-dev libcap-ng-dev libattr1-dev libsdl2-dev device-tree-compiler bison flex gperf intltool mtd-utils libpulse-dev libalsa-ocaml-dev libsdl2-dev libslirp-dev libvirglrenderer-dev libsdl2-image-dev

Installation

To install this project, you can clone this repository using git:

git clone https://github.com/QQxiaoming/quard_star_tutorial.git

Then, you can run the build.sh script to compile the qemu simulator and other components:

cd quard_star_tutorial
./build.sh all all

This will generate the output directory with all the binaries and files needed to run the project.

Usage

To run the project, you can use the run.sh script:

./run.sh graphic

This will launch the qemu simulator with the Quard Star board and load the Linux system. You should see a graphical user interface on a new window.

You can also use some command-line options to customize your run. For example:

./run.sh nographic

For more details on how to use these options, please refer to the tutorial files.

Tutorial

This project comes with a series of tutorial files that explain each step of building and running an embedded Linux system based on QEMU. You can find them in the tutorial directory. They are available in Chinese languages.

The tutorial files cover the following topics:

  • Setting up the QEMU environment
  • Writing low-level boot code and mask ROM
  • Using OpenSBI and U-Boot bootloader
  • Compiling Linux kernel and device tree
  • Creating root filesystem and boot image
  • Developing graphical user interface with Qt
  • Implementing trusted domain and secure boot
  • Debugging with gdb and kgdb

You can also access the tutorial online on my blog or on read the docs.

Contributing

This project is open source and welcomes contributions from anyone who is interested in learning or teaching embedded Linux system development. If you want to contribute, please follow these steps:

  1. Fork this repository on GitHub.
  2. Create a new branch for your feature or bugfix.
  3. Make your changes and commit them with clear messages.
  4. Push your branch to your forked repository.
  5. Create a pull request from your branch to the main repository.
  6. Wait for review and feedback.

Please make sure your code follows the coding style and conventions of this project. Also, please write comments and documentation for your code.

License

This project uses some open source projects as components or references. I would like to thank and acknowledge their authors and contributors for their great work. so the newly added codes of each part respect the original project license. The rest of the original code open source license is BSD-3-Clause License. See the LICENSE file for more details.

Contact

If you have any questions, suggestions, or feedback about this project, please feel free to contact me at [email protected] or leave a comment on my blog.

Further Reading

If you want to read more about the development process and challenges of this project, you can check out my development note file DEVELOPNOTE.md. It contains some insights and tips on how I built and debugged this project.😎

Note: This project also has an experimental branch called next-kernel that uses the latest Linux kernel from linux-next. It is used to learn and test new features and functions. It might be unstable or incompatible with some components. You can switch to this branch using git checkout next-kernel if you are interested, but please be careful and report any issues or bugs you encounter.😉

Thanks

I would like to acknowledge AI tool (New Bing) for assisting me with writing part of this readme file.

Star History

Donate

If you like this project, you can donate to the author to support the development of the project.

paypal alipay wechat
paypal alipay wechat

관련 프로젝트 살펴보기

불러오는 중…