diff --git a/src/Makefile.inc b/src/Makefile.inc index 8a14d34..935fc6c 100644 --- a/src/Makefile.inc +++ b/src/Makefile.inc @@ -2,8 +2,8 @@ # Global 'Source' Options # allow you to change your default compiler without affecting your other work -CC = gcc295 -CXX = g++295 +CC = gcc +CXX = g++ LD = ld AR = ar REMOVE = rm -rf diff --git a/src/sys/compile/ldscript.i386 b/src/sys/compile/ldscript.i386 index b86bc7b..731e787 100644 --- a/src/sys/compile/ldscript.i386 +++ b/src/sys/compile/ldscript.i386 @@ -37,7 +37,7 @@ /* text/read-only data */ .text : { *(.text .gnu.linkonce.t.*) } =0x9090 - .rodata : { *(.rodata) } + .rodata : { *(.rodata) .rodata.* .gnu.linkonce.r.* } /* writable data */ . = ALIGN(0x1000); @@ -45,11 +45,23 @@ .data : { *(.data .gnu.linkonce.d.*) } __ctor_list = .; - .ctors : { *(.ctors) } + .ctors : + { + LONG((__ctor_end - __ctor_list) / 4 - 2) + *(.ctors) + LONG(0) + } __ctor_end = .; + __dtor_list = .; - .dtors : { *(.dtors) } + .dtors : + { + LONG((__dtor_end - __dtor_list) / 4 - 2) + *(.dtors) + LONG(0) + } __dtor_end = .; + .got : { *(.got.plt) *(.got) } .dynamic : { *(.dynamic) } diff --git a/src/sys/include/ubixos/init.h b/src/sys/include/ubixos/init.h index c8648eb..331f0d9 100644 --- a/src/sys/include/ubixos/init.h +++ b/src/sys/include/ubixos/init.h @@ -46,11 +46,13 @@ #include #include #include +#include typedef int (*intFunctionPTR)(void); intFunctionPTR init_tasks[] = { vmm_init, + static_constructors, i8259_init, idt_init, vitals_init, @@ -76,6 +78,9 @@ /*** $Log$ + Revision 1.32 2004/09/08 07:33:37 reddawg + Fixes + Revision 1.31 2004/09/07 22:26:04 reddawg synced in diff --git a/src/sys/include/ubixos/static.h b/src/sys/include/ubixos/static.h new file mode 100644 index 0000000..94fe513 --- /dev/null +++ b/src/sys/include/ubixos/static.h @@ -0,0 +1,6 @@ +#ifndef _UBIXOS_STATIC_H +#define _UBIXOS_STATIC_H + +int static_constructors(void); + +#endif diff --git a/src/sys/include/ubixos/types.h b/src/sys/include/ubixos/types.h index 32bba37..c362d79 100644 --- a/src/sys/include/ubixos/types.h +++ b/src/sys/include/ubixos/types.h @@ -61,8 +61,10 @@ typedef int size_t; /* standart */ #ifndef NOBOOL +#ifndef __cplusplus typedef enum { FALSE=0,TRUE=1 } bool; #endif +#endif #ifndef _INO_T_DECLARED typedef __ino_t ino_t; /* inode number */ @@ -96,6 +98,9 @@ /*** $Log$ + Revision 1.5 2004/07/05 23:06:32 reddawg + Fixens + Revision 1.4 2004/06/01 02:50:45 reddawg Cleanup diff --git a/src/sys/init/Makefile b/src/sys/init/Makefile index 0a0cf04..bc3b916 100644 --- a/src/sys/init/Makefile +++ b/src/sys/init/Makefile @@ -6,7 +6,7 @@ include ../Makefile.inc # Objects -OBJS = start.o main.o +OBJS = start.o main.o static.o all: $(OBJS) diff --git a/src/sys/init/static.c b/src/sys/init/static.c new file mode 100644 index 0000000..ca2632e --- /dev/null +++ b/src/sys/init/static.c @@ -0,0 +1,17 @@ +#include + +int static_constructors(void) +{ + kprintf("Calling static constructors\n"); + + extern void (* __ctor_list)(); + void (** l_ctor)() = &__ctor_list; + int l_ctorCount = *(int *)l_ctor; + l_ctor++; + while(l_ctorCount) + { + (*l_ctor)(); + l_ctorCount--; + l_ctor++; + } +} diff --git a/src/sys/lib/libcpp.cc b/src/sys/lib/libcpp.cc index 2e8ee84..4a0af9c 100644 --- a/src/sys/lib/libcpp.cc +++ b/src/sys/lib/libcpp.cc @@ -32,8 +32,12 @@ #include #include void __pure_virtual() { while(1); } + void __cxa_pure_virtual() { while(1); } -void __cxa_atexit() { while(1); } + +/* Don't plan on exiting the kernel...so do nothing. */ +int __cxa_atexit(void (*func)(void *), void * arg, void * d) { return 0; } + void __dso_handle() { while(1); } } @@ -65,6 +69,9 @@ /*** $Log$ + Revision 1.4 2004/07/20 22:58:33 reddawg + retiring to the laptop for the night must sync in work to resume from there + Revision 1.3 2004/07/02 12:28:24 reddawg Changes for new libc, someone please test that the kernel still works diff --git a/src/sys/sys/video.c b/src/sys/sys/video.c index 71f7e86..fd4dc0d 100644 --- a/src/sys/sys/video.c +++ b/src/sys/sys/video.c @@ -65,10 +65,10 @@ unsigned int bufferOffset = 0x0, character = 0x0, i = 0x0; /* Short circuit if we're in tty mode */ - if (tty_foreground) + if (0 != tty_foreground) { - tty_print(string,tty_find(0)); - return; + //tty_print(string,tty_find(0)); + //return; } /* We Need To Get The Y Position */ @@ -127,6 +127,9 @@ /*** $Log$ + Revision 1.12 2004/09/07 22:00:20 apwillia + Fix gcc 2.95 being retarded and not follwing the C99 specs + Revision 1.11 2004/09/07 21:50:25 apwillia Make kprintf stay on tty0 diff --git a/src/tools/Makefile b/src/tools/Makefile index d06e5c3..88586d7 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -52,11 +52,11 @@ (cp ../bin/ld/ld.so ./) #(cp /lib/libc.so.5 ./) (cp ../bin/ttyd/ttyd ./) - (./format 50 2000 /dev/fd0 ubix.elf 0 login 3754 ROM8X14.DPF 3754 init 3754 ubistry 3754 shell 3754 userdb 3754 ls 3754 motd 3754 fdisk 3754 mbr 3754 cp 3754 clock 3754 libc_old.so 3754 ld.so 3754 ttyd 3754) + (./format 50 2000 /dev/loop0 ubix.elf 0 login 3754 ROM8X14.DPF 3754 init 3754 ubistry 3754 shell 3754 userdb 3754 ls 3754 motd 3754 fdisk 3754 mbr 3754 cp 3754 clock 3754 libc_old.so 3754 ld.so 3754 ttyd 3754) # (./format 50 2000 /dev/fd0 ubix.elf 0 login 3754 init 3754 ubistry 3754 shell 3754 userdb 3754 motd 3754 libc_old.so 3754 ld.so 3754 test 3754 libc.so.5 3754) #(./format 263 204361 /dev/md1 ubix.elf 0 format 3754 fdisk 3754 ROM8X14.DPF 3754 init 3754 login 3754 shell 3754 userdb 3754 ls 3754 motd 3754 cp 3754) - (./format 1064 2000 /dev/fd0 shell 3754 clock 3754) + (./format 1064 2000 /dev/loop0 shell 3754 clock 3754) #(./format 200 2000 /dev/md1 ubix.elf 0 shell 3754 motd 3754 libc_old.so 3754) (rm -fr ubix.elf) (rm -fr login)