projects
/
bootcensus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- moved the int86 code out of the 2nd stage boot loader code, and into a
[bootcensus]
/
Makefile
diff --git
a/Makefile
b/Makefile
index
23c8eaf
..
6887307
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-1,5
+1,5
@@
csrc = $(wildcard src/*.c) $(wildcard src/libc/*.c) $(wildcard src/test/*.c)
csrc = $(wildcard src/*.c) $(wildcard src/libc/*.c) $(wildcard src/test/*.c)
-ssrc = $(wildcard src/*.s) $(wildcard src/libc/*.s) $(wildcard src/boot/*.s)
+ssrc = $(wildcard src/*.s) $(wildcard src/libc/*.s) $(wildcard src/boot/*.s) $(wildcard src/test/*.s)
Ssrc = $(wildcard src/*.S)
obj = $(csrc:.c=.o) $(ssrc:.s=.o) $(Ssrc:.S=.o)
dep = $(obj:.o=.d)
Ssrc = $(wildcard src/*.S)
obj = $(csrc:.c=.o) $(ssrc:.s=.o) $(Ssrc:.S=.o)
dep = $(obj:.o=.d)
@@
-16,6
+16,7
@@
CFLAGS = $(ccarch) -march=i386 $(warn) $(opt) $(dbg) $(gccopt) $(inc) $(def)
ASFLAGS = $(asarch) -march=i386 $(dbg) -nostdinc -fno-builtin $(inc)
LDFLAGS = $(ldarch) -nostdlib -T pcboot.ld -print-gc-sections
ASFLAGS = $(asarch) -march=i386 $(dbg) -nostdinc -fno-builtin $(inc)
LDFLAGS = $(ldarch) -nostdlib -T pcboot.ld -print-gc-sections
+QEMU_FLAGS = -fda floppy.img -serial file:serial.log -soundhw sb16
ifneq ($(shell uname -m), i386)
ccarch = -m32
ifneq ($(shell uname -m), i386)
ccarch = -m32
@@
-27,16
+28,23
@@
floppy.img: boot.img
dd if=/dev/zero of=$@ bs=512 count=2880
dd if=$< of=$@ conv=notrunc
dd if=/dev/zero of=$@ bs=512 count=2880
dd if=$< of=$@ conv=notrunc
+pcboot.iso: floppy.img
+ rm -rf cdrom
+ git archive --format=tar --prefix=cdrom/ HEAD | tar xf -
+ cp $< cdrom
+ mkisofs -o $@ -R -J -V pcboot -b $< cdrom
+
+
boot.img: bootldr.bin $(bin)
cat bootldr.bin $(bin) >$@
boot.img: bootldr.bin $(bin)
cat bootldr.bin $(bin) >$@
-# bootldr.bin will contain only .boot and .boot2
+# bootldr.bin will contain .boot, .boot2, .bootend, and .lowtext
bootldr.bin: $(elf)
bootldr.bin: $(elf)
- objcopy -O binary -j '.boot*' $< $@
+ objcopy -O binary -j '.boot*' -j .lowtext $< $@
-# the main binary will contain every section *except* .boot and .boot2
+# the main binary will contain every section *except* those
$(bin): $(elf)
$(bin): $(elf)
- objcopy -O binary -R '.boot*' $< $@
+ objcopy -O binary -R '.boot*' -R .lowtext $< $@
$(elf): $(obj)
$(LD) -o $@ $(obj) -Map link.map $(LDFLAGS)
$(elf): $(obj)
$(LD) -o $@ $(obj) -Map link.map $(LDFLAGS)
@@
-64,18
+72,18
@@
bootldr.disasm: $(elf)
objdump -d $< -j .boot -j .boot2 -m i8086 >$@
$(elf).disasm: $(elf)
objdump -d $< -j .boot -j .boot2 -m i8086 >$@
$(elf).disasm: $(elf)
- objdump -d $< -j .startup -j .text -m i386 >$@
+ objdump -d $< -j .startup -j .text -j .lowtext -m i386 >$@
$(elf).sym: $(elf)
objcopy --only-keep-debug $< $@
.PHONY: run
run: $(bin)
$(elf).sym: $(elf)
objcopy --only-keep-debug $< $@
.PHONY: run
run: $(bin)
- qemu-system-i386 -fda floppy.img -serial file:serial.log
+ qemu-system-i386 $(QEMU_FLAGS)
.PHONY: debug
debug: $(bin) $(elf).sym
.PHONY: debug
debug: $(bin) $(elf).sym
- qemu-system-i386 -fda floppy.img -serial file:serial.log -s -S
+ qemu-system-i386 $(QEMU_FLAGS) -s -S
.PHONY: sym
sym: $(elf).sym
.PHONY: sym
sym: $(elf).sym