System Programming Lab

Size: px
Start display at page:

Download "System Programming Lab"

Transcription

1 System Programming Lab Week 4: Shell

2 Schedule for your own shell 1 st shell 기본기능 fork / exec Background Processing/ Sequential Execution ls, find, grep 2 nd Environment variables/ Shell variables built-in command cd, exit, set, unset, alias, unalias, umask

3 Schedule for your own shell 3 rd Signal Trap history 4 th pipe / redirection

4 Shell 쉘의시작 Text mode : 시스템에로그인하면쉘상태로진입 GUI mode : xterm 이나 hanterm 등의터미널실행으로쉘진입 쉘의역할 명령을해석하고실행 쉘의종류 bash, csh, ksh, sh, tcsh, zsh 리눅스배포본 = Kernel + Shell + Application

5 fork() 새로운프로세스생성 생성된프로세스 : 자식프로세스 (child process) fork() 를호출한프로세스 : 부모프로세스 (parent process) fork() 가이루어지는시점에서두프로세스가동시에작업수행 함수정의

6 fork() Example I #include <stdio.h> #include <string.h> #include <sys/types.h> #define MAX_COUNT 200 #define BUF_SIZE 100 int main(void){ pid_t pid; int i; char buf[buf_size]; fork(); pid = getpid(); for (i = 1; i <= MAX_COUNT; i++) { sprintf(buf, "This line is from pid %d, value = %d\n", pid, i); write(1, buf, strlen(buf)); }return; }

7 fork() Example I

8 fork() Example II #include <stdio.h> #include <sys/types.h> #define MAX_COUNT 200 void ChildProcess(void); /* child process prototype */ void ParentProcess(void); /* parent process prototype */ int main(void) { pid_t pid; } pid = fork(); if (pid == 0) ChildProcess(); else ParentProcess(); return;

9 fork() Example II void ChildProcess(void) { int i; } for (i = 1; i <= MAX_COUNT; i++){ printf("this line is from child, value = %d\n", i); sleep(1); printf(" *** Child process is done ***\n"); void ParentProcess(void){ int i; check the process tree using pstree command running this example } for (i = 1; i <= MAX_COUNT; i++){ printf("this line is from parent, value = %d\n", i); sleep(1); } printf("*** Parent is done ***\n");

10 fork() Example II

11 fork() Example II

12 fork() Example II

13 exec() family 실행파일을수행 exec 계열의함수가사용된뒤의코드는메모리에서삭제 exec 함수에인자로들어간실행파일의코드가메모리에올라감 fork() 를항상수반 exec 수행후다른코드는의미가없어짐 fork() 를이용해 child process 가 exec 를수행 exec 뒤의코드는 parent process 가수행

14 exec() family exec family execl : 실행파일수행 execle : 실행파일에환경변수를인자로넘겨줌 execlp : 현재디렉토리의실행파일수행 execv : 인자를배열에저장해서실행파일수행 execve : 환경변수를인자로넘겨줌. 인자는배열에저장 execvp : 현재디렉토리의실행파일수행, 인자는배열에저장 section 8.10 exec functions 실제 exec 함수군의 prototype 정의 ( 다른 PPT 에나와있음 )

15 exec() family Int execl(const char *pathname, const char *arg0, /* (char *)0 */); 실행파일수행 Int execle(const char *pathname, const char *arg0, /* (char *)0, char *const envp[] */); 실행파일에환경변수를인자로넘겨줌 Int execlp(const char *pathname, const char *arg0,, /* (char *)0 */); 현재디렉토리의실행파일수행 Int execv(const char *pathname, *const argv[]); 인자를배열에저장해서실행파일수행 execve(const char *pathname, *const argv[], /* (char *)0, char *const envp[] */); 환경변수를인자로넘겨줌. 인자는배열에저장 execvp(const char *pathname, *const argc[]); 현재디렉토리의실행파일수행, 인자는배열에저장

16 exec() Example I #include <unistd.h> Int main(void){ puts( exec before\n ); execl( /bin/ls, ls, -l, NULL); puts( exec after..blahblah ); return; }

17 exec() Example II #include <unistd.h> Int main(void){ if(fork()==0){ execl( /bin/ls, ls, -l, NULL); } else{ wait(null); puts( Child Finished\n ); } }

18 Basic functions of Shell 명령어를받아서이를자식프로세스에서생성 예 ) 두번째주강의자료 fork & exec example

19 Background Processing background / foreground 명령끝에 & 문자를넣어실행 e.g) gcc shell.c & 작업번호와프로세스 ID 를출력하고 background 로돌아가고, 쉘프롬프트출력. 작업번호는 background 명령에순서대로부여. 사용자입력이필요한명령은 background 로보낼수없음 jobs 명령을이용하여 background process 를확인할수있음. fg/bg 명령을사용하여 background/foreground 상태에서실행가능. kill 명령으로 background 작업멈춤

