diff --git a/iso/boot/kernel.elf b/iso/boot/kernel.elf index b43f5e9..8e0ae03 100755 Binary files a/iso/boot/kernel.elf and b/iso/boot/kernel.elf differ diff --git a/os.iso b/os.iso index 6d4fd1d..389c463 100644 Binary files a/os.iso and b/os.iso differ diff --git a/src/kernel/kmain.c b/src/kernel/kmain.c index 110be8b..a382462 100644 --- a/src/kernel/kmain.c +++ b/src/kernel/kmain.c @@ -4,8 +4,6 @@ #include "idt.h" #include "system.h" -#define BUFFER_SIZE 256 - int kmain(int retvalue) { @@ -34,10 +32,7 @@ int kmain(int retvalue) //timer_install(); keyboard_install(); - char input_buffer[BUFFER_SIZE]; - colorputs("Enter something: ", 9); - get_input(input_buffer, BUFFER_SIZE); - printf("\nYou entered: %s\n", input_buffer); + shell_install(); return retvalue; } diff --git a/src/kernel/shell.c b/src/kernel/shell.c new file mode 100644 index 0000000..9f17a0e --- /dev/null +++ b/src/kernel/shell.c @@ -0,0 +1,24 @@ +#include "system.h" +#include "../libc/stdio.h" +#include "../libc/string.h" + +#define BUFFER_SIZE 256 + +void shell_install() +{ + while (1) // Bad!! + { + char input_buffer[BUFFER_SIZE]; + colorputs("blankos> ", 9); + get_input(input_buffer, BUFFER_SIZE); + printf("\n"); + + // Childish shell + + if (strcmp(input_buffer, "help") == 0) + { + printf("This is the Blank Operating System\ndesigned for fun by xamidev\n\nCommand help:\n\n\thelp - shows this message\n"); + } + + } +} \ No newline at end of file diff --git a/src/kernel/system.h b/src/kernel/system.h index 0b436e3..09933cf 100644 --- a/src/kernel/system.h +++ b/src/kernel/system.h @@ -21,5 +21,6 @@ void timer_install(); void delay(int ticks); void keyboard_install(); char keyboard_getchar(); +void shell_install(); #endif diff --git a/src/libc/stdio.c b/src/libc/stdio.c index 4468acb..87c0e57 100644 --- a/src/libc/stdio.c +++ b/src/libc/stdio.c @@ -87,6 +87,9 @@ void putc(char c) case '\r': VGA_X = 0; break; + case '\t': + VGA_X += 4; + break; default: putchar(VGA_X, VGA_Y, c); VGA_X++; @@ -114,6 +117,9 @@ void colorputc(char c, unsigned int color) case '\r': VGA_X = 0; break; + case '\t': + VGA_X += 4; + break; default: putchar(VGA_X, VGA_Y, c); putcolor(VGA_X, VGA_Y, color); diff --git a/src/libc/string.c b/src/libc/string.c index 022f462..54fedc9 100644 --- a/src/libc/string.c +++ b/src/libc/string.c @@ -7,3 +7,13 @@ int strlen(char* str) } return len; } + +int strcmp(char* str1, char* str2) +{ + while (*str1 && (*str1 == *str2)) + { + str1++; + str2++; + } + return *(const unsigned char*)str1 - *(const unsigned char*)str2; +} \ No newline at end of file diff --git a/src/libc/string.h b/src/libc/string.h index f65cf56..7e406bd 100644 --- a/src/libc/string.h +++ b/src/libc/string.h @@ -2,5 +2,6 @@ #define INCLUDE_STRING_H int strlen(char* str); +int strcmp(char* str1, char* str2); #endif