From f7441cb70d78d4d0fa633177929627e9ceaacd66 Mon Sep 17 00:00:00 2001 From: Aurel Feer Date: Sun, 22 May 2022 17:21:17 +0200 Subject: [PATCH] hello from shelly --- hake/menu.lst.armv8_a57_qemu | 3 ++- hake/menu.lst.armv8_imx8x | 3 ++- platforms/Hakefile | 2 +- usr/init/main.c | 8 ++++++++ usr/shelly/Hakefile | 18 ++++++++++++++++++ usr/shelly/shelly.c | 14 ++++++++++++++ 6 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 usr/shelly/Hakefile create mode 100644 usr/shelly/shelly.c diff --git a/hake/menu.lst.armv8_a57_qemu b/hake/menu.lst.armv8_a57_qemu index fff9c2c..62f6408 100644 --- a/hake/menu.lst.armv8_a57_qemu +++ b/hake/menu.lst.armv8_a57_qemu @@ -6,9 +6,10 @@ bootdriver /armv8/sbin/boot_armv8_generic cpudriver /armv8/sbin/cpu_a57_qemu loglevel=3 serial=0x9000000 logmask=128 module /armv8/sbin/init module /armv8/sbin/hello echoclient -module /armv8/sbin/memeater +# module /armv8/sbin/memeater module /armv8/sbin/mallocator module /armv8/sbin/stackoverflow module /armv8/sbin/echoserver +module /armv8/sbin/shelly # End of file, this needs to have a certain length... diff --git a/hake/menu.lst.armv8_imx8x b/hake/menu.lst.armv8_imx8x index 04edcd0..481e6fa 100644 --- a/hake/menu.lst.armv8_imx8x +++ b/hake/menu.lst.armv8_imx8x @@ -7,7 +7,8 @@ cpudriver /armv8/sbin/cpu_imx8x module /armv8/sbin/init module /armv8/sbin/enet module /armv8/sbin/hello echoclient -module /armv8/sbin/memeater +# module /armv8/sbin/memeater module /armv8/sbin/mallocator module /armv8/sbin/stackoverflow module /armv8/sbin/echoserver +module /armv8/sbin/shelly diff --git a/platforms/Hakefile b/platforms/Hakefile index 88fadb7..7309dbc 100644 --- a/platforms/Hakefile +++ b/platforms/Hakefile @@ -12,7 +12,7 @@ let -- Default list of modules to build/install - modules_common = [ "/sbin/" ++ f | f <- [ "init", "hello", "memeater", "mallocator", "stackoverflow", "echoserver", "enet" + modules_common = [ "/sbin/" ++ f | f <- [ "init", "hello", "mallocator", "stackoverflow", "echoserver", "enet", "shelly" ] ] in [ diff --git a/usr/init/main.c b/usr/init/main.c index cf1ae87..ae9dd09 100644 --- a/usr/init/main.c +++ b/usr/init/main.c @@ -313,6 +313,14 @@ app_main(int argc, char *argv[]) { // Grading grading_test_late(); + //spawn shell + struct spawninfo shelly_si; + domainid_t shelly_pid; + err = spawn_load_by_name("shelly", &shelly_si, &shelly_pid); + if (err_is_fail(err)) { + DEBUG_ERR(err, "when spawning shelly"); + } + debug_printf("Message handler loop\n"); // Hang around struct waitset *default_ws = get_default_waitset(); diff --git a/usr/shelly/Hakefile b/usr/shelly/Hakefile new file mode 100644 index 0000000..87f3d05 --- /dev/null +++ b/usr/shelly/Hakefile @@ -0,0 +1,18 @@ +-------------------------------------------------------------------------- +-- Copyright (c) 2007-2010, ETH Zurich. +-- All rights reserved. +-- +-- This file is distributed under the terms in the attached LICENSE file. +-- If you do not find this file, copies can be found by writing to: +-- ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group. +-- +-- Hakefile for /usr/shelly +-- +-------------------------------------------------------------------------- + +[ build application + { + target = "shelly", + cFiles = [ "shelly.c" ] + } +] diff --git a/usr/shelly/shelly.c b/usr/shelly/shelly.c new file mode 100644 index 0000000..1921974 --- /dev/null +++ b/usr/shelly/shelly.c @@ -0,0 +1,14 @@ +/** + * \file + * \brief shelly - a shell process + */ + +#include +#include + +#include + +int main(int argc, char *argv[]) +{ + debug_printf("welcome to shelly!\n"); +} \ No newline at end of file