kermit the frog kermit@tower.com.ar writes:
First of all, thanks for replying. I happen to have another problem. If i try to create a new task, no matter what i do i always get the message
'KDB: task new: not chief'
the line im using to create a task is as follows: recv = l4_task_new(recv, 6, (dword_t) task+(4096*2), (dword_t)task, L4_NIL_ID); Where task is a function defined void task(void); Im asuming here that the stack will begin , lets say to pages from the code page (task + (4096*2)).
Am i missing something here ?? (-:
Yes: In order to be allowed to create or delete a task, you must be the task's ``chief.'' When the system boots, Rmgr (task 4) is the chief of all other tasks, and thus is the only task which may create new tasks. Your task (probably task 5) initially cannot create any task.
The current owner of a chief right to nonexistent tasks can transfer the right using the l4_task_new() system call. There is an Rmgr protocol message which allows tasks to request chief rights to specific tasks from Rmgr.
I'll append below a library which wraps the Rmgr protocol into C bindings. With it it you can request a new chief right using the sequence:
rmgr_init(); error = rmgr_get_task(number);
(The library also contains functions called rmgr_task_new() and rmgr_task_new_with_prio() which lets Rmgr create a new task, but these currently don't work with Fiasco because they require long-message IPC. Long-message IPC has only been implemented recently, and I'm currently testing it; it will be included in the next release.)
Michael
l4-hackers@os.inf.tu-dresden.de