# Makefile.SimOS.mips, Copyright (c) by G. Fankhauser, # Swiss Federal Institute of Technology, # Computer Engineering and Networks Laboratory. # # TOPSY -- A Teachable Operating System. # Implementation of a tiny and simple # micro kernel for teaching purposes. # # For further information, please visit http://www.tik.ee.ethz.ch/~topsy # # This software is provided under the terms of the GNU General Public Licence. # A full copy of the GNU GPL is provided in the file COPYING found in the # development root of Topsy. # # # File: $Source: /usr/drwho/vault/cvs/topsy/Topsy/Makefiles/Makefile.SimOS.mips,v $ # Author(s): # Affiliation: ETH Zuerich, TIK # Version: $Revision: 1.5 $ # Creation Date: # Last Date of Change: $Date: 1999/12/13 21:48:29 $ by: $Author: ruf $ # # # $Log: Makefile.SimOS.mips,v $ # Revision 1.5 1999/12/13 21:48:29 ruf # GNU General Public Licence Update # # Revision 1.4 1999/11/01 09:44:37 gfa # *** empty log message *** # # Revision 1.3 1999/10/31 19:01:25 gfa # *** empty log message *** # # Revision 1.2 1999/10/31 14:42:47 jeker # first fixes for SimOS # # Revision 1.1 1999/10/23 19:07:10 jeker # added Makefile.SimOS.mips and did some code cleanup # # # ############################################################################### # machine dependent subdirectories for each module and folder for object files ARCH=mips # make procedures for the outside all: version kernel user bootlink # include default stuff include Makefiles/Makefile.default include Makefiles/Makefile.user # host platform (Filename Platform.ARCH.PLATFORM) include Makefiles/Platform.$(ARCH).std # address of memory layout description after loading # needed by both kernel startup code (which passes the pointer to the # memory manager) and the bootlinker SEGMAP=800FFF00 USERINKERNELAT=80021000 HEXSEGMAP=0x$(SEGMAP) SEGMAPDEFINE=-DSEGMAP=$(HEXSEGMAP) # compiler defines DEBUG=-g CCDEBUG=$(DEBUG) -ggdb CFLAGS=-G 0 $(CCDEBUG) -Wall INC=$(addprefix -I, $(ALLDIRS)) DEFS = -DDEBUG_LEVEL=2 -DSIMOS #OPTIMIZE = -O2 -fno-strict-aliasing # for gcc 2.95 ... OPTIMIZE = -O2 LDFLAGS = -N $(DEBUG) # first the kernel architecture depending files by module STFILESARCH=start.S StartMeFirst.c TOFILESARCH=SyscallMsg.S SupportAsm.S Exception.c PrintReg.c MMFILESARCH=MMDirectMapping.c MMError.c tlb.S TMFILESARCH=TMClock.c TMError.c TMHal.c TMHalAsm.S IOFILESARCH=IOHal.c # now the drivers, this is a temporary solution, will be changed in near future IOFILESDRIVERS= Loopback.c SimOSConsole.c # make depending files LINKSCRIPT=link.$(ARCH).simos.scr KERNEL_LINKSCRIPT=Boot/$(ARCH)/$(LINKSCRIPT) USER_LINKSCRIPT=User/$(LINKSCRIPT) ######################### KERNEL STUFF ######################### # this builds the Topsy mips kernel kernel: kernel.ecoff kernel.bin bootlinking: BootLinker symbols kernel.ecoff: $(REALKERNELOBJS) $(KERNEL_LINKSCRIPT) $(LD) $(LDFLAGS) -o kernel.ecoff $(REALKERNELOBJS) \ -T $(KERNEL_LINKSCRIPT) kernel.bin: $(REALKERNELOBJS) $(KERNEL_LINKSCRIPT) $(LD) $(LDFLAGS) -oformat binary -o kernel.bin $(REALKERNELOBJS) \ -T $(KERNEL_LINKSCRIPT) # something special for the TMClock.c file ${OBJ}/$(TM)/$(ARCH)/TMClock.o: $(OBJ)/%.o: %.c $(OBJ) $(CC) $(CFLAGS) $(INC) $(DEFS) $(SEGMAPDEFINE) -c $< -o $@ # user and kernel need to be joined for download bootlink: kernel user bootlinker $(SIZE) -Ax kernel.ecoff > kSize $(SIZE) -Ax user.ecoff > uSize (cd Boot/$(ARCH); \ ./BootLinker ../../kSize ../../uSize ../../user.srec $(SEGMAP) \ $(USERINKERNELAT); \ mv segmap.bin ../.. ) $(OBJCOPY) kernel.ecoff \ --adjust-section-vma=".user"=+0x$(USERINKERNELAT) \ --add-section=".user"=user.bin \ --adjust-section-vma=".segmap"=+0x$(SEGMAP) \ --add-section=".segmap"=segmap.bin \ --target=ecoff-bigmips topsy.ecoff $(OBJCOPY) --target=srec topsy.ecoff topsy.srec # this is the tool which generates the segmap bootlinker: ( cd Boot/$(ARCH); $(LCC) -o BootLinker BootLinker.c ) # symbols for simulator symbols: $(NM) kernel.ecoff > kernel.symbols $(NM) user.ecoff > user.symbols $(NM) kernel.ecoff > topsy.symbols $(NM) user.ecoff >> topsy.symbols ########################## USER STUFF ########################## # this builds the Topsy user stuff user: user.ecoff user.bin # shell and user targets # (simulator, debugger, and linker need different obj formats) user.bin: $(REALOBJS) $(SYSCALL) $(USER_LINKSCRIPT) $(LD) $(LDFLAGS) -o user.srec $(REALOBJS) $(SYSCALL) \ -T $(USER_LINKSCRIPT) $(LD) $(LDFLAGS) -o user.bin -oformat binary $(REALOBJS) \ $(SYSCALL) -T $(USER_LINKSCRIPT) user.ecoff: $(REALOBJS) $(SYSCALL) $(USER_LINKSCRIPT) $(LD) $(LDFLAGS) -o user.ecoff -oformat ecoff-bigmips \ $(REALOBJS) $(SYSCALL) -T $(USER_LINKSCRIPT)