Add: begin shell with help command

This commit is contained in:
xamidev
2024-07-21 15:37:32 +02:00
parent 05393b36f8
commit 5eee67a0e5
8 changed files with 43 additions and 6 deletions

View File

@@ -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;
}

24
src/kernel/shell.c Normal file
View File

@@ -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");
}
}
}

View File

@@ -21,5 +21,6 @@ void timer_install();
void delay(int ticks);
void keyboard_install();
char keyboard_getchar();
void shell_install();
#endif