mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2025-10-14 13:35:07 -07:00
Fixing the memory, adding a shell, and other minor bugs to gdt and idt and the types, also adds .github files for bug reports and feature requests.
This commit is contained in:
32
src/shell/shell.c
Normal file
32
src/shell/shell.c
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "shell.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void shell_loop()
|
||||
{
|
||||
char input[256];
|
||||
|
||||
while (1)
|
||||
{
|
||||
printf("> ");
|
||||
fgets(input, sizeof(input), stdin);
|
||||
|
||||
// Remove newline character from input
|
||||
input[strcspn(input, "\n")] = '\0';
|
||||
|
||||
// Parse input and execute commands
|
||||
// ...
|
||||
|
||||
// Exit the shell if the user enters "exit"
|
||||
if (strcmp(input, "exit") == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
shell_loop();
|
||||
return 0;
|
||||
}
|
13
src/shell/shell.h
Normal file
13
src/shell/shell.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef SHELL_H
|
||||
#define SHELL_H
|
||||
|
||||
// Function to read user input
|
||||
char *read_input();
|
||||
|
||||
// Function to parse user input
|
||||
char **parse_input(char *input);
|
||||
|
||||
// Function to execute a command
|
||||
int execute_command(char **args);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user