Skip to content

Commit

Permalink
initial commit of the system
Browse files Browse the repository at this point in the history
  • Loading branch information
bhimebau committed Aug 31, 2016
1 parent a02d3a2 commit a1099ff
Show file tree
Hide file tree
Showing 353 changed files with 42,956 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# P436-F16
Class Repository for P436 Fall 2016 Semester
# Fall 2016

Welcome to Operating Systems!


6 changes: 6 additions & 0 deletions apps/consume.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <xinu.h>
#include <prodcons.h>

void consumer(int count) {
}

8 changes: 8 additions & 0 deletions apps/produce.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <xinu.h>
#include <prodcons.h>

void producer(int count) {
}



699 changes: 699 additions & 0 deletions compile/.defs

Large diffs are not rendered by default.

Empty file added compile/.deps
Empty file.
4 changes: 4 additions & 0 deletions compile/.gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target extended-remote :5560
load xinu
b main
c
1 change: 1 addition & 0 deletions compile/.vers_num
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
184 changes: 184 additions & 0 deletions compile/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
#########################################################################
# #
# #
# Makefile for Qemu version of hte the Xinu operating system #
# #
# includes: .deps and .defs #
# #
# #
#########################################################################

NODE=0
GPORT=556${NODE}

COMPILER_ROOT = /l/arm2/devtools/bin/arm-none-eabi-
LIBGCC_LOC = /l/arm2/devtools/lib/gcc/arm-none-eabi/4.8.4

PNAME = bbb
PLAT = Platform_$(PNAME)
TOPDIR = ..

CC = ${COMPILER_ROOT}gcc
LD = ${COMPILER_ROOT}ld
OBJCOPY = ${COMPILER_ROOT}objcopy
XINU = $(TOPDIR)/compile/xinu
XINUBIN = $(TOPDIR)/compile/xinu.bin
XINUBOOT = $(TOPDIR)/compile/xinu.boot
BUILDMAKE = $(TOPDIR)/compile/bin/build-make
MKVERS = $(TOPDIR)/compile/bin/mkvers

MAKEDEP = $(CC) -M -MG

DEPSFILE = .deps
DEFSFILE = .defs
VERSIONFILE = version
LDSCRIPT = ld.script
MKVERS = $(TOPDIR)/compile/bin/mkvers
REBUILDFLAGS = -s $(TOPDIR)/system debug.c \
-s $(TOPDIR)/lib \
-s $(TOPDIR)/device/tty \
-s $(TOPDIR)/device/nam \
-s $(TOPDIR)/device/ram \
-s $(TOPDIR)/device/lfs \
-s $(TOPDIR)/device/uart \
-s $(TOPDIR)/device/uart-pl011 \
-s $(TOPDIR)/device/loopback \
-s $(TOPDIR)/shell 'xsh_rdstest*' \
-s $(TOPDIR)/apps


INCLUDE = -I$(TOPDIR)/include
DEFS = -DBSDURG -DVERSION=\""`cat $(VERSIONFILE)`"\"

# Compiler flags
CFLAGS = -mcpu=arm1176jz-s -ggdb3 -mno-unaligned-access -marm -fno-builtin -fno-stack-protector -nostdlib -c -Wall -O ${DEFS} ${INCLUDE}
SFLAGS = ${INCLUDE}

# Loader flags

LDFLAGS = -dn -m armelf -Map xinu.map -T ld.script

all: xinu

#--------------------------------------------------------------------------------
# Handle generation of a new version string when initialize is recompiled
#--------------------------------------------------------------------------------

newversion:
@echo creating new version
@$(MKVERS) $(PNAME) > version

#--------------------------------------------------------------------------------
# Include generic make targets and rules from the file generated by build-make
#--------------------------------------------------------------------------------
-include $(DEFSFILE)

#--------------------------------------------------------------------------------
# Add files that require special rules and place start.o at the front
#--------------------------------------------------------------------------------
LD_LIST = binaries/start.o $(filter-out binaries/start.o,$(OBJ_FILES))

#------------------------------------------------------------
# Rules for files that need special handling
#------------------------------------------------------------

# Define variables for the Configuration file and generated files

CONFFILE = $(TOPDIR)/config/Configuration
CONFH = $(TOPDIR)/include/conf.h
CONFC = $(TOPDIR)/system/conf.c

# Define variables for the config program and its sources

CONFPGM = $(TOPDIR)/config/config
CONFL = $(TOPDIR)/config/config.l
CONFY = $(TOPDIR)/config/config.y

# Set up the required build directory structure

BLDDIRS = binaries
export

#--------------------------------------------------------------------------------
# Specific additional rules and exceptions
#--------------------------------------------------------------------------------

xinu: Makefile rebuild $(BLDDIRS) $(DEFSFILE) $(DEPSFILE) $(CONFH) $(CONFC) $(LD_LIST)
@echo;echo 'Loading object files to produce xinu'
@$(LD) $(LDFLAGS) $(LD_LIST) -o $(XINU) -L$(LIBGCC_LOC) -lgcc
@$(OBJCOPY) -O binary $(XINU) $(XINUBIN)
@./uboot-tool/mkimage -A arm -O linux -T kernel -C none -a 0x81000000 -e 0x81000000 -d $(XINUBIN) $(XINUBOOT)

$(BLDDIRS):
@mkdir -p $(BLDDIRS)

objects: $(LD_LIST)

$(CONFH): $(CONFFILE) $(CONFPGM)
@echo making $(CONFH)
@make configure

$(CONFC): $(CONFFILE) $(CONFPGM)
@echo making $(CONFC)
@make configure

$(CONFPGM): $(CONFL) $(CONFY)
@echo making the config program
@make -C $(TOPDIR)/config clean all install

configure:
@echo forcing a rebuild of conf.h and conf.c
@make newversion
@(cd $(TOPDIR)/config; make install)

clean:
@echo removing .o files
@rm -f ${LD_LIST}
@echo removing configuration files ...
@rm -f $(CONFH) $(CONFC)
@(cd $(TOPDIR)/config; make clean)
@echo removing xinu ...
@rm -f $(XINU)
@rm -f $(XINUBIN)
@rm -f $(XINUBOOT)

install: xinu
cp xinu.boot /tftpboot

qemu: xinu
qemu-system-arm -M versatilepb -m 3G -nographic -cpu arm1176 -kernel xinu.boot

qemu-gdb: xinu
qemu-system-arm -M versatilepb -m 3G -nographic -cpu arm1176 -kernel xinu.boot -S -gdb tcp::${GPORT}
#--------------------------------------------------------------------------------
# Locations of source directories and exceptions (.c and .[sS] files to exclude)
#--------------------------------------------------------------------------------

$(DEFSFILE):
@rm -f $(DEFSFILE)
@echo "" > $(DEFSFILE)
@make rebuild

$(DEPSFILE):
@rm -f $(DEPSFILE)
@echo "" > $(DEPSFILE)
@make depend

rebuild: $(CONFC)
@echo Rebuilding the $(DEFSFILE) file
@$(BUILDMAKE) $(REBUILDFLAGS) > $(DEFSFILE)

defclean:
rm -f $(DEFSFILE)
echo "" > $(DEFSFILE)

depend: $(DEFSFILE)
@echo;echo Making all dependencies in $(DEPSFILE)
@$(MAKEDEP) ${INCLUDE} ${SRC_FULL} > $(DEPSFILE)
@echo;echo Finished making dependencies

depclean:
rm -f $(DEPSFILE)
echo "" > $(DEPSFILE)

-include $(DEPSFILE)
Loading

0 comments on commit a1099ff

Please sign in to comment.