This commit is contained in:
Mark
2019-12-31 13:13:38 +02:00
parent 6a03d92882
commit f8b30fee62
2 changed files with 28 additions and 1 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ void amd64_timer_init(void) {
// LAPIC Timer is only used to trigger task switches
LAPIC(LAPIC_REG_TMRDIV) = 0x3;
LAPIC(LAPIC_REG_LVTT) = 32 | (1 << 17);
LAPIC(LAPIC_REG_TMRINITCNT) = 1000;
LAPIC(LAPIC_REG_TMRINITCNT) = 10000;
LAPIC(LAPIC_REG_TMRCURRCNT) = 0;
get_cpu()->ticks = 0;
+27
View File
@@ -37,6 +37,7 @@ static int b_pwd(const char *_);
static int b_cat(const char *path);
static int b_curs(const char *arg);
static int b_sleep(const char *arg);
static int b_help(const char *arg);
static struct builtin builtins[] = {
{
@@ -69,6 +70,11 @@ static struct builtin builtins[] = {
"Sleep N seconds",
b_sleep
},
{
"help",
"Please help me",
b_help
},
{ NULL, NULL, NULL }
};
@@ -208,6 +214,27 @@ static int b_sleep(const char *arg) {
return 0;
}
static int b_help(const char *arg) {
if (arg) {
// Describe a specific command
for (size_t i = 0; builtins[i].run; ++i) {
if (!strcmp(arg, builtins[i].name)) {
printf("%s: %s\n", builtins[i].name, builtins[i].desc);
return 0;
}
}
printf("%s: Unknown command\n", arg);
return -1;
} else {
for (size_t i = 0; builtins[i].run; ++i) {
printf("%s: %s\n", builtins[i].name, builtins[i].desc);
}
return 0;
}
}
static void prompt(void) {
printf("\033[36mygg\033[0m > ");
}