forked from Bananymous/banan-os
Kernel/Userspace: Add basic init process
This process parses /etc/passwd and promps login screen. When an username is entered, it will launch that users shell
This commit is contained in:
@@ -27,15 +27,6 @@ FILE* stdin = &s_files[0];
|
||||
FILE* stdout = &s_files[1];
|
||||
FILE* stderr = &s_files[2];
|
||||
|
||||
extern "C" void _init_stdio()
|
||||
{
|
||||
char tty[L_ctermid];
|
||||
ctermid(tty);
|
||||
if (open(tty, O_RDONLY) != 0) _exit(1);
|
||||
if (open(tty, O_WRONLY) != 1) _exit(1);
|
||||
if (open(tty, O_WRONLY) != 2) _exit(1);
|
||||
}
|
||||
|
||||
void clearerr(FILE* file)
|
||||
{
|
||||
file->eof = false;
|
||||
|
||||
@@ -11,12 +11,9 @@
|
||||
|
||||
char** environ;
|
||||
|
||||
extern "C" void _init_stdio();
|
||||
|
||||
extern "C" void _init_libc(char** _environ)
|
||||
{
|
||||
environ = _environ;
|
||||
_init_stdio();
|
||||
}
|
||||
|
||||
void _exit(int status)
|
||||
|
||||
Reference in New Issue
Block a user