Added scenario for testing cell destruction.

This commit is contained in:
Michael Mueller
2025-02-10 13:02:46 +01:00
parent 086e9ac5be
commit c1017645b7
3 changed files with 106 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
set build_components {
core init hoitaja timer app/empty_cell app/volatile_cell
}
build $build_components
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="PD"/>
<service name="CPU"/>
<service name="ROM"/>
<service name="RAM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="CAP"/>
<service name="RM"/>
<service name="SIGNAL"/>
<service name="TRACE"/>
</parent-provides>
<default-route>
<any-service><parent/><any-child/></any-service>
</default-route>
<default caps="2000"/>
<start name="timer">
<resource name="RAM" quantum="3M"/>
<provides><service name="Timer"/></provides>
<route>
<any-service><parent/><any-child/></any-service>
</route>
</start>
<start name="hoitaja" caps="1046284">
<resource name="RAM" quantum="250G"/>
<config prio_levels="32" verbose="true">
<parent-provides>
<service name="LOG"/>
<service name="PD"/>
<service name="CPU"/>
<service name="ROM"/>
<service name="RAM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="CAP"/>
<service name="RM"/>
<service name="SIGNAL"/>
<service name="TRACE"/>
<service name="Timer"/>
</parent-provides>
<default-route>
<any-service><parent/><any-child/></any-service>
</default-route>
<default caps="600"/>
<affinity-space width="64" height="1"/>
<start name="cell1" priority="-1">
<binary name="volatile_cell"/>
<resource name="RAM" quantum="3M"/>
</start>
<!--
<start name="cell2" priority="-2">
<binary name="empty_cell"/>
<resource name="RAM" quantum="3M"/>
</start>
-->
</config>
</start>
</config>
}
build_boot_image [build_artifacts]
append qemu_args " -nographic "
run_genode_until forever

View File

@@ -0,0 +1,27 @@
#include <base/component.h>
#include <base/env.h>
#include <base/log.h>
#include <timer_session/connection.h>
namespace Hoitaja_test
{
class Empty_cell;
}
class Hoitaja_test::Empty_cell
{
private:
Genode::Env &_env;
Timer::Connection _timer{_env};
public:
Empty_cell(Genode::Env &env) : _env(env)
{
Genode::log("Volatile dummy cell started.");
_timer.msleep(10000);
Genode::log("Exiting..");
_env.parent().exit(0);
}
};
void Component::construct(Genode::Env &env) { static Hoitaja_test::Empty_cell cell(env);}

View File

@@ -0,0 +1,3 @@
TARGET = volatile_cell
SRC_CC += main.cc
LIBS += base