슬라이드 1

Size: px
Start display at page:

Download "슬라이드 1"

Transcription

1 프로세스 (Process) (1) Chapter #5

2 Process 정의 Process 구조 Process Context Process Scheduling 강의목차 Unix System Programming 2

3 Program( 프로그램 ) Process 정의 (1) 기계어명령어와데이터를모아놓은실행파일 C 언어등프로그램언어로작성된소스파일을컴파일링하여생성 COFF(Common Object File Format) 등의형식으로저장 UNIX에서는파일접근모드가실행가능으로설정되어있어야하며, 주로보조기억장치에저장되어있음 Program 자체만으로실행가능한가? Unix System Programming 3

4 Process( 프로세스 ) Process 정의 (2) 수행중인프로그램 (an instance of a running program) 프로그램의수행환경 (an execution environment of a program) 스케줄링단위 (scheduling entity) 제어흐름과주소공간의집합 (a control flow and address space) Multitasking을지원하는객체 Task( 태스크 ) in Linux A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task. (by Silberschatz) Unix System Programming 4

5 Program vs. Process Process 정의 (3) program loading Unix System Programming 5

6 Process 정의 (4) 사용자프로세스 & 커널프로세스 하나의응용프로그램실행과정은응용프로그램실행과커널함수실행으로이루어진다 사용자프로세스 응용프로그램의실행객체 커널프로세스 커널프로그램의실행객체 응용프로그램의실행은사용자프로세스와커널프로세스사이의전환실행으로이루어진다 Unix System Programming 6

7 Process 정의 (5) 층, 프로세스, 링크, 레벨의관계 Unix System Programming 7

8 Process 구조 Process 구조 (1) 실제프로그램이기억공간에로딩되어구성되는프로세스이미지 텍스트, 데이터, 스택, 힙영역으로구성 프로세스생성및관리와관련된커널데이터구조 : (1) 프로세스테이블 (2) PCB( 프로세스제어블록 ) (3) 사용자영역 (u-area) 파일디스크립터테이블, OS 스택등 Unix System Programming 8

9 Process 구조 (2) Process 구조 ( 계속 ) Unix System Programming 9

10 Process 이미지구조 Process 구조 (3) 텍스트, 데이터, 스택, 힙영역으로구성 텍스트 (text) 영역 프로그램코드부분 (assembly 언어 ) 프로그램순서에따라메모리상위번지로자람 데이터 (data) 영역 전역변수 초기화된부분과초기화되지않은부분을별도로관리 스택 (stack) 영역 지역변수, 인자, 복귀주소 함수호출순서에따라동적으로메모리하위번지로자람 힙 (heap) 영역 malloc(), calloc() 등의인터페이스로동적할당되는부분 Unix System Programming 10

11 Process 구조 (4) Process 이미지구조 ( 계속 ) Unix System Programming 11

12 Process 이미지구조 ( 계속 ) 함수호출시의스택구조 Process 구조 (5) int func2(int x, int y) { int f2_local1 = 21, f2_local2 = 22; int *pointer, i;... } void func1(){ int ret_val; int f1_local1 = 11, f1_local2 = 12;... ret_val = func2(111, 112);... } int main(){... func1();... } Unix System Programming 12

13 Process 구조 (6) User Stack vs. Kernel Stack 사용자스택 사용자함수호출에필요한여러가지요소들을저장 지역변수들 (local variables) 이전스택프레임에대한포인터 ( 주소 ) 함수호출수행후의리턴주소 함수호출에사용한인자들 (parameters) 커널스택 시스템호출에필요한여러가지요소들을저장 내용은사용자스택과유사 Unix System Programming 13

14 Process 구조 (7) 프로세스이미지에대한텍스트 (etext), 데이터 (edata), 스택및사용자영역의한계점 (end point) 을출력하여프로세스이미지구조를이해 #define PRADDR(X) printf(" X at 0x%x and value = 0x%x\n",&X,X) extern etext, edata, end; static char s = 'S'; int a,b = 1; int main(int argc,char *argv[]) { void sub1(); static int c, d =1; char m,n = 'n'; printf("main at 0x%x and sub1 at 0x%x\n",main,sub1); printf("end of text segment at 0x%x\n",&etext); PRADDR(s); PRADDR(b); PRADDR(c); PRADDR(d); Unix System Programming 14

15 Process 구조 (8) printf("end of statics & initialized externals at 0x%x\n", &edata); PRADDR(a); printf("end of uninitialized externals at 0x%x\n", &end); } PRADDR(m); PRADDR(n); PRADDR(argc); PRADDR(argv); for(b = 0; b<argc; b++) printf("argv[%d] at 0x%x and value = 0x%x or %s\n", b, &argv[b], argv[b], argv[b]); sub1(c); return 0; void sub1(int p) { static int t; char v; } PRADDR(t); PRADDR(p); PRADDR(v); Unix System Programming 15

16 Process 구조 (9) 프로세스의크기변경 : brk, sbrk Unix System Programming 16

17 Process 구조 (10) 프로세스의크기변경 ( 계속 ) Unix System Programming 17

18 Process 구조 (11) brk 와 sbrk 시스템호출을이용하여수행중인프로세스의크기를설정하고출력하는프로그램을작성하라. extern int etext, edata, end; int main(void) { int brk(), ret; char *sbrk(), *bv; system("clear"); printf("the program text ends at %08x\n", &etext); printf("the initialized data ends at %08x\n", &edata); printf("the uninitialized data ends at %08x\n", &end); bv = sbrk(0); printf("current break value is %%08x\n\n",bv); ret = brk(bv+512); /* */ printf("brk returned.... %d\n",ret); bv = sbrk(0); printf("current break value is %08x\n\n",bv); Unix System Programming 18

19 Process 구조 (12) ret = brk(&ret); printf("brk returned.... %d\n",ret); bv = sbrk(0); printf("current break value is %08x\n\n",bv); bv = sbrk(64); /* 0100 */ printf("sbrk returned %08x\n",bv); bv = sbrk(0); printf("current break value is %08x\n\n",bv); bv = sbrk(-1024); /* memory deallocation: */ printf("sbrk returned %08x\n",bv); printf("current break value is %08x\n\n",bv); } return 0; Unix System Programming 19

20 Process Context (1) 프로세스문맥 (Process Context) 커널이관리하는프로세스자원과제어흐름의집합 다음과같은 3 부분으로구성 시스템문맥 (System Context) 메모리문맥 (Memory Context) 하드웨어문맥 (Hardware Context) 프로세스실행이전환될때에문맥교환 (Context Switching) 이일어난다 프로세스스케줄링 시스템호출 (Trip) 인터럽트처리 Unix System Programming 20

21 프로세스문맥구조 Process Context (2) Unix System Programming 21

22 시스템문맥 Process Context (3) 프로세스를관리하는정보집합 태스크정보 : pid, uid, euid, suid, 태스크상태 : 실행상태, READY 상태, 수면상태, 태스크의가족관계 : p_pptr, p_cptr, next_task, next_run 스케줄링정보 : policy, priority, counter, rt_priority, need_resched 태스크의메모리정보 : 세그먼트, 페이지 태스크가접근한파일정보 : file descriptor 시그널정보 쓰레드정보 그외 : 수행시간정보, 수행파일이름, 등등 (kernel dependent) Unix System Programming 22

