X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Finit_src%2Fmain.c;h=5a4633c21df0d750b0000d829b06d36d199bdaed;hb=52fad670ab81459de0ff1bd0fa99a3396a6999e3;hp=4d66654c4923354cc1b0787b287f0b8ced33fbbb;hpb=11686aa86bc0adae2555aa7796fe229770bb02f7;p=tpg%2Facess2.git diff --git a/Usermode/Applications/init_src/main.c b/Usermode/Applications/init_src/main.c index 4d66654c..5a4633c2 100644 --- a/Usermode/Applications/init_src/main.c +++ b/Usermode/Applications/init_src/main.c @@ -4,50 +4,16 @@ #include #include #include -//#include //#include "common.h" // === CONSTANTS === #define NUM_TERMS 4 #define DEFAULT_TERMINAL "/Devices/VTerm/0" #define DEFAULT_SHELL "/Acess/SBin/login" -#define DEFAULT_SCRIPT "/Acess/Conf/BootConf.isc" #define ARRAY_SIZE(x) ((sizeof(x))/(sizeof((x)[0]))) // === PROTOTYPES === -/* -tSpiderVariable *Script_System_IO_Open(tSpiderScript *, int, tSpiderVariable *); -*/ - -// === GLOBALS === -/* -tSpiderFunction gaScriptNS_IO_Fcns[] = { - {"Open", Script_System_IO_Open} -}; -tSpiderNamespace gaScriptNS_System[] = { - { - "IO", - 0, NULL, - ARRAY_SIZE(gaScriptNS_IO_Fcns), gaScriptNS_IO_Fcns, - 0, NULL - } -}; - -tSpiderNamespace gaScriptNamespaces[] = { - { - "System", - ARRAY_SIZE(gaScriptNS_System), gaScriptNS_System, - 0, NULL, - 0, NULL - } -}; - -tSpiderVariant gScriptVariant = { - "init", 0, - ARRAY_SIZE(gaScriptNamespaces), gaScriptNamespaces -}; -*/ // === CODE === /** @@ -71,40 +37,18 @@ int main(int argc, char *argv[]) { termpath[sizeof(DEFAULT_TERMINAL)-2] = '0' + i; - open(termpath, OPENFLAG_READ); // Stdin - open(termpath, OPENFLAG_WRITE); // Stdout - open(termpath, OPENFLAG_WRITE); // Stderr + _SysOpen(termpath, OPENFLAG_READ); // Stdin + _SysOpen(termpath, OPENFLAG_WRITE); // Stdout + _SysOpen(termpath, OPENFLAG_WRITE); // Stderr execve(DEFAULT_SHELL, child_argv, NULL); - for(;;) sleep(); + for(;;) ; } } // TODO: Implement message watching - for(;;) sleep(); + for(;;) + _SysWaitEvent(THREAD_EVENT_IPCMSG); return 42; } -/** - * \brief Reads and parses the boot configuration script - * \param Filename File to parse and execute - */ -void ExecuteScript(const char *Filename) -{ - /* - tSpiderScript *script; - script = SpiderScript_ParseFile(&gScriptVariant, Filename); - SpiderScript_ExecuteMethod(script, ""); - SpiderScript_Free(script); - */ -} - -/** - * \brief Open a file - */ -/* -tSpiderVariable *Script_System_IO_Open(tSpiderScript *Script, int NArgs, tSpiderVariable *Args) -{ - return NULL; -} -*/