Permalink
Browse files

Adding user runtime and user application test source. Added ELF

implementation from old source... it needs cleaning. Cleaned up some
files.
  • Loading branch information...
1 parent a07e541 commit 8c71f8fe2f1e7a8b4a78f3f10cc6a6ead580e4f5 @wilkie wilkie committed Sep 12, 2009
Showing with 6,697 additions and 100 deletions.
  1. +5 −0 app/.gitignore
  2. +82 −0 app/dsss.conf
  3. +11 −0 app/testapp.d
  4. +0 −2 kernel/arch/x86_64/core/lapic.d
  5. +560 −0 kernel/system/elf.d
  6. +83 −98 kernel/system/multiboot.d
  7. +1,110 −0 runtimes/mindrt/dstubs.d
  8. +17 −0 runtimes/mindrt/entry.d
  9. +16 −0 runtimes/mindrt/entry.s
  10. +41 −0 runtimes/mindrt/gcc/builtins.d
  11. +28 −0 runtimes/mindrt/invariant.d
  12. +1,098 −0 runtimes/mindrt/object.d
  13. +600 −0 runtimes/mindrt/precision.d
  14. +38 −0 runtimes/mindrt/std/c/stdarg.d
  15. +264 −0 runtimes/mindrt/std/intrinsic.d
  16. +72 −0 runtimes/mindrt/std/moduleinit.d
  17. +43 −0 runtimes/mindrt/std/stdarg.d
  18. +96 −0 runtimes/mindrt/std/typeinfo/ti_AC.d
  19. +107 −0 runtimes/mindrt/std/typeinfo/ti_Acdouble.d
  20. +105 −0 runtimes/mindrt/std/typeinfo/ti_Acfloat.d
  21. +108 −0 runtimes/mindrt/std/typeinfo/ti_Acreal.d
  22. +116 −0 runtimes/mindrt/std/typeinfo/ti_Adouble.d
  23. +115 −0 runtimes/mindrt/std/typeinfo/ti_Afloat.d
  24. +204 −0 runtimes/mindrt/std/typeinfo/ti_Ag.d
  25. +119 −0 runtimes/mindrt/std/typeinfo/ti_Aint.d
  26. +111 −0 runtimes/mindrt/std/typeinfo/ti_Along.d
  27. +117 −0 runtimes/mindrt/std/typeinfo/ti_Areal.d
  28. +134 −0 runtimes/mindrt/std/typeinfo/ti_Ashort.d
  29. +76 −0 runtimes/mindrt/std/typeinfo/ti_C.d
  30. +39 −0 runtimes/mindrt/std/typeinfo/ti_byte.d
  31. +67 −0 runtimes/mindrt/std/typeinfo/ti_cdouble.d
  32. +66 −0 runtimes/mindrt/std/typeinfo/ti_cfloat.d
  33. +43 −0 runtimes/mindrt/std/typeinfo/ti_char.d
  34. +68 −0 runtimes/mindrt/std/typeinfo/ti_creal.d
  35. +45 −0 runtimes/mindrt/std/typeinfo/ti_dchar.d
  36. +40 −0 runtimes/mindrt/std/typeinfo/ti_delegate.d
  37. +68 −0 runtimes/mindrt/std/typeinfo/ti_double.d
  38. +68 −0 runtimes/mindrt/std/typeinfo/ti_float.d
  39. +12 −0 runtimes/mindrt/std/typeinfo/ti_idouble.d
  40. +12 −0 runtimes/mindrt/std/typeinfo/ti_ifloat.d
  41. +43 −0 runtimes/mindrt/std/typeinfo/ti_int.d
  42. +12 −0 runtimes/mindrt/std/typeinfo/ti_ireal.d
  43. +43 −0 runtimes/mindrt/std/typeinfo/ti_long.d
  44. +47 −0 runtimes/mindrt/std/typeinfo/ti_ptr.d
  45. +68 −0 runtimes/mindrt/std/typeinfo/ti_real.d
  46. +39 −0 runtimes/mindrt/std/typeinfo/ti_short.d
  47. +43 −0 runtimes/mindrt/std/typeinfo/ti_ubyte.d
  48. +43 −0 runtimes/mindrt/std/typeinfo/ti_uint.d
  49. +43 −0 runtimes/mindrt/std/typeinfo/ti_ulong.d
  50. +39 −0 runtimes/mindrt/std/typeinfo/ti_ushort.d
  51. +44 −0 runtimes/mindrt/std/typeinfo/ti_void.d
  52. +44 −0 runtimes/mindrt/std/typeinfo/ti_wchar.d
  53. +185 −0 runtimes/mindrt/util.d
