Professional Documents
Culture Documents
The process
becomes runnable
if it receives a
signal.
http://www.linuxjournal.com/article/1060
search_binary_handler
• It releases all resources used by the old
process.
• It maps the application into virtual address
space.
– text, pre-initialized data, heap, stack
• It sets the instruction pointer of the process
and some other architecture-specific registers
Note: Interpreting Binary Formats
<binfmts.h>
struct linux_binfmt {
struct linux_binfmt * next;
struct module *module;
int (*load_binary)
(struct linux_binprm *, struct pt_regs * regs);
int (*load_shlib)
(struct file *);
int (*core_dump)
(long signr, struct pt_regs * regs, struct file * file);
unsigned long min_coredump; /* minimal dump size */
};
Process termination
1. set the PF_EXITING flag in the flags member
of the task_struct.
2. calls del_timer_sync() to remove any kernel
timers (that are software timers).
3. calls __exit_mm() to release the mm_struct
4. calls exit_sem(). If the process is queued
waiting for an IPC semaphore, it is dequeued
here.
Process termination
5. calls __exit_files(), __exit_fs(),
exit_namespace(), and exit_sighand() to
decrement the usage count of objects
6. sets the task's exit code, stored in the
exit_code member of the task_struct
7. calls exit_notify() to send signals to the task's
parent
8. calls schedule()
Removal of the Process Descriptor