HighlightOS
x86_64 操作系统(内核)完全使用汇编和 Rust 从零开始构建
目录
在 Linux 上从源码构建
主内核
要求:
Steps:
- Make sure
rustupis installed:
rustup --version
- Create a local clone of the repository:
git clone git@github.com:adamperkowski/highlightos.git && cd highlightos
cdinto thekernel/directory:
cd kernel
- Build the bootable binary:
cargo bootimage --release
This command will create the
target/target/releasedirectory in which you'll find thebootimage-hlkernel.binbinary file.
HighlightOS ASM
要求:
Steps:
- Create a local clone of the repository:
git clone git@github.com:adamperkowski/highlightos.git && cd highlightos
cdinto theasm/directory:
cd asm
- Compile the bootable binary:
nasm -f bin boot.asm -o boot.bin
This command will generate & place the
boot.binfile inside of the current directory.
在 Linux 上通过 QEMU 运行
要求:
步骤:
cd进入包含该二进制的目录。- 运行以下命令:
qemu-system-x86_64 -drive format=raw,file=<your_binary_filename>.bin
[!IMPORTANT] 将
<your_binary_filename>替换为您已下载/构建的二进制的实际名称。
在真实硬件上运行
你也可以将二进制镜像刷写到 U 盘上,并在真实机器上启动它。
您可以通过运行以下命令来刷写它:
dd if=<your_binary_filename>.bin of=/dev/sdX && sync
[!IMPORTANT] 请确保将
<your_binary_filename>.bin替换为您下载/编译的二进制文件名称,并确保将/dev/sdX替换为您 USB 的实际分区号。其上的所有数据都将丢失!
[!NOTE] 您可以从 BIOS 启动菜单(通过按 F8 或 F12 访问)中选择启动设备。
请再次确认您的主板支持启动传统介质,因为 HighlightOS 目前尚不兼容 UEFI。
附录
开发状态
https://github.com/user-attachments/assets/663e8477-4275-411b-a39a-c12e54096ad8
附加信息
您知道我们有一个 IRC 频道吗?它是 #highlightos,位于 libera.chat。
内置命令和功能列表可在此处。
如需进一步了解 HighlightOS,请访问wiki。
不建议使用仓库代码部分中的预编译二进制文件。
贡献者
衷心感谢所有贡献者:
致谢
部分代码受 blog_os 启发。很棒的项目!
版权
Copyright © 2025 Adam Perkowski
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.