From: John Hodge Date: Sun, 27 Sep 2009 03:11:25 +0000 (+0800) Subject: Turned debug on for binary loader to trace Proc_Execve X-Git-Tag: rel0.06~475 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=a048f2a350824bb7e0b8191bcf16addd1543b882;p=tpg%2Facess2.git Turned debug on for binary loader to trace Proc_Execve --- diff --git a/Kernel/binary.c b/Kernel/binary.c index ae8207bf..d6960e3f 100644 --- a/Kernel/binary.c +++ b/Kernel/binary.c @@ -2,21 +2,10 @@ * Acess2 * Common Binary Loader */ +#define DEBUG 1 #include #include -#define DEBUG 0 - -#if DEBUG -#else -# undef ENTER -# undef LOG -# undef LEAVE -# define ENTER(...) -# define LOG(...) -# define LEAVE(...) -#endif - // === CONSTANTS === #define BIN_LOWEST MM_USER_MIN // 1MiB #define BIN_GRANUALITY 0x10000 // 64KiB diff --git a/Usermode/Applications/init_src/main.c b/Usermode/Applications/init_src/main.c index e701b44e..55c48012 100644 --- a/Usermode/Applications/init_src/main.c +++ b/Usermode/Applications/init_src/main.c @@ -14,17 +14,22 @@ */ int main(int argc, char *argv[]) { + int tid; open(DEFAULT_TERMINAL, OPENFLAG_READ); // Stdin open(DEFAULT_TERMINAL, OPENFLAG_WRITE); // Stdout open(DEFAULT_TERMINAL, OPENFLAG_WRITE); // Stderr write(1, 13, "Hello, World!"); - if(clone(CLONE_VM, 0) == 0) + tid = clone(CLONE_VM, 0); + if(tid == 0) { execve(DEFAULT_SHELL, NULL, NULL); + for(;;) __asm__ __volatile__("hlt"); } + __asm__ __volatile__("xchg %%bx, %%bx"::"a"(tid)); + for(;;) sleep(); return 42;