X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Facesskernel_src%2Fmain.c;h=bc4083cf90a62b83925d5610251d719b65dd97bd;hb=e979d4ddec178d242cad5273fe154084ee7bbecd;hp=3f152efaca6b5e4a4ea8c18a04cf12f6989ec1e7;hpb=8cdfaebb825cb8d0f78dbf1b4f29fd0bff796045;p=tpg%2Facess2.git diff --git a/AcessNative/acesskernel_src/main.c b/AcessNative/acesskernel_src/main.c index 3f152efa..bc4083cf 100644 --- a/AcessNative/acesskernel_src/main.c +++ b/AcessNative/acesskernel_src/main.c @@ -6,28 +6,46 @@ */ #include #include +#include +#include // === IMPORTS === extern int UI_Initialise(int Width, int Height); +extern void UI_MainLoop(void); extern int VFS_Init(void); extern int Video_Install(char **Arguments); extern int NativeKeyboard_Install(char **Arguments); +extern int NativeFS_Install(char **Arguments); +extern void Debug_SetKTerminal(char *Path); 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); +extern const char gsKernelVersion[]; +extern const char gsGitHash[]; +extern int giBuildNumber; + +// === GLOBALS === +const char *gsAcessDir = "../Usermode/Output/x86"; // === CODE === int main(int argc, char *argv[]) { // Parse command line settings - + printf("Acess2 Native v%s\n", gsKernelVersion); + printf(" Build %i, Git Hash %s\n", giBuildNumber, gsGitHash); + // Start UI subsystem - UI_Initialise(640, 480); + UI_Initialise(800, 480); + // - Ignore SIGUSR1 (used to wake threads) + signal(SIGUSR1, SIG_IGN); + // Initialise VFS VFS_Init(); // - Start IO Drivers Video_Install(NULL); NativeKeyboard_Install(NULL); + NativeFS_Install(NULL); // - Start VTerm { char *args[] = { @@ -37,11 +55,18 @@ int main(int argc, char *argv[]) }; VT_Install(args); } + + VFS_MkDir("/Acess"); + VFS_Mount(gsAcessDir, "/Acess", "nativefs", ""); + + Debug_SetKTerminal("/Devices/VTerm/8"); // Start syscall server // - Blocks SyscallServer(); + UI_MainLoop(); + return 0; } @@ -50,3 +75,15 @@ void AcessNative_Exit(void) // TODO: Close client applications too exit(0); } + +uint64_t DivMod64U(uint64_t Num, uint64_t Den, uint64_t *Rem) +{ + if(Rem) *Rem = Num % Den; + return Num / Den; +} + +int Module_EnsureLoaded(const char *Name) +{ + return 0; +} +