Hi,
I'm being spectacularly unsuccessful in getting a process thread to be associated with an RM Pager object.
I have an application whose main function creates an object instance based on a Thread. That instance creates another object instance whose main purpose is to read and write to an ffat file system through the libc plug-in for that purpose. As soon as this object attempts to access the file system a error message complaining about no pager object implemented ("/void Genode::Pager_object::unresolved_page_fault_occurred(): not implemented/") occurs.
On re-reading the Architecture documentation about RM in the Core, it *very* briefly explains that a thread capability for a pager needs to be created for the thread, using an add_client function call. I assumed this would be done in the thread entry() member function and added the following line of code at the the beginning of that function:
Thread_capability ap = Thread::cap(); Pager_capability pc = env()->rm_session()->add_client(ap); env()->cpu_session()->set_pager(ap, pc);
This did not work and I got he same error message about no pager object.
In looking through the threading code, I noticed that Thread_base::start() creates the thread and sets up a pager. Adding a void start() function to my thread with a call to the Thread_base::start function resulted in the same error.
I finally got a pager to be associated with the thread and access the file system by creating my own thread object in my thread start() function, binding it to the PD, and setting up the pager with the snippet shown above the same as was done in the Thread_base::start() function.
I'm obviously confused about what's going with a process's region manager handling of threads. Could someone please enlighten me?
Thanks in advance, Bob Stewart Bob Stewart