CE interactive shell
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m36s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m36s
This commit is contained in:
22
init/init.c
22
init/init.c
@@ -6,9 +6,24 @@
|
||||
#include <string.h>
|
||||
#include <terminal.h>
|
||||
|
||||
static int ce_pgid;
|
||||
|
||||
void receiver (void) {
|
||||
for (;;) {
|
||||
char rcv;
|
||||
mail_receive (&rcv, 1);
|
||||
if (rcv == '\n')
|
||||
terminal_print ("\r\n", 2);
|
||||
else
|
||||
terminal_print (&rcv, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void app_main (void) {
|
||||
int ce_pid = exec ("ramdisk:/ce");
|
||||
int ce_pgid = get_procgroup (ce_pid);
|
||||
ce_pgid = get_procgroup (ce_pid);
|
||||
|
||||
process_spawn (&receiver, NULL);
|
||||
|
||||
for (;;) {
|
||||
int ch = kb_read_key ();
|
||||
@@ -17,10 +32,5 @@ void app_main (void) {
|
||||
continue;
|
||||
|
||||
mail_send (ce_pgid, (uint8_t*)&ch, 1);
|
||||
|
||||
char rcv;
|
||||
mail_receive (&rcv, 1);
|
||||
/* test (rcv); */
|
||||
terminal_print (&rcv, 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user