2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include <sys/types.h>
27 int main(int argc
,char *argv
[]);
28 void _stdlib_init(); ///< @see apps/lib/stdlibc/stdlib.c
29 void _libmeinos_init(); ///< @see apps/lib/libmeinos/misc.c
32 char *backup_argv
[] = { NULL
};
33 char **argv
= backup_argv
;
41 int var
= syscall_call(SYSCALL_PROC_GETVAR
,1,getpid());
42 if (var
!=-1) proc_unpack_procdata(var
,&argc
,&argv
);
45 _process_data = shmat(var,NULL,0);
46 if (_process_data!=NULL) get_cmdline(_process_data,&argv,&argc,&_stdin,&_stdout,&_stderr);
48 else _process_data = NULL;
50 // post initialize stdlibc
51 _stdlib_init_post(_stdin,_stdout,_stderr);
54 // call main function and exit
55 exit(main(argc
,argv
));