mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
Task initally exec'ing with success. Some errors need to be investigated.
- Directory creation, file read/write is OK. - Cannot reuse old task's fds. They are not recycled for some reason. - Problems with fork/clone/exit. They fail for a reason.
This commit is contained in:
@@ -87,7 +87,7 @@ void do_exchange_registers(struct ktcb *task, struct exregs_data *exregs)
|
||||
* the register context of a thread. The thread's registers can be
|
||||
* set only when the thread is in user mode. A newly created thread
|
||||
* that is the copy of another thread (forked or cloned) will also
|
||||
* be given its user mode context on the first chance to execute so
|
||||
* be given its user mode context on the first chance to execute so
|
||||
* such threads can also be modified by this call before execution.
|
||||
*
|
||||
* A thread executing in the kernel cannot be modified since this
|
||||
@@ -119,6 +119,9 @@ int sys_exchange_registers(syscall_context_t *regs)
|
||||
goto out;
|
||||
}
|
||||
|
||||
#if 0
|
||||
A suspended thread implies it cannot do any harm
|
||||
even if it is in kernel mode.
|
||||
/*
|
||||
* The thread must be in user mode for its context
|
||||
* to be modified.
|
||||
@@ -127,6 +130,7 @@ int sys_exchange_registers(syscall_context_t *regs)
|
||||
err = -EPERM;
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Copy registers */
|
||||
do_exchange_registers(task, exregs);
|
||||
|
||||
Reference in New Issue
Block a user