📄 compile.bat
字号:
###################################################################################
# 文件说明:pyos 执行总编译文件
# 作者:谢煜波
# xieyubo@126.com
###################################################################################
# 创建文件夹
mkdir final
mkdir out
# 先编译几个汇编文件
nasm boot.asm -o out/boot.bin
nasm setup.asm -o out/setup.bin
nasm -f elf interrupt.asm -o out/interrupt.bin
# 编译内核文件
g++ -fpack-struct -ffreestanding -nostdlib -fno-builtin -fno-rtti -nostdinc++ -nostdinc -fno-exceptions -c kernel.cpp -o out/kernel.o
g++ -fpack-struct -ffreestanding -nostdlib -fno-builtin -fno-rtti -nostdinc++ -nostdinc -fno-exceptions -c system.cpp -o out/system.o
g++ -fpack-struct -ffreestanding -nostdlib -fno-builtin -fno-rtti -nostdinc++ -nostdinc -fno-exceptions -c video.cpp -o out/video.o
g++ -fpack-struct -ffreestanding -nostdlib -fno-builtin -fno-rtti -nostdinc++ -nostdinc -fno-exceptions -c interrupt.cpp -o out/interrupt.o
# 链接内核
ld -o out/kernel -Ttext 0x0 -e Pyos_Main out/kernel.o out/system.o out/video.o out/interrupt.o out/interrupt.bin
objcopy -R .note -R .comment -S -O binary out/kernel out/kernel.bin
# 制作内核映象文件
g++ make_pyos_kernel.cpp -o out/make_pyos_kernel.exe
chmod 755 out/make_pyos_kernel.exe
out/make_pyos_kernel.exe final/pyos.img out/boot.bin out/setup.bin out/kernel.bin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -