projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Nicer way to generate kernel.lds.s.
[pintos-anon]
/
src
/
Makefile.inc
diff --git
a/src/Makefile.inc
b/src/Makefile.inc
index 915312813f98f64fb613487c7ac0df7e5fa77536..df6b01046a306f9efb4e20fd60d0819df8009ca0 100644
(file)
--- a/
src/Makefile.inc
+++ b/
src/Makefile.inc
@@
-3,7
+3,6
@@
SHELL = /bin/sh
CC = gcc
SHELL = /bin/sh
CC = gcc
-CPP = $(CC) -E
VPATH := $(TOP_SRCDIR)/threads
VPATH := $(VPATH):$(TOP_SRCDIR)/devices
VPATH := $(TOP_SRCDIR)/threads
VPATH := $(VPATH):$(TOP_SRCDIR)/devices
@@
-12,12
+11,11
@@
VPATH := $(VPATH):$(TOP_SRCDIR)/filesys
VPATH := $(VPATH):$(TOP_SRCDIR)/userprog
WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes
VPATH := $(VPATH):$(TOP_SRCDIR)/userprog
WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS = -g -O3 -MMD $(WARNINGS) $(INCLUDES) $(DEFINES)
-ASFLAGS = -Wa,--gstabs
+
$(INCLUDES) $(DEFINES)
+CFLAGS = -g -O3 -MMD
-msoft-float
$(WARNINGS) $(INCLUDES) $(DEFINES)
+ASFLAGS = -Wa,--gstabs $(INCLUDES) $(DEFINES)
# Core kernel.
# Core kernel.
-THREADS_SRC = start.S # Must be linked first.
-THREADS_SRC += init.c # Start-up code.
+THREADS_SRC = init.c # Main program.
THREADS_SRC += thread.c # Thread management core.
THREADS_SRC += switch.S # Thread switch routine.
THREADS_SRC += interrupt.c # Interrupt core.
THREADS_SRC += thread.c # Thread management core.
THREADS_SRC += switch.S # Thread switch routine.
THREADS_SRC += interrupt.c # Interrupt core.
@@
-26,6
+24,7
@@
THREADS_SRC += synch.c # Synchronization.
THREADS_SRC += paging.c # Page tables.
THREADS_SRC += palloc.c # Page allocator.
THREADS_SRC += malloc.c # Subpage allocator.
THREADS_SRC += paging.c # Page tables.
THREADS_SRC += palloc.c # Page allocator.
THREADS_SRC += malloc.c # Subpage allocator.
+THREADS_SRC += start.S # Startup code.
# Device driver code.
DEVICES_SRC = timer.c # Timer device.
# Device driver code.
DEVICES_SRC = timer.c # Timer device.
@@
-40,36
+39,41
@@
LIB_SRC += lib.c # Standard C library.
LIB_SRC += random.c # Pseudo-random numbers.
LIB_SRC += list.c # Doubly-linked lists.
LIB_SRC += bitmap.c # Bitmaps.
LIB_SRC += random.c # Pseudo-random numbers.
LIB_SRC += list.c # Doubly-linked lists.
LIB_SRC += bitmap.c # Bitmaps.
-LIB_SRC +=
backdoor.c # Backdoor IPC
.
+LIB_SRC +=
hash.c # Hash tables
.
# Filesystem code.
FILESYS_SRC = filesys.c # Filesystem core.
FILESYS_SRC += file.c # Files.
FILESYS_SRC += directory.c # Directories.
FILESYS_SRC += filehdr.c # File headers (inodes).
# Filesystem code.
FILESYS_SRC = filesys.c # Filesystem core.
FILESYS_SRC += file.c # Files.
FILESYS_SRC += directory.c # Directories.
FILESYS_SRC += filehdr.c # File headers (inodes).
+FILESYS_SRC += fsutil.c # Utilities.
# User process code.
USERPROG_SRC = addrspace.c # Address spaces.
# User process code.
USERPROG_SRC = addrspace.c # Address spaces.
+USERPROG_SRC += exception.c # User exception handler.
+USERPROG_SRC += syscall.c # System call handler.
+USERPROG_SRC += gdt.c # GDT initialization.
+USERPROG_SRC += tss.c # TSS management.
# Objects.
OBJECTS = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SOURCES)))
all: diskimage.bin
# Objects.
OBJECTS = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SOURCES)))
all: diskimage.bin
-intr-stubs.S: $(TOP_SRCDIR)/threads/intr-stubs.pl
+intr-stubs.S: $(TOP_SRCDIR)/threads/intr-stubs.pl
$(TOP_SRCDIR)/threads/loader.h
$< > $@
$< > $@
-kernel.lds
: $(TOP_SRCDIR)/threads/kernel.lds.in
- $(CPP) -x assembler-with-cpp -P $< -o $@
+kernel.lds
.s: CPPFLAGS += -P -C
+kernel.lds.s: $(TOP_SRCDIR)/threads/kernel.lds.S $(TOP_SRCDIR)/threads/loader.h
-kernel.o: $(OBJECTS) kernel.lds
- ld -T kernel.lds -o $@ $(OBJECTS) `$(CC) -print-libgcc-file-name`
+kernel.o: $(OBJECTS) kernel.lds
.s
+ ld -T kernel.lds
.s
-o $@ $(OBJECTS) `$(CC) -print-libgcc-file-name`
kernel.bin: kernel.o
objcopy -O binary -R .note -R .comment -S $< $@.tmp
$(TOP_SRCDIR)/pad 4096 < $@.tmp > $@
kernel.bin: kernel.o
objcopy -O binary -R .note -R .comment -S $< $@.tmp
$(TOP_SRCDIR)/pad 4096 < $@.tmp > $@
-loader.bin: loader.S kernel.bin
+loader.bin: loader.S
loader.h
kernel.bin
gcc -c $< -DKERNEL_LOAD_PAGES=`perl -e 'print +(-s "kernel.bin") / 4096;'`
ld -N -e start -Ttext 0x7c00 --oformat binary -o $@ loader.o
gcc -c $< -DKERNEL_LOAD_PAGES=`perl -e 'print +(-s "kernel.bin") / 4096;'`
ld -N -e start -Ttext 0x7c00 --oformat binary -o $@ loader.o
@@
-78,6
+82,6
@@
diskimage.bin: loader.bin kernel.bin
clean:
rm -f *.o *.d *.bin
clean:
rm -f *.o *.d *.bin
- rm -f kernel.bin.data kernel.bin.pad intr-stubs.S kernel.lds
+ rm -f kernel.bin.data kernel.bin.pad intr-stubs.S kernel.lds
.s
-include *.d
-include *.d