*/
#include <stdio.h>
#include <stdlib.h>
-#include <SDL/SDL.h>
+#include <signal.h>
-int main(int argc, char *argv[])
-{
- return 0;
-}
+// === IMPORTS ===
+extern int UI_Initialise(int Width, int Height);
+extern int VFS_Init(void);
+extern int Video_Install(char **Arguments);
+extern int NativeKeyboard_Install(char **Arguments);
+extern int VT_Install(char **Arguments);
+extern int VFS_Mount(const char *Device, const char *MountPoint, const char *Filesystem, const char *Options);
+extern int SyscallServer(void);
-void LogF(const char *Fmt, ...)
-{
- va_list args;
- va_start(args, Fmt);
- vprintf(Fmt, args);
- va_end(args);
-}
+// === GLOBALS ===
+const char *gsAcessDir = "../Usermode/Output/i386";
-void Log(const char *Fmt, ...)
+// === CODE ===
+int main(int argc, char *argv[])
{
- va_list args;
- printf("Log: ");
- va_start(args, Fmt);
- vprintf(Fmt, args);
- va_end(args);
- printf("\n");
-}
+ // Parse command line settings
-void Warning(const char *Fmt, ...)
-{
- va_list args;
- printf("Warning: ");
- va_start(args, Fmt);
- vprintf(Fmt, args);
- va_end(args);
- printf("\n");
-}
+ // - Ignore SIGUSR1 (used to wake threads)
+ signal(SIGUSR1, SIG_IGN);
+
+ // Start UI subsystem
+ UI_Initialise(800, 480);
+
+ // Initialise VFS
+ VFS_Init();
+ // - Start IO Drivers
+ Video_Install(NULL);
+ NativeKeyboard_Install(NULL);
+ NativeFS_Install(NULL);
+ // - Start VTerm
+ {
+ char *args[] = {
+ "Video=NativeVideo",
+ "Input=NativeKeyboard",
+ NULL
+ };
+ VT_Install(args);
+ }
+
+ VFS_Mount(gsAcessDir, "/Acess", "nativefs", "");
-int CheckMem(void *Mem, int Count)
-{
- return 1;
+ Debug_SetKTerminal("/Devices/VTerm/8");
+
+ // Start syscall server
+ // - Blocks
+ SyscallServer();
+
+ return 0;
}
-int CheckString(const char *String)
+void AcessNative_Exit(void)
{
- return 1;
+ // TODO: Close client applications too
+ exit(0);
}