





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















Introduction to process descriptors and their related data-structures for Linux kernel version 2.6.
Upon entering ‘main()’:
During execution of ‘main()’:
A user process enters ‘kernel-mode’:
Upon entering kernel-mode:
(e.g., address of task’s user-mode stack)
During execution of kernel functions:
task_struct *stack^ state flags *mm exit_code *user pid *files *parent
mm_struct *pgd
pagedir[]
user_struct
signal_struct *signal
files_struct
Each process descriptor contains many fields and some are pointers to other kernel structures which may themselves include fields that point to structures
page-frame to store ‘thread information’
Task’s kernel-stack
Task’s thread-info page-frame aligned
Task’s process-descriptor
struct task_struct (^) 8-KB
struct task_struct { volatile long state; void *stack; unsigned long flags; struct mm_struct *mm; struct thread_struct thread; pid_t pid; char comm[16]; / plus many other fields */ };
movl $0xFFFFF000, %eax andl %esp, %eax
Ok, now %eax = the thread-info’s base-address There’s a macro that implements this computation
init_task (pid=0)
newest … task
next_task
prev_task