3 Part I http netwk hannam ac kr
- Slides: 41
리눅스 커널의 이해… 3 Part I : 프로세스 디스크립터 http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 6 리눅스 프로세스 디스크립터 State Flags Need_resched Counter Priority Next_task Prev_task Next_run Prev_run P_OPTR P_PPTR ………… Tty_struct 프로세스와 연관된 tty Fs_struct 현재 디렉토리 files_struct 파일 드스크립터 포인터 Tss mm_struct 메모리 영역 드스크립터 포인터 Fs Files Mm Signal_lock Sig …… signal_struct 수신한 시그널 [그림 3 -1] 리눅스 프로세스 드스크립터(Page. 124) http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 7 프로세스 상태 < TASK_RUNNING q 실행중이거나 실행을 기다리는 중 < TASK_INTRRUPTIBLE q 대기중 < TASK_ININTERRUPTIBLE q 실행중이거나 실행을 기다리는 중 < TASK_STOPPED q 프로세스 실행이 중단 (SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU) < TASK_ZOMBIE q 죽은 프로세스 http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 11 프로세스 리스트 Next_task prev_task Next_task init_task [그림 3 -3] 프로세스 리스트(Page. 131) http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 12 프로세스 리스트 < 프로세스 디스크립터 추가 / 제거 q SET_LINKS , REMOVE_LINKS < For_each_task q 전체 프로세스 리스트 탐색 #define for_each_task(p) for(p=&init_task; (p=p next_task) != &init_task; ) < TASK_RUNNING q 새로운 프로세스 찾을경우, 실행할수 있는 프로세스 고려 http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 13 Pidhash 테이블 과 연쇄리스트 pidhash 0 . . . PID 228 PID 27535 . . . PID 27535 123 Pidhash_next Pidhash_pprev . . . 127 [그림 3 -4] Pidhash 테이블과 연쇄리스트(Page. 133) http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 16 프로세스 친족관계 P 0 P 1 P 2 P 3 p_pptr p_ysptr P 4 p_osptr p_cptr [그림 3 -6] 다섯프로세스간 친족관계(Page. 136) http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 17 대기큐 < TASK_STOPPED, TASK_ZOMBIE 리스트로 연결안함 q 실행중이거나 실행을 기다리는 중 < TASK_INTRRUPTIBLE or TASK_ININTERRUPTIBLE http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 20 Part II : 프로세스 전환 http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 24 Switch_to 매크로 < 80 X 86의 Switch_to 전환 q Prev와 next값을 eax와 edx 레지스터 저장 q 레지스터 내용 prev 커널 모드 스택에 저장 q Esp 값 prev tss. esp저장 q Next tss. esp를 esp 저장 q 1로 표시된곳의 주소를 Prev tss. eip 저장 q Next tss. eip q Swtich_to()함수 이동 http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 31 커널 스레드 < 커널 스레드 만들기 int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) { pid_t p; p = clone(0, flags | clone_VM); if(p) /* 부모 */ return p; else { fn(arg); /* 자식 */ exit(); } } http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 32 프로세스 0 < = 스와퍼 프로세스 q Start_kernel()가 리눅스를 초기화하는 동안 만들어지는 커널스레드 q Init_task_union, init_task, init_stack 디스크립터와 스택주소 q 프로세스 디스크립터 - init_mm, init_mmap, init_fs, init_files, init_signals ㅇ 매크로 - INIT_MM, INIT_MMAP, INIT_FS, INIT_FILES, INIT_SIGNALS q INIT_TSS매크로로 초기화한 TSS세그먼트 q TSSD와 LDTD GDT에 저장 q Swapper_pg_dir 커널 페이지 전역 디렉토리 http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 33 프로세스 1 < 프로세스 0이 만든 커널 스레드는 정기적인 커널 작업에 필요한 커 널스레드를 만들기 위해 kernel_thread()함수를 네번 호출 q Kernel_thread(bdflush, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND); q Kernel_thread(kupdate, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND); q Kernel_thread(kpiod, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND); q Kernel_thread(kswapd, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND); http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 35 Part VI : 프로세스 끝내기 http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 38 Part VI : 리눅스 2. 4 예상 http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
리눅스 커널의 이해… 41 Q&A http: //netwk. hannam. ac. kr HANNAM UNIVERSITY
- Hannam.ac.kr
- Netwk
- Netwk
- Netwk
- Hannam mobile
- Http //mbs.meb.gov.tr/ http //www.alantercihleri.com
- Siat ung sistem informasi akademik
- Define technical description
- Part whole model subtraction
- What are the three parts of the bar
- Part to part ratio definition
- The phase of the moon you see depends on ______.
- Brainpop ratios
- Two way anova minitab 17
- Http://4.bp.blogspot.com
- Ies suel
- Kcvs.ca photoelectric effect
- Edupalvelut.
- Teachertech.rice.edu
- Http://www.mesopotamia.co.uk/
- Http://whats up
- Book publishers in louisiana
- Http //htwins.net/scale 2/
- Http://system.windows.media/
- Arasaac.org pictogramas
- Formulageo.blogspot.com
- Http//sciencespot.net
- Http
- (http //www.history.com/topics/byzantine-empire
- "http://www.allocine.fr/".
- Kfmgf
- Mbg.net
- 2-bp.blogspot.com
- Stachura edmund
- Sportdb
- Http://www.stopdisastersgame.org/
- Http://www.free-powerpoint-templates-design.com
- Dendro.cnre.vt.edu photosynthesis
- Http://www.damodaran.com
- Http//aka
- Http://www.youtube.com/google
- Http://solarsystem.nasa.gov/planets