-
-
Save zgzollers/48181fbc2dac6e51015602c6329593f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Booting `Genode on NOVA' | |
Bender Version 0.9-beta7-51-g28ba2ad-dirty | |
Patching BDA with I/O port 0x3f8. | |
Bender: Hello World. | |
hwp config: eeo=na irq=na hwp=na epp=na epb=na | |
NOVA Microhypervisor v9-aca598b (x86_64): [gcc 12.3.0] [MBI2] | |
[ 0] TSC:2610340 kHz BUS:1006687 kHz (measured) | |
[ 0] CORE:00:00:0 6:1a:3:0 [1] Intel Core i7 9xx (Nehalem Core i7, IBRS update) | |
Hypervisor NOVA (API v9) | |
core image [0000000000100000,000000000041d000) | |
binaries region [0000000000278000,000000000041d000) free for reuse | |
detected physical memory: 0x0000000000000000 - size: 0x000000000009fc00 | |
use physical memory: 0x0000000000000000 - size: 0x000000000009f000 | |
detected physical memory: 0x0000000000100000 - size: 0x0000000007edf000 | |
use physical memory: 0x0000000000100000 - size: 0x0000000007edf000 | |
reserved memory: 0x7cc0000 - size: 0x31e338 type=-2 | |
reserved memory: 0x9fc00 - size: 0x400 type=2 | |
reserved memory: 0xf0000 - size: 0x10000 type=2 | |
reserved memory: 0x7fdf000 - size: 0x21000 type=2 | |
reserved memory: 0xb0000000 - size: 0x10000000 type=2 | |
reserved memory: 0xfed1c000 - size: 0x4000 type=2 | |
reserved memory: 0xfffc0000 - size: 0x40000 type=2 | |
reserved memory: 0xfd000000 - size: 0x3e8000 type=-5 | |
reserved memory: 0x200000 - size: 0x4000 type=-1 | |
reserved memory: 0x1000 - size: 0x1000 type=-1 | |
reserved memory: 0x1000000 - size: 0x800000 type=-1 | |
reserved memory: 0x1800000 - size: 0x1c00000 type=-1 | |
reserved memory: 0x7fe22fc - size: 0x0 type=-3 | |
Hypervisor reports 1x1 CPU | |
Warning: CPU has no invariant TSC. | |
mapping: affinity space -> kernel cpu id - package:core:thread | |
remap (0x0) -> 0 - 0:0:0 boot cpu | |
ROM modules: | |
ROM: [0000000007e39000,0000000007e42b88) client | |
ROM: [0000000007fdd000,0000000007fdd275) config | |
ROM: [000000000000a000,000000000000e000) core_log | |
ROM: [0000000007f3f000,0000000007fae670) init | |
ROM: [0000000007e52000,0000000007f3ec48) ld.lib.so | |
ROM: [0000000007fcc000,0000000007fdccb0) parent | |
ROM: [0000000000006000,0000000000009000) platform_info | |
ROM: [0000000007e43000,0000000007e517f8) server | |
ROM: [0000000007faf000,0000000007fcb4d8) timer | |
36884K kernel memory | |
Genode 23.11 | |
87 MiB RAM and 63252 caps assigned to init | |
[init -> parent] Child requested session: 'PD' | |
Error: illegal READ at address 0x4 by pager_object: pd='init -> parent' thread='ep' ip=0x7acf4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <base/component.h> | |
#include <base/log.h> | |
#include <base/child.h> | |
namespace Tutorial { struct Child; } | |
struct Tutorial::Child : Genode::Child_policy | |
{ | |
Genode::Env& _env; | |
Child_policy::Name _name; | |
Genode::Heap _heap { _env.ram(), _env.rm() }; | |
Genode::Child _child { _env.rm(), _env.ep().rpc_ep(), *this }; | |
Genode::Registry<Genode::Registered<Genode::Child_service>>& _child_services; | |
/* | |
I tried replacing the above line with this line to see if the issue was with the reference. It only eliminated | |
the illegal read error. | |
*/ | |
// Genode::Registry<Genode::Registered<Genode::Child_service>>& _child_services; | |
Child_policy::Name name() const override | |
{ | |
return _name; | |
} | |
Child_policy::Route resolve_session_request(Genode::Service::Name const& name, Genode::Session_label const& label, Genode::Session::Diag const diag) override | |
{ | |
Genode::log("Child requested session: '", name, "'"); | |
Genode::Service* service = nullptr; | |
_child_services.for_each([&] (Genode::Registered<Genode::Child_service>& child_service) | |
{ | |
if(child_service.name() == name) | |
{ | |
Genode::log("Service '", name, "' is provided by a child"); | |
service = &child_service; | |
} | |
}); | |
if(!service) { | |
Genode::log("Service '", name, "' not provided by a child. Routing to parent."); | |
service = new (_heap) Genode::Parent_service(_env, name); | |
} | |
return Child_policy::Route { *service, label, diag }; | |
} | |
Genode::Pd_session& ref_pd() override | |
{ | |
return _env.pd(); | |
} | |
Genode::Pd_session_capability ref_pd_cap() const override | |
{ | |
return _env.pd_session_cap(); | |
} | |
void resource_request(Genode::Parent::Resource_args const& args) override | |
{ | |
Genode::log("Child requested resource: ", args); | |
} | |
void init(Genode::Pd_session& pd, Genode::Pd_session_capability pd_cap) override | |
{ | |
pd.ref_account(ref_pd_cap()); | |
ref_pd().transfer_quota(pd_cap, Genode::Cap_quota{20}); | |
ref_pd().transfer_quota(pd_cap, Genode::Ram_quota{10*1024*1024}); | |
Genode::log("Transfered initial resource quotas to child"); | |
} | |
Child(Genode::Env& env, Child_policy::Name name, Genode::Registry<Genode::Registered<Genode::Child_service>>& child_services) : _env(env), _name(name), _child_services(child_services) | |
{ | |
} | |
~Child() | |
{ | |
Genode::log("Destroying parent component"); | |
} | |
}; | |
namespace Tutorial { struct Main; } | |
struct Tutorial::Main | |
{ | |
Genode::Registry<Genode::Registered<Genode::Child_service>> _registry { }; | |
Genode::Env& _env; | |
Tutorial::Child server{_env, "server", _registry }; | |
Tutorial::Child client{_env, "client", _registry}; | |
Main(Genode::Env& env) : _env(env) | |
{ | |
} | |
}; | |
void Component::construct(Genode::Env& env) | |
{ | |
static Tutorial::Main main(env); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build { core lib/ld init tutorial timer } | |
create_boot_directory | |
install_config { | |
<config> | |
<parent-provides> | |
<service name="LOG"/> | |
<service name="PD"/> | |
<service name="CPU"/> | |
<service name="ROM"/> | |
</parent-provides> | |
<default-route> | |
<service name="ROM" label="server"> <parent label="server"/> </service> | |
<any-service> <parent/> <any-child/> </any-service> | |
</default-route> | |
<default caps="160"/> | |
<start name="timer"> | |
<resource name="RAM" quantum="1M"/> | |
<provides> <service name="Timer"/> </provides> | |
</start> | |
<start name="parent"> | |
<resource name="RAM" quantum="30M"/> | |
</start> | |
</config> | |
} | |
build_boot_image [build_artifacts] | |
append qemu_args "-nographic -m 128" | |
run_genode_until "I'm alive!" 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment