From cf1ec8a36f5b30066bb23c0ec89659e8d21509c2 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 1 Nov 2014 15:40:33 +0000 Subject: [PATCH] Makefile: introduce the _VIDEO segment, rebalance CODE and CODE2 Not that the linker can bank the things yet... --- Kernel/Makefile | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Kernel/Makefile b/Kernel/Makefile index 34101151..542bc061 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -14,11 +14,13 @@ export CROSS_AS=sdasz80 export CROSS_LD=sdldz80 export CROSS_CC=sdcc #export CROSS_CCOPTS=-c --std-sdcc99 --no-std-crt0 -mz80 -I$(ROOT_DIR)/cpu-z80 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include --max-allocs-per-node 1000000 --opt-code-size --Werror --stack-auto --constseg CONST -export CROSS_CCOPTS=-c --std-sdcc99 --no-std-crt0 -mz80 -I$(ROOT_DIR)/cpu-z80 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include --max-allocs-per-node 30000 --opt-code-size --Werror --stack-auto --constseg CONST +export CROSS_CCOPTS=-c --std-sdcc99 --no-std-crt0 -mz80 -I$(ROOT_DIR)/cpu-z80 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include --max-allocs-per-node 200000 --opt-code-size --Werror --stack-auto --constseg CONST +#export CROSS_CCOPTS=-c --std-sdcc99 --no-std-crt0 -mz80 -I$(ROOT_DIR)/cpu-z80 -I$(ROOT_DIR)/platform-$(TARGET) -I$(ROOT_DIR)/include --max-allocs-per-node 30000 --opt-code-size --Werror --stack-auto --constseg CONST #export CROSS_CCOPTS+=--nostdlib --nostdinc -Isdcclib/include export CROSS_CC_SEG2=--codeseg CODE2 export CROSS_CC_SEGDISC=--codeseg DISCARD export CROSS_CC_FONT=--constseg FONT +export CROSS_CC_VIDEO=--codeseg VIDEO export ASOPTS=-plosff export BINEXT = .rel else ifeq ($(CPU),6502) @@ -50,17 +52,21 @@ ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) # be a linear chunk eg if you need to put the kernel in two non adjacent 16K # chunks or compile it around a hole for videomemory or similar # +# VT and FONT are handled specially because they can be mapped more +# freely and also because you often want to overlay part of the kernel +# with the framebuffer when doing video output +# CDSRCS = start.c C1SRCS = version.c kdata.c filesys.c -C1SRCS += inode.c syscall_fs.c -C2SRCS = devio.c process.c syscall_proc.c timer.c +C1SRCS += inode.c syscall_fs.c process.c usermem.c timer.c +C2SRCS = devio.c syscall_proc.c C2SRCS += syscall_fs2.c syscall_other.c C2SRCS += bank16k.c bank32k.c bankfixed.c single.c simple.c -C2SRCS += vt.c tty.c devsys.c -C2SRCS += mm.c swap.c usermem.c - -CFONTSRCS += font4x6.c font8x8.c +C2SRCS += tty.c devsys.c +C2SRCS += mm.c swap.c +CVIDEOSRCS = vt.c +CFONTSRCS = font4x6.c font8x8.c ASRCS = lowlevel-$(CPU).s usermem_std-$(CPU).s @@ -70,10 +76,11 @@ CDOBJS = $(CDSRCS:.c=$(BINEXT)) C1OBJS = $(C1SRCS:.c=$(BINEXT)) C2OBJS = $(C2SRCS:.c=$(BINEXT)) CFONTOBJS = $(CFONTSRCS:.c=$(BINEXT)) +CVIDEOOBJS = $(CVIDEOSRCS:.c=$(BINEXT)) AOBJS = $(ASRCS:.s=$(BINEXT)) -CSRCS = $(CDSRCS) $(C1SRCS) $(C2SRCS) $(CFONTSRCS) -COBJS = $(CDOBJS) $(C1OBJS) $(C2OBJS) $(CFONTOBJS) +CSRCS = $(CDSRCS) $(C1SRCS) $(C2SRCS) $(CFONTSRCS) $(CVIDEOSRCS) +COBJS = $(CDOBJS) $(C1OBJS) $(C2OBJS) $(CFONTOBJS) $(CVIDEOOBJS) OBJS = $(COBJS) $(AOBJS) @@ -102,6 +109,9 @@ $(C2OBJS): %$(BINEXT): %.c $(CFONTOBJS): %$(BINEXT): %.c $(CROSS_CC) $(CROSS_CCOPTS) $(CROSS_CC_FONT) $< +$(CVIDEOOBJS): %$(BINEXT): %.c + $(CROSS_CC) $(CROSS_CCOPTS) $(CROSS_CC_VIDEO) $< + $(AOBJS): %$(BINEXT): %.s $(CROSS_AS) $(ASOPTS) -o $*$(BINEXT) $< -- 2.34.1