Adds csl(conductance standard library) with CPUTYPE.

This commit is contained in:
Felix Queissner 2015-10-08 00:29:11 +02:00
parent cc72d4f366
commit a61859269c
8 changed files with 201 additions and 166 deletions

View file

@ -1,7 +1,7 @@
#Config
Artifact=kernel
TempDir=obj
SourceDir=asm src
SourceDir=asm src csl
AdditionalObjects=obj/main.o
ExternalObjects=conductance/|*.o
@ -27,7 +27,7 @@ LDFLAGS=-g -m32 -nostdlib -fno-builtin -Tkernel.ld
--
obj/main.o: scripts/main.spark
/home/felix/projects/Electronics/build-Electronics-Desktop-Debug/bin/spark \
/home/felix/projects/Electronics/build-Electronics-Clang-Debug/bin/spark \
scripts/main.spark \
obj/main.ca
objcopy -B i386 -I binary -O elf32-i386 \

View file

@ -8,12 +8,13 @@ CXX = g++
LD = g++
LEX = flex
YACC = bison
TEMPLE = mono temple.exe
# File Lists
SRCS_AS = asm/dynamic.S asm/intr_common_handler.S asm/multiboot.S asm/start.S
SRCS_CC = src/console.c src/init.c src/interrupts.c src/malloc.c src/pmm.c src/serial.c src/stdlib.c src/timer.c src/vmm.c
SRCS_CXX = src/cplusplus.cpp src/cpp-test.cpp src/vm.cpp
OBJS = obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/main.o
SRCS_CXX = src/cplusplus.cpp src/cpp-test.cpp src/vm.cpp csl/cpustatetype.cpp
OBJS = obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/cpustatetype.o obj/main.o
# Flags
FLAGS = -m32 -DCIRCUIT_OS -Dnullptr=0 -D__cdecl="__attribute__((cdecl))" -mno-sse -mno-sse2 -mno-mmx -I/home/felix/projects/Electronics/Electronics/Conductance -I/home/felix/projects/Electronics/Electronics/Tools
@ -27,78 +28,83 @@ all: kernel
.PHONY: clean
clean:
$(RM) obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/main.o
$(RM) obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/cpustatetype.o obj/main.o
kernel: obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/main.o conductance/assembly.o conductance/compoundtype.o conductance/opcodes.o conductance/string.o conductance/virtualmachine.o conductance/vmpointertype.o conductance/vmprimitivetype.o conductance/vmtype.o conductance/vmvalue.o conductance/vmvoidtype.o
$(LD) $(FLAGS) $(LDFLAGS) -o $@ obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/main.o conductance/assembly.o conductance/compoundtype.o conductance/opcodes.o conductance/string.o conductance/virtualmachine.o conductance/vmpointertype.o conductance/vmprimitivetype.o conductance/vmtype.o conductance/vmvalue.o conductance/vmvoidtype.o
kernel: obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/cpustatetype.o obj/main.o conductance/assembly.o conductance/compoundtype.o conductance/opcodes.o conductance/string.o conductance/virtualmachine.o conductance/vmpointertype.o conductance/vmprimitivetype.o conductance/vmtype.o conductance/vmvalue.o conductance/vmvoidtype.o
$(LD) $(FLAGS) $(LDFLAGS) -o $@ obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/cpustatetype.o obj/main.o conductance/assembly.o conductance/compoundtype.o conductance/opcodes.o conductance/string.o conductance/virtualmachine.o conductance/vmpointertype.o conductance/vmprimitivetype.o conductance/vmtype.o conductance/vmvalue.o conductance/vmvoidtype.o
# src/console.c
obj/console.o: src/console.c include/console.h include/kstdlib.h \
include/varargs.h include/config.h include/malloc.h
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/console.c
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/console.c
# src/init.c
obj/init.o: src/init.c include/kernel.h include/kstdlib.h include/varargs.h \
include/config.h include/malloc.h include/console.h include/interrupts.h \
include/cpustate.h include/pmm.h include/multiboot.h include/vmm.h \
include/timer.h include/serial.h
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/init.c
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/init.c
# src/interrupts.c
obj/interrupts.o: src/interrupts.c include/interrupts.h include/cpustate.h \
include/console.h include/kstdlib.h include/varargs.h include/config.h \
include/malloc.h include/io.h src/intr_stubs.h
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/interrupts.c
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/interrupts.c
# src/malloc.c
obj/malloc.o: src/malloc.c include/config.h include/kernel.h \
include/kstdlib.h include/varargs.h include/malloc.h include/console.h \
include/serial.h
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/malloc.c
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/malloc.c
# src/pmm.c
obj/pmm.o: src/pmm.c include/pmm.h include/multiboot.h include/kernel.h \
include/kstdlib.h include/varargs.h include/config.h include/malloc.h \
include/console.h
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/pmm.c
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/pmm.c
# src/serial.c
obj/serial.o: src/serial.c include/io.h include/serial.h include/kstdlib.h \
include/varargs.h include/config.h include/malloc.h
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/serial.c
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/serial.c
# src/stdlib.c
obj/stdlib.o: src/stdlib.c include/kstdlib.h include/varargs.h \
include/config.h include/malloc.h include/kernel.h
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/stdlib.c
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/stdlib.c
# src/timer.c
obj/timer.o: src/timer.c include/timer.h include/kernel.h \
include/interrupts.h include/cpustate.h
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/timer.c
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/timer.c
# src/vmm.c
obj/vmm.o: src/vmm.c include/config.h include/vmm.h include/pmm.h \
include/multiboot.h include/kstdlib.h include/varargs.h include/malloc.h \
include/console.h include/kernel.h
$(CC) $(FLAGS) $(CCFLAGS) -o $@ -c src/vmm.c
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/vmm.c
# src/cplusplus.cpp
obj/cplusplus.o: src/cplusplus.cpp include/kstdlib.h include/varargs.h \
include/config.h include/malloc.h include/console.h include/ker/new.hpp
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c src/cplusplus.cpp
$(CXX) -iquoteobj $(FLAGS) $(CXXFLAGS) -o $@ -c src/cplusplus.cpp
# src/cpp-test.cpp
obj/cpp-test.o: src/cpp-test.cpp include/console.h include/ker/string.hpp \
include/ker/vector.hpp include/ker/dictionary.hpp include/kernel.h \
include/ker/pair.hpp
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c src/cpp-test.cpp
$(CXX) -iquoteobj $(FLAGS) $(CXXFLAGS) -o $@ -c src/cpp-test.cpp
# src/vm.cpp
obj/vm.o: src/vm.cpp include/kstdlib.h include/varargs.h include/config.h \
include/malloc.h include/timer.h include/dynamic.h include/console.h \
include/interrupts.h include/cpustate.h
$(CXX) $(FLAGS) $(CXXFLAGS) -o $@ -c src/vm.cpp
include/interrupts.h include/cpustate.h src/../csl/cpustatetype.hpp
$(CXX) -iquoteobj $(FLAGS) $(CXXFLAGS) -o $@ -c src/vm.cpp
# csl/cpustatetype.cpp
obj/cpustatetype.o: csl/cpustatetype.cpp csl/cpustatetype.hpp \
include/cpustate.h include/console.h
$(CXX) -iquoteobj $(FLAGS) $(CXXFLAGS) -o $@ -c csl/cpustatetype.cpp
# asm/dynamic.S
obj/dynamic.o: asm/dynamic.S
@ -119,7 +125,7 @@ obj/start.o: asm/start.S
# Custom Targets
obj/main.o: scripts/main.spark
/home/felix/projects/Electronics/build-Electronics-Desktop-Debug/bin/spark \
/home/felix/projects/Electronics/build-Electronics-Clang-Debug/bin/spark \
scripts/main.spark \
obj/main.ca
objcopy -B i386 -I binary -O elf32-i386 \

