diff --git a/src/bin/login/main.c b/src/bin/login/main.c index 73cbe19..26231c3 100755 --- a/src/bin/login/main.c +++ b/src/bin/login/main.c @@ -44,9 +44,14 @@ struct passwd *data = (struct passwd *)malloc(4096); if (!(fd = fopen("userdb","r"))) { printf("Error Opening File"); + memcpy(data[0].username,"root",4); + memcpy(data[0].password,"user",4); + memcpy(data[0].shell,"shell", 6); } - fread(data,4096,0,fd); - fclose(fd); + else { + fread(data,4096,0,fd); + fclose(fd); + } printf("\nUbixOS/IA-32 (devel.ubixos.com) (console)\n\n"); login: printf("Login: "); diff --git a/src/lib/libc/stdio/fgetc.c b/src/lib/libc/stdio/fgetc.c index 08671ae..bd562a0 100755 --- a/src/lib/libc/stdio/fgetc.c +++ b/src/lib/libc/stdio/fgetc.c @@ -24,11 +24,11 @@ #include int fgetc(FILE *fd) { - int ch = 0; + volatile int ch = 0; asm( "int %0" : : "i" (0x80),"a" (5),"b" (&ch),"c" (fd) ); return(ch); - } \ No newline at end of file + } diff --git a/src/sys/drivers/keyboard.c b/src/sys/drivers/keyboard.c index 0466885..251adcc 100755 --- a/src/sys/drivers/keyboard.c +++ b/src/sys/drivers/keyboard.c @@ -30,7 +30,7 @@ #include unsigned int keystrokeBuffer[255]; -unsigned int keystrokeBuffersize = 0; +volatile unsigned int keystrokeBuffersize = 0; unsigned int controlKeys = 0; unsigned int keyMap = 0; unsigned int ledStatus = 0; @@ -386,9 +386,8 @@ unsigned char getch() { unsigned char ret_key=0; unsigned int loop=0; - + while (keystrokeBuffersize == 0); - ret_key = keystrokeBuffer[0]; keystrokeBuffersize--;