Hey,

I am currently looking for a way to reclaim resources allocated by kernel for
the rootserver thread, i.e. memory for CNode, TCB, BootInfo, etc. My current 
approach
looks like this:

* in rootserver instead of calling seL4_TCB_Suspend, call custom syscall
  seL4_ReclaimRootserverResources. This sycall as parameters takes CNode and
  slot no. after which kernel should be able to freely write new caps. This 
CNode is
  main CNode of some component initialized by the rootserver.
* implmenetation of this syscall then suspends initial thread, schedules new 
thread,
  revokes most of rootserver's resources, notably TCB, BootInfo, IPCBuffer, 
VSpace and CNode.
  Then for those now free memory regions new untyped capabilities are created, 
with the same
  sizes as the original objects. Lastly, new capabilities are written to 
subsequent slots
  in CNode a'la boot.c, so with null MDBNode; mdbRevocable and mdbFirstBadged 
set to true.

This solution has couple of problems. First and foremost, it requires creating 
additional
syscall to handle this. Secondly, even though the component _technically_ has 
access to this
newly created capabilities, it doesn't know where they are, or how big they 
are. This could be
partially band-aided by hardcoding this information in relevant component, but 
that is far from
elegant. This component also recives rest of the untyped memory from 
rootserver, including bootinfo
entries about this memory specification, so that renders solution with 
hardcoding spec even worse.
Last but not least, before the seL4_ReclaimRootserverResources is called, all 
the components are
resumed using seL4_TCB_Resume as part of rootserver's work, so there could be 
race-condition between
calling reclaiming syscall, and component initialization (although I am not 
100% sure about that part)

Is there maybe a better way to do it, and I am doing it all round? The perfect 
solution
would be to somehow extend bootinfo and/or remaining untypeds that were given 
by the kernel to the
rootserver.
_______________________________________________
Devel mailing list -- devel@sel4.systems
To unsubscribe send an email to devel-leave@sel4.systems

Reply via email to