23 Process Context (4) 시스템문맥 ( 계속 ) task_struct 자료구조 /* include/linux/sched.h*/ task identification : pid, pgrg, session, uid, euid, suid, fsuid state : TASK_RUNNING, TASK_ZOMBIE, ASK_INTERRUPTABLE, TASK_UNINTERRUPTABLE, TASK_STOPPED task relationship : p_pptr, p_cptr, next_task, next_run scheduling information : policy, priority, counter, rt_priority, need_resched memory information : mm_struct signal information : signal_struct, sigpending, signal, blocked file information : files_struct, fs_struct thread information : tss time information : start_time, times, timer_list executable format : personality, exec_domain resource limits : rlim miscellaneous : flag, comm, maj_flt, min_flt, exit_code 등 Unix System Programming 23

24 Process Context (5) 시스템문맥 ( 계속 ) task_struct 자료구조 Unix System Programming 24

25 Process Context (6) 시스템문맥 ( 계속 ) PCB(Process Control Block) in Unix Process state Program counter CPU registers CPU scheduling information Memory-management information Accounting information I/O status information Unix System Programming 25

26 Process Context (7) 시스템문맥 ( 계속 ) PCB Management in Unix Unix System Programming 26

27 메모리문맥 Process Context (8) fork internal : after loading (after run a.out) & before fork Unix System Programming 27

28 Process Context (9) 메모리문맥 ( 계속 ) fork internal : after fork Unix System Programming 28

29 하드웨어문맥 Process Context (10) CPU 레지스터집합 - CPU 내에서의현재프로그램의실행상태를의미 예 : 80x86 Architecture Unix System Programming 29

30 Process Context (11) 하드웨어문맥 ( 계속 ) 문맥교환과정 Unix System Programming 30

31 Process Context (12) 하드웨어문맥 ( 계속 ) 문맥교환제어흐름 Unix System Programming 31

32 Process Scheduling (1) 프로세스상태 (Process State) 프로세스는여러가지상태간의변환을거치면서실행된다 프로세스상태 생성 (Initial) 상태 fork() 시스템호출로프로세스가생성된상태 준비 (Ready) 상태 CPU 를할당받기위한대기상태 실행 (Running) 상태 CPU 에서실행중인상태 휴면 (Sleep) 상태 입출력이종료될때까지대기중인상태 좀비 (Zombie) 상태 exit() 시스템호출에의해종료된상태 정지된준비 (Suspended Ready) 상태 스왑영역에서의실행준비상태 정지된휴면 (Suspended Ready) 상태 스왑영역에서의휴면상태 Unix System Programming 32

33 Process Scheduling (2) 프로세스상태전환 (Process State Transition) Unix System Programming 33

34 실행상태구분 Process Scheduling (3) 사용자수준실행 / 커널수준실행 Unix System Programming 34

35 Process Scheduling (4) 사용자모드 / 시스템모드 사용자가작성한프로그램은 user mode 에서수행됨 system call 나 Interrupt 는 system mode 에서수행 한프로세스가 user mode와 system mode에서동시에수행될수는없음 system mode에서는 kernel stack을사용 Unix System Programming 35

36 Process Scheduling (5) 프로세스스케줄링 스케줄링 자원을특정객체가사용할수있도록할당하는것 프로세스스케줄링에서는 CPU 가자원이되고, 프로세스가객체가된다 프로세스스케줄링목표 CPU Utilization 극대화 CPU cycle 의효율적인배치 프로세스스케줄링유형 선점형스케줄링 (Preemptive Scheduling) 비선정형스케줄링 (Non preemptive Scheduling) Unix System Programming 36

37 Process Scheduling (6) 프로세스스케줄러 (Dispatcher) 주요동작 Ready Queue 에서다음에실행할프로세스선택 선택된프로세스에 CPU 를할당 스케줄링수행시점 1. Switches from running to waiting state 2. Switches from running to ready state 3. Switches from waiting to ready 4. Terminates Unix System Programming 37

38 Process Scheduling (7) 프로세스스케줄링기준 공평성 (fairness) : 기아상태 (starvation) 가되는태스크가없어야된다. 효율성 (efficiency) : 태스크선택과정이빠르게수행되어야한다. 응답시간 (response time) vs 처리율 (throughput) Unix System Programming 38

39 Process Scheduling (8) 프로세스스케줄링알고리즘 FCFS (First Come First Service) 라운드 - 로빈 (Round-Robin) SJF (Short Job First) 다단계피드백큐 (Multilevel Feedback Queue) EDF (Earliest Deadline First) RM (Rate Monotonic) Fair Queuing(Process group이scheduling 단위 ) Gang Scheduling(Synchronization 필요한 Process group이단위 ) Scheduling for Clustering System Process Migration Unix System Programming 39

40 Process Scheduling (9) Unix 프로세스스케줄링 Mutilevel Feedback Queue Interactive process 의효과적인처리가능 Unix System Programming 40

41 Process Scheduling (10) UNIX 프로세스스케줄링철학 프로세스마다 scheduling priority 갖는다 특정프로세스가 CPU 를독점하는것을방지 특정프로세스가기아상태에빠지는것을방지 프로세스가자발적으로 CPU를반납할수도있음 (sleep 상태로전이 ) Event가발생하면 wakeup 되어다시 ready queue로들어감 CPU를사용한프로세스는 aging에의해 sleep 상태에있었던프로세스에비해 scheduling priority가낮아진다 Unix System Programming 41

42 Process 트리구조 (1) Unix 프로세스의생성 fork() & exec() 시스템호출 fork() 시스템호출 프로세스복제 exec() 시스템호출 프로세스변신 프로세스복제에의해부모-자식관계성립 fork() 시스템호출을호출한프로세스 부모프로세스 fork() 시스템호출에의해복제된프로세스 - 자식프로세스 Unix System Programming 42

43 Process 트리구조 (2) Unix 프로세스계층구조 Unix 시스템은부모-자식관계에기반하여모든프로세스를트리구조로형성하여관리한다 Process #0 스와퍼 ( 스케줄러 ) 프로세스 Process #1 init 프로세스 ( 모든프로세스의선조프로세스 ) # pstree p more Unix System Programming 43

44 Process 트리구조 (3) Unix 프로세스계층구조 Unix System Programming 44

6주차.key

6주차.key 6, Process concept A program in execution Program code PCB (process control block) Program counter, registers, etc. Stack Heap Data section => global variable Process in memory Process state New Running

More information

Microsoft PowerPoint - Lecture_Note_7.ppt [Compatibility Mode]

Microsoft PowerPoint - Lecture_Note_7.ppt [Compatibility Mode] Unix Process Department of Computer Engineering Kyung Hee University. Choong Seon Hong 1 유닉스기반다중서버구현방법 클라이언트들이동시에접속할수있는서버 서비스를동시에처리할수있는서버프로세스생성을통한멀티태스킹 (Multitasking) 서버의구현 select 함수에의한멀티플렉싱 (Multiplexing)

More information

슬라이드 1