20 setpgid() #include <unistd.h> int setpgid(pid_t pid, pid_t pgid); 프로세스는 setpgid 함수를이용하여프로세스의그룹을바꿀수있음. pid 번호를가진프로세스의그룹 ID 를 pgid 그룹으로변경 pid 가 0 이면호출하는프로세스 ID 를사용 pgid 가 0 이면 pid 에해당하는프로세스가그룹리더 리턴값 : 0 success 1 fail

21 Five-State Process Model Dispatch New Admit Ready TimeOut Running Release Exit Event Occurs Event Wait Blocked New A process that has just been created but has not yet been admitted to the pool of executable processes by the operating system. Typically, a new process has not yet been loaded into main memory, although its process control block has been created

22 Five-State Process Model Dispatch New Admit Ready TimeOut Running Release Exit Event Occurs Event Wait Blocked Ready A process that is prepared to execute when given the opportunity

23 Five-State Process Model Dispatch New Admit Ready TimeOut Running Release Exit Event Occurs Event Wait Blocked Running The Process that is currently being executed. For this chapter, we will assume a computer with a single processor, so at most one process at a time can be in this state

24 Five-State Process Model Dispatch New Admit Ready TimeOut Running Release Exit Event Occurs Event Wait Blocked Blocked A process that is cannot execute until some event occurs, such as the completion of an I/O operation

25 Five-State Process Model Dispatch New Admit Ready TimeOut Running Release Exit Event Occurs Event Wait Blocked Exit A process that has been released from the pool of executable processes by the O/S, eithe because it halted or because it aborted for some reason

26 Scheduling First-Come-First-Served Non-preemptive Ai Bi Ci Di Ei A B C D E

27 Scheduling A Round Robin Preemptive B C D E Ai Bi Ci Di Ei A 3 B 6 C 2 D 1 E 5

28 Interrupt Interrupt A mechanism that peripheral devices inform an asynchronous event to Linux Due to some sort of event that is external to and independent of the currently running process Ex) Completion of I/O operation

29 Exception Exception Inform an synchronous software event to Linux Divided by zero Invalid machine code Overflow Page fault Segmentation fault Protection fault

30 Trap Trap Relates to an error or exception condition generated within the currently running process Ex) illegal file access attempt IDT ( Interrupt Description Table ) Common trap handler for 80*86 divide_error() debug() nmi(). segment_not_present(). page_fault (). 0x0 Device interrupt handler Timer_interrupt Hd_interrupt. 0x20 System_call vector System_call() 0x80

31 Signal handling 시그널 (signal) 의개념 시그널 소프트웨어인터럽트 (interrupt) 프로세스들사이에서비동기적사건의발생을젂달 시그널이름 서로다른사건을구별하기위하여여려종류의시그널을제공 모든시그널은 SIG 로시작하는이름을갖는다 시그널에대한작업 시그널의발생, 젂달, 처리

32 signal handling 시그널의종류 <sys/signal.h> 에정의 e.g) #define SIGHUP 1 #define SIGINT 2

33 signal handling 시그널의발생 (generation) 터미널에서특수키를누르는경우 하드웨어의오류 0 으로나눆경우, 잘못된메모리를참조하는경우등 kill 함수의호출 특정프로세스나프로세스그룹에서원하는시그널을발생 / 젂달한다 대상프로세스에대한권한이있어야한다. kill 명령의실행 내부적으로 kill 함수를호출한다 소프트웨어적조건 네트워크에서의데이터오류 (SIGURG), 파이프작업에서의오류 (SIGPIPE), 알람의종료 (SIGALRM) 등

34 signal handling 시그널의젂달 (delivery) 발생된시그널이수싞되어정해진방법대로처리되는것 지연 (pending) : 발생된시그널이젂달되지못한상태 시그널의블록 (block) 블록이해제되거나무시하도록변경될때까지지연된상태로남는다. 시그널마스크 (signal mask) : 블록될시그널집합

35 signal handling 시그널의처리 (disposition, action) 시그널을무시한다 (ignore) SIGKILL 과 SIGSTOP 시그널을제외한모든시그널을무시할수있다. 하드웨어오류에의해발생한시그널에대해서는주의해야한다. 시그널을처리한다 (catch) 시그널이발생하면미리등록된함수 (handler) 가수행된다 SIGKILL 과 SIGSTOP 시그널에는처리할함수를등록할수없다. 기본처리방법에따른다. (default) 특별한처리방법을선택하지않은경우 대부분시그널의기본처리방법은프로세스를종료시키는것이다.

36 signal handling 시그널처리방법의선택 typedef void(*sighandler_t)(int signo); sighandler_t signal(int signum, sighandler_t handler); 지정한시그널에대한세가지처리방법중하나를선택한다. signo 인자 : 시그널번호

37 signal handling handler 인자 SIG_IGN : 지정한시그널을무시한다. SIG_DFL : 기본처리방법에따라처리한다. 사용자정의함수 (signal handler) : 시그널이발생하면호출될함수의주소 리턴값 : 지정한시그널에대한이젂까지의처리방법

38 Signal handling When you press. Ctrl + z SIGSTOP is sent to the process. 프로세스는 blocked 상태에머물게됨. Ctrl + c SIGINT is sent to the process. 프로세스는 Terminate

