演算法在Linux作业系统上之应用AlgorithmApplicationsin....pptVIP

  • 2
  • 0
  • 约2.72万字
  • 约 81页
  • 2019-03-26 发布于天津
  • 举报

演算法在Linux作业系统上之应用AlgorithmApplicationsin....ppt

演算法在Linux作業系統上之應用 Algorithm Applications in Linux Operating System CE6100 許 富 皓 Chapter 3 Processes Parameters of do_fork() clone_flags Same as the flags parameter of clone( ) stack_start Same as the child_stack parameter of clone( ) regs Pointer to the values of the general purpose registers saved into the Kernel Mode stack when switching from User Mode to Kernel Mode (see the section The do_IRQ( ) function in Chapter 4) stack_size Unused (always set to 0) parent_tidptr, child_tidptr Same as the corresponding ptid and ctid parameters of clone() copy_process( ) do_fork( ) makes use of an auxiliary function called copy_process( ) to set up the process descriptor and any other kernel data structure required for childs execution. do_fork()- a new PID Allocates a new PID for the child by looking in the pidmap_array bitmap (see the earlier section Identifying a Process). The Meaning of Some Clone Flags CLONE_PTRACE If traced, the parent wants the child to be traced too. Furthermore, the debugger may want to trace the child on its own; in this case, the kernel forces the flag to 1. CLONE_STOPPED Forces the child to start in the TASK_STOPPED state. CLONE_UNTRACED Set by the kernel to override the value of the CLONE_PTRACE flag (used for disabling tracing of kernel threads ; see the section Kernel Threads later in this chapter). CLONE_VM Shares the memory descriptor and all Page Tables (see Chapter 9). do_fork()- the ptrace Field Checks the ptrace field of the parent (current-ptrace): if it is not zero, the parent process is being traced by another process, thus do_fork( ) checks whether the debugger wants to trace the child on its own (independently of the value of the CLONE_PTRACE flag specified by the parent); in this case, if the child is not a kernel thread (CLONE_UNTRACED flag cleared), the function sets the CLONE_PTRACE flag. do_fork()- copy_process() Invokes copy_process() to make a copy of the process descriptor. If all needed resources are availab

文档评论(0)

1亿VIP精品文档

相关文档