슬라이드 1 -Part3- 제 4 장동적메모리할당과가변인 자 학습목차 4.1 동적메모리할당 4.1 동적메모리할당 4.1 동적메모리할당 배울내용 1 프로세스의메모리공간 2 동적메모리할당의필요성 4.1 동적메모리할당 (1/6) 프로세스의메모리구조 코드영역 : 프로그램실행코드, 함수들이저장되는영역 스택영역 : 매개변수, 지역변수, 중괄호 ( 블록 ) 내부에정의된변수들이저장되는영역

More information

Microsoft PowerPoint - StallingsOS6e-Chap03.ppt [호환 모드]

Microsoft PowerPoint - StallingsOS6e-Chap03.ppt [호환 모드] 3 장프로세스기술 (Description) 및제어 (Control) 3 장의강의목표 프로세스의개념을이해한다. 프로세스의상태에대해서이해한다. 프로세스를표현하는운영체제의자료구조를이해한다. 프로세스제어블록의필요성및용도를이해한다. 모드전환과문맥교환에대해서이해한다. 운영체제의실행방식에대해서이해한다. 운영체제보안이슈에대해서이해한다. UNIX SVR4 의프로세스관리기법을이해한다.

More information

Figure 5.01

Figure 5.01 Chapter 4: Threads Yoon-Joong Kim Hanbat National University, Computer Engineering Department Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading Issues Operating

More information

untitled

untitled Embedded System Lab. II Embedded System Lab. II 2 RTOS Hard Real-Time vs Soft Real-Time RTOS Real-Time, Real-Time RTOS General purpose system OS H/W RTOS H/W task Hard Real-Time Real-Time System, Hard

More information

강의10

강의10 Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced

More information

<4D F736F F F696E74202D20BBE7BABB202D204F DC7C1B7CEBCBCBDBA20BDBAC4C9C1D9B8B528BAF1BCB1C1A12CBCB1C1A1292E707074>

<4D F736F F F696E74202D20BBE7BABB202D204F DC7C1B7CEBCBCBDBA20BDBAC4C9C1D9B8B528BAF1BCB1C1A12CBCB1C1A1292E707074> . 프로세스스케줄링 (= CPU 스케줄링 ) [ 출제빈도 상 ] - 정의 : 컴퓨터시스템의성능을높이기위해그사용순서를결정하기위한정책 - 목적 ( 성능평가 ) : 처리율증가, CPU 이용률증가, 우선순위제도, 오버헤드 ( 부하 ) 최소화, 응답시간 / 반환시간 / 최소화, 균형있는자원의사용, 무한연기회피. 프로세스스케줄링기법 ) 비선점스케줄링 (Non Preemptive)

More information

<C1A4BAB8C3B3B8AE5FB1E2BBE75FC7CAB1E25F E687770>

<C1A4BAB8C3B3B8AE5FB1E2BBE75FC7CAB1E25F E687770> 2.4 스케줄링 (1) 스케줄링의개요스케줄링은프로세스가생성되어실행될때필요한시스템의여러자원을해당프로세스에할당하는작업을의미 1) 작업스케줄링 (Job Scheduling) 1 어떤프로세스가시스템의자원을차지할수있는지를결정하여준비상태큐로보내는작업을의미 2 작업스케줄러 (Job Scheduler) 에의해수행 2) 프로세서스케줄링 (Processor Scheduling)

More information

Microsoft Word - ExecutionStack

Microsoft Word - ExecutionStack Lecture 15: LM code from high level language /* Simple Program */ external int get_int(); external void put_int(); int sum; clear_sum() { sum=0; int step=2; main() { register int i; static int count; clear_sum();

More information

Microsoft PowerPoint - o8.pptx

Microsoft PowerPoint - o8.pptx 메모리보호 (Memory Protection) 메모리보호를위해 page table entry에 protection bit와 valid bit 추가 Protection bits read-write / read-only / executable-only 정의 page 단위의 memory protection 제공 Valid bit (or valid-invalid bit)

More information

운영체제

운영체제 2017 운영체제 CHAPTER 02 프로세스와스레드관리 SEOKRAE KIM 내용 I. 프로세스와스레드관리... 1 1. 개요... 1 1) 중앙처리장치 (CPU)... 1 2) 중앙처리장치스케줄링... 1 2. 프로세스관리... 1 1) 프로세스의정의... 1 3. 프로세스구성요소... 2 4. 프로세스의상태... 2 1) 실행상태 (running)...

More information

ABC 11장

ABC 11장 12 장고급응용 0 수행중인프로그램 프로세스 모든프로세스는유일한프로세스식별번호 (PID) 를가짐 유닉스에서는 ps 명령을사용하여프로세스목록을볼수있음 12-1 프로세스 $ ps -aux USER PID %CPU %MEM SZ RSS TT STAT START TIME COMMAND blufox 17725 34.0 1.6 146 105 i2 R 15:13 0:00

More information

<4D F736F F F696E74202D FC7C1B7CEBCBCBDBA20BBFDBCBAB0FA20BDC7C7E0205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D FC7C1B7CEBCBCBDBA20BBFDBCBAB0FA20BDC7C7E0205BC8A3C8AF20B8F0B5E55D> 학습목표 프로세스를생성하는방법을이해한다. 프로세스를종료하는방법을이해한다. exec함수군으로새로운프로그램을실행하는방법을이해한다. 프로세스를동기화하는방법을이해한다. 프로세스생성과실행 IT CookBook, 유닉스시스템프로그래밍 2/24 목차 프로세스생성 프로세스종료함수 exec 함수군활용 exec 함수군과 fork 함수 프로세스동기화 프로세스생성 [1] 프로그램실행

More information

2009년 상반기 사업계획

2009년 상반기 사업계획 프로세스생성과실행 IT CookBook, 유닉스시스템프로그래밍 학습목표 프로세스를생성하는방법을이해한다. 프로세스를종료하는방법을이해한다. exec함수군으로새로운프로그램을실행하는방법을이해한다. 프로세스를동기화하는방법을이해한다. 2/24 목차 프로세스생성 프로세스종료함수 exec 함수군활용 exec 함수군과 fork 함수 프로세스동기화 3/24 프로세스생성 [1]

More information

좀비프로세스 2

좀비프로세스 2 Signal & Inter-Process Communication Department of Computer Engineering Kyung Hee University. Choong Seon Hong 1 좀비프로세스 2 좀비프로세스 (zombie process) 좀비프로세스란프로세스종료후메모리상에서사라지지않는프로세스 좀비프로세스의생성이유. 자식프로세스는부모프로세스에게실행결과에대한값을반환해야한다.

More information

Microsoft Word - FunctionCall

Microsoft Word - FunctionCall Function all Mechanism /* Simple Program */ #define get_int() IN KEYOARD #define put_int(val) LD A val \ OUT MONITOR int add_two(int a, int b) { int tmp; tmp = a+b; return tmp; } local auto variable stack

More information

제9장 프로세스 제어

제9장 프로세스 제어 제 9 장프로세스제어 리눅스시스템프로그래밍 청주대학교전자공학과 한철수 제 9 장 목차 프로세스생성 프로그램실행 입출력재지정 프로세스그룹 시스템부팅 2 9.1 절 프로세스생성 fork() 시스템호출 새로운프로그램을실행하기위해서는먼저새로운프로세스를생성해야하는데, fork() 시스템호출이새로운프로세스를생성하는유일한방법임. 함수프로토타입 pid_t fork(void);

More information

임베디드시스템설계강의자료 6 system call 1/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과

