38 lines
726 B
C
38 lines
726 B
C
#include <debugconsole.h>
|
|
#include <limits.h>
|
|
#include <malloc.h>
|
|
#include <process.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <terminal.h>
|
|
|
|
#define RECV_MAX (1024 * 16)
|
|
|
|
static int ce_pgid;
|
|
|
|
void receiver (void* arg) {
|
|
(void)arg;
|
|
|
|
for (;;) {
|
|
char recv[RECV_MAX];
|
|
memset (recv, 0, sizeof (recv));
|
|
mail_receive (&recv, sizeof (recv) - 1);
|
|
|
|
terminal_print (recv, strlen (recv));
|
|
}
|
|
}
|
|
|
|
void app_main (void) {
|
|
debug_printf ("Init process is running. Starting user shell...\n");
|
|
|
|
int ce_pid = exec ("sys", "/ce");
|
|
ce_pgid = get_procgroup (ce_pid);
|
|
|
|
struct process_data* pdata = process_spawn (&receiver, NULL);
|
|
|
|
wait_for_pid (pdata->pid);
|
|
|
|
process_data_free (pdata);
|
|
}
|