AcessNative - Debugging and implementing, getting there now
[tpg/acess2.git] / AcessNative / acesskernel_src / main.c
1 /*
2  * Acess2 Native Kernel
3  * - Acess kernel emulation on another OS using SDL and UDP
4  *
5  * Kernel Main
6  */
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <signal.h>
10
11 // === IMPORTS ===
12 extern int      UI_Initialise(int Width, int Height);
13 extern int      VFS_Init(void);
14 extern int      Video_Install(char **Arguments);
15 extern int      NativeKeyboard_Install(char **Arguments);
16 extern int      VT_Install(char **Arguments);
17 extern int      VFS_Mount(const char *Device, const char *MountPoint, const char *Filesystem, const char *Options);
18 extern int      SyscallServer(void);
19
20 // === GLOBALS ===
21 const char      *gsAcessDir = "../Usermode/Output/i386";
22
23 // === CODE ===
24 int main(int argc, char *argv[])
25 {
26         // Parse command line settings
27
28         // - Ignore SIGUSR1 (used to wake threads)
29         signal(SIGUSR1, SIG_IGN);
30                 
31         // Start UI subsystem
32         UI_Initialise(800, 480);
33         
34         // Initialise VFS
35         VFS_Init();
36         // - Start IO Drivers
37         Video_Install(NULL);
38         NativeKeyboard_Install(NULL);
39         NativeFS_Install(NULL);
40         // - Start VTerm
41         {
42                 char    *args[] = {
43                         "Video=NativeVideo",
44                         "Input=NativeKeyboard",
45                         NULL
46                         };
47                 VT_Install(args);
48         }
49         
50         VFS_Mount(gsAcessDir, "/Acess", "nativefs", "");
51
52         Debug_SetKTerminal("/Devices/VTerm/8");
53         
54         // Start syscall server
55         // - Blocks
56         SyscallServer();
57         
58         return 0;
59 }
60
61 void AcessNative_Exit(void)
62 {
63         // TODO: Close client applications too
64         exit(0);
65 }

UCC git Repository :: git.ucc.asn.au