summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 55ee56e)
raw | patch | inline | side by side (parent: 55ee56e)
author | Alexander Shiryaev <aixp@mail.ru> | |
Fri, 16 Nov 2012 15:47:16 +0000 (19:47 +0400) | ||
committer | Alexander Shiryaev <aixp@mail.ru> | |
Fri, 16 Nov 2012 15:47:16 +0000 (19:47 +0400) |
35 files changed:
diff --git a/new/Dev/Docu/Packer.odc b/new/Dev/Docu/Packer.odc
new file mode 100644 (file)
index 0000000..70a04f4
Binary files /dev/null and b/new/Dev/Docu/Packer.odc differ
index 0000000..70a04f4
Binary files /dev/null and b/new/Dev/Docu/Packer.odc differ
diff --git a/new/Dev/Mod/Packer.odc b/new/Dev/Mod/Packer.odc
new file mode 100644 (file)
index 0000000..a8afd4f
Binary files /dev/null and b/new/Dev/Mod/Packer.odc differ
index 0000000..a8afd4f
Binary files /dev/null and b/new/Dev/Mod/Packer.odc differ
diff --git a/new/_LinuxOpenBSD_/Host/Mod/PackedFiles.odc b/new/_LinuxOpenBSD_/Host/Mod/PackedFiles.odc
index 24afbb440e43904d6a457634f24076dbdf5e1f97..0fcdfe2fcf8e02433e507c4011be797369620f8a 100644 (file)
Binary files a/new/_LinuxOpenBSD_/Host/Mod/PackedFiles.odc and b/new/_LinuxOpenBSD_/Host/Mod/PackedFiles.odc differ
Binary files a/new/_LinuxOpenBSD_/Host/Mod/PackedFiles.odc and b/new/_LinuxOpenBSD_/Host/Mod/PackedFiles.odc differ
diff --git a/new/_LinuxOpenBSD_/Lin/Rsrc/loader/BlackBox-dl.c b/new/_LinuxOpenBSD_/Lin/Rsrc/loader/BlackBox-dl.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <dlfcn.h>
-#include <stdio.h>
-
-int main (int argc, char *argv[])
-{
- void * h;
- /*
- void * h1;
- void (*SetKernelBaseStack) (int);
- void (*Init) (void);
- */
- int res;
-
- h = dlopen("libBB.so", RTLD_LAZY | RTLD_GLOBAL);
- if (h != NULL) {
- /*
- h1 = dlsym(h, "SetKernelBaseStack");
- if (h1 != NULL) {
- *(void **) (&SetKernelBaseStack) = h1;
- h1 = dlsym(h, "Init");
- if (h1 != NULL) {
- *(void **) (&Init) = h1;
-
- asm ("movl %%esp, %[res]" : [res] "=m" (res) );
- SetKernelBaseStack(res - 8);
-
- printf("before Init()\n");
- Init();
- printf("after Init()\n");
-
- res = 0;
- } else {
- perror(dlerror());
- res = 3;
- }
- } else {
- perror(dlerror());
- res = 2;
- }
- */
- res = 0;
- } else {
- perror(dlerror());
- res = 1;
- }
-
- return res;
-}
diff --git a/new/_LinuxOpenBSD_/Lin/Rsrc/loader/BlackBox.c b/new/_LinuxOpenBSD_/Lin/Rsrc/loader/BlackBox.c
+++ /dev/null
@@ -1,4 +0,0 @@
-int main (int argc, char *argv[])
-{
- return 0;
-}
diff --git a/new/_LinuxOpenBSD_/Lin/Rsrc/loader/BlackBox1.c b/new/_LinuxOpenBSD_/Lin/Rsrc/loader/BlackBox1.c
+++ /dev/null
@@ -1,24 +0,0 @@
-// #include <stdio.h>
-
-// extern void SetKernelBaseStack (int);
-extern void Init (void);
-
-int main (int argc, char *argv[])
-{
- // int res;
-
- // printf("START\n");
-
- /* 2012.09.02: This is from oberoncore.ru
- 2012.09.05: not required in case of static linking of shared library (-lBB) */
- // asm ("movl %%esp, %[res]" : [res] "=m" (res) );
- // SetKernelBaseStack(res - 8);
- // printf("SetKernelBaseStack(0x%02x): done\n", res - 8);
- // <return adr> <caller ebp> -> base stack = locals of main proc
-
- Init();
-
- // printf("END\n");
-
- return 0;
-}
diff --git a/new/_LinuxOpenBSD_/Lin/Rsrc/loader/dev0.c b/new/_LinuxOpenBSD_/Lin/Rsrc/loader/dev0.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <dlfcn.h>
-#include <stdio.h>
-
-int main (int argc, char *argv[])
-{
- void * h;
- int res;
-
- h = dlopen("libBB0.so", RTLD_LAZY | RTLD_GLOBAL);
- if (h != NULL) {
- res = 0;
- } else {
- perror(dlerror());
- res = 1;
- }
-
- return res;
-}
diff --git a/new/_LinuxOpenBSD_/Lin/Rsrc/loader/loader.c b/new/_LinuxOpenBSD_/Lin/Rsrc/loader/loader.c
--- /dev/null
@@ -0,0 +1,23 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+int main (int argc, char *argv[])
+{
+ void * h;
+ int res;
+
+ if (argc == 2) {
+ h = dlopen(argv[1], RTLD_LAZY | RTLD_GLOBAL);
+ if (h != NULL) {
+ res = 0;
+ } else {
+ perror(dlerror());
+ res = 2;
+ }
+ } else {
+ fprintf(stderr, "usage: %s file.so\n", argv[0]);
+ res = 1;
+ }
+
+ return res;
+}
index f7789eddf9024d411efd147b723d03ea9fbbfe7e..433bef490c7713a231bc1d615a29a166f7143d56 100644 (file)
Binary files a/new/_LinuxOpenBSD_GUI/Port.odc and b/new/_LinuxOpenBSD_GUI/Port.odc differ
Binary files a/new/_LinuxOpenBSD_GUI/Port.odc and b/new/_LinuxOpenBSD_GUI/Port.odc differ
index dd0a76016c5feb2ab20ea0740aa952f67b462e31..b6c96419659520e9d36686557564b72cb2b20369 100644 (file)
Binary files a/new/_LinuxOpenBSD_GUI/TODO.odc and b/new/_LinuxOpenBSD_GUI/TODO.odc differ
Binary files a/new/_LinuxOpenBSD_GUI/TODO.odc and b/new/_LinuxOpenBSD_GUI/TODO.odc differ
diff --git a/new/_Linux_/BlackBox b/new/_Linux_/BlackBox
--- a/new/_Linux_/BlackBox
+++ /dev/null
@@ -1 +0,0 @@
-Lin/Rsrc/loader/BlackBox
\ No newline at end of file
diff --git a/new/_Linux_/Lin/Rsrc/loader/BlackBox b/new/_Linux_/Lin/Rsrc/loader/BlackBox
deleted file mode 100755 (executable)
index c456d0e..0000000
Binary files a/new/_Linux_/Lin/Rsrc/loader/BlackBox and /dev/null differ
index c456d0e..0000000
Binary files a/new/_Linux_/Lin/Rsrc/loader/BlackBox and /dev/null differ
index 16b78c9c8fb71f72c2451cd8591bcd3abca99b27..4af1536d5bd229a84b583dae1431a9da1397df74 100644 (file)
# ${.ALLSRC} $^
# ${.IMPSRC} $<
-all: dev0 BlackBox
+all: loader
CFLAGS += -Wall -O0 -g -m32
-#BlackBox: BlackBox.c
-# ${CC} ${CFLAGS} -o $@ $^ -L. -lBB
-
-BlackBox: BlackBox-dl.c
- ${CC} ${CFLAGS} -o $@ $^ -ldl
-
-dev0: dev0.c
+loader: loader.c
${CC} ${CFLAGS} -o $@ $^ -ldl
clean:
- rm -f dev0 BlackBox
+ rm -f loader
diff --git a/new/_Linux_/Lin/Rsrc/loader/dev0 b/new/_Linux_/Lin/Rsrc/loader/dev0
deleted file mode 100755 (executable)
index 2ea46b7..0000000
Binary files a/new/_Linux_/Lin/Rsrc/loader/dev0 and /dev/null differ
index 2ea46b7..0000000
Binary files a/new/_Linux_/Lin/Rsrc/loader/dev0 and /dev/null differ
diff --git a/new/_Linux_/Lin/Rsrc/loader/libBB.so b/new/_Linux_/Lin/Rsrc/loader/libBB.so
+++ /dev/null
@@ -1 +0,0 @@
-../../../libBB.so
\ No newline at end of file
diff --git a/new/_Linux_/Lin/Rsrc/loader/libBB0.so b/new/_Linux_/Lin/Rsrc/loader/libBB0.so
+++ /dev/null
@@ -1 +0,0 @@
-../../../libBB0.so
\ No newline at end of file
diff --git a/new/_Linux_/Lin/Rsrc/loader/loader b/new/_Linux_/Lin/Rsrc/loader/loader
new file mode 100755 (executable)
index 0000000..91423d9
Binary files /dev/null and b/new/_Linux_/Lin/Rsrc/loader/loader differ
index 0000000..91423d9
Binary files /dev/null and b/new/_Linux_/Lin/Rsrc/loader/loader differ
diff --git a/new/_Linux_/dev0 b/new/_Linux_/dev0
--- a/new/_Linux_/dev0
+++ /dev/null
@@ -1 +0,0 @@
-Lin/Rsrc/loader/dev0
\ No newline at end of file
diff --git a/new/_Linux_/loader b/new/_Linux_/loader
--- /dev/null
+++ b/new/_Linux_/loader
@@ -0,0 +1 @@
+Lin/Rsrc/loader/loader
\ No newline at end of file
diff --git a/new/_OpenBSD_/BlackBox b/new/_OpenBSD_/BlackBox
--- a/new/_OpenBSD_/BlackBox
+++ /dev/null
@@ -1 +0,0 @@
-Lin/Rsrc/loader/BlackBox
\ No newline at end of file
diff --git a/new/_OpenBSD_/Lin/Rsrc/loader/BlackBox b/new/_OpenBSD_/Lin/Rsrc/loader/BlackBox
deleted file mode 100755 (executable)
index 8090ec9..0000000
Binary files a/new/_OpenBSD_/Lin/Rsrc/loader/BlackBox and /dev/null differ
index 8090ec9..0000000
Binary files a/new/_OpenBSD_/Lin/Rsrc/loader/BlackBox and /dev/null differ
index b3bdcd540175bb536a9c1dd915553a02b4c8aef4..f4104ddc8803543a96cede957feedf94343ded8b 100644 (file)
CFLAGS += -Wall -O0 -g
-all: libdlobsdwrap.so dev0 BlackBox
-
-# libdlobsdwrap.so: universal method of correct access to dl* functions
-# in case of dynamic loading of libBB*.so "ld.so" in LibDl may be used instead of "libc.so", but not in case of static linking
-# wrapper method is universal
+all: loader
# -pthread required to dlopen libraries that depends on pthread
-#BlackBox: BlackBox.c
-# ${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC} -L. -lBB -pthread
-
-BlackBox: BlackBox-dl.c
+loader: loader.c
${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC} -pthread
-#dev0: BlackBox1.c
-# ${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC} -L . -lBB0
-
-dev0: dev0.c
- ${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC}
-
-libdlobsdwrap.so: libdlobsdwrap.c
- ${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC} -fPIC -shared
-
clean:
- rm -f dev0 BlackBox libdlobsdwrap.so
+ rm -f loader
diff --git a/new/_OpenBSD_/Lin/Rsrc/loader/dev0 b/new/_OpenBSD_/Lin/Rsrc/loader/dev0
deleted file mode 100755 (executable)
index b145e7a..0000000
Binary files a/new/_OpenBSD_/Lin/Rsrc/loader/dev0 and /dev/null differ
index b145e7a..0000000
Binary files a/new/_OpenBSD_/Lin/Rsrc/loader/dev0 and /dev/null differ
diff --git a/new/_OpenBSD_/Lin/Rsrc/loader/libBB.so b/new/_OpenBSD_/Lin/Rsrc/loader/libBB.so
+++ /dev/null
@@ -1 +0,0 @@
-../../../libBB.so
\ No newline at end of file
diff --git a/new/_OpenBSD_/Lin/Rsrc/loader/libBB0.so b/new/_OpenBSD_/Lin/Rsrc/loader/libBB0.so
+++ /dev/null
@@ -1 +0,0 @@
-../../../libBB0.so
\ No newline at end of file
diff --git a/new/_OpenBSD_/Lin/Rsrc/loader/libdlobsdwrap.c b/new/_OpenBSD_/Lin/Rsrc/loader/libdlobsdwrap.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <dlfcn.h>
-
-void * __dlopen (const char *path, int mode)
-{
- return dlopen(path, mode);
-}
-
-int __dlclose (void *handle)
-{
- return dlclose(handle);
-}
-
-void * __dlsym (void *handle, const char *symbol)
-{
- return dlsym(handle, symbol);
-}
-
-const char * __dlerror (void)
-{
- return dlerror();
-}
diff --git a/new/_OpenBSD_/Lin/Rsrc/loader/libdlobsdwrap.so b/new/_OpenBSD_/Lin/Rsrc/loader/libdlobsdwrap.so
deleted file mode 100755 (executable)
index 8874e67..0000000
Binary files a/new/_OpenBSD_/Lin/Rsrc/loader/libdlobsdwrap.so and /dev/null differ
index 8874e67..0000000
Binary files a/new/_OpenBSD_/Lin/Rsrc/loader/libdlobsdwrap.so and /dev/null differ
diff --git a/new/_OpenBSD_/Lin/Rsrc/loader/loader b/new/_OpenBSD_/Lin/Rsrc/loader/loader
new file mode 100755 (executable)
index 0000000..745fb08
Binary files /dev/null and b/new/_OpenBSD_/Lin/Rsrc/loader/loader differ
index 0000000..745fb08
Binary files /dev/null and b/new/_OpenBSD_/Lin/Rsrc/loader/loader differ
diff --git a/new/_OpenBSD_/dev0 b/new/_OpenBSD_/dev0
--- a/new/_OpenBSD_/dev0
+++ /dev/null
@@ -1 +0,0 @@
-Lin/Rsrc/loader/dev0
\ No newline at end of file
diff --git a/new/_OpenBSD_/libdlobsdwrap.so b/new/_OpenBSD_/libdlobsdwrap.so
+++ /dev/null
@@ -1 +0,0 @@
-Lin/Rsrc/loader/libdlobsdwrap.so
\ No newline at end of file
diff --git a/new/_OpenBSD_/loader b/new/_OpenBSD_/loader
--- /dev/null
+++ b/new/_OpenBSD_/loader
@@ -0,0 +1 @@
+Lin/Rsrc/loader/loader
\ No newline at end of file
diff --git a/new/build b/new/build
index 44a52bd0faf6872b12dc71e907f83aee4b1aca89..d0e52238c32bf79ce3b629e990fb432bb80b6a26 100755 (executable)
--- a/new/build
+++ b/new/build
DATA
./run-BlackBox <<DATA
-DevCompiler.CompileThis CommStreams
-DevCompiler.CompileThis XhtmlEntitySets XhtmlWriters XhtmlStdFileWriters XhtmlTextTableMarkers XhtmlExporter
-
-DevCompiler.CompileThis ObxHello0 ObxPi ObxRandom ObxTrap
-DATA
+DevCompiler.CompileThis HostPackedFiles DevPacker
-./run-BlackBox <<DATA
+DevCompiler.CompileThis CommStreams
ConsCompiler.Compile('Lin/Mod', 'Termios.txt')
ConsCompiler.Compile('Lin/Mod', 'Ioctl.txt')
ConsCompiler.Compile('Lin/Mod', 'Net.txt')
DevCompiler.CompileThis CommV24 CommTCP
+
+DevCompiler.CompileThis XhtmlEntitySets XhtmlWriters XhtmlStdFileWriters XhtmlTextTableMarkers XhtmlExporter
+
+DevCompiler.CompileThis ObxHello0 ObxPi ObxRandom ObxTrap
DATA
diff --git a/new/run-BlackBox b/new/run-BlackBox
index abaf6c6af8fede722cf2b98cd76e6934391cfcee..f0b8b5f7f9e8e2f620dfb9cefe6da8d3a4d52e4a 100755 (executable)
--- a/new/run-BlackBox
+++ b/new/run-BlackBox
# ulimit -a
rn=`readlink -f "${0}"`
-d=`dirname "${rn}"`
+pd=`dirname "${rn}"`
+sd=`readlink -f .`
-exe="BlackBox"
+loader="loader"
+lib="libBB.so"
# export LD_DEBUG=all
-env LD_LIBRARY_PATH="${d}" BB_PRIMARY_DIR="${d}" BB_SECONDARY_DIR=. "${d}"/${exe}
+env \
+ BB_PRIMARY_DIR="${pd}" BB_SECONDARY_DIR="${sd}" \
+ BB_PACKED_NAME="${lib}" \
+ "${pd}"/${loader} "${pd}"/${lib}
diff --git a/new/run-dev0 b/new/run-dev0
index bffae58883408613f856787b0f6dd1a3b6af1df8..486e03636d0c140ad786d71b664338d1e3e63ba9 100755 (executable)
--- a/new/run-dev0
+++ b/new/run-dev0
#!/bin/sh
-# env LD_LIBRARY_PATH=. env LD_DEBUG=1 ./dev0
-env LD_LIBRARY_PATH=. ./dev0
+# ulimit -s 32000
+# ulimit -a
+
+rn=`readlink -f "${0}"`
+pd=`dirname "${rn}"`
+sd=`readlink -f .`
+
+loader="loader"
+lib="libBB0.so"
+
+# export LD_DEBUG=all
+env \
+ BB_PRIMARY_DIR="${pd}" BB_SECONDARY_DIR="${sd}" \
+ BB_PACKED_NAME="${lib}" \
+ "${pd}"/${loader} "${pd}"/${lib}
diff --git a/new/switch-target b/new/switch-target
index 4bf8e6aa71db64298cf6ed6aff4de0f0c67dad25..4b0845404be2d2a42c81318c9ee78f505f776dd0 100755 (executable)
--- a/new/switch-target
+++ b/new/switch-target
none() {
checkAndRm || exit 2
- rm -rf *.exe *.so BlackBox dev0
+ rm -rf *.exe *.so loader
# System/Code/Kernel.ocf System/Sym/Kernel.osf Code/Kernel.ocf Sym/Kernel.osf \
# System/Code/Init.ocf System/Sym/Init.osf Code/Init.ocf Sym/Init.osf \
# System/Code/Config.ocf System/Sym/Config.osf Code/Config.ocf Sym/Config.osf \