AcessNative - Huge changes, cleaning up and getting it to work
[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
10 // === IMPORTS ===
11 extern int      UI_Initialise(int Width, int Height);
12 extern int      VFS_Init(void);
13 extern int      Video_Install(char **Arguments);
14 extern int      NativeKeyboard_Install(char **Arguments);
15 extern int      VT_Install(char **Arguments);
16 extern int      VFS_Mount(const char *Device, const char *MountPoint, const char *Filesystem, const char *Options);
17 extern int      SyscallServer(void);
18
19 // === GLOBALS ===
20 const char      *gsAcessDir = "../Usermode/Output/i386";
21
22 // === CODE ===
23 int main(int argc, char *argv[])
24 {
25         // Parse command line settings
26         
27         // Start UI subsystem
28         UI_Initialise(800, 480);
29         
30         // Initialise VFS
31         VFS_Init();
32         // - Start IO Drivers
33         Video_Install(NULL);
34         NativeKeyboard_Install(NULL);
35         NativeFS_Install(NULL);
36         // - Start VTerm
37         {
38                 char    *args[] = {
39                         "Video=NativeVideo",
40                         "Input=NativeKeyboard",
41                         NULL
42                         };
43                 VT_Install(args);
44         }
45         
46         VFS_Mount(gsAcessDir, "/Acess", "nativefs", "");
47
48         Debug_SetKTerminal("/Devices/VTerm/8");
49         
50         // Start syscall server
51         // - Blocks
52         SyscallServer();
53         
54         return 0;
55 }
56
57 void AcessNative_Exit(void)
58 {
59         // TODO: Close client applications too
60         exit(0);
61 }

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