forked from xamidev/pepperOS
Keyboard buffer + getline
This commit is contained in:
12
src/kmain.c
12
src/kmain.c
@@ -68,7 +68,7 @@ struct process_t* idle_proc;
|
||||
// Never gets executed although pedicel is scheduled?
|
||||
void pedicel_main(void* arg)
|
||||
{
|
||||
printf("\n\nWelcome to PepperOS! Pedicel speaking.\r\nNothing left to do, let's go idle!");
|
||||
printf("\n\nWelcome to PepperOS! Pedicel speaking.\r\nNothing left to do, let's go idle!\r\n");
|
||||
}
|
||||
|
||||
void idle_main(void* arg)
|
||||
@@ -78,6 +78,14 @@ void idle_main(void* arg)
|
||||
}
|
||||
}
|
||||
|
||||
void thing_main(void* arg)
|
||||
{
|
||||
printf("What's your name, pal? ");
|
||||
char name[10];
|
||||
keyboard_getline(name, 10);
|
||||
printf("\r\n{%s} is such a nice name!\r\n", name);
|
||||
}
|
||||
|
||||
extern uintptr_t kheap_start;
|
||||
|
||||
/*
|
||||
@@ -118,7 +126,7 @@ void kmain()
|
||||
process_init();
|
||||
idle_proc = process_create("idle", (void*)idle_main, 0);
|
||||
struct process_t* pedicel = process_create("pedicel", (void*)pedicel_main, 0);
|
||||
|
||||
process_create("thing", thing_main, NULL);
|
||||
process_display_list(processes_list);
|
||||
|
||||
scheduler_init();
|
||||
|
||||
Reference in New Issue
Block a user