39 Signal handling Example #include errhdr.h static void sig_usr(int); int main(void) { if(signal(sigusr1,sig_usr)==sig_err) err_sys( can t catch SIGUSR1 ); if(signal(sigusr2,sig_usr)==sig_err) err_sys( can t catch SIGUSR2 ); for(;;) pause(); } static void sig_usr(int signo) { if(signo==sigusr1) printf( received SIGUSR1\n ); else if(signo==sigusr2) printf( received SIGUSR2\n ); else err_dump( received signal %d\n,signo); }

40 순차실행 입력된명령어를순차적으로실행 입력서식 command1; command2; command3 e.g)mkdir test ; pwd ; ls -l

41 Assignment #3 Requirements shell 실행으로쉘시작 커맨드프롬프트는 현재위치 $ ex)root@splab $ 제작한 ls, find, grep 수행가능 Shell에서 exec으로수행하도록 하나의프로젝트로묶어서사용하도록 background 수행가능 순차실행가능 Ctrl+C(SIGINT) 시그널처리 프로그램종료되지않음 커맨드실행주에는 SIGINT 가능하게처리

42 Makefile Tips 프로젝트디렉토리구조 Makefile 에서다른디렉토리의 Makefile 호출 kwsh/makefile 의경우 make C kwls 를사용하면해당디렉토리의 makefile 을호출

43 Makefile Tips Makefile

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

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

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

<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

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

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

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 PowerPoint - chap9 [호환 모드]

Microsoft PowerPoint - chap9 [호환 모드] 제 9 장프로세스관계 숙대창병모 1 Contents 1. Logins 2. Process Groups 3. Sessions 4. Controlling Terminal 5. Job Control 숙대창병모 2 로그인 숙대창병모 3 터미널로그인 /etc/ttys: 1 line per terminal device getty: opens terminal device

More information

/chroot/lib/ /chroot/etc/

/chroot/lib/ /chroot/etc/ 구축 환경 VirtualBox - Fedora 15 (kernel : 2.6.40.4-5.fc15.i686.PAE) 작동 원리 chroot유저 ssh 접속 -> 접속유저의 홈디렉토리 밑.ssh의 rc 파일 실행 -> daemonstart실행 -> daemon 작동 -> 접속 유저만의 Jail 디렉토리 생성 -> 접속 유저의.bashrc 의 chroot 명령어

More information

Microsoft PowerPoint - 10_Signal

Microsoft PowerPoint - 10_Signal Operating System Laboratory 시그널 - IPC - 시그널의종류 - 시그널구현함수 IPC 프로세스간통신 (Inter-Process Communication) 실행중인프로세스간에데이터를주고받는기법 IPC 에는매우많은방법이있다! File Pipe/Named pipe Socket Shared memory Message passing Remote

More information

제9장 프로세스 제어

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

More information

<4D F736F F F696E74202D BDC3B1D7B3CEB0FA20BDC3B1D7B3CE20C3B3B8AE2E707074>

<4D F736F F F696E74202D BDC3B1D7B3CEB0FA20BDC3B1D7B3CE20C3B3B8AE2E707074> 10 장시그널과시그널처리 시그널과시그널처리 - sigemptyset, sigfillset - sigaddset, sigdelset, sigismember - sigaction - sigprocmask - kill, raise - alarm - pause 1 1. 서론 시그널의종류 이름설명 DA SIGABRT abort() 를호출할때발생 SIGALRM 설정된알람시간이경과한겨우발생

More information

제1장 Unix란 무엇인가?

제1장  Unix란 무엇인가? 1 시그널 2 11.1 시그널 시그널 시그널은예기치않은사건이발생할때이를알리는소프트웨어인터럽트이다. 시그널발생예 SIGFPE 부동소수점오류 SIGPWR 정전 SIGALRM 알람시계울림 SIGCHLD 자식프로세스종료 SIGINT 키보드로부터종료요청 (Ctrl-C) SIGSTP 키보드로부터정지요청 (Ctrl-Z) 3 주요시그널 시그널이름 의미 기본처리 SIGABRT

More information

Microsoft PowerPoint - 10_Process

Microsoft PowerPoint - 10_Process Linux 프로세스프로그래밍 Programming - 프로세스생성 : fork, exec - 프로세스동기화 : wait - 프로세스관리함수 프로세스관련함수 프로세스생성과종료 함수 의미 fork 자신과완전히동일한프로세스를생성한다. exec 계열지정한실행파일로부터프로세스를생성한다. exit 종료에따른상태값을부모프로세스에게전달하며프로세스를종료한다. atexit exit

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

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

본 강의에 들어가기 전

본 강의에 들어가기 전 유닉스프로그래밍및실습 9 장. 시그널 1. 시그널개념 시그널생명주기 시그널이발생한다. 커널이해당시그널을쌓아둔다.( 동일한시그널이오는경우하나만 ) 가능한시점에서커널이적절하게처리한다 커널의처리방법 시그널무시 아무런동작을하지않는다 절대무시할수없는시그널 SIGKILL SIGSTOP 시그널을붙잡아처리 현재코드경로를따라가는실행을중단하고, 시그널마다등록된함수로점프 기본동작

