Added very basic interactive shell.
This commit is contained in:
+20
@@ -2,6 +2,7 @@
|
||||
#include "../include/gdt.h"
|
||||
#include "../include/idt.h"
|
||||
#include "../include/scrn.h"
|
||||
#include "../include/shell.h"
|
||||
|
||||
unsigned char *memcpy(unsigned char *dest, const unsigned char *src, int count)
|
||||
{
|
||||
@@ -44,6 +45,24 @@ int strlen(const char *str)
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool strcmp(char* str1, char* str2)
|
||||
{
|
||||
int len1 = strlen(str1);
|
||||
int len2 = strlen(str2);
|
||||
|
||||
if(len1 != len2)
|
||||
{
|
||||
puts("Lengths different!\n");
|
||||
return false;
|
||||
}
|
||||
for(int i = len1; i >= 0; i--)
|
||||
{
|
||||
if(str1[i] != str2[i]) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* We will use this later on for reading from the I/O ports to get data
|
||||
* from devices such as the keyboard. We are using what is called
|
||||
* 'inline assembly' in these routines to actually do the work */
|
||||
@@ -87,6 +106,7 @@ void main()
|
||||
kb_install();
|
||||
puts("Keyboard installed.\n");
|
||||
puts("SDOS version 0.0.0.1 initialized.\n");
|
||||
run_shell();
|
||||
//puts(&__BUILD_DATE);
|
||||
//puts(&__BUILD_NUMBER);
|
||||
//puts("Divide by zero check:\n");
|
||||
|
||||
Reference in New Issue
Block a user