To ease the pain of debuggin I can now interact with the system through a very simplistic terminal. Hopefully things can be tested more easily by activating the piece through a simple command. The max characters for a command is 10. To achieve this I have had to make the following changes. - Changed IRQ to update a global status variable - Added a standalone keyboard driver with getKey functions - Changed the main kernel loop to display a prompt - Added a strncmp function to the clib/string file
28 lines
402 B
C
28 lines
402 B
C
#include "string.h"
|
|
|
|
size_t strlen(const char* str) {
|
|
size_t len = 0;
|
|
while(str[len]){
|
|
len++;
|
|
}
|
|
return len;
|
|
}
|
|
|
|
|
|
|
|
int strncmp ( const char* str1, const char* str2, size_t num ){
|
|
for( int i = 0; i < num ; i++){
|
|
|
|
if( str1[i] < str2[i]){
|
|
return -1;
|
|
}
|
|
|
|
if( str1[i] > str2[i] ){
|
|
return 1;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
return 0;
|
|
} |