View file

@ -14,8 +14,8 @@ CC = gcc
CXX = g++
DEFINES = -DCIRCUIT_OS
CFLAGS = -pipe -m32 -g -fPIC -Wall -W $(DEFINES)
CXXFLAGS = -pipe -g -std=c++11 -Wall -Wextra -fno-stack-protector -fno-use-cxa-atexit -nostdlib -fno-builtin -fno-rtti -fno-exceptions -ffreestanding -Wno-unused-function -m32 -g -fPIC -std=c++0x -Wall -W $(DEFINES)
INCPATH = -I../../Electronics/Electronics/Conductance -I. -I../../Electronics/Electronics/Tools -I../include -I/usr/lib/qt/mkspecs/linux-g++
CXXFLAGS = -pipe -g -Wall -Wextra -fno-stack-protector -fno-use-cxa-atexit -nostdlib -fno-builtin -fno-rtti -fno-exceptions -ffreestanding -m32 -fno-leading-underscore -g -fPIC -std=c++0x -Wall -W $(DEFINES)
INCPATH = -I../../Electronics/Electronics/Conductance -I. -I../../Electronics/Electronics/Tools -I/home/felix/projects/trainOS/include -I/usr/lib/qt/mkspecs/linux-g++
QMAKE = /usr/lib/qt/bin/qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
@ -33,7 +33,7 @@ MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
DISTNAME = Conductance1.0.0
DISTDIR = /home/felix/projects/trainOS/conductance/.tmp/Conductance1.0.0
DISTDIR = /data/projects/trainOS/conductance/.tmp/Conductance1.0.0
AR = ar cqs
RANLIB =
SED = sed
@ -75,7 +75,6 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \
/usr/lib/qt/mkspecs/common/g++-unix.conf \
/usr/lib/qt/mkspecs/qconfig.pri \
/usr/lib/qt/mkspecs/modules/qt_Attica.pri \
/usr/lib/qt/mkspecs/modules/qt_BluezQt.pri \
/usr/lib/qt/mkspecs/modules/qt_KActivities.pri \
/usr/lib/qt/mkspecs/modules/qt_KArchive.pri \
/usr/lib/qt/mkspecs/modules/qt_KAuth.pri \
@ -111,8 +110,6 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \
/usr/lib/qt/mkspecs/modules/qt_KWidgetsAddons.pri \
/usr/lib/qt/mkspecs/modules/qt_KWindowSystem.pri \
/usr/lib/qt/mkspecs/modules/qt_KXmlGui.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_bluetooth.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_bluetooth_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_bootstrap_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_clucene_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_concurrent.pri \
@ -135,14 +132,8 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \
/usr/lib/qt/mkspecs/modules/qt_lib_help_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_location.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_location_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_multimedia.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_multimedia_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_multimediawidgets.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_network.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_network_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_nfc.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_nfc_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_opengl.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_opengl_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_openglextensions.pri \
@ -157,7 +148,6 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \
/usr/lib/qt/mkspecs/modules/qt_lib_qmldevtools_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_qmltest.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_qmltest_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_quick.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_quick_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_quickparticles_private.pri \
@ -180,16 +170,8 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \
/usr/lib/qt/mkspecs/modules/qt_lib_uiplugin.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_uitools.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_uitools_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_waylandclient.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_waylandclient_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webchannel.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webchannel_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webengine.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webengine_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webenginecore.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webenginecore_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webenginewidgets.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webenginewidgets_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webkit.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webkit_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webkitwidgets.pri \
@ -293,7 +275,6 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/common/g++-unix.conf \
/usr/lib/qt/mkspecs/qconfig.pri \
/usr/lib/qt/mkspecs/modules/qt_Attica.pri \
/usr/lib/qt/mkspecs/modules/qt_BluezQt.pri \
/usr/lib/qt/mkspecs/modules/qt_KActivities.pri \
/usr/lib/qt/mkspecs/modules/qt_KArchive.pri \
/usr/lib/qt/mkspecs/modules/qt_KAuth.pri \
@ -329,8 +310,6 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/modules/qt_KWidgetsAddons.pri \
/usr/lib/qt/mkspecs/modules/qt_KWindowSystem.pri \
/usr/lib/qt/mkspecs/modules/qt_KXmlGui.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_bluetooth.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_bluetooth_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_bootstrap_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_clucene_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_concurrent.pri \
@ -353,14 +332,8 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/modules/qt_lib_help_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_location.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_location_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_multimedia.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_multimedia_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_multimediawidgets.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_network.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_network_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_nfc.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_nfc_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_opengl.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_opengl_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_openglextensions.pri \
@ -375,7 +348,6 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/modules/qt_lib_qmldevtools_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_qmltest.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_qmltest_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_quick.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_quick_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_quickparticles_private.pri \
@ -398,16 +370,8 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/modules/qt_lib_uiplugin.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_uitools.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_uitools_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_waylandclient.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_waylandclient_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webchannel.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webchannel_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webengine.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webengine_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webenginecore.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webenginecore_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webenginewidgets.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webenginewidgets_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webkit.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webkit_private.pri \
/usr/lib/qt/mkspecs/modules/qt_lib_webkitwidgets.pri \
@ -456,7 +420,6 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/common/g++-unix.conf:
/usr/lib/qt/mkspecs/qconfig.pri:
/usr/lib/qt/mkspecs/modules/qt_Attica.pri:
/usr/lib/qt/mkspecs/modules/qt_BluezQt.pri:
/usr/lib/qt/mkspecs/modules/qt_KActivities.pri:
/usr/lib/qt/mkspecs/modules/qt_KArchive.pri:
/usr/lib/qt/mkspecs/modules/qt_KAuth.pri:
@ -492,8 +455,6 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/modules/qt_KWidgetsAddons.pri:
/usr/lib/qt/mkspecs/modules/qt_KWindowSystem.pri:
/usr/lib/qt/mkspecs/modules/qt_KXmlGui.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_bluetooth.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_bluetooth_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_bootstrap_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_clucene_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_concurrent.pri:
@ -516,14 +477,8 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/modules/qt_lib_help_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_location.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_location_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_multimedia.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_multimedia_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_multimediawidgets.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_multimediawidgets_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_network.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_network_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_nfc.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_nfc_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_opengl.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_opengl_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_openglextensions.pri:
@ -538,7 +493,6 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/modules/qt_lib_qmldevtools_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_qmltest.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_qmltest_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_quick.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_quick_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_quickparticles_private.pri:
@ -561,16 +515,8 @@ Makefile: ../../Electronics/Electronics/Conductance/Conductance.pro /usr/lib/qt/
/usr/lib/qt/mkspecs/modules/qt_lib_uiplugin.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_uitools.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_uitools_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_waylandclient.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_waylandclient_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webchannel.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webchannel_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webengine.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webengine_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webenginecore.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webenginecore_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webenginewidgets.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webenginewidgets_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webkit.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webkit_private.pri:
/usr/lib/qt/mkspecs/modules/qt_lib_webkitwidgets.pri:
@ -649,71 +595,71 @@ compiler_clean:
####### Compile
compoundtype.o: ../../Electronics/Electronics/Conductance/types/compoundtype.cpp ../../Electronics/Electronics/Conductance/types/compoundtype.hpp \
../include/ker/dictionary.hpp \
../include/kernel.h \
../include/ker/pair.hpp \
../include/ker/vector.hpp \
../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h \
../include/ker/new.hpp \
/home/felix/projects/trainOS/include/ker/dictionary.hpp \
/home/felix/projects/trainOS/include/kernel.h \
/home/felix/projects/trainOS/include/ker/pair.hpp \
/home/felix/projects/trainOS/include/ker/vector.hpp \
/home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h \
/home/felix/projects/trainOS/include/ker/new.hpp \
../../Electronics/Electronics/Conductance/vmtype.hpp \
../../Electronics/Electronics/Conductance/vmtypes.hpp \
../include/ker/string.hpp \
/home/felix/projects/trainOS/include/ker/string.hpp \
../../Electronics/Electronics/Conductance/vmvalue.hpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o compoundtype.o ../../Electronics/Electronics/Conductance/types/compoundtype.cpp
vmpointertype.o: ../../Electronics/Electronics/Conductance/types/vmpointertype.cpp ../../Electronics/Electronics/Conductance/types/vmpointertype.hpp \
../../Electronics/Electronics/Conductance/vmtype.hpp \
../../Electronics/Electronics/Conductance/vmtypes.hpp \
../include/ker/string.hpp \
../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h \
../include/ker/vector.hpp \
../include/ker/new.hpp \
/home/felix/projects/trainOS/include/ker/string.hpp \
/home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h \
/home/felix/projects/trainOS/include/ker/vector.hpp \
/home/felix/projects/trainOS/include/ker/new.hpp \
../../Electronics/Electronics/Conductance/vmvalue.hpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o vmpointertype.o ../../Electronics/Electronics/Conductance/types/vmpointertype.cpp
vmprimitivetype.o: ../../Electronics/Electronics/Conductance/types/vmprimitivetype.cpp ../../Electronics/Electronics/Conductance/types/vmprimitivetype.hpp \
../include/ker/string.hpp \
../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h \
/home/felix/projects/trainOS/include/ker/string.hpp \
/home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h \
../../Electronics/Electronics/Conductance/vmtype.hpp \
../../Electronics/Electronics/Conductance/vmtypes.hpp \
../include/ker/vector.hpp \
../include/ker/new.hpp \
/home/felix/projects/trainOS/include/ker/vector.hpp \
/home/felix/projects/trainOS/include/ker/new.hpp \
../../Electronics/Electronics/Conductance/vmvalue.hpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o vmprimitivetype.o ../../Electronics/Electronics/Conductance/types/vmprimitivetype.cpp
vmvoidtype.o: ../../Electronics/Electronics/Conductance/types/vmvoidtype.cpp ../../Electronics/Electronics/Conductance/types/vmvoidtype.hpp \
../../Electronics/Electronics/Conductance/vmtype.hpp \
../../Electronics/Electronics/Conductance/vmtypes.hpp \
../include/ker/string.hpp \
../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h \
../include/ker/vector.hpp \
../include/ker/new.hpp \
/home/felix/projects/trainOS/include/ker/string.hpp \
/home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h \
/home/felix/projects/trainOS/include/ker/vector.hpp \
/home/felix/projects/trainOS/include/ker/new.hpp \
../../Electronics/Electronics/Conductance/vmvalue.hpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o vmvoidtype.o ../../Electronics/Electronics/Conductance/types/vmvoidtype.cpp
assembly.o: ../../Electronics/Electronics/Conductance/assembly.cpp ../../Electronics/Electronics/Conductance/assembly.hpp \
../include/ker/dictionary.hpp \
../include/kernel.h \
../include/ker/pair.hpp \
../include/ker/vector.hpp \
../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h \
../include/ker/new.hpp \
../include/ker/string.hpp \
/home/felix/projects/trainOS/include/ker/dictionary.hpp \
/home/felix/projects/trainOS/include/kernel.h \
/home/felix/projects/trainOS/include/ker/pair.hpp \
/home/felix/projects/trainOS/include/ker/vector.hpp \
/home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h \
/home/felix/projects/trainOS/include/ker/new.hpp \
/home/felix/projects/trainOS/include/ker/string.hpp \
../../Electronics/Electronics/Conductance/vmtypes.hpp \
../../Electronics/Electronics/Tools/refcounted.hpp \
../../Electronics/Electronics/Tools/fixedstring.hpp \
@ -722,34 +668,34 @@ assembly.o: ../../Electronics/Electronics/Conductance/assembly.cpp ../../Electro
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o assembly.o ../../Electronics/Electronics/Conductance/assembly.cpp
opcodes.o: ../../Electronics/Electronics/Conductance/opcodes.cpp ../../Electronics/Electronics/Conductance/opcodes.hpp \
../include/ker/dictionary.hpp \
../include/kernel.h \
../include/ker/pair.hpp \
../include/ker/vector.hpp \
../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h \
../include/ker/new.hpp \
../include/ker/string.hpp \
/home/felix/projects/trainOS/include/ker/dictionary.hpp \
/home/felix/projects/trainOS/include/kernel.h \
/home/felix/projects/trainOS/include/ker/pair.hpp \
/home/felix/projects/trainOS/include/ker/vector.hpp \
/home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h \
/home/felix/projects/trainOS/include/ker/new.hpp \
/home/felix/projects/trainOS/include/ker/string.hpp \
../../Electronics/Electronics/Tools/fixedstring.hpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o opcodes.o ../../Electronics/Electronics/Conductance/opcodes.cpp
virtualmachine.o: ../../Electronics/Electronics/Conductance/virtualmachine.cpp ../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h \
virtualmachine.o: ../../Electronics/Electronics/Conductance/virtualmachine.cpp /home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h \
../../Electronics/Electronics/Conductance/vmtype.hpp \
../../Electronics/Electronics/Conductance/vmtypes.hpp \
../include/ker/string.hpp \
../include/ker/vector.hpp \
../include/ker/new.hpp \
/home/felix/projects/trainOS/include/ker/string.hpp \
/home/felix/projects/trainOS/include/ker/vector.hpp \
/home/felix/projects/trainOS/include/ker/new.hpp \
../../Electronics/Electronics/Conductance/vmvalue.hpp \
../../Electronics/Electronics/Conductance/virtualmachine.hpp \
../../Electronics/Electronics/Conductance/opcodes.hpp \
../include/ker/dictionary.hpp \
../include/kernel.h \
../include/ker/pair.hpp \
/home/felix/projects/trainOS/include/ker/dictionary.hpp \
/home/felix/projects/trainOS/include/kernel.h \
/home/felix/projects/trainOS/include/ker/pair.hpp \
../../Electronics/Electronics/Tools/fixedstring.hpp \
../../Electronics/Electronics/Tools/binaryreader.hpp \
../../Electronics/Electronics/Tools/refcounted.hpp \
@ -759,13 +705,13 @@ virtualmachine.o: ../../Electronics/Electronics/Conductance/virtualmachine.cpp .
vmtype.o: ../../Electronics/Electronics/Conductance/vmtype.cpp ../../Electronics/Electronics/Conductance/vmtype.hpp \
../../Electronics/Electronics/Conductance/vmtypes.hpp \
../include/ker/string.hpp \
../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h \
../include/ker/vector.hpp \
../include/ker/new.hpp \
/home/felix/projects/trainOS/include/ker/string.hpp \
/home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h \
/home/felix/projects/trainOS/include/ker/vector.hpp \
/home/felix/projects/trainOS/include/ker/new.hpp \
../../Electronics/Electronics/Conductance/vmvalue.hpp \
../../Electronics/Electronics/Conductance/types/vmvoidtype.hpp \
../../Electronics/Electronics/Conductance/types/vmprimitivetype.hpp
@ -773,21 +719,21 @@ vmtype.o: ../../Electronics/Electronics/Conductance/vmtype.cpp ../../Electronics
vmvalue.o: ../../Electronics/Electronics/Conductance/vmvalue.cpp ../../Electronics/Electronics/Conductance/vmvalue.hpp \
../../Electronics/Electronics/Conductance/vmtypes.hpp \
../include/ker/string.hpp \
../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h \
../include/ker/vector.hpp \
../include/ker/new.hpp \
/home/felix/projects/trainOS/include/ker/string.hpp \
/home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h \
/home/felix/projects/trainOS/include/ker/vector.hpp \
/home/felix/projects/trainOS/include/ker/new.hpp \
../../Electronics/Electronics/Conductance/vmtype.hpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o vmvalue.o ../../Electronics/Electronics/Conductance/vmvalue.cpp
string.o: ../ker/string.cpp ../include/ker/string.hpp \
../include/kstdlib.h \
../include/varargs.h \
../include/config.h \
../include/malloc.h
/home/felix/projects/trainOS/include/kstdlib.h \
/home/felix/projects/trainOS/include/varargs.h \
/home/felix/projects/trainOS/include/config.h \
/home/felix/projects/trainOS/include/malloc.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o string.o ../ker/string.cpp
####### Install

