⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compile.bat

📁 是经典的UNIX的部分源代码
💻 BAT
字号:
###################################################################################
# 文件说明:pyos 执行总编译文件
# 作者:谢煜波
# xieyubo@126.com
###################################################################################

# 先编译几个汇编文件
nasm source_code/boot.asm -o out/boot.bin
nasm source_code/setup.asm -o out/setup.bin

nasm -f elf source_code/kernel.asm -o out/kernel.asmo
nasm -f elf source_code/interrupt.asm -o out/interrupt.asmo
nasm -f elf source_code/mouse.asm -o out/mouse.asmo
nasm -f elf source_code/keyboard.asm -o out/keyboard.asmo

# 使用 gcc 编译内核文件
gcc -fpack-struct -std=c99 -c source_code/kernel.c -o out/kernel.o 
gcc -fpack-struct -std=c99 -c source_code/system.c -o out/system.o
gcc -fpack-struct -std=c99 -c source_code/vesa.c -o out/vesa.o
gcc -fpack-struct -std=c99 -c source_code/io.c -o out/io.o
gcc -fpack-struct -std=c99 -c source_code/interrupt.c -o out/interrupt.o
gcc -fpack-struct -std=c99 -c source_code/mouse.c -o out/mouse.o
gcc -fpack-struct -std=c99 -c source_code/keyboard.c -o out/keyboard.o
gcc -fpack-struct -std=c99 -c source_code/message.c -o out/message.o

# 链接内核
ld -o out/kernel.ld -Ttext 0x90000 -e main out/kernel.asmo out/kernel.o out/system.o out/vesa.o out/io.o out/interrupt.o out/interrupt.asmo out/keyboard.o out/keyboard.asmo out/message.o out/mouse.o out/mouse.asmo

# 去掉 ld 产生的不需要的段,得到纯机器码的二进制文件  
objcopy -R .note -R .comment -S -O binary out/kernel.ld out/kernel.bin 

# 制作内核映象文件
g++ additional/make_pyos_kernel/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

# 制作字库
g++ additional/make_font/make_font.cpp -o out/make_font.exe
chmod 755 out/make_font.exe
out/make_font.exe resource/asc16 resource/en.fong resource/hzk16f resource/ch.font

# 加入图片及字库文件
g++ additional/make_together/make_together.cpp -o out/make_together.exe
chmod 755 out/make_together.exe
out/make_together.exe final/pyos.img 36864 resource/login_1.bmp   # 起始( 0.2 )
out/make_together.exe final/pyos.img 101376 resource/login_2.bmp  # 起始 1.5 ( 1 磁头 5 磁道 )
out/make_together.exe final/pyos.img 165888 resource/normal_cursor.bmp # 起始 0.9 ( 0 磁头 9 磁道 ) 
out/make_together.exe final/pyos.img 169984 resource/down_cursor.bmp
out/make_together.exe final/pyos.img 174080 resource/hold_down_cursor.bmp
out/make_together.exe final/pyos.img 178176 resource/empty.bmp         
out/make_together.exe final/pyos.img 182272 resource/full.bmp
out/make_together.exe final/pyos.img 186368 resource/wall.bmp
out/make_together.exe final/pyos.img 190464 resource/my_ball.bmp
out/make_together.exe final/pyos.img 194560 resource/people.bmp
out/make_together.exe final/pyos.img 202752 resource/ch.font # 中文字库( 0.11.1 )
out/make_together.exe final/pyos.img 203264 resource/en.font # 英文字库( 0.11.2 ) 
out/make_together.exe final/pyos.img 211968 resource/bomb.bmp # 应用程序图标( 1.11 )
out/make_together.exe final/pyos.img 248832 resource/logout.bmp # 应用程序图标( 1.13 )
out/make_together.exe final/pyos.img 304128 resource/top.bmp # 应用程序图标( 1.16 )

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -