From 739b296a95e08315dc23cdb7237409c8621302c3 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 14 Sep 2011 18:11:52 +0200 Subject: [PATCH] libmaxsi now has a function called upon process creation. --- libmaxsi/Makefile | 14 +++++++++++--- libmaxsi/init.cpp | 34 ++++++++++++++++++++++++++++++++++ libmaxsi/start.s | 2 ++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 libmaxsi/init.cpp diff --git a/libmaxsi/Makefile b/libmaxsi/Makefile index 58758c45..27114d45 100644 --- a/libmaxsi/Makefile +++ b/libmaxsi/Makefile @@ -40,11 +40,19 @@ c/h/features.h \ c/h/string.h \ c/h/sys/stat.h \ c/h/sys/types.h \ -c/h/stdio.h +c/h/stdio.h \ -COMMONOBJS=c++.o thread.o io.o memory.o string.o error.o format.o +COMMONOBJS=c++.o memory.o string.o error.o format.o SORTIXOBJS:=$(addprefix sortix/,$(COMMONOBJS)) -LIBMAXSIOBJS:=$(COMMONOBJS) sortix-vga.o sortix-keyboard.o sortix-sound.o process.o +LIBMAXSIOBJS:=$(COMMONOBJS) \ +sortix-vga.o \ +sortix-keyboard.o \ +sortix-sound.o \ +process.o \ +thread.o \ +io.o \ +init.o \ + HEADERS=\ error.h \ io.h \ diff --git a/libmaxsi/init.cpp b/libmaxsi/init.cpp new file mode 100644 index 00000000..9aa4e4e4 --- /dev/null +++ b/libmaxsi/init.cpp @@ -0,0 +1,34 @@ +/****************************************************************************** + + COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2011. + + This file is part of LibMaxsi. + + LibMaxsi is free software: you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + LibMaxsi is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + + You should have received a copy of the GNU Lesser General Public License + along with LibMaxsi. If not, see . + + init.cpp + Initializes the process by setting up the heap, signal handling, + static memory and other useful things. + +******************************************************************************/ + +#include "platform.h" + +namespace Maxsi +{ + extern "C" void initialize_standard_library() + { + + } +} diff --git a/libmaxsi/start.s b/libmaxsi/start.s index 4131b495..8eef55c4 100644 --- a/libmaxsi/start.s +++ b/libmaxsi/start.s @@ -30,6 +30,8 @@ .type _start, @function _start: + call initialize_standard_library + # Run main # TODO: Sortix should push these values to the stack itself! push $0x0 # argv