More information

제1장 Unix란 무엇인가?

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

More information

<C1A63130C0E5C7C1B7CEBCBCBDBA2E687770>

<C1A63130C0E5C7C1B7CEBCBCBDBA2E687770> 제 10 장프로세스프로그래밍 프로세스시작 / 종료 자식프로세스생성 프로세스내에서새로운프로그램실행 시그널 시스템부팅 10.1 프로그램시작및종료 Unix 에서프로그램은어떻게실행이시작되고종료될까? 프로그램은 10.3 절에서살펴볼 exec 시스템호출에의해실행된다. 이호출은실행될프로그램의시작루틴에게명령줄인수 (command-line arguments) 와환경변수 (environment

More information

Microsoft PowerPoint - 09-Pipe

Microsoft PowerPoint - 09-Pipe 9. 파이프 상명대학교소프트웨어학부 파이프 시그널은이상한사건이나오류를처리하는데는이용하지만, 한프로세스로부터다른프로세스로대량의정보를전송하는데는부적합하다. 파이프 한프로세스를다른관련된프로세스에연결시켜주는단방향의통신채널 2 pipe() Usage #include int pipe(int filedes[2]); 3 < ex_1.c > #include

More information

리눅스 프로세스 관리

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

More information

슬라이드 1

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

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

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

Microsoft PowerPoint - ch09_파이프 [호환 모드]

Microsoft PowerPoint - ch09_파이프 [호환 모드] 학습목표 파이프를이용한 IPC 기법을이해한다. 이름없는파이프를이용해통신프로그램을작성할수있다. 이름있는파이프를이용해통신프로그램을작성할수있다. 파이프 IT CookBook, 유닉스시스템프로그래밍 2/20 목차 파이프의개념 이름없는파이프만들기 복잡한파이프생성 양방향파이프활용 이름있는파이프만들기 파이프의개념 파이프 두프로세스간에통신할수있도록해주는특수파일 그냥파이프라고하면일반적으로이름없는파이프를의미

More information

2009년 상반기 사업계획

2009년 상반기 사업계획 파이프 IT CookBook, 유닉스시스템프로그래밍 학습목표 파이프를이용한 IPC 기법을이해한다. 이름없는파이프를이용해통신프로그램을작성할수있다. 이름있는파이프를이용해통신프로그램을작성할수있다. 2/20 목차 파이프의개념 이름없는파이프만들기 복잡한파이프생성 양방향파이프활용 이름있는파이프만들기 3/20 파이프의개념 파이프 두프로세스간에통신할수있도록해주는특수파일 그냥파이프라고하면일반적으로이름없는파이프를의미

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

PowerPoint 프레젠테이션

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

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

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

chap12(process).hwp

chap12(process).hwp 제 12 장프로세스 프로세스는파일과더불어유닉스운영체제가제공하는핵심개념중의하나이다. 유닉스시스템을깊이있게이해하기위해서는프로세스에대해정확히이해해야한다. 이장에서는프로그램이시작되는과정, 프로세스의구조, 프로세스생성및프로그램실행메커니즘, 프로세스사이의시그널등에대해서자세히살펴본다. 12.1 프로그램시작및종료 유닉스에서프로그램은어떻게실행이시작되고종료될까? 프로그램은 12.3절에서살펴볼

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

슬라이드 1

슬라이드 1 프로세스 (Process) (2) Chapter #9 강의목차 Process 관련시스템호출 Simple Shell Session Unix System Programming 2 프로세스정보 프로세스 ID 정보 프로세스정보 (1) PID(Process ID) 프로세스에할당되는유일한 ID( 정수값 ) PPID(Parent Process ID) 부모프로세스 ID PGID(Porcess

More information

PowerPoint 프레젠테이션

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

More information

Microsoft PowerPoint - SP6장-시그널.ppt [호환 모드]

Microsoft PowerPoint - SP6장-시그널.ppt [호환 모드] UNIX System Programming Ki-Hyun, JUNG Email : kingjung@paran.com 구성 1 장 : 기본적인개념들과기초적인용어들 2 장 : 파일을다루는시스템호출 primitives 3 장 : 파일에대한문맥상의특성 4 장 : 유닉스디렉토리개념 5 장 : 유닉스프로세스의기본적인성질과제어 6 장 : 프로세스간통신 7 장 : 유용한유닉스프로세스간통신기법

More information

3. 다음장에나오는 sigprocmask 함수의설명을참고하여다음프로그램의출력물과그출력물이화면이표시되는시점을예측하세요. ( 힌트 : 각줄이표시되는시점은다음 4 가지중하나. (1) 프로그램수행직후, (2) kill 명령실행직후, (3) 15 #include <signal.

3. 다음장에나오는 sigprocmask 함수의설명을참고하여다음프로그램의출력물과그출력물이화면이표시되는시점을예측하세요. ( 힌트 : 각줄이표시되는시점은다음 4 가지중하나. (1) 프로그램수행직후, (2) kill 명령실행직후, (3) 15 #include <signal. 학번 : 이름 : 1. 다음가정하에서아래프로그램의출력물을예측하세요. 가정 : 부모프로세스의 process id=20100, 자식프로세스의 process id=20101. int glob = 31; /* external variable in initialized data */ char buf[] = "a write to stdout\n"; int main(void)

More information

2009년 상반기 사업계획

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

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

Microsoft PowerPoint oshw1.ppt [호환 모드]

Microsoft PowerPoint oshw1.ppt [호환 모드] 과제 1 : 기본이해 제출일 : 4월 10일 ( 목 ) 까지 과제내용» 연습문제풀이 1 1.6 2 2.8 3 3.8» 프로그래밍과제 4 $ ftp 211.119.245.75 (id: anonymous, passwd: 자기loginID) 또는 (id: ftp, passwd:ftp) 한다음 # cd pub 하고 # get p.c 하여 p 프로그램의 version

More information

PowerPoint 프레젠테이션

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

More information

Microsoft PowerPoint oshw1.ppt [호환 모드]

Microsoft PowerPoint oshw1.ppt [호환 모드] 제출일 : 4월 5일 ( 목 ) 까지 과제내용» 연습문제풀이 1 1.6 2 2.8 3 3.8» 프로그래밍과제 4 5 과제 1 : 기본이해 # ftp 211.119.245.75 (id: anonymous, passwd: 자기 loginid) 또는 (id: ftp, passwd:ftp) 한다음 # cd pub 하고 # get p.c 하여 p 프로그램의 version

More information

untitled

untitled Step Motor Device Driver Embedded System Lab. II Step Motor Step Motor Step Motor source Embedded System Lab. II 2 open loop, : : Pulse, 1 Pulse,, -, 1 +5%, step Step Motor (2),, Embedded System Lab. II

More information

제8장 프로세스

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

More information

본 강의에 들어가기 전

본 강의에 들어가기 전 C 기초특강 종합과제 과제내용 구조체를이용하여교과목이름과코드를파일로부터입력받아관리 구조체를이용하여학생들의이름, 학번과이수한교과목의코드와점수를파일로부터입력 학생개인별총점, 평균계산 교과목별이수학생수, 총점및평균을계산 결과를파일에저장하는프로그램을작성 2 Makefile OBJS = score_main.o score_input.o score_calc.o score_print.o

More information

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 - (Asynchronous Mode) - - - ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 - UART (Univ ers al As y nchronous Receiver / T rans mitter) 8250A 8250A { COM1(3F8H). - Line Control Register

More information

슬라이드 1

슬라이드 1 Task 통신및동기화 : 시그널 (Signal) Chapter #10 Cooperating Processes Signal 개요 Signal 처리 Signal 전송 타이머처리 강의목차 Unix System Programming 2 Cooperating Processes (1) Independent process cannot affect or be affected

More information

Microsoft PowerPoint oshw1&2.ppt [호환 모드]

Microsoft PowerPoint oshw1&2.ppt [호환 모드] 과제 1 : 기본이해 (4 월 8 일까지 ) 1. 1장 & 2장연습문제풀이 1 1.4 2 1.17 3 2.3 4 2.7 2. 프로그래밍과제 1» 연습문제 2.18 프로그램안에서가능한한많은 system call을사용한다. ptrace, dtrace 시스템호출추적방법은테스트한후수업시간에설명할예정이다. 3. 프로그래밍과제 2 ( 교재 p138 Chapter 3 프로젝트

More information

<4D F736F F F696E74202D20B8AEB4AABDBA20BFC0B7F920C3B3B8AEC7CFB1E22E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20B8AEB4AABDBA20BFC0B7F920C3B3B8AEC7CFB1E22E BC8A3C8AF20B8F0B5E55D> 리눅스 오류처리하기 2007. 11. 28 안효창 라이브러리함수의오류번호얻기 errno 변수기능오류번호를저장한다. 기본형 extern int errno; 헤더파일 라이브러리함수호출에실패했을때함수예 정수값을반환하는함수 -1 반환 open 함수 포인터를반환하는함수 NULL 반환 fopen 함수 2 유닉스 / 리눅스 라이브러리함수의오류번호얻기 19-1

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

제8장 프로세스

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

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

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

제1장 Unix란 무엇인가?

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

More information

The Pocket Guide to TCP/IP Sockets: C Version

The Pocket Guide to  TCP/IP Sockets: C Version 인터넷프로토콜 6 장 중급소켓프로그래밍 (2) 목차 제 6 장중급소켓프로그래밍 6.1 소켓옵션 6.2 시그널 6.3 넌블로킹입 / 출력 6.4 멀티태스킹 6.5 멀티플렉싱 6.6 다수의수신자처리 2 시그널 (Signal) 시그널이란? 예상치않은이벤트발생에따른일종의소프트웨어인터럽트 Ex) ctrl + c, ctrl + z, 자식프로세스의종료 외부에서프로세스에게전달할수있는유일한통로

More information

슬라이드 1

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

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

Microsoft PowerPoint - ch07_시그널 [호환 모드]

Microsoft PowerPoint - ch07_시그널 [호환 모드] 학습목표 시그널의기본개념을이해한다. 시그널을보내는방법을이해한다. 시그널을받아서처리하는기본적인방법을이해한다. 시그널집합의개념과사용방법을이해한다. sigaction 함수를사용해시그널을처리하는방법을이해한다. 알람시그널의처리방법을이해한다. 시그널관련기타함수들의사용방법을이해한다. 시그널 IT CookBook, 유닉스시스템프로그래밍 2/38 목차 시그널의개념 시그널의종류

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 오픈소스소프트웨어개발입문 (CP33992) Linux 명령어사용법 - 계속 부산대학교공과대학정보컴퓨터공학부 파일비교 cmp diff 두파일의동일성을검사하여, 차이가생기는첫번째바이트를보여줌 두파일을비교하여한파일을다른파일로전환하는편집변경을행할때에필요한동작목록을보여줌 2 [ 실습 ] 파일비교 : diff (1) $ vi Hello1.c #include

More information

Microsoft PowerPoint - u5.pptx

Microsoft PowerPoint - u5.pptx 5.1 셸의기능과종류 5. 셸 (shell) 셸 (shell) 사용자와 OS 사이의인터페이스프로그램 셸의기본기능 명령어해독기 (command interpreter) 역할수행 셸의종료 ^D( 입력끝 ), exit 명령어, 또는 logout ( 로그인셸만해당 ) 셸의추가기능 셸프로그램처리기능 shell script 표준입출력방향전환, 파이프등의다양한기능 shell의종류

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

제12장 파일 입출력

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

More information

Microsoft PowerPoint - chap13-입출력라이브러리.pptx

Microsoft PowerPoint - chap13-입출력라이브러리.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

À©µµ³×Æ®¿÷ÇÁ·Î±×·¡¹Ö4Àå_ÃÖÁ¾

À©µµ³×Æ®¿÷ÇÁ·Î±×·¡¹Ö4Àå_ÃÖÁ¾ P a 02 r t Chapter 4 TCP Chapter 5 Chapter 6 UDP Chapter 7 Chapter 8 GUI C h a p t e r 04 TCP 1 3 1 2 3 TCP TCP TCP [ 4 2] listen connect send accept recv send recv [ 4 1] PC Internet Explorer HTTP HTTP

More information

2009년 상반기 사업계획

2009년 상반기 사업계획 시그널 IT CookBook, 유닉스시스템프로그래밍 학습목표 시그널의기본개념을이해한다. 시그널을보내는방법을이해한다. 시그널을받아서처리하는기본적인방법을이해한다. 시그널집합의개념과사용방법을이해한다. sigaction 함수를사용해시그널을처리하는방법을이해한다. 알람시그널의처리방법을이해한다. 시그널관련기타함수들의사용방법을이해한다. 2/38 목차 시그널의개념 시그널의종류

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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 7-SEGMENT DEVICE CONTROL - DEVICE DRIVER Jo, Heeseung 디바이스드라이버구현 : 7-SEGMENT HBE-SM5-S4210 의 M3 Module 에는 6 자리를가지는 7-Segment 모듈이아래그림처럼실장 6 Digit 7-Segment 2 디바이스드라이버구현 : 7-SEGMENT 6-Digit 7-Segment LED

More information

untitled

untitled if( ) ; if( sales > 2000 ) bonus = 200; if( score >= 60 ) printf(".\n"); if( height >= 130 && age >= 10 ) printf(".\n"); if ( temperature < 0 ) printf(".\n"); // printf(" %.\n \n", temperature); // if(

More information

K&R2 Reference Manual 번역본

K&R2 Reference Manual 번역본 typewriter structunion struct union if-else if if else if if else if if if if else else ; auto register static extern typedef void char short int long float double signed unsigned const volatile { } struct

More information

2009년 상반기 사업계획

2009년 상반기 사업계획 메모리매핑 IT CookBook, 유닉스시스템프로그래밍 학습목표 통신프로그램이무엇인지이해한다. 메모리매핑을이용한 IPC 기법을이해한다. 메모리매핑함수를사용해프로그램을작성할수있다. 2/20 목차 메모리매핑의개념 메모리매핑함수 메모리매핑해제함수 메모리매핑의보호모드변경 파일의크기확장 매핑된메모리동기화 데이터교환하기 3/20 메모리매핑의개념 메모리매핑 파일을프로세스의메모리에매핑

More information

3. 다음장에나오는 sigprocmask 함수의설명을참고하여다음프로그램의출력물과그출력물이화면이표시되는시점을예측하세요. ( 힌트 : 각줄이표시되는시점은다음 6 가지중하나. (1) 프로그램수행직후, (2) 5 초후 (3) 10 초후 (4) 15 #include <signa

3. 다음장에나오는 sigprocmask 함수의설명을참고하여다음프로그램의출력물과그출력물이화면이표시되는시점을예측하세요. ( 힌트 : 각줄이표시되는시점은다음 6 가지중하나. (1) 프로그램수행직후, (2) 5 초후 (3) 10 초후 (4) 15 #include <signa 학번 : 이름 : 1. 다음가정하에서아래프로그램의출력물을예측하세요. 가정 : 부모프로세스의 process id=10100, 자식프로세스의 process id=10101. char buf[] = "a write to stdout\n"; int var; /* automatic variable on the stack */ pid_t pid; int glob = 31;

More information

11장 포인터

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

More information

슬라이드 1

슬라이드 1 7.4 프로세스간통신 Interprocess Communication 기본적인프로세스간통신기법 데이터스트림과파이프 data stream and pipe 정보의송수신에사용되는일련의연속된데이터 a sequence of data used to send or receive information 예 : 프로세스와파일 ( 파일디스크립터을통하여 ) 을연결해주는데이터스트림

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

untitled

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

More information

<4D F736F F F696E74202D FB8DEB8F0B8AE20B8C5C7CE205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D FB8DEB8F0B8AE20B8C5C7CE205BC8A3C8AF20B8F0B5E55D> 학습목표 통신프로그램이무엇인지이해한다. 을이용한 IPC 기법을이해한다. 함수를사용해프로그램을작성할수있다. IT CookBook, 유닉스시스템프로그래밍 2/20 목차 의개념 함수 해제함수 의보호모드변경 파일의크기확장 매핑된메모리동기화 데이터교환하기 의개념 파일을프로세스의메모리에매핑 프로세스에전달할데이터를저장한파일을직접프로세스의가상주소공간으로매핑 read, write

More information

61 62 63 64 234 235 p r i n t f ( % 5 d :, i+1); g e t s ( s t u d e n t _ n a m e [ i ] ) ; if (student_name[i][0] == \ 0 ) i = MAX; p r i n t f (\ n :\ n ); 6 1 for (i = 0; student_name[i][0]!= \ 0&&

More information

DE1-SoC Board

DE1-SoC Board 실습 1 개발환경 DE1-SoC Board Design Tools - Installation Download & Install Quartus Prime Lite Edition http://www.altera.com/ Quartus Prime (includes Nios II EDS) Nios II Embedded Design Suite (EDS) is automatically

More information

금오공대 컴퓨터공학전공 강의자료

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 14. 포인터와함수에대한이해 2013.10.09. 오병우 컴퓨터공학과 14-1 함수의인자로배열전달 기본적인인자의전달방식 값의복사에의한전달 val 10 a 10 11 Department of Computer Engineering 2 14-1 함수의인자로배열전달 배열의함수인자전달방식 배열이름 ( 배열주소, 포인터 ) 에의한전달 #include

More information

Microsoft Word - Network Programming_NewVersion_01_.docx

Microsoft Word - Network Programming_NewVersion_01_.docx 10. Unix Domain Socket 105/113 10. Unix Domain Socket 본절에서는 Unix Domain Socket(UDS) 에대한개념과이에대한실습을수행하고, 이와동시에비신뢰적인통신시스템의문제점에대해서분석하도록한다. 이번실습의목표는다음과같다. 1. Unix Domain Socket의사용법을익히고, IPC에대해서실습 2. TCP/IP의응용계층과전달계층의동작을구현및실습

More information

03장.스택.key

03장.스택.key ---------------- DATA STRUCTURES USING C ---------------- 03CHAPTER 1 ? (stack): (LIFO:Last-In First-Out) 2 : top : ( index -1 ),,, 3 : ( ) ( ) -> ->. ->.... 4 Stack ADT : (LIFO) : init():. is_empty():

More information

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for 2003 Development of the Software Generation Method using Model Driven Software Engineering Tool,,,,, Hoon-Seon Chang, Jae-Cheon Jung, Jae-Hack Kim Hee-Hwan Han, Do-Yeon Kim, Young-Woo Chang Wang Sik, Moon

More information

02.Create a shellcode that executes "/bin/sh" Excuse the ads! We need some help to keep our site up. List Create a shellcode that executes "/bin/sh" C

02.Create a shellcode that executes /bin/sh Excuse the ads! We need some help to keep our site up. List Create a shellcode that executes /bin/sh C 02.Create a shellcode that executes "/bin/sh" Excuse the ads! We need some help to keep our site up. List Create a shellcode that executes "/bin/sh" C language Assembly code Change permissions(seteuid())

More information

02장.배열과 클래스

02장.배열과 클래스 ---------------- DATA STRUCTURES USING C ---------------- CHAPTER 배열과구조체 1/20 많은자료의처리? 배열 (array), 구조체 (struct) 성적처리프로그램에서 45 명의성적을저장하는방법 주소록프로그램에서친구들의다양한정보 ( 이름, 전화번호, 주소, 이메일등 ) 를통합하여저장하는방법 홍길동 이름 :

More information

Lab 3. 실습문제 (Single linked list)_해답.hwp

Lab 3. 실습문제 (Single linked list)_해답.hwp Lab 3. Singly-linked list 의구현 실험실습일시 : 2009. 3. 30. 담당교수 : 정진우 담당조교 : 곽문상 보고서제출기한 : 2009. 4. 5. 학과 : 학번 : 성명 : 실습과제목적 : 이론시간에배운 Singly-linked list를실제로구현할수있다. 실습과제내용 : 주어진소스를이용해 Singly-linked list의각함수를구현한다.

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

UI TASK & KEY EVENT

UI TASK & KEY EVENT T9 & AUTOMATA 2007. 3. 23 PLATFORM TEAM 정용학 차례 T9 개요 새로운언어 (LDB) 추가 T9 주요구조체 / 주요함수 Automata 개요 Automata 주요함수 추후세미나계획 질의응답및토의 T9 ( 2 / 30 ) T9 개요 일반적으로 cat 이라는단어를쓸려면... 기존모드 (multitap) 2,2,2, 2,8 ( 총 6번의입력

More information

Microsoft PowerPoint - lab14.pptx

Microsoft PowerPoint - lab14.pptx Mobile & Embedded System Lab. Dept. of Computer Engineering Kyung Hee Univ. Keypad Device Control in Embedded Linux HBE-SM5-S4210 에는 16 개의 Tack Switch 를사용하여 4 행 4 열의 Keypad 가장착되어있다. 2 Keypad Device Driver

More information

vi 사용법

vi 사용법 네트워크프로그래밍 6 장과제샘플코드 - 1:1 채팅 (udp 버전 ) 과제 서버에서먼저 bind 하고그포트를다른사람에게알려줄것 클라이언트에서알려준포트로접속 서로간에키보드입력을받아상대방에게메시지전송 2 Makefile 1 SRC_DIR =../../common 2 COM_OBJS = $(SRC_DIR)/addressUtility.o $(SRC_DIR)/dieWithMessage.o

More information

교육지원 IT시스템 선진화

교육지원 IT시스템 선진화 Module 16: ioctl 을활용한 LED 제어디바이스드라이버 ESP30076 임베디드시스템프로그래밍 (Embedded System Programming) 조윤석 전산전자공학부 주차별목표 ioctl() 을활용법배우기 커널타이머와 ioctl 을활용하여 LED 제어용디바이스드라이브작성하기 2 IOCTL 을이용한드라이버제어 ioctl() 함수활용 어떤경우에는읽는용도로만쓰고,

More information

Mango-AM335x LCD Type 커널 Module Parameter에서 변경하기

Mango-AM335x LCD Type 커널 Module Parameter에서 변경하기 Mango-AM335x LCD Type 커널 Module Parameter 에서 변경하기 http://www.mangoboard.com/ http://cafe.naver.com/embeddedcrazyboys Crazy Embedded Laboratory www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology

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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Sensor Device Jo, Heeseung Sensor 실습 HBE-SM5-S4210 에는근접 / 가속도 / 컴파스센서가장착 각센서들을사용하기위한디바이스드라이버와어플리케이션을작성 2 근접 (Proximity) 센서 HBE-SM5-S4210 Camera Module 근접센서디바이스 근접센서는사물이다른사물에접촉되기이전에가까이접근하였는지를검출할목적으로사용 일반적으로생활에서자동문이나엘리베이터,

More information

13주-14주proc.PDF

13주-14주proc.PDF 12 : Pro*C/C++ 1 2 Embeded SQL 3 PRO *C 31 C/C++ PRO *C NOT! NOT AND && AND OR OR EQUAL == = SQL,,, Embeded SQL SQL 32 Pro*C C SQL Pro*C C, C Pro*C, C C 321, C char : char[n] : n int, short, long : float

More information

UI TASK & KEY EVENT

UI TASK & KEY EVENT KEY EVENT & STATE 구현 2007. 1. 25 PLATFORM TEAM 정용학 차례 Key Event HS TASK UI TASK LONG KEY STATE 구현 소스코드및실행화면 질의응답및토의 2 KEY EVENT - HS TASK hs_task keypad_scan_keypad hs_init keypad_pass_key_code keypad_init

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

歯7장.PDF

歯7장.PDF 7 Hello!! C 2 . 3 ([] ) < > [ ]; int array[10]; < > [ ][ ]; int array [3] [5]; 4 < > [ ]={ x1,,x10} ( ); (,). ({}). : int array[10]={1,2,3,4,5,6,7,8,9,10}; (" "). : char array[7]="turbo-c"; 5 int array[2][3]={{1,2},{3,4},{5,6}};

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++-¿Ïº®Çؼ³10Àå

C++-¿Ïº®Çؼ³10Àå C C++. (preprocessor directives), C C++ C/C++... C++, C. C++ C. C C++. C,, C++, C++., C++.,.. #define #elif #else #error #if #itdef #ifndef #include #line #pragma #undef #.,.,. #include #include

More information

chap7.PDF

chap7.PDF 7 Hello!! C 2 . 3 ([] ) < > [ ]; int array[10]; < > [ ][ ]; int array [3] [5]; 4 < > [ ]={ x1,,x10} ( ); (,). ({}). : int array[10]={1,2,3,4,5,6,7,8,9,10}; (" "). : char array[7]="turbo-c"; 5 int array[2][3]={{1,2},{3,4},{5,6}};

More information