59
csl/cpustatetype.cpp Normal file
View file

@ -0,0 +1,59 @@
#include "cpustatetype.hpp"
#include <types/compoundtype.hpp>
#include <console.h>
static CompoundType type {
"CPUSTATE",
{
{ "eax", &VMType::UInt32 },
{ "ebx", &VMType::UInt32 },
{ "ecx", &VMType::UInt32 },
{ "edx", &VMType::UInt32 },
{ "esi", &VMType::UInt32 },
{ "edi", &VMType::UInt32 },
{ "ebp", &VMType::UInt32 },
{ "intr", &VMType::UInt32 },
{ "error", &VMType::UInt32 },
{ "eip", &VMType::UInt32 },
{ "cs", &VMType::UInt32 },
{ "eflags", &VMType::UInt32 },
{ "esp", &VMType::UInt32 },
{ "ss", &VMType::UInt32 },
}
};
namespace csl
{
const VMType * CpuStateType = &type;
VMValue createCpuState(CpuState *state)
{
Compound object = new ker::Dictionary<VMText, VMValue>();
#define COPY(name) (*object)[#name] = VMValue::UInt32(state->name)
COPY(eax);
COPY(ebx);
COPY(ecx);
COPY(edx);
COPY(esi);
COPY(edi);
COPY(ebp);
COPY(intr);
COPY(error);
COPY(eip);
COPY(cs);
COPY(eflags);
COPY(esp);
COPY(ss);
#undef COPY
return VMValue(CpuStateType, &object);
}
}

