Linux 10282021 Linux OS Analysis 7 Linux v
- Slides: 92
Linux的进程
10/28/2021 Linux OS Analysis 7
Linux进程的状态 v 可运行状态(TASK_RUNNING) v 可中断的等待状态(TASK_INTERRUPTIBLE) v 不可中断的等待状态(TASK_UNINTERRUPTIBLE) v 暂停状态(TASK_STOPPED) v 僵死状态(TASK_ZOMBIE) v 状态值的改变通常是一个简单的赋值 v 内核也提供set_task_state 和set_current_state 宏 10/28/2021 Linux OS Analysis 8
进程状态转换图 10/28/2021 Linux OS Analysis 9
Task_union v C语言允许用如下的一个union结构来方便的表示 这样的一个混合体 v 进程描述符的分配/回收/访问 =2048 Ø alloc_task_struct Ø free_task_struct Ø get_task_struct 10/28/2021 Linux OS Analysis 14
v SET_LINKS和REMOVE_LINKS宏用来分别在进 程链表中插入和删除一个进程描述符。 10/28/2021 Linux OS Analysis 18
v for_each_task宏扫描整个进程链表 10/28/2021 Linux OS Analysis 19
pidhash表及链接表 10/28/2021 Linux OS Analysis 23
等待队列的链表 10/28/2021 Linux OS Analysis 27
sleep_on 10/28/2021 Linux OS Analysis 29
进程的唤醒 v 利用wake_up或者wake_up_interruptible等一系列 的宏,都让插入等待队列中的进程进入 TASK_RUNNING状态 10/28/2021 Linux OS Analysis 30
thread_struct 10/28/2021 Linux OS Analysis 36
__switch_to的关键操作 v unlazy_fpu() 处理数学协处理器 v 保存和恢复fs、gs v 等等 10/28/2021 Linux OS Analysis 43
使用fork和exec的例子 If (result = fork() == 0){ /* 子进程代码 */ … if (execve(“new_program”, …)<0) perror(“execve failed”); exit(1); }else if (result<0){ perror(“fork failed”) } /* result==子进程的pid,父进程将会从这里继续执行*/ … 10/28/2021 Linux OS Analysis 54
do_fork v 不论是fork,vfork还是clone,在内核中最终都调 用了do_fork 10/28/2021 Linux OS Analysis 56
10/28/2021 Linux OS Analysis 57
进程树 v 进程0 v 进程1 v… 10/28/2021 Linux OS Analysis 65
进程1 v 又称为init进程 v 由进程0在start_kernel调用rest_init创建 v init进程PID为 1,当调度程序选择到init进程时, init进程开始执行init()函数 10/28/2021 Linux OS Analysis 67
与调度相关的系统调用 v nice v getpriority/setpriority v sched_getscheduler/sched_setscheduler v sched_getparam/sched_setparam v sched_yield v sched_get_priority_min/sched_get_priority_max v sched_rr_get_interval 10/28/2021 Linux OS Analysis 82
举例:进程0(INIT_TASK)的时间片: HZ代表了1秒内的tick数 因此一个tick就是 1/100秒 即 10 ms 可以计算出 DEF_COUNTER=10个tick 即 100 ms (实际上约 105 ms) 10/28/2021 Linux OS Analysis 86 MAX_COUNTER=20个tick 即 200 ms
- Linux security modules
- Cs423
- Fuzzer kali
- Data structured tool
- Autohotkey obfuscator
- Difference between content and discourse analysis
- Difference between error analysis and contrastive analysis
- Contrastive analysis error analysis and interlanguage
- What is fact analysis
- Content analysis and task analysis
- Parent ego state
- Structured vs object oriented analysis
- Lex
- Content analysis of secondary data
- Organizational feasibility in system analysis and design
- Kmo test
- Wind river linux commands
- Is unix and linux same
- Uml
- /etc/shadow linux
- Unix and linux similarities
- Supervision linux
- Tasklet_hi_schedule
- Linux design principles
- Td linux
- Suse linux 9
- Suse linux administration
- Linux operation and administration chapter 8
- Current path linux command
- Open source jobscheduler
- Slax se
- 4445201
- Webcam server linux
- Proc_create linux
- Linux process states
- Linux prezentace
- Pliki konfiguracyjne linux
- Wim coekaerts salary
- "oracle linux 9"
- Operating system
- Netmap linux
- Fiddler for linux
- Asai linux
- Linux undo cp
- Eso midas linux open
- Linux memmap
- Low level linux programming
- Linux virtual server project
- Linux vfs
- Linux terminal api
- Linux swan
- Qt framework
- Linux operating system presentation
- Linux family tree
- Character device file in linux
- Ikev
- Linux kernel internals
- Linux jukebox distro
- Interprocess communication in linux
- Commande linux
- Inode in linux
- Linux everywhere
- Linux device model
- High performance computing linux
- Adb commands
- Linux kernel map data structure
- Bastille linux
- Linux fork exec example
- Declare_tasklet
- Message passing os
- Character device file in linux
- Unet bootin
- Mantenimiento sistemas linux
- Linuxone emperor
- Linux rexx
- Linux on z systems
- Twamp linux
- Eclipse linux kernel
- Cst linux
- Bash startup files
- Sd card health check linux
- Radius server linux
- Linux operating system concepts
- Process virtual address space
- Teus linux
- Jelaskan arsitektur sistem operasi
- Windows ve linux karşılaştırması
- Pencipta linux
- Linux programmer's manual
- Suse linux remote desktop
- Vantagens e desvantagens do linux
- Bagian dari kernel linux
- Security strategies in linux platforms and applications