임베디드시스템설계강의자료 6 system call 1/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 임베디드시스템설계강의자료 6 system call 1/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 시스템호출개요 리눅스에서는사용자공간과커널공간을구분 사용자프로그램은사용자모드, 운영체제는커널모드에서수행 커널공간에대한접근은커널 ( 특권, priviledged) 모드에서가능 컴퓨팅자원 (CPU, memory, I/O 등 ) 을안전하게보호 커널수행을안전하게유지

More information

Microsoft PowerPoint - chap6 [호환 모드]

Microsoft PowerPoint - chap6 [호환 모드] 제 6 장프로세스 (Process) 숙대창병모 1 내용 프로세스시작 / 종료 명령중인수 / 환경변수 메모리배치 / 할당 비지역점프 숙대창병모 2 프로세스시작 / 종료 숙대창병모 3 Process Start Kernel exec system call user process Cstart-up routine call return int main(int argc,

More information

사용자수준의스레드 : 사용자의라이브러리에의해운영, 속도는빠르나, 구현이복잡하다. 커널수준의스레드 : 운영체제커널에의해운영, 속도는느리나, 구현이단순하다. 스케줄링 (Scheduling) 1) 스케줄링의정의 프로세스가생성되어실행될때필요한시스템의여러자원을해당프로세스에게할당

사용자수준의스레드 : 사용자의라이브러리에의해운영, 속도는빠르나, 구현이복잡하다. 커널수준의스레드 : 운영체제커널에의해운영, 속도는느리나, 구현이단순하다. 스케줄링 (Scheduling) 1) 스케줄링의정의 프로세스가생성되어실행될때필요한시스템의여러자원을해당프로세스에게할당 프로세스 (Process) 1) 프로세스의개념 프로세서에의해처리되어지는사용자프로그램및시스템프로그램을의미한다. 현재실행중인프로그램이며 Job(=Task) 이라고도한다. PCB를가지는프로그램으로비동기적인행위를일으키는주체이며실제주기억장치에저장된프로그램이다. 운영체제가관리하는실행단위이며프로시저 ( 프로그램내의하위프로그램 ) 가활동중인것을의미한다. 2) 프로세스의상태전이과정

More information

제11장 프로세스와 쓰레드

제11장 프로세스와 쓰레드 제9장자바쓰레드 9.1 Thread 기초 (1/5) 프로그램 명령어들의연속 (a sequence of instruction) 프로세스 / Thread 실행중인프로그램 (program in execution) 프로세스생성과실행을위한함수들 자바 Thread 2 9.1 Thread 기초 (2/5) 프로세스단위작업의문제점 프로세스생성시오버헤드 컨텍스트스위치오버헤드

More information

임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과

임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 System call table and linkage v Ref. http://www.ibm.com/developerworks/linux/library/l-system-calls/ - 2 - Young-Jin Kim SYSCALL_DEFINE 함수

More information

Microsoft PowerPoint - 15-MARS

Microsoft PowerPoint - 15-MARS MARS 소개및실행 어셈블리프로그램실행예 순천향대학교컴퓨터공학과이상정 1 MARS 소개및실행 순천향대학교컴퓨터공학과 2 MARS 소개 MARS MIPS Assembler and Runtime Simulator MIPS 어셈블리언어를위한소프트웨어시뮬레이터 미주리대학 (Missouri State Univ.) 의 Ken Vollmar 등이자바로개발한교육용시뮬레이터

More information

C 프로그래밍 언어 입문 C 프로그래밍 언어 입문 김명호저 숭실대학교 출판국 머리말..... C, C++, Java, Fortran, Python, Ruby,.. C. C 1972. 40 C.. C. 1999 C99. C99. C. C. C., kmh ssu.ac.kr.. ,. 2013 12 Contents 1장 프로그래밍 시작 1.1 C 10 1.2 12

More information

<4D F736F F F696E74202D20322DBDC7BDC3B0A320BFEEBFB5C3BCC1A6>

<4D F736F F F696E74202D20322DBDC7BDC3B0A320BFEEBFB5C3BCC1A6> 컴퓨터시스템구성 2. 실시간운영체제 1 2 운영체제의주요기능 프로세스관리 (Process management) 메모리관리 (Memory management) 인터럽트핸들링 (Interrupt handling) 예외처리 (Exception handling) 프로세스동기화 (Process synchronization) 프로세스스케쥴링 (Process scheduling)

More information

리눅스 프로세스 관리

리눅스 프로세스 관리 프로세스 (Process) Process 프로그램이나명령어를실행하면메모리에적재되어실제로실행되고있는상태를의미 이러한프로세스들은프로세스가시작하면서할당받는프로세스식별번호인 PID(Process ID), 해당프로세스를실행한부모프로세스를나타내는 PPID(Parent Process ID), UID 와 GID 정보를통해해당프로세스가어느사용자에속해있는지, 프로세스가파일에대해갖는권한및프로세스가실행된터미널,

More information

7 프로시저가활동중인것 8 실행중인프로시저의제어궤적 9 CPU가할당되는실체 운영체제가관리하는최소단위작업 (2) 프로세스상태전이도 (3) 주요프로세스상태 1 준비 (Read) 상태 : 실행하기위해준비하고있는상태 2 실행 (Run) 상태 :

