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

📄 makefile

📁 Simple Operating Systems (简称SOS)是一个可以运行在X86平台上(包括QEMU
💻
字号:
OBJCOPY=objcopyall: sos_qemu.img-include ../.mkvars# The image is the simple concatenation of the boot sector and the kernel# It may be use in bochs or on a real floppy, but NOT in qemu (see below)sos_bsect.img: bsect.bin sos.bin	cat $^ > $@	@echo "You can use the $@ image in bochs or on a real floppy (NOT qemu)"# For qemu, the trick is to tell it we have *more* than 1440 sectors (720kB).# Rtherwise the qemu disk geometry will be configured to be that of a 720kB# floppy, while our boot sector assumes it to be 1.44MBsos_qemu.img: sos_bsect.img	# Padding with 0s after the bsect/kernel image	cat $< /dev/zero | dd of=$@ bs=1k count=1440	@echo "You can use the $@ image in qemu, bochs, or on a real floppy"# we extract the boot sector from the main ELF binarybsect.bin: sos_bsect.elf	$(OBJCOPY) -v -O binary -j .bootsect $< $@# we extract the kernel code from the main ELF binarysos.bin: sos_bsect.elf	$(OBJCOPY) -v -O binary -R .bootsect $< $@# The main ELF binary contains the boot sector and the kernel code# linked together (hence we deal with a SINGLE image that we split# above) because they share some symbol definitionssos_bsect.elf: bootsect.o compile_kernel	$(LD) --warn-common -T ./sos_bsect.lds -o $@ \		bootsect.o $(wildcard ../hwcore/*.o ../drivers/*.o ../sos/*.o)compile_kernel:	$(MAKE) -C ..clean:	$(RM) *.img *.elf *.bin *~ *.o *.out

⌨️ 快捷键说明

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