compile.bat

来自「保护模式下8259A芯片编程及中断处理探究」· Batch 代码 · 共 30 行

BAT
30
字号
###################################################################################
# 文件说明: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 + =
减小字号Ctrl + -
显示快捷键?