7 프로시저가활동중인것 8 실행중인프로시저의제어궤적 9 CPU가할당되는실체 운영체제가관리하는최소단위작업 (2) 프로세스상태전이도 (3) 주요프로세스상태 1 준비 (Read) 상태 : 실행하기위해준비하고있는상태 2 실행 (Run) 상태 : 3 신뢰도 (Reliability) 작업의결과를얼마나정확하고믿을수있는가의요인 4 이용가능도 (Availability) 시스템의전체운영시간중에서실제가동하여사용중인시간의비율 ( 오류없이작동된시간의비율 ) (2) 다중프로그래밍에서의시간 (Time) 대기시간 기다림 A 작업 B 작업 A 작업 B 작업 A 작업 요청시간응답시간실행시간 반환시간 1 응답시간 (Response

More information

Deok9_Exploit Technique

Deok9_Exploit Technique Exploit Technique CodeEngn Co-Administrator!!! and Team Sur3x5F Member Nick : Deok9 E-mail : DDeok9@gmail.com HomePage : http://deok9.sur3x5f.org Twitter :@DDeok9 > 1. Shell Code 2. Security

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 UNIX 및실습 8 장. 프로세스와사용자 명령익히기 1 학습목표 유닉스에서프로세스가무엇인지그개념을이해한다. 프로세스와관련된유닉스명령의사용방법을익힌다. 포그라운드처리와백그라운드처리의차이를이해한다. 사용자정보를보는명령의사용방법을익힌다. 2 01. 프로세스의개념과종류 프로세스 (process) 현재시스템에서실행중인프로그램 프로세스는고유번호를가진다. Process

More information

KEY 디바이스 드라이버

KEY 디바이스 드라이버 KEY 디바이스드라이버 임베디드시스템소프트웨어 I (http://et.smu.ac.kr et.smu.ac.kr) 차례 GPIO 및 Control Registers KEY 하드웨어구성 KEY Driver 프로그램 key-driver.c 시험응용프로그램 key-app.c KEY 디바이스드라이버 11-2 GPIO(General-Purpose Purpose I/O)

More information

10.

10. 10. 10.1 10.2 Library Routine: void perror (char* str) perror( ) str Error 0 10.3 10.3 int fd; /* */ fd = open (filename, ) /*, */ if (fd = = -1) { /* */ } fcnt1 (fd, ); /* */ read (fd, ); /* */ write

More information

chap 5: Trees

chap 5: Trees 5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경

More information

PCServerMgmt7

PCServerMgmt7 Web Windows NT/2000 Server DP&NM Lab 1 Contents 2 Windows NT Service Provider Management Application Web UI 3 . PC,, Client/Server Network 4 (1),,, PC Mainframe PC Backbone Server TCP/IP DCS PLC Network

More information

JVM 메모리구조

JVM 메모리구조 조명이정도면괜찮조! 주제 JVM 메모리구조 설미라자료조사, 자료작성, PPT 작성, 보고서작성. 발표. 조장. 최지성자료조사, 자료작성, PPT 작성, 보고서작성. 발표. 조원 이용열자료조사, 자료작성, PPT 작성, 보고서작성. 이윤경 자료조사, 자료작성, PPT작성, 보고서작성. 이수은 자료조사, 자료작성, PPT작성, 보고서작성. 발표일 2013. 05.

More information

Microsoft PowerPoint APUE(Intro).ppt

Microsoft PowerPoint APUE(Intro).ppt 컴퓨터특강 () [Ch. 1 & Ch. 2] 2006 년봄학기 문양세강원대학교컴퓨터과학과 APUE 강의목적 UNIX 시스템프로그래밍 file, process, signal, network programming UNIX 시스템의체계적이해 시스템프로그래밍능력향상 Page 2 1 APUE 강의동기 UNIX 는인기있는운영체제 서버시스템 ( 웹서버, 데이터베이스서버

More information

Chapter #01 Subject

Chapter #01  Subject Device Driver March 24, 2004 Kim, ki-hyeon 목차 1. 인터럽트처리복습 1. 인터럽트복습 입력검출방법 인터럽트방식, 폴링 (polling) 방식 인터럽트서비스등록함수 ( 커널에등록 ) int request_irq(unsigned int irq, void(*handler)(int,void*,struct pt_regs*), unsigned

More information

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx #include int main(void) { int num; printf( Please enter an integer "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 을 작성하면서 C 프로그램의

More information

학습목표 ü 01_ 소개 ü 02_ 스케줄링수준 ü 03_ 선점형 / 비선점형스케줄링 ü 04_ 우선순위 ü 05_ 스케줄링목적 ü 06_ 스케줄링기준 ü 07_ 스케줄링알고리즘 ü 08_ 데드라인스케줄링 ü 09_ 실시간스케줄링 ü 10_ 자바스레드스케줄링 2/23

학습목표 ü 01_ 소개 ü 02_ 스케줄링수준 ü 03_ 선점형 / 비선점형스케줄링 ü 04_ 우선순위 ü 05_ 스케줄링목적 ü 06_ 스케줄링기준 ü 07_ 스케줄링알고리즘 ü 08_ 데드라인스케줄링 ü 09_ 실시간스케줄링 ü 10_ 자바스레드스케줄링 2/23 Ch08_ 프로세서스케줄링 운영체제론 학습목표 ü 01_ 소개 ü 02_ 스케줄링수준 ü 03_ 선점형 / 비선점형스케줄링 ü 04_ 우선순위 ü 05_ 스케줄링목적 ü 06_ 스케줄링기준 ü 07_ 스케줄링알고리즘 ü 08_ 데드라인스케줄링 ü 09_ 실시간스케줄링 ü 10_ 자바스레드스케줄링 2/23 01_ 소개 o 프로세서스케줄링정책 주어진시간에시스템이실행할프로세스를선택하는작업

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 System Software Experiment 1 Lecture 5 - Array Spring 2019 Hwansoo Han (hhan@skku.edu) Advanced Research on Compilers and Systems, ARCS LAB Sungkyunkwan University http://arcs.skku.edu/ 1 배열 (Array) 동일한타입의데이터가여러개저장되어있는저장장소

More information

제1장 Unix란 무엇인가?

제1장  Unix란 무엇인가? 1 12 장파이프 2 12.1 파이프 파이프원리 $ who sort 파이프 3 물을보내는수도파이프와비슷 한프로세스는쓰기용파일디스크립터를이용하여파이프에데이터를보내고 ( 쓰고 ) 다른프로세스는읽기용파일디스크립터를이용하여그파이프에서데이터를받는다 ( 읽는다 ). 한방향 (one way) 통신 파이프생성 파이프는두개의파일디스크립터를갖는다. 하나는쓰기용이고다른하나는읽기용이다.

More information

Sena Technologies, Inc. HelloDevice Super 1.1.0

Sena Technologies, Inc. HelloDevice Super 1.1.0 HelloDevice Super 110 Copyright 1998-2005, All rights reserved HelloDevice 210 ()137-130 Tel: (02) 573-5422 Fax: (02) 573-7710 E-Mail: support@senacom Website: http://wwwsenacom Revision history Revision

More information

chap7.key

chap7.key 1 7 C 2 7.1 C (System Calls) Unix UNIX man Section 2 C. C (Library Functions) C 1975 Dennis Ritchie ANSI C Standard Library 3 (system call). 4 C?... 5 C (text file), C. (binary file). 6 C 1. : fopen( )

More information

BMP 파일 처리

BMP 파일 처리 BMP 파일처리 김성영교수 금오공과대학교 컴퓨터공학과 학습내용 영상반전프로그램제작 2 Inverting images out = 255 - in 3 /* 이프로그램은 8bit gray-scale 영상을입력으로사용하여반전한후동일포맷의영상으로저장한다. */ #include #include #define WIDTHBYTES(bytes)

More information

11장 포인터

11장 포인터 Dynamic Memory and Linked List 1 동적할당메모리의개념 프로그램이메모리를할당받는방법 정적 (static) 동적 (dynamic) 정적메모리할당 프로그램이시작되기전에미리정해진크기의메모리를할당받는것 메모리의크기는프로그램이시작하기전에결정 int i, j; int buffer[80]; char name[] = data structure"; 처음에결정된크기보다더큰입력이들어온다면처리하지못함

More information

Microsoft PowerPoint - chap06-5 [호환 모드]

Microsoft PowerPoint - chap06-5 [호환 모드] 2011-1 학기프로그래밍입문 (1) chapter 06-5 참고자료 변수의영역과데이터의전달 박종혁 Tel: 970-6702 Email: jhpark1@seoultech.ac.kr h k 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- ehanbit.net 자동변수 지금까지하나의함수안에서선언한변수는자동변수이다. 사용범위는하나의함수내부이다. 생존기간은함수가호출되어실행되는동안이다.

More information

Microsoft PowerPoint - o4.pptx

Microsoft PowerPoint - o4.pptx 목표 쓰레드 (thread) 개념소개 Thread API Multithreaded 프로그래밍관련이슈 4 장. 쓰레드 2 4.1 개요 쓰레드 쓰레드 (Thread ) CPU 이용의기본실행단위 단일쓰레드 (Single threaded) Processes 전통적인프로세스 한개의실행단위로구성 다중쓰레드 (Multithreaded) Process 여러개의실행쓰레드를갖는프로세스

More information

Microsoft PowerPoint - o5.pptx

Microsoft PowerPoint - o5.pptx 목표 5 장. CPU 스케줄링 multiprogramming 운영체제의기반인 CPU 스케줄링소개 다양한 CPU 스케줄링알고리즘 CPU 스케줄링알고리즘선택을위한평가기준 스케줄링알고리즘사례 1 2 5.1 기본개념 CPU-burst 시간의분포도 multiprogramming 의목적 CPU 이용률최대화 exponential ( e - x ) or hyperexponential

More information

슬라이드 1

슬라이드 1 / 유닉스시스템개요 / 파일 / 프로세스 01 File Descriptor file file descriptor file type unix 에서의파일은단지바이트들의나열임 operating system 은파일에어떤포맷도부과하지않음 파일의내용은바이트단위로주소를줄수있음 file descriptor 는 0 이나양수임 file 은 open 이나 creat 로 file

More information

ESP1ºÎ-04

ESP1ºÎ-04 Chapter 04 4.1..,..,.,.,.,. RTOS(Real-Time Operating System)., RTOS.. VxWorks(www.windriver.com), psos(www.windriver.com), VRTX(www.mento. com), QNX(www.qnx.com), OSE(www.ose.com), Nucleus(www.atinudclus.

More information

Microsoft PowerPoint - o5.pptx

Microsoft PowerPoint - o5.pptx 5 장. CPU 스케줄링 1 목표 multiprogramming 운영체제의기반인 CPU 스케줄링소개 다양한 CPU 스케줄링알고리즘 CPU 스케줄링알고리즘선택을위한평가기준 스케줄링알고리즘사례 2 5.1 기본개념 multiprogramming 의목적 CPU 이용률최대화 CPU-I/O Burst Cycle 프로세스실행은 CPU 실행과 I/O 대기의사이클로구성됨 CPU

More information

Chap06(Interprocess Communication).PDF

Chap06(Interprocess Communication).PDF Interprocess Communication 2002 2 Hyun-Ju Park Introduction (interprocess communication; IPC) IPC data transfer sharing data event notification resource sharing process control Interprocess Communication

More information

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100 2015-1 프로그래밍언어 9. 연결형리스트, Stack, Queue 2015 년 5 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) 연결리스트 (Linked List) 연결리스트연산 Stack

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 DEVELOPMENT ENVIRONMENT 2 MAKE Jo, Heeseung MAKE Definition make is utility to maintain groups of programs Object If some file is modified, make detects it and update files related with modified one 2

More information

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074> Chap #2 펌웨어작성을위한 C 언어 I http://www.smartdisplay.co.kr 강의계획 Chap1. 강의계획및디지털논리이론 Chap2. 펌웨어작성을위한 C 언어 I Chap3. 펌웨어작성을위한 C 언어 II Chap4. AT89S52 메모리구조 Chap5. SD-52 보드구성과코드메모리프로그래밍방법 Chap6. 어드레스디코딩 ( 매핑 ) 과어셈블리어코딩방법

More information

1장. 유닉스 시스템 프로그래밍 개요

1장.  유닉스 시스템 프로그래밍 개요 Unix 프로그래밍및실습 7 장. 시그널 - 과제보충 응용과제 1 부모프로세스는반복해서메뉴를출력하고사용자로부터주문을받아자식프로세스에게주문내용을알린다. (SIGUSR1) ( 일단주문을받으면음식이완료되기전까지 SIGUSR1 을제외한다른시그널은모두무시 ) timer 자식프로세스는주문을받으면조리를시작한다. ( 일단조리를시작하면음식이완성되기전까지 SIGALARM 을제외한다른시그널은모두무시

More information

A Dynamic Grid Services Deployment Mechanism for On-Demand Resource Provisioning

A Dynamic Grid Services Deployment Mechanism for On-Demand Resource Provisioning C Programming Practice (II) Contents 배열 문자와문자열 구조체 포인터와메모리관리 구조체 2/17 배열 (Array) (1/2) 배열 동일한자료형을가지고있으며같은이름으로참조되는변수들의집합 배열의크기는반드시상수이어야한다. type var_name[size]; 예 ) int myarray[5] 배열의원소는원소의번호를 0 부터시작하는색인을사용

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Development Environment 2 Jo, Heeseung make make Definition make is utility to maintain groups of programs Object If some file is modified, make detects it and update files related with modified one It

More information

2009년 상반기 사업계획

2009년 상반기 사업계획 소켓프로그래밍활용 IT CookBook, 유닉스시스템프로그래밍 학습목표 소켓인터페이스를활용한다양한프로그램을작성할수있다. 2/23 목차 TCP 기반프로그래밍 반복서버 동시동작서버 동시동작서버-exec함수사용하기 동시동작서버-명령행인자로소켓기술자전달하기 UDP 프로그래밍 3/23 TCP 기반프로그래밍 반복서버 데몬프로세스가직접모든클라이언트의요청을차례로처리 동시동작서버

More information

- 코드로읽는리눅스디바이스드라이버 강남용

- 코드로읽는리눅스디바이스드라이버 강남용 - 코드로읽는리눅스디바이스드라이버 - 2011.1.3 강남용 (nykang@ssu.ac.kr) 커널스레드 스레드란? 스레드종류 도우미인터페이스 연결리스트 해시리스트 작업큐 통지연쇄 완료인터페이스 kthread 도우미 오류처리지원 ( 원시코드살펴보기 ) 2 스레드란? - 하나의프로그램내에서실행되는함수를의미 - 일반적인프로세서의경우는한순간에하나의함수만실행되지만,

More information

vi 사용법

vi 사용법 유닉스프로그래밍및실습 gdb 사용법 fprintf 이용 단순디버깅 확인하고자하는코드부분에 fprintf(stderr, ) 를이용하여그지점까지도달했는지여부와관심있는변수의값을확인 여러유형의단순한문제를확인할수있음 그러나자세히살펴보기위해서는디버깅툴필요 int main(void) { int count; long large_no; double real_no; init_vars();

More information

Microsoft PowerPoint - chap10-함수의활용.pptx

Microsoft PowerPoint - chap10-함수의활용.pptx #include int main(void) { int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 중 값에 의한 전달 방법과

More information

Chap04(Signals and Sessions).PDF

Chap04(Signals and Sessions).PDF Signals and Session Management 2002 2 Hyun-Ju Park (Signal)? Introduction (1) mechanism events : asynchronous events - interrupt signal from users : synchronous events - exceptions (accessing an illegal

More information

hlogin7

hlogin7 0x07. Return Oriented Programming ROP? , (DEP, ASLR). ROP (Return Oriented Programming) (excutable memory) rop. plt, got got overwrite RTL RTL Chain DEP, ASLR gadget Basic knowledge plt, got call function

More information

슬라이드 1

슬라이드 1 마이크로컨트롤러 2 (MicroController2) 2 강 ATmega128 의 external interrupt 이귀형교수님 학습목표 interrupt 란무엇인가? 기본개념을알아본다. interrupt 중에서가장사용하기쉬운 external interrupt 의사용방법을학습한다. 1. Interrupt 는왜필요할까? 함수동작을추가하여실행시키려면? //***

More information

Microsoft PowerPoint - chap06-2pointer.ppt

Microsoft PowerPoint - chap06-2pointer.ppt 2010-1 학기프로그래밍입문 (1) chapter 06-2 참고자료 포인터 박종혁 Tel: 970-6702 Email: jhpark1@snut.ac.kr 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- 포인터의정의와사용 변수를선언하는것은메모리에기억공간을할당하는것이며할당된이후에는변수명으로그기억공간을사용한다. 할당된기억공간을사용하는방법에는변수명외에메모리의실제주소값을사용하는것이다.

More information

hlogin2

hlogin2 0x02. Stack Corruption off-limit Kernel Stack libc Heap BSS Data Code off-limit Kernel Kernel : OS Stack libc Heap BSS Data Code Stack : libc : Heap : BSS, Data : bss Code : off-limit Kernel Kernel : OS

More information

제12장 파일 입출력

제12장 파일 입출력 제 4 장파일입출력 리눅스시스템프로그래밍 청주대학교전자공학과 한철수 1 시스템호출 (system call) 파일 (file) 임의접근 (random access) 주요학습내용 2 4.1 절 커널의역할 (kernel) 커널 (kernel) 은운영체제의핵심부분으로서, 하드웨어를운영관리하는여러가지서비스를제공함 파일관리 (File management) 디스크 프로세스관리

More information

Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3

Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3 Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3 Example 3.1 Files 3.2 Source code 3.3 Exploit flow

More information

제1장 Unix란 무엇인가?

제1장  Unix란 무엇인가? 4 장파일 컴퓨터과학과박환수 1 2 4.1 시스템호출 컴퓨터시스템구조 유닉스커널 (kernel) 하드웨어를운영관리하여다음과같은서비스를제공 파일관리 (File management) 프로세스관리 (Process management) 메모리관리 (Memory management) 통신관리 (Communication management) 주변장치관리 (Device

More information

<4D F736F F F696E74202D C465F4B6F F6E662DB8AEB4AABDBABFA1BCADC0C7BDC7BDC3B0A3C1F6BFF8>

<4D F736F F F696E74202D C465F4B6F F6E662DB8AEB4AABDBABFA1BCADC0C7BDC7BDC3B0A3C1F6BFF8> Korea Tech Conference 2005 년 5 월 14 일, 서울 2005 년 5 월 14 일 CE Linux Forum Korea Tech Conference 1 리눅스에서의실시간지원 정영준 / 임용관 2005 년 5 월 14 일 CE Linux Forum Korea Tech Conference 2 1. 개요 2. 스케줄러 목차 I. 고정스케줄링시간지원

More information

untitled

untitled int i = 10; char c = 69; float f = 12.3; int i = 10; char c = 69; float f = 12.3; printf("i : %u\n", &i); // i printf("c : %u\n", &c); // c printf("f : %u\n", &f); // f return 0; i : 1245024 c : 1245015

More information

구문 분석

구문 분석 컴파일러구성 제 10 강 중간언어 / 인터프리터 Motivation rapid development of machine architectures proliferation of programming languages portable & adaptable compiler design --- P_CODE porting --- rewriting only back-end

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 KeyPad Device Control - Device driver Jo, Heeseung HBE-SM5-S4210 에는 16 개의 Tack Switch 를사용하여 4 행 4 열의 Keypad 가장착 4x4 Keypad 2 KeyPad 를제어하기위하여 FPGA 내부에 KeyPad controller 가구현 KeyPad controller 16bit 로구성된

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Chapter 15 고급프로그램을 만들기위한 C... 1. main( ) 함수의숨겨진이야기 2. 헤더파일 3. 전처리문과예약어 1. main( ) 함수의숨겨진이야기 main( ) 함수의매개변수 [ 기본 14-1] main( ) 함수에매개변수를사용한예 1 01 #include 02 03 int main(int argc, char* argv[])

More information

제8장 프로세스

제8장 프로세스 제 8 장프로세스 리눅스시스템프로그래밍 청주대학교전자공학과 한철수 1 목차 쉘과프로세스 프로그램실행 프로그램종료 프로세스 ID 프로세스이미지 2 8.1 절 프로세스 프로세스 (process) 는파일과더불어리눅스운영체제의핵심개념중하나임. 리눅스시스템을깊이있게이해하기위해서는프로세스에대해서정확히이해해야함. 프로세스는간단히실행중인프로그램이라고할수있음. 프로그램이실행되면프로세스가됨.

More information

2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다.

2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다. C 언어와 Assembly Language 을사용한 Programming 20011.9 경희대학교조원경 1. AVR Studio 에서사용하는 Assembler AVR Studio에서는 GCC Assembler와 AVR Assmbler를사용한다. A. GCC Assembler : GCC를사용하는경우 (WinAVR 등을사용하는경우 ) 사용할수있다. New Project

More information

슬라이드 1

슬라이드 1 정적메모리할당 (Static memory allocation) 일반적으로프로그램의실행에필요한메모리 ( 변수, 배열, 객체등 ) 는컴파일과정에서결정되고, 실행파일이메모리에로드될때할당되며, 종료후에반환됨 동적메모리할당 (Dynamic memory allocation) 프로그램의실행중에필요한메모리를할당받아사용하고, 사용이끝나면반환함 - 메모리를프로그램이직접관리해야함

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 쉽게풀어쓴 C 언어 Express 제 9 장함수와변수 이번장에서학습할내용 변수의속성 전역, 지역변수 자동변수와정적변수 재귀호출 이번장에서는함수와변수와의관계를집중적으로살펴볼것이다. 또한함수가자기자신을호출하는재귀호출에대하여살펴본다. 변수의속성 변수의속성 : 이름, 타입, 크기, 값 + 범위, 생존시간, 연결 범위 (scope) : 변수가사용가능한범위, 가시성생존시간

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Network Programming Jo, Heeseung Network 실습 네트워크프로그래밍 멀리떨어져있는호스트들이서로데이터를주고받을수있도록프로그램을구현하는것 파일과는달리데이터를주고받을대상이멀리떨어져있기때문에소프트웨어차원에서호스트들간에연결을해주는장치가필요 이러한기능을해주는장치로소켓이라는인터페이스를많이사용 소켓프로그래밍이란용어와네트워크프로그래밍이랑용어가같은의미로사용

More information

TEL: 042-863-8301~3 FAX: 042-863-8304 5 6 6 6 6 7 7 8 8 9 9 10 10 10 10 10 11 12 12 12 13 14 15 14 16 17 17 18 1 8 9 15 1 8 9 15 9. REMOTE 9.1 Remote Mode 1) CH Remote Flow Set 0 2) GMate2000A

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

C언어 및 실습 C Language and Practice

C언어 및 실습  C Language and Practice C언어 및 실습 C Language and Practice Chap. 2 : 변수의 영역 동국대학교 멀티미디어공학과 Young-Sik Jeong C 언어메모리구조 지역변수들이저장되는곳. 정확히는지역변수와그에따른환경이같이저장된다. 복귀주소와호출함수의환경이저장된다. 동적기억장소를위한공간. 프로그램이실행되는중간에필요에의해서할당받는메모리영역을통칭한다. 크기가정해져있지않고유동적이다.

More information

제 14 장포인터활용 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다.

제 14 장포인터활용 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 제 14 장포인터활용 유준범 (JUNBEOM YOO) Ver. 2.0 jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 이중포인터란무엇인가? 포인터배열 함수포인터 다차원배열과포인터 void 포인터 포인터는다양한용도로유용하게활용될수있습니다. 2 이중포인터

More information

Microsoft PowerPoint - StallingsOS6e-Chap04.pptx

Microsoft PowerPoint - StallingsOS6e-Chap04.pptx 제 4 장. 쓰레드, SMP, 그리고마이크로커널 4 장의강의목표 쓰레드 (thread) 의개념을이해하고, 프로세스와의차이점를구별한다. 쓰레드의장단점을이해한다. 사용자수준쓰레드와커널수준쓰레드의개념을이해한다. 대칭적다중처리 (SMP) 에대해서이해한다. 마이크로커널의개념과장단점을이해한다. Windows, Solaris, Linux 의쓰레드관리및 SMP 관리기법을이해한다.

More information

MPLAB C18 C

MPLAB C18 C MPLAB C18 C MPLAB C18 MPLAB C18 C MPLAB C18 C #define START, c:\mcc18 errorlevel{0 1} char isascii(char ch); list[list_optioin,list_option] OK, Cancel , MPLAB IDE User s Guide MPLAB C18 C

More information

Microsoft PowerPoint - polling.pptx

Microsoft PowerPoint - polling.pptx 지현석 (binish@home.cnu.ac.kr) http://binish.or.kr Index 이슈화된키보드해킹 최근키보드해킹이슈의배경지식 Interrupt VS polling What is polling? Polling pseudo code Polling 을이용한키로거분석 방어기법연구 이슈화된키보드해킹 키보드해킹은연일상한가! 주식, 펀드투자의시기?! 최근키보드해킹이슈의배경지식

More information

리눅스커널-06

리눅스커널-06 C h a p t e r 06 CPU CPU CPU 1MB 600KB 500KB 4GB 512MB 1GB 230 231 Virtual Memory Physical Memory Virtual address Physical address 0 CPU 4GB 3GB 1GB 61 init proc1maps cat 0x08048000 0xC0000000 0x08048000

More information

PRO1_09E [읽기 전용]

PRO1_09E [읽기 전용] Siemens AG 1999 All rights reserved File: PRO1_09E1 Information and - ( ) 2 3 4 5 Monitor/Modify Variables" 6 7 8 9 10 11 CPU 12 Stop 13 (Forcing) 14 (1) 15 (2) 16 : 17 : Stop 18 : 19 : (Forcing) 20 :

More information

11장 포인터

11장 포인터 누구나즐기는 C 언어콘서트 제 9 장포인터 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습한다. 포인터란? 포인터 (pointer): 주소를가지고있는변수 메모리의구조 변수는메모리에저장된다. 메모리는바이트단위로액세스된다. 첫번째바이트의주소는 0, 두번째바이트는 1, 변수와메모리

More information

untitled

untitled 시스템소프트웨어 : 운영체제, 컴파일러, 어셈블러, 링커, 로더, 프로그래밍도구등 소프트웨어 응용소프트웨어 : 워드프로세서, 스프레드쉬트, 그래픽프로그램, 미디어재생기등 1 n ( x + x +... + ) 1 2 x n 00001111 10111111 01000101 11111000 00001111 10111111 01001101 11111000

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Text-LCD Device Control - Device driver Jo, Heeseung M3 모듈에장착되어있는 Tedxt LCD 장치를제어하는 App 을개발 TextLCD 는영문자와숫자일본어, 특수문자를표현하는데사용되는디바이스 HBE-SM5-S4210 의 TextLCD 는 16 문자 *2 라인을 Display 할수있으며, 이 TextLCD 를제어하기위하여

More information

1217 WebTrafMon II

1217 WebTrafMon II (1/28) (2/28) (10 Mbps ) Video, Audio. (3/28) 10 ~ 15 ( : telnet, ftp ),, (4/28) UDP/TCP (5/28) centralized environment packet header information analysis network traffic data, capture presentation network

More information

No Slide Title

No Slide Title Copyright, 2017 Multimedia Lab., UOS 시스템프로그래밍 (Assembly Code and Calling Convention) Seong Jong Choi chois@uos.ac.kr Multimedia Lab. Dept. of Electrical and Computer Eng. University of Seoul Seoul, Korea

More information

Microsoft PowerPoint - ch07 - 포인터 pm0415

Microsoft PowerPoint - ch07 - 포인터 pm0415 함수의인수 (argument) 전달방법 C 에서함수의인수전달방법 값에의한호출 (call-by-value): 기본적인방법 포인터에의한호출 (call-by-pointer): 포인터이용 참조에의한호출 (call-by-reference): 참조 (reference) 이용 7-35 값에의한호출 (call-by-value) 함수호출시에변수의값을함수에복사본으로전달 복사본이전달되며,

More information

1. auto_ptr 다음프로그램의문제점은무엇인가? void func(void) int *p = new int; cout << " 양수입력 : "; cin >> *p; if (*p <= 0) cout << " 양수를입력해야합니다 " << endl; return; 동적할

1. auto_ptr 다음프로그램의문제점은무엇인가? void func(void) int *p = new int; cout <<  양수입력 : ; cin >> *p; if (*p <= 0) cout <<  양수를입력해야합니다  << endl; return; 동적할 15 장기타주제들 auto_ptr 변환함수 cast 연산자에의한명시적형변환실행시간타입정보알아내기 (RTTI) C++ 프로그래밍입문 1. auto_ptr 다음프로그램의문제점은무엇인가? void func(void) int *p = new int; cout > *p; if (*p

More information

Sharing Memory Between Drivers and Applications

Sharing Memory Between Drivers and Applications 본컬럼에대한모든저작권은 DevGuru에있습니다. 컬럼을타사이트등에기재및링크또는컬럼내용을인용시반드시출처를밝히셔야합니다. 컬럼들을 CD나기타매체로배포하고자할경우 DevGuru에동의를얻으셔야합니다. c DevGuru Corporation. All rights reserved 기타자세한질문사항들은웹게시판이나 support@devguru.co.kr 으로 문의하기바랍니다.

More information

Microsoft PowerPoint - System Programming Lab Week1.ppt [호환 모드]

Microsoft PowerPoint - System Programming Lab Week1.ppt [호환 모드] System Programming Lab Week 1: Basic Skills for Practice Contents vi Editor 사용법 GCC 컴파일러사용법 Makefile 사용법 GDB 사용법 VI Editor Usage vi 모드 입력모드 : 실제문서를편집하는모드. 명령모드 : 키입력이바로명령이되는모드로서쓴내용을삭제하거나, 복사할때사용. ex 명령모드

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 7-Segment Device Control - Device driver Jo, Heeseung HBE-SM5-S4210 의 M3 Module 에는 6 자리를가지는 7-Segment 모듈이아래그림처럼실장 6 Digit 7-Segment 2 6-Digit 7-Segment LED controller 16비트로구성된 2개의레지스터에의해제어 SEG_Sel_Reg(Segment

More information

untitled

untitled - -, (insert) (delete) - - (insert) (delete) (top ) - - (insert) (rear) (delete) (front) A A B top A B C top push(a) push(b) push(c) A B top pop() top A B D push(d) top #define MAX_STACK_SIZE 100 int

More information