View
@@ -0,0 +1,5 @@
+testapp
+testapp.dump
+dsss.last
+dsss_imports
+dsss_objs
View
@@ -0,0 +1,82 @@
+name = xomb
+
+CC = x86_64-pc-elf-gcc
+CFLAGS = -nostdlib -nodefaultlibs -g -DUSE_ASSERT -mcmodel=kernel
+
+[*]
+buildflags=-dc=ldc-xomb
+
+[testapp.d]
+
+buildflags=-dc=ldc-xomb -I..
+
+# compile runtime
+
+prebuild= \
+\
+\echo ;\
+echo "Building Application Runtime (mindrt)" ;\
+mkdir -p dsss_imports;\
+mkdir -p dsss_objs;\
+mkdir -p dsss_objs/G;\
+mkdir -p dsss_objs/O;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/object.d -ofdsss_objs/G/runtime.object.o; \
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/invariant.d -ofdsss_objs/G/runtime.invariant.o; \
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/dstubs.d -ofdsss_objs/G/runtime.dstubs.o; \
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/util.d -ofdsss_objs/G/runtime.util.o; \
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/util.d -ofdsss_objs/G/runtime.util.o; \
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/stdarg.d -ofdsss_objs/G/runtime.std.stdarg.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/moduleinit.d -ofdsss_objs/G/runtime.std.moduleinit.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/intrinsic.d -ofdsss_objs/G/runtime.std.intrinsic.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/moduleinit.d -ofdsss_objs/G/runtime.std.moduleinit.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_AC.d -ofdsss_objs/G/runtime.std.typeinfo.ti_AC.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_Acdouble.d -ofdsss_objs/G/runtime.std.typeinfo.ti_Acdouble.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_Acfloat.d -ofdsss_objs/G/runtime.std.typeinfo.ti_Acfloat.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_Ag.d -ofdsss_objs/G/runtime.std.typeinfo.ti_Ag.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_Aint.d -ofdsss_objs/G/runtime.std.typeinfo.ti_Aint.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_Along.d -ofdsss_objs/G/runtime.std.typeinfo.ti_Along.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_Areal.d -ofdsss_objs/G/runtime.std.typeinfo.ti_Areal.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_Ashort.d -ofdsss_objs/G/runtime.std.typeinfo.ti_Ashort.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_C.d -ofdsss_objs/G/runtime.std.typeinfo.ti_C.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_byte.d -ofdsss_objs/G/runtime.std.typeinfo.ti_byte.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_cdouble.d -ofdsss_objs/G/runtime.std.typeinfo.ti_cdouble.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_cfloat.d -ofdsss_objs/G/runtime.std.typeinfo.ti_cfloat.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_char.d -ofdsss_objs/G/runtime.std.typeinfo.ti_char.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_creal.d -ofdsss_objs/G/runtime.std.typeinfo.ti_creal.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_dchar.d -ofdsss_objs/G/runtime.std.typeinfo.ti_dchar.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_delegate.d -ofdsss_objs/G/runtime.std.typeinfo.ti_delegate.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_double.d -ofdsss_objs/G/runtime.std.typeinfo.ti_double.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_float.d -ofdsss_objs/G/runtime.std.typeinfo.ti_float.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_idouble.d -ofdsss_objs/G/runtime.std.typeinfo.ti_idouble.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_ifloat.d -ofdsss_objs/G/runtime.std.typeinfo.ti_ifloat.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_int.d -ofdsss_objs/G/runtime.std.typeinfo.ti_int.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_ireal.d -ofdsss_objs/G/runtime.std.typeinfo.ti_ireal.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_long.d -ofdsss_objs/G/runtime.std.typeinfo.ti_long.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_ptr.d -ofdsss_objs/G/runtime.std.typeinfo.ti_ptr.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_real.d -ofdsss_objs/G/runtime.std.typeinfo.ti_real.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_short.d -ofdsss_objs/G/runtime.std.typeinfo.ti_short.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_ubyte.d -ofdsss_objs/G/runtime.std.typeinfo.ti_ubyte.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_uint.d -ofdsss_objs/G/runtime.std.typeinfo.ti_uint.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_ulong.d -ofdsss_objs/G/runtime.std.typeinfo.ti_ulong.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_ushort.d -ofdsss_objs/G/runtime.std.typeinfo.ti_ushort.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_void.d -ofdsss_objs/G/runtime.std.typeinfo.ti_void.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/typeinfo/ti_wchar.d -ofdsss_objs/G/runtime.std.typeinfo.ti_wchar.o;\
+ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/entry.d -ofdsss_objs/G/runtime.entry.o;\
+#ldc -nodefaultlib -I../runtimes/mindrt/. -c ../runtimes/mindrt/std/c/stdarg.d -ofdsss_objs/G/runtime.std.c.stdarg.o;\
+#yasm -o dsss_objs/O/runtime.entry.o ../runtimes/mindrt/entry.s -felf64;\
+
+target = testapp
+
+# we will need some post build foo to link to the runtime
+
+postbuild = \
+\
+echo ; \
+echo Creating Application Executable; \
+echo '--> testapp';\
+ld -nostdlib -nodefaultlibs -b elf64-x86-64 -Ttext 0x100000 -o testapp `ls dsss_objs/G/*.o` `ls dsss_objs/O/*.o`;\
+\
+echo ;\
+echo Creating App Dump; \
+echo '--> testapp.dump';\
+rm -f testapp.dump && objdump -d -S -r testapp > testapp.dump;
View
@@ -0,0 +1,11 @@
+/* testapp.d
+
+ Example application to be used with XOmB
+
+*/
+
+module testapp;
+
+void main() {
+ for (;;) {}
+}
@@ -116,8 +116,6 @@ private:
kprintfln!("Starting AP {}")(apicID);
apLock.lock();
- // success will be printed by the AP in apExec();
-
ulong p;
for (ulong o=0; o < 10000; o++) {
p = o << 5 + 10;
Oops, something went wrong.

0 comments on commit 8c71f8f

Please sign in to comment.