12
csl/cpustatetype.hpp Normal file
View file

@ -0,0 +1,12 @@
#pragma once
#include <vmtype.hpp>
#include <cpustate.h>
namespace csl
{
extern const VMType * CpuStateType;
VMValue createCpuState(::CpuState *state);
}

View file

@ -2,6 +2,7 @@
.author "Felix Queißner"
.descr "The main file of the operating system"
; PUB main()
main:
pushi 0
@ -26,15 +27,17 @@ _loop:
jmp _loop
_end:
; Our OS should not end.
; Our OS should not go into shutdown mode...
jmp _end
ret
; PUB irq( id : INT32, data : CPUSTATE )
irq:
pusht "Hello IRQ: "
load -1
pusht ", "
load -2
readfld eax
pusht "\n"
calln print 5

View file

@ -9,6 +9,8 @@
#include <interrupts.h>
#include "../csl/cpustatetype.hpp"
extern "C" {
extern const char mainscript_start;
extern const char mainscript_end;
@ -81,17 +83,19 @@ extern "C" void vm_handle_interrupt(CpuState *state)
irqFiFo.items[irqFiFo.write] = *state;
irqFiFo.write += 1;
if(irqFiFo.write >= irqFiFo.length) {
// TODO: Don't die
die("irqList overflow.");
// TODO: Don't die!
// Logging, statistics...
die("irqFiFo overflow.");
}
}
extern "C" void vm_start()
{
intr_set_handler(0x20, vm_handle_interrupt);
// intr_set_handler(0x20, vm_handle_interrupt);
intr_set_handler(0x21, vm_handle_interrupt);
VirtualMachine machine;
machine.type("CPUSTATE") = csl::CpuStateType;
machine.import("print") = printArguments;
Assembly *assembly = machine.load(mainAssembly.ptr, mainAssembly.size);
@ -125,7 +129,10 @@ extern "C" void vm_start()
CpuState *cpu = &irqFiFo.items[irqFiFo.read];
auto *thread = irqService->createThread(irqRoutine);
thread->start({ VMValue::Int32(cpu->intr), VMValue::Int32(cpu->eip) });
thread->start({
VMValue::Int32(cpu->intr),
csl::createCpuState(cpu)
});
irqFiFo.read += 1;

View file

@ -15,7 +15,8 @@ SOURCES += \
src/cplusplus.cpp \
src/vm.cpp \
src/serial.c \
src/cpp-test.cpp
src/cpp-test.cpp \
csl/cpustatetype.cpp
HEADERS += \
include/console.h \
@ -39,7 +40,8 @@ HEADERS += \
include/dynamic.h \
include/config.h \
include/serial.h \
include/malloc.h
include/malloc.h \
csl/cpustatetype.hpp
DISTFILES += \
asm/intr_common_handler.S \