Linux 의대표적인방화벽모듈로는 iptables 가있다. 2. Netfilter Netfilter 는표준 Berkeley socket interface 의외부에존재하는 packet mangling 에대한 framework 로, 크게네부분으로구성된다. 먼저각각의프로토콜

Size: px
Start display at page:

Download "Linux 의대표적인방화벽모듈로는 iptables 가있다. 2. Netfilter Netfilter 는표준 Berkeley socket interface 의외부에존재하는 packet mangling 에대한 framework 로, 크게네부분으로구성된다. 먼저각각의프로토콜"

Transcription

1 양희철 / 이화경부산대학교정보컴퓨터공학부정보보호동아리 Keeper Heecheol, Yang / Hhakyung, Lee Keeper. Dept. of CSE, Pusan National University shrtngo@gmail.com / pongpong21@naver.com 2010 년 5 월 27 일 요약 이문서는 Linux의 Netfilter Framework를이용하여 Network 상의 Packet를분석하고 Accept & Drop 하는방법을담고있다. Netfilter Framework는 Linux Network Stack 사이에서움직이는 Packet를 Hooking하는기능을제공하며이를이용하면다양한네트워크조작이가능하다. Netfilter는 Kernel-Level에서동작하므로 Kernel에포함되거나 Module로서동작가능하며, 이문서에서는 Module로서의사용법을다룬다. 나아가이것들을이용하여간단한 Firewall Module을제작하여 Packet을분석후조건에맞게 Filtering 해본다. 주제어 : Netfilter, Packet, Filter, Module, Linux, Firewall 1. Introduction Firewall( 방화벽 ) 은네트워크의특정계층사이에존재하여정책에따라계층과계층사이의 데이터통신을감시하고, 필요시에는이것을차단하거나허용하는역할을하는모듈 (Module) 이다. 이모듈은하드웨어가될수도있고, 소프트웨어도될수있다. 일반적으로방화벽이네트워크를감시하는방식은계층과계층사이의패킷을분석하는방식이다. 자신을통과하는패킷들에포함되어있는각종계층의헤더파일을분석하여 IP주소, Port등을알아내는것뿐만아니라헤더외에실제데이터의내용도분석하여위험한데이터는차단하는등의방식도가능하다. 이렇게방화벽은계층사이의모든계층을감시해야하기때문에, 물리적, 논리적으로모든 패킷이공통적으로반드시지나가게되는위치에설치를해야한다. Dept. of Computer Science & Engineering 1/18 Pusan National University

2 Linux 의대표적인방화벽모듈로는 iptables 가있다. 2. Netfilter Netfilter 는표준 Berkeley socket interface 의외부에존재하는 packet mangling 에대한 framework 로, 크게네부분으로구성된다. 먼저각각의프로토콜은 hooks 라는것을정의하며, 이는패킷프로토콜스택의 packet s traversal 에있는잘정의된포인터를의미한다. 이러한포인터에서, 각각의프로토콜은 packet 과 hook number 를이용하여 netfilter framework 을호출하게된다. 두번째로, 커널의일부분은각프로토콜에대하여다른 hook을감시하도록등록할수있다. 따라서패킷이넷필터프레임웍을통과할때, 누가그프로토콜과훅을등록했는지확인하게된다. 이러한것이등록되어있다면, 등록된순서대로패킷을검사하고, 패킷을무시하거나 (NF_DROP), 통과시키고 (NF_ACCEPT), 또는패킷에대한것을잊어버리도록넷필터에게지시하거나 (NF_STOLEN), 사용자공간에패킷을대기시키도록 (queuing) 넷필터에게요청한다 (NF_QUEUE). 세번째부분은대기된패킷을사용자공간으로보내기위해제어하는것으로이러한패킷은 비동기방식으로처리된다. Netfilter 는이러한저수준 framework 와더불어, 다양한모듈이작성되었으며, 이는이전 버전의커널에대하여유사한기능, 확장가능한 NAT 시스템그리고확장가능한패킷필터링시 스템을제공한다. 3. Packet Capture / Drop 대부분의모듈이그렇듯이, Netfilter 모듈은자신을처리하기위한기본정보를구조체에채워 넣은다음커널에등록하는방식으로동작하게된다. Netfilter 의경우, nf_hook_ops 구조체에이정 보가저장되는데, linux/netfilter.h 에정의되어있다. struct nf_hook_ops Dept. of Computer Science & Engineering 2/18 Pusan National University

3 struct list_head list; ; /* User fills in from here down. */ nf_hookfn *hook; struct module *owner; u_int8_t pf; unsigned int hooknum; /* Hooks are ordered in ascending priority. */ int priority; 그림 1 linux/netfilter.h : struct_netfilter_ops 여기서주의깊게봐야할것은 nf_hook *hook 멤버이다. 이멤버는패킷을받았을시실행할 hooking function 의 function pointer 를지정한다. nf_hook 타입은그림 2 와같다. typedef unsigned int nf_hookfn(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)); 그림 2 nf_hookfn 이함수가호출되면인자로여러가지정보들이넘겨지는데, 이중특히중요한 sk_buff 는실 제 NIC 에전달될패킷을가리키는포인터가저장되어있다. 이함수가어떤값을리턴하느냐에따라패킷의이동여부가결정된다. 예를들어, NF_DROP 를리턴하면이패킷은다음 Layer 로가지못하고 Drop 되며, NF_ACCEPT 를리턴하면이패킷은 다음 Layer 로이동한다. 즉어떤식으로리턴하느냐를조정하여 Packet Filtering 을할수있다. 4. Important Fields in IP & TCP Header 단순히 Packet 만을 filtering 하는것은크게의미없는행위이다. 그러나 Packet 내부의어떤 Dept. of Computer Science & Engineering 3/18 Pusan National University

4 Netfilter를이용한 Packet Capturing과 정보를이용하면원하는 Packet을 filtering 할수있다. TCP/IP의경우, 일반적으로 Packet filtering 에사용될수있는정보는 protocol, source & destination IP, source & destination Port가있을수있는데, 이는 IP Header, TCP Header 에서찾아볼수있다. 그림 3 IP Header Dept. of Computer Science & Engineering 4/18 Pusan National University

5 Netfilter를이용한 Packet Capturing과 그림 4 TCP Header IP, TCP Header는그림4, 그림 5와같이구성되어있다. Linux 에서는위와같은 Header 를 <linux/ip.h>, <linux/tcp.h> 에정의해두고있다. struct iphdr #if defined( LITTLE_ENDIAN_BITFIELD) u8 ihl:4, version:4; #elif defined ( BIG_ENDIAN_BITFIELD) u8 version:4, ihl:4; #else #error "Please fix <asm/byteorder.h>" #endif u8 tos; be16 tot_len; be16 id; be16 frag_off; u8 ttl; u8 protocol; Dept. of Computer Science & Engineering 5/18 Pusan National University

6 ; sum16 check; be32 saddr; be32 daddr; /*The options start here. */ 그림 5 IP Header - linux/ip.h : struct iphdr struct tcphdr be16 source; be16 dest; be32 seq; be32 ack_seq; #if defined( LITTLE_ENDIAN_BITFIELD) u16 res1:4, doff:4, fin:1, syn:1, rst:1, psh:1, ack:1, urg:1, ece:1, cwr:1; #elif defined( BIG_ENDIAN_BITFIELD) u16 doff:4, res1:4, cwr:1, ece:1, urg:1, ack:1, psh:1, rst:1, syn:1, fin:1; #else Dept. of Computer Science & Engineering 6/18 Pusan National University

7 #error "Adjust your <asm/byteorder.h> defines" #endif be16 window; sum16 check; be16 urg_ptr; ; 그림 6 TCP Header - linux/tcp.h : struct tcphdr 그림 3,4의각 Field는각각그림 5,6의각멤버에 mapping 되어있다. 예를들어, 패킷의목적지포트를알고싶으면 iphdr.daddr를조사하면된다. 전송된패킷에서 IP Header 를추출하려면 ip_hdr() 함수의인자로 skb 를넘겨주면 IP Header 의 포인터를리턴한다. 그리고 IP Header 의다음에 TCP Header 가위치하여있으므로그림 7 과같 은방식으로 IP Header 와 TCP Header 의포인터를얻을수있다. struct iphdr *iph = ip_hdr(skb); struct tcphdr *tcph = (struct tcphdr*)((char*)iph + sizeof(struct iphdr)); char *data = (char*)tcph + sizeof(*tcph); 그림 7 skb로부터 IP Header와 TCP Header, Original Data를얻는코드그림 7에서 data는 Application Layer에서생성한 Original Data를가리키는포인터이다. iph 에서는 Source / Destination 의 IP Address 를얻을수있는데, iph->saddr / iph ->daddr 멤버에서 알수있다. 마찬가지로 tcph 에는 Port Number 를알수있으며, tcph->saddr / tcph -> daddr 멤버에 서얻을수있다. 단이때에는 Byte Ordering 에주의하자. 5. Device Driver Module Register to Kernel Netfilter 는 Kernel Level 에서동작하는만큼 Module 로써움직인다. 즉 Netfilter Module 을작성후 등록해야동작한다. Module 의 init_module() 함수는 Module 이 Insert 될때가장먼저실행되는함수로, 여기서등 록작업을할수있다. Dept. of Computer Science & Engineering 7/18 Pusan National University

8 int init_module() netfilter_ops.hook = main_hook; netfilter_ops.pf = PF_INET; netfilter_ops.hooknum = NF_INET_PRE_ROUTING; netfilter_ops.priority = 1; nf_register_hook(&netfilter_ops); // 모듈등록 return 0; 그림 8 Netfilter 모듈등록 struct nf_hook_ops netfilter_ops 에각초기값을지정한후 nf_register_hook() 함수로등록하면 모듈로서동작이가능하다. Compile 한 Module 은 insmod 명령으로삽입가능하며, lsmod 로확인가능하고, rmmod 로제거 할수있다. 그림 9 모듈컴파일과삽입 Dept. of Computer Science & Engineering 8/18 Pusan National University

9 6. Example Source Code Simple Firewall Module 2~5 절에서설명한내용을바탕으로간단한방화벽을제작하여보자. 방화벽프로그램은은 그림 10 과같이구성되어있다. 파일 drop.c app.c myprotocol.h Makefile 설명 Netfilter Firewall Module Application that controls module Command Protocol Makefile 그림 10 방화벽소스파일의구성 drop.c 는실제방화벽 Module Source 이다. app.c 의 Application 은 Rule 를등록하는명령을 Module 에게내릴수있으며, 이예제에서는차단할 IP 주소를추가하는명령만넣었다. 필요한명 령은 myprotocol.h 에추가해서넣을수있다. Makefile 은 Module 을 Compile 하기위한 Makefile 이다. 그림 11,12,13,14,15 는 Simple Firewall 의전체소스코드이다. #include <linux/init.h> #include <linux/kernel.h> #include <linux/fs.h> #include <linux/types.h> #include <linux/fcntl.h> #include <linux/module.h> #include <linux/skbuff.h> #include <linux/netdevice.h> #include <linux/netfilter.h> #include <linux/netfilter_ipv4.h> #include <linux/in.h> #include <linux/tcp.h> #include <linux/udp.h> #include <linux/ip.h> #include "myprotocol.h" Dept. of Computer Science & Engineering 9/18 Pusan National University

10 #define DROP_NAME "drop" #define DROP_MAJOR 240 unsigned long filter_addr[10]; /* array that contains ip addresses to drop */ unsigned int filter_addr_cnt = 0; static struct nf_hook_ops netfilter_ops; struct sk_buff *sock_buff; struct file_operations drop_fops ; void add_addr(const char*); /* open() system call */ int drop_open(struct inode *inode, struct file *filp) return 0; /* close() system call */ int drop_release(struct inode *inode, struct file *filp) return 0; /* write() system call */ ssize_t drop_write(struct file *filp, const char *buf, size_t count, loff_t *fpos) struct myprotocol* pmsg = (struct myprotocol*)buf; if(pmsg->cmd == ADD_IP) char *addr = pmsg->addr; add_addr(addr); return 0; Dept. of Computer Science & Engineering 10/18 Pusan National University

11 unsigned long inet_aton(const char*); unsigned int main_hook(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff*)) int i; char *data; struct iphdr *iph = ip_hdr(skb); /* ip header*/ unsigned long saddr = 0, daddr = 0; /* ip address */ unsigned short source = 0, dest = 0; /* port number */ //tcph, udph is apart from iph 20byte(size of(struct iphdr)); struct tcphdr *tcph = (struct tcphdr*)((char*)iph + sizeof(struct iphdr)); struct udphdr *udph = (struct udphdr*)((char*)iph + sizeof(struct iphdr)); unsigned short http = 80; //http port number : 80 //get source and dest ip from iph saddr = iph->saddr; daddr = iph->daddr; //get source and dest port from tcph source = htons(tcph->source); dest = htons(tcph->dest); if(iph->protocol == IPPROTO_UDP) data = (char*)udph + sizeof(*udph); /* print udp data */ printk("<1>source : %u \t dest : %u\n %s\n",source,dest,data); for(i = 0 ; i < filter_addr_cnt ; i++) if(saddr == filter_addr[i]) Dept. of Computer Science & Engineering 11/18 Pusan National University

12 /* ip drop */ return NF_DROP; if(source == http)return NF_DROP; //http port Drop return NF_ACCEPT; int init_module() drop_fops.owner = THIS_MODULE; drop_fops.open = drop_open; drop_fops.release = drop_release; drop_fops.write = drop_write; netfilter_ops.hook = main_hook; netfilter_ops.pf = PF_INET; netfilter_ops.hooknum = NF_INET_PRE_ROUTING; netfilter_ops.priority = 1; nf_register_hook(&netfilter_ops); // 모듈등록 register_chrdev(drop_major,drop_name,&drop_fops); return 0; void cleanup_module() nf_unregister_hook(&netfilter_ops); // 모듈해제 unregister_chrdev(drop_major,drop_name); unsigned long inet_aton(const char * str) unsigned long result = 0; unsigned int iaddr[4] = 0,; unsigned char addr[4] = 0,; Dept. of Computer Science & Engineering 12/18 Pusan National University

13 int i; sscanf(str,"%d.%d.%d.%d ",iaddr,iaddr+1,iaddr+2,iaddr+3); for(i = 0 ; i < 4 ; i++) addr[i] = (char)iaddr[i]; for(i = 3 ; i > 0 ; i--) result = addr[i]; result <<= 8; result = addr[0]; return result; /* add address to drop */ void add_addr(const char *addr) filter_addr[filter_addr_cnt++] = inet_aton(addr); printk("<1> %s(%lu) drop added! \n",addr,filter_addr[filter_addr_cnt]); 그림 11 drop.c #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include "myprotocol.h" Dept. of Computer Science & Engineering 13/18 Pusan National University

14 int main() int dev; printf("open start\n"); dev = open("/dev/drop",o_rdwr O_NDELAY); printf("open end\n"); if( dev < 0 ) printf("open error!\n"); return -1; struct myprotocol msg; msg.cmd = ADD_IP; strcpy(msg.addr," "); write(dev,(char*)&msg,sizeof(msg)); close(dev); #define ADD_IP 1 그림 12 app.c struct myprotocol unsigned int cmd; char addr[256]; ; 그림 13 myprotocol.h obj-m := drop.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules 그림 14 Makefile Module 은 HTTP Port 인 80 번막도록하였고, app.c 에서 IP 를차단할 IP 목록에추가 하여 Firewall Module 이차단하도록하였다. 앞서관련내용들을설명하였고, 코드상특별히어려 Dept. of Computer Science & Engineering 14/18 Pusan National University

15 운부분은없기에 drop.c 의설명은주석정도로마무리짓겠다. Kernel-Level 에서는 inet_aton() 함 수가제공되지않아서직접구현하였다는것과 add_addr() 함수가차단할 IP 를추가한다는것정 도만염두해두자. Module 은 Application 과연동하기위해 Character Device Driver 를이용하여 I/O 를수행하도록 하였다. Character Device Driver 의설명은이문서의범주를벗어나므로생략하겠다. 그림 15 는 Firewall Module 실행후 HTTP Port(80) 을차단하여웹브라우저가접속을하지못 하는것을보여준다. 그림 15 HTTP Port를차단한모습 app.c는 라는 IP를차단하게하는데, 이 IP 주소는필자의테스트당시 IP 주소이다. 이 Host에서 Firewall이 Load되어있는 Host로 Ping Test를하였는데, Application을실행시키기전에는 IP 주소가등록되어있지않으므로 Ping Test가성공하지만실행후에는실패하게된다. 그림 16은이것을보여준다. Dept. of Computer Science & Engineering 15/18 Pusan National University

16 그림 16 Application 실행결과 마지막으로, 이방화벽은 UDP 기반의 Echo Server와 Client가서로데이터를주고받으면 UDP Packet을 Capture하여그내용을보여주는기능도수행한다. TCP의경우에는 Byte Stream 단위로전송되기때문에그내용을알기어렵지만 UDP는 Message 단위로전동되기때문에그내용을쉽게알수있다. 그림 17은그결과를보여준다. Dept. of Computer Science & Engineering 16/18 Pusan National University

17 그림 17 UDP Packet Capture 7. Conclusion Netfilter Framework 를이용하여 Packet 를 Capture 하는방법을알아보고 TCP/IP 의주요 Field 들을 확인하여보았다. Netfilter는 Packet 전송시중간에서 Hook하여이를처리할수있게해주는 Framework로, 어떻게사용하느냐에따라다양한응용이가능하다. 예를들어 Hooking Function의 Return을어떻게해주느냐에따라패킷을 Accept/Drop할수있고, 패킷의내용을알수있으므로패킷내용의조작도가능하다. Netfilter 도결국 Kernel Level Module 이기때문에 Module 로제작하여동작한다. 이 Netfilter 를이용하여서예제로간단한방화벽을제작해보았다. IP 와 TCP 의 Header 를확인 하여특정 IP 와 Port 를차단할수있게하였고, UDP Packet 인경우 Original Data 도확인하여출력하 여보았다. Dept. of Computer Science & Engineering 17/18 Pusan National University

18 User Level 이아닌 Kernel Level 에서하는작업은무궁무진하다. Netfilter 도그예이다. 하지만이 렇게 Low Level 의조작은항상시스템을불안하게하고심하게는망가뜨리게할수도있으므로 항상사용에신중을기해야할것이다. Refernces. [1] Rusty Russel, kenji, KLDP Wiki : Netfilter-Hacking HOWTO, [2] Netfilter Project, [3] 유영창, 리눅스디바이스드라이버, 한빛미디어, 2008 [4] Alessandro Rubini & Jonathan Corbet, Linux Device Driver, O Reilly Media, [5] 부산대학교이동통신연구실, 양희철 / Hee-cheol, Yang 2010 년부산대학교정보컴퓨터공학부 2 학년에재학중임. 현재정보컴퓨터공학부산하보안동아리 Keeper 에서회장을담당하고있음. 시스템소프트웨어와컴퓨터네트워크, 임베디드시스템, 전산학이론에관심이있음. 작성한주요프로그램으로 Windows Shell, Network Manager, File Manager, Internet Messenger 등이있음 Blog : 이화경 / Hwa-kyung, Lee 2010 년부산대학교정보컴퓨터공학부 4 학년에재학중임. 현재정보컴퓨터공학부산하보안동아리 Keeper 에서기술고문을담당하고있음. 컴퓨터네트워크와컴퓨터보안, 임베디드공부에관심이있음. 작성한주요프로그램으로 Firewall on Windows XP 가있음 Dept. of Computer Science & Engineering 18/18 Pusan National University

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

Microsoft Word - CPL-TR MOFI-6to4.doc

Microsoft Word - CPL-TR MOFI-6to4.doc MOFI Implementation using 6-to-4 Tunnel and Netfilter June 2012 Ji-In Kim and Nak-Jung Choi 요약 6-to-4 Tunneling 기법을이용한 MOFI 구현에대한기술문서로써구현을위해서 6-to-4 Tunneling 기 법과 netfilter, iptables 를이용한구현설계와구현과정, 실제구현에대한테스트결과를정리한문서

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 - 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

임베디드시스템설계강의자료 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

교육지원 IT시스템 선진화

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

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

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

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

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

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

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

슬라이드 1

슬라이드 1 / 임베디드시스템개요 / 임베디드운영체제 / 디바이스드라이버 01 Linux System Architecture Application Area Application System Call Interface BSD Socket Virtual File System INET(AF_INET) Kernel Area Buffer Cache Network Subsystem

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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Web server porting 2 Jo, Heeseung Web 을이용한 LED 제어 Web 을이용한 LED 제어프로그램 web 에서데이터를전송받아타겟보드의 LED 를조작하는프로그램을작성하기위해다음과같은소스파일을생성 2 Web 을이용한 LED 제어 LED 제어프로그램작성 8bitled.html 파일을작성 root@ubuntu:/working/web# vi

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

Embeddedsystem(8).PDF

Embeddedsystem(8).PDF insmod init_module() register_blkdev() blk_init_queue() blk_dev[] request() default queue blkdevs[] block_device_ops rmmod cleanup_module() unregister_blkdev() blk_cleanup_queue() static struct { const

More information

TCP.IP.ppt

TCP.IP.ppt TCP/IP TCP/IP TCP/IP TCP/IP TCP/IP Internet Protocol _ IP Address Internet Protocol _ Subnet Mask Internet Protocol _ ARP(Address Resolution Protocol) Internet Protocol _ RARP(Reverse Address Resolution

More information

Microsoft Word doc

Microsoft Word doc TCP/IP 구조 1. I.P 구조설명 2. ARP 구조설명 3. TCP 구조설명 4. UDT 구조설명 5. RIP 구조설명 6. BOOTP 구조설명 7. TFTP 구조설명 destination addr source addr type data CRC 6 6 2 46-1500 4 type 0X0800 IP datagram 2 46-1500 type 0X0806

More information

bn2019_2

bn2019_2 arp -a Packet Logging/Editing Decode Buffer Capture Driver Logging: permanent storage of packets for offline analysis Decode: packets must be decoded to human readable form. Buffer: packets must temporarily

More information

PowerPoint 프레젠테이션

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

More information

SYN flooding

SYN flooding Hacking & Security Frontier SecurityFirst SYN flooding - SYN flooding 공격의원리와코드그리고대응 by amur, myusgun, leemeca 2008. 09. myusgun Agenda 개요...3 원리...3 위협...4 잠깐! - 문서에관하여...4 이문서는...4 Code...4 대응방안...4 소스코드...5

More information

슬라이드 1

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

More information

Microsoft PowerPoint - Supplement-02-Socket Overview.ppt [호환 모드]

Microsoft PowerPoint - Supplement-02-Socket Overview.ppt [호환 모드] 소켓개요 참고문헌 : 컴퓨터네트워크프로그래밍, 김화종, 홍릉과학출판사 Socket 정의 Socket 은 Transport 계층 (TCP 나 UDP) 을이용하는 API 1982 년 BSD 유닉스 41 에서처음소개 윈도우즈의경우 Winsock 제공 JAVA 또한 Socket 프로그래밍을위한클래스제공 Socket Interface 의위치 5-7 (Ses, Pre,

More information

PowerPoint 프레젠테이션

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

More information

SMB_ICMP_UDP(huichang).PDF

SMB_ICMP_UDP(huichang).PDF SMB(Server Message Block) UDP(User Datagram Protocol) ICMP(Internet Control Message Protocol) SMB (Server Message Block) SMB? : Microsoft IBM, Intel,. Unix NFS. SMB client/server. Client server request

More information

<4D F736F F F696E74202D205BBAB0C3B75D20B8AEB4AABDBA20B5F0B9D9C0CCBDBA20B5E5B6F3C0CCB9F620B8F0B5A82E >

<4D F736F F F696E74202D205BBAB0C3B75D20B8AEB4AABDBA20B5F0B9D9C0CCBDBA20B5E5B6F3C0CCB9F620B8F0B5A82E > 안드로이드환경에서의 리눅스디바이스드라이버 문자디바이스드라이버설명 Table of contents 디바이스드라이버구조 시스템구조 모듈의기본골격 드라이버 IO 제어 안드로이드환경에서의 한백전자교육사업부 리눅스디바이스드라이버 시스템구조 쉘 응용프로그램 표준라이브러리 시스템콜 가상파일시스템 (VFS) 버퍼캐시 네트워크시스템 문자디바이스드라이버 블럭디바이스드라이버 네트워크디바이스드라이버

More information

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770>

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770> i ii iii iv v vi 1 2 3 4 가상대학 시스템의 국내외 현황 조사 가상대학 플랫폼 개발 이상적인 가상대학시스템의 미래상 제안 5 웹-기반 가상대학 시스템 전통적인 교수 방법 시간/공간 제약을 극복한 학습동기 부여 교수의 일방적인 내용전달 교수와 학생간의 상호작용 동료 학생들 간의 상호작용 가상대학 운영 공지사항,강의록 자료실, 메모 질의응답,

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

<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

Microsoft Word doc

Microsoft Word doc 1. 디바이스드라이버 [ GPIO ] 1.1. GPIO 란 GPIO(General Purpose Input/Output) 란일반적인용도로사용가능한디지털입출력기능의 Port pins 이다. S3C2410의 GPIO는총 117개이며각각이 pin 들은 input/output으로프로그램되거나인터럽트 source로사용될수있다. S3C2410의대부분의 GPIO는단순히디지털입출력뿐만아니라부가적인기능을갖고있다.

More information

Network Security - Wired Sniffing 실습 ICNS Lab. Kyung Hee University

Network Security - Wired Sniffing 실습 ICNS Lab. Kyung Hee University Network Security - Wired Sniffing 실습 ICNS Lab. Kyung Hee University Outline Network Network 구조 Source-to-Destination 간 packet 전달과정 Packet Capturing Packet Capture 의원리 Data Link Layer 의동작 Wired LAN Environment

More information

Microsoft PowerPoint - lab15.pptx

Microsoft PowerPoint - lab15.pptx Mobile & Embedded System Lab. Dept. of Computer Engineering Kyung Hee Univ. TextLCD Device Control in Embedded Linux M3 모듈에장착되어있는 Tedxt LCD 장치를제어하는 App을개발 TextLCD는영문자와숫자일본어, 특수문자를표현하는데사용되는디바이스 HBE-SM5-S4210의

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 (Host) set up : Linux Backend RS-232, Ethernet, parallel(jtag) Host terminal Target terminal : monitor (Minicom) JTAG Cross compiler Boot loader Pentium Redhat 9.0 Serial port Serial cross cable Ethernet

More information

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 Word - KPMC-400,401 SW 사용 설명서

Microsoft Word - KPMC-400,401 SW 사용 설명서 LKP Ethernet Card SW 사용설명서 Version Information Tornado 2.0, 2.2 알 림 여기에실린내용은제품의성능향상과신뢰도의증대를위하여예고없이변경될수도있습니다. 여기에실린내용의일부라도엘케이일레븐의사전허락없이어떠한유형의매체에복사되거나저장될수없으며전기적, 기계적, 광학적, 화학적인어떤방법으로도전송될수없습니다. 엘케이일레븐경기도성남시중원구상대원동

More information

Microsoft PowerPoint - L4-7Switch기본교육자료.ppt

Microsoft PowerPoint - L4-7Switch기본교육자료.ppt L4-7 Switch 기본교육자료 Pumpkin Networks. Inc. http://www.pumpkinnet.co.kr (Tel) 02-3280-9380 (Fax) 02-3280-9382 info@pumpkinnet.co.kr 기본개념 L4/L7 Switch 란? -2- 기본개념 - Switching & Routing Switching & Routing

More information

Network seminar.key

Network seminar.key Intro to Network .. 2 4 ( ) ( ). ?!? ~! This is ~ ( ) /,,,???? TCP/IP Application Layer Transfer Layer Internet Layer Data Link Layer Physical Layer OSI 7 TCP/IP Application Layer Transfer Layer 3 4 Network

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

The Pocket Guide to TCP/IP Sockets: C Version

The Pocket Guide to  TCP/IP Sockets: C Version 얇지만얇지않은 TCP/IP 소켓프로그래밍 C 2 판 4 장 UDP 소켓 제 4 장 UDP 소켓 4.1 UDP 클라이언트 4.2 UDP 서버 4.3 UDP 소켓을이용한데이터송싞및수싞 4.4 UDP 소켓의연결 UDP 소켓의특징 UDP 소켓의특성 싞뢰할수없는데이터젂송방식 목적지에정확하게젂송된다는보장이없음. 별도의처리필요 비연결지향적, 순서바뀌는것이가능 흐름제어 (flow

More information

A Hierarchical Approach to Interactive Motion Editing for Human-like Figures

A Hierarchical Approach to Interactive Motion Editing for Human-like Figures 단일연결리스트 (Singly Linked List) 신찬수 연결리스트 (linked list)? tail 서울부산수원용인 null item next 구조체복습 struct name_card { char name[20]; int date; } struct name_card a; // 구조체변수 a 선언 a.name 또는 a.date // 구조체 a의멤버접근 struct

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

Microsoft Word - MPC850 SPI Driver.doc

Microsoft Word - MPC850 SPI Driver.doc MPC850 SPI Driver 네트워크보드에서구현한 SPI Device Driver 제작및이용방법입니다. 문서작성 : 이재훈 (kingseft.lee@samsung.com) 이용한 SPI EEPROM - X5043/X5045 512 x 8 bit SPI EEPROM (4Kbits = 512bytes) - 제조사 : XICOR (www.xicor.com) -

More information

06Àå

06Àå Chapter 5 Chapter 6 Chapter 7 chapter 6 Part 1 6.1 Part 2 Part 3 145 146 Chapter 5 Chapter 6 Chapter 7 Part 1 Part 2 Part 3 147 148 Chapter 5 Chapter 6 Chapter 7 Part 1 Part 2 Part 3 149 150 Chapter 5

More information

Microsoft PowerPoint - Lecture_Note_5.ppt [Compatibility Mode]

Microsoft PowerPoint - Lecture_Note_5.ppt [Compatibility Mode] TCP Server/Client Department of Computer Engineering Kyung Hee University. Choong Seon Hong 1 TCP Server Program Procedure TCP Server socket() bind() 소켓생성 소켓번호와소켓주소의결합 listen() accept() read() 서비스처리, write()

More information

Subnet Address Internet Network G Network Network class B networ

Subnet Address Internet Network G Network Network class B networ Structure of TCP/IP Internet Internet gateway (router) Internet Address Class A Class B Class C 0 8 31 0 netid hostid 0 16 31 1 0 netid hostid 0 24 31 1 1 0 netid hostid Network Address : (A) 1 ~ 127,

More information

Microsoft PowerPoint - 10-EmbedSW-11-모듈

Microsoft PowerPoint - 10-EmbedSW-11-모듈 11. 개요 proc 파일시스템 순천향대학교컴퓨터학부이상정 1 개요 순천향대학교컴퓨터학부이상정 2 개요 커널프래그래밍 커널의일부변경시커널전체를다시컴파일해야하는번거로움 해당모듈만컴파일하고필요할때만동적으로링크시켜커널의일부로사용할수있어효율적 자주사용하지않는커널기능은메모리에상주시키지않아도됨 확장성과재사용성을높일수있음. 순천향대학교컴퓨터학부이상정 3 모듈 (module)

More information

제1장 Unix란 무엇인가?

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

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

Assign an IP Address and Access the Video Stream - Installation Guide

Assign an IP Address and Access the Video Stream - Installation Guide 설치 안내서 IP 주소 할당 및 비디오 스트림에 액세스 책임 본 문서는 최대한 주의를 기울여 작성되었습니다. 잘못되거나 누락된 정보가 있는 경우 엑시스 지사로 알려 주시기 바랍니다. Axis Communications AB는 기술적 또는 인쇄상의 오류에 대해 책 임을 지지 않으며 사전 통지 없이 제품 및 설명서를 변경할 수 있습니다. Axis Communications

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 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

임베디드시스템설계강의자료 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

일반적인 네트워크의 구성은 다음과 같다

일반적인 네트워크의 구성은 다음과 같다 W5200 Errata Sheet Document History Ver 1.0.0 (Feb. 23, 2012) First release (erratum 1) Ver 1.0.1 (Mar. 28, 2012) Add a solution for erratum 1, 2 Ver 1.0.2 (Apr. 03, 2012) Add a solution for erratum 3

More information

Adding a New Dev file

Adding a New Dev file Adding a New Dev file - 김성영, 이재혁, 김남현 - 발표자 : 김남현 목차 01 Progress 02 Device file 03 How create dev file 04 Example Progress 4 월 1 일 프로젝트방향설정 4 월 8 일 device file 추가방법조사 mem.c 파일분석 4 월 10 일 알고리즘제시필요한함수분석

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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 LED Device Control - mmap() Jo, Heeseung 디바이스제어 디바이스제어 HBE-SM5-S4210 에장착된 Peripheral 들은다양한인터페이스로연결되어있음 베이스보드에있는 LED 와 7-Segment 는 GPIO 로직접 CPU 에연결 M3 모듈인 FPGA 모듈은 FPGA 에의해서제어되며 CPU 와호스트버스로연결되어있어서프로그램에서는메모리인터페이스로인식

More information

교육지원 IT시스템 선진화

교육지원 IT시스템 선진화 Module 11: 가상디바이스드라이버작성 ESP30076 임베디드시스템프로그래밍 (Embedded System Programming) 조윤석 전산전자공학부 주차별목표 디바이스드라이버의실행과정이해하기 크로스컴파일러를이용하여가상의디바이스드라이버생성하기 Kbuild 에대해이해하기 2 file_operations 구조체 struct file_operations {

More information

제1장 Unix란 무엇인가?

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

More information

1. What is AX1 AX1 Program은 WIZnet 사의 Hardwired TCP/IP Chip인 iinchip 들의성능평가및 Test를위해제작된 Windows 기반의 PC Program이다. AX1은 Internet을통해 iinchip Evaluation

1. What is AX1 AX1 Program은 WIZnet 사의 Hardwired TCP/IP Chip인 iinchip 들의성능평가및 Test를위해제작된 Windows 기반의 PC Program이다. AX1은 Internet을통해 iinchip Evaluation 1. What is AX1 AX1 Program은 WIZnet 사의 Hardwired TCP/IP Chip인 iinchip 들의성능평가및 Test를위해제작된 Windows 기반의 PC Program이다. AX1은 Internet을통해 iinchip Evaluation Board(EVB B/D) 들과 TCP/IP Protocol로연결되며, 연결된 TCP/IP

More information

슬라이드 1

슬라이드 1 TCPdump 사용법 Neworks, Inc. (Tel) 070-7101-9382 (Fax) 02-2109-6675 ech@pumpkinne.com hp://www.pumpkinne.co.kr TCPDUMP Tcpdump 옵션 ARP 정보 ICMP 정보 ARP + ICMP 정보 IP 대역별정보 Source 및 Desinaion 대역별정보 Syn 과 syn-ack

More information

Microsoft Word doc

Microsoft Word doc 2. 디바이스드라이버 [ DIO ] 2.1. 개요 타겟보드의데이터버스를이용하여 LED 및스위치동작을제어하는방법을설명하겠다. 2.2. 회로도 2.3. 준비조건 ARM 용크로스컴파일러가설치되어있어야한다. 하드웨어적인점검을하여정상적인동작을한다고가정한다. NFS(Network File System) 를사용할경우에는 NFS가마운트되어있어야한다. 여기서는소스전문을포함하지않았다.

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

ECE30076 Embedded System Programming - LED Device Driver

ECE30076 Embedded System Programming - LED Device Driver Module 12: LED 제어디바이스드라이버 ESP30076 임베디드시스템프로그래밍 (Embedded System Programming) 조윤석 전산전자공학부 주차별목표 하드웨어제어를위한디바이스드라이버작성방법알아보기 LED 제어용디바이스드라이버작성하기 ioremap 을이용한 LED 제어디바이스드라이버 mmap 을이용한 LED 제어디바이스드라이버 2 디바이스구분

More information

Microsoft Word doc

Microsoft Word doc 1. 임베디드리눅스장비에서램디스크를이용하여루트파일시스템을구현하였을경우에는보드동작중에파일로기록된내용이전원이꺼짐과동시에소실된다. 기록된내용을영구저장하기위해서는일반적으로플래시메모리에기록하여야한다. 플래시메모리를리눅스의루트파일시스템으로사용하기위해서는 MTD (Memory Technology Device ) 블록디바이스드라이버를사용하여야한다. 타겟보드는 NAND 플래시기반의보드이다.

More information

0. 표지에이름과학번을적으시오. (6) 1. 변수 x, y 가 integer type 이라가정하고다음빈칸에 x 와 y 의계산결과값을적으시오. (5) x = (3 + 7) * 6; x = 60 x = (12 + 6) / 2 * 3; x = 27 x = 3 * (8 / 4

0. 표지에이름과학번을적으시오. (6) 1. 변수 x, y 가 integer type 이라가정하고다음빈칸에 x 와 y 의계산결과값을적으시오. (5) x = (3 + 7) * 6; x = 60 x = (12 + 6) / 2 * 3; x = 27 x = 3 * (8 / 4 Introduction to software design 2012-1 Final 2012.06.13 16:00-18:00 Student ID: Name: - 1 - 0. 표지에이름과학번을적으시오. (6) 1. 변수 x, y 가 integer type 이라가정하고다음빈칸에 x 와 y 의계산결과값을적으시오. (5) x = (3 + 7) * 6; x = 60 x

More information

망고100 보드로 놀아보자 -13

망고100 보드로 놀아보자 -13 리눅스디바이스드라이버개요 http://cafe.naver.com/embeddedcrazyboys http://www.mangoboard.com 디바이스드라이버개요 디바이스 (Device ) 네트워크어댑터, LCD 디스플레이, PCMCIA, Audio, 터미널, 키보드, 하드디스 크, 플로피디스크, 프린터등과같은주변장치들을말함 디바이스의구동에필요한프로그램, 즉디바이스드라이버가필수적으로요구

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Linux Kernel and Device Driver Jo, Heeseung 커널과의관계 시스템이지원하는하드웨어를응용프로그램에서사용할수있도록커널에서제공하는라이브러리 응용프로그램이하드웨어를제어하려면커널에자원을요청 - 응용프로그램에서는 C 라이브러리같은함수를호출 - 라이브러리내부에서는커널에게시스템콜을호출 - 커널로제어가넘어가게되면 ( 커널모드 ) 를통해서하드웨어를제어

More information

커알못의 커널 탐방기 이 세상의 모든 커알못을 위해서

커알못의 커널 탐방기 이 세상의 모든 커알못을 위해서 커알못의 커널 탐방기 2015.12 이 세상의 모든 커알못을 위해서 개정 이력 버전/릴리스 0.1 작성일자 2015년 11월 30일 개요 최초 작성 0.2 2015년 12월 1일 보고서 구성 순서 변경 0.3 2015년 12월 3일 오탈자 수정 및 글자 교정 1.0 2015년 12월 7일 내용 추가 1.1 2015년 12월 10일 POC 코드 삽입 및 코드

More information

시스템, 네트워크모니터링을통한보안강화 네트워크의미래를제시하는세미나 세미나 NetFocus 2003 : IT 관리자를위한네트워크보안방법론 피지피넷 /

시스템, 네트워크모니터링을통한보안강화 네트워크의미래를제시하는세미나 세미나 NetFocus 2003 : IT 관리자를위한네트워크보안방법론 피지피넷 / 시스템, 네트워크모니터링을통한보안강화 네트워크의미래를제시하는세미나 세미나 NetFocus 2003 : IT 관리자를위한네트워크보안방법론 피지피넷 / 팀장나병윤!dewymoon@pgpnet.com 주요내용 시스템모니터링! 패킷크기와장비의 CPU 및 Memory 사용량! SNMP를장비의상태관찰 비정상적인트래픽모니터링! Packet 분석기의다양한트래픽모니터링도구를이용한비정상적인트래픽관찰!

More information

The Pocket Guide to TCP/IP Sockets: C Version

The Pocket Guide to  TCP/IP Sockets: C Version 1 목포해양대해양컴퓨터공학과 UDP 소켓 네트워크프로그램설계 4 장 2 목포해양대해양컴퓨터공학과 목차 제 4장 UDP 소켓 4.1 UDP 클라이언트 4.2 UDP 서버 4.3 UDP 소켓을이용한데이터송신및수신 4.4 UDP 소켓의연결 3 목포해양대해양컴퓨터공학과 UDP 소켓의특징 UDP 소켓의특성 신뢰할수없는데이터전송방식 목적지에정확하게전송된다는보장이없음.

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

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

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

<4D F736F F F696E74202D E20B3D7C6AEBFF6C5A920C7C1B7CEB1D7B7A1B9D62E >

<4D F736F F F696E74202D E20B3D7C6AEBFF6C5A920C7C1B7CEB1D7B7A1B9D62E > 웹프로그래밍및실습 ( g & Practice) 문양세강원대학교 IT 대학컴퓨터과학전공 소켓 (Socket) (1/2) Socket 이란? 서버와클라이언트가서로특정한규약을사용하여데이터를전송하기위한방식 서버와클라이언트는소켓연결을기다렸다가소켓이연결되면서로데이터를전송 현재네트워크상에서의모든통신의근간은 Socket 이라할수있음 Page 2 1 소켓 (Socket) (2/2)

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Web server porting 2 Jo, Heeseung Web 을이용한 LED 제어 Web 을이용한 LED 제어프로그램 web 에서데이터를전송받아타겟보드의 LED 를조작하는프로그램을작성하기위해다음과같은소스파일을생성 2 Web 을이용한 LED 제어 LED 제어프로그램작성 8bitled.html 파일을작성 root@ubuntu:/working/web# vi

More information

SRC PLUS 제어기 MANUAL

SRC PLUS 제어기 MANUAL ,,,, DE FIN E I N T R E A L L O C E N D SU B E N D S U B M O TIO

More information

[ 네트워크 1] 3 주차 1 차시. IPv4 주소클래스 3 주차 1 차시 IPv4 주소클래스 학습목표 1. IP 헤더필드의구성을파악하고요약하여설명할수있다. 2. Subnet ID 및 Subnet Mask 를설명할수있고, 각클래스의사용가능한호스트수와사설 IP 주소및네트

[ 네트워크 1] 3 주차 1 차시. IPv4 주소클래스 3 주차 1 차시 IPv4 주소클래스 학습목표 1. IP 헤더필드의구성을파악하고요약하여설명할수있다. 2. Subnet ID 및 Subnet Mask 를설명할수있고, 각클래스의사용가능한호스트수와사설 IP 주소및네트 3 주차 1 차시 IPv4 주소클래스 학습목표 1. IP 헤더필드의구성을파악하고요약하여설명할수있다. 2. Subnet ID 및 Subnet Mask 를설명할수있고, 각클래스의사용가능한호스트수와사설 IP 주소및네트워크주소와 브로드캐스트주소를설명할수있다. 학습내용 1 : IP 헤더필드구성 1. Network Layer Fields 2. IP 헤더필드의구성 1)

More information

11장 포인터

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

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

Remote UI Guide

Remote UI Guide Remote UI KOR Remote UI Remote UI PDF Adobe Reader/Adobe Acrobat Reader. Adobe Reader/Adobe Acrobat Reader Adobe Systems Incorporated.. Canon. Remote UI GIF Adobe Systems Incorporated Photoshop. ..........................................................

More information

본 강의에 들어가기 전

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

More information

歯9장.PDF

歯9장.PDF 9 Hello!! C printf() scanf() getchar() putchar() gets() puts() fopen() fclose() fprintf() fscant() fgetc() fputs() fgets() gputs() fread() fwrite() fseek() ftell() I/O 2 (stream) C (text stream) : `/n'

More information

슬라이드 1

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

More information

hd1300_k_v1r2_Final_.PDF

hd1300_k_v1r2_Final_.PDF Starter's Kit for HelloDevice 1300 Version 11 1 2 1 2 3 31 32 33 34 35 36 4 41 42 43 5 51 52 6 61 62 Appendix A (cross-over) IP 3 Starter's Kit for HelloDevice 1300 1 HelloDevice 1300 Starter's Kit HelloDevice

More information

API 매뉴얼

API 매뉴얼 PCI-DIO12 API Programming (Rev 1.0) Windows, Windows2000, Windows NT and Windows XP are trademarks of Microsoft. We acknowledge that the trademarks or service names of all other organizations mentioned

More information

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

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 27. 파일의분할과헤더파일의디자인 2013.09.11. 오병우 컴퓨터공학과 설계 (design) 중요 27-1 프로그램의모듈화 변경, 확장등의유지보수가용이하도록설계 C 언어에서는 module 구성중요 C++, Java 등의객체지향언어에서는 class, abstraction 중요 Design Patterns 에대해 2 학년여름방학이나겨울방학에공부해보시기바랍니다.

More information

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F >

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F > 10주차 문자 LCD 의인터페이스회로및구동함수 Next-Generation Networks Lab. 5. 16x2 CLCD 모듈 (HY-1602H-803) 그림 11-18 19 핀설명표 11-11 번호 분류 핀이름 레벨 (V) 기능 1 V SS or GND 0 GND 전원 2 V Power DD or V CC +5 CLCD 구동전원 3 V 0 - CLCD 명암조절

More information

윤성우의 열혈 TCP/IP 소켓 프로그래밍

윤성우의 열혈 TCP/IP 소켓 프로그래밍 C 프로그래밍프로젝트 Chap 22. 구조체와사용자정의자료형 1 2013.10.10. 오병우 컴퓨터공학과 구조체의정의 (Structure) 구조체 하나이상의기본자료형을기반으로사용자정의자료형 (User Defined Data Type) 을만들수있는문법요소 배열 vs. 구조체 배열 : 한가지자료형의집합 구조체 : 여러가지자료형의집합 사용자정의자료형 struct

More information

OPCTalk for Hitachi Ethernet 1 2. Path. DCOMwindow NT/2000 network server. Winsock update win95. . . 3 Excel CSV. Update Background Thread Client Command Queue Size Client Dynamic Scan Block Block

More information

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어 개나리 연구소 C 언어 노트 (tyback.egloos.com) 프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어먹고 하더라구요. 그래서,

More information

슬라이드 1

슬라이드 1 Computer Networks Practice Socket 1 DK Han Junghwan Song dkhan@mmlab.snu.ac.kr jhsong@mmlab.snu.ac.kr 2012-3-26 Multimedia and Mobile communications Laboratory Introduction Client / Server model Server

More information

BMP 파일 처리

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

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

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

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

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 13. 포인터와배열! 함께이해하기 2013.10.02. 오병우 컴퓨터공학과 13-1 포인터와배열의관계 Programming in C, 정재은저, 사이텍미디어. 9 장참조 ( 교재의 13-1 은읽지말것 ) 배열이름의정체 배열이름은 Compile 시의 Symbol 로서첫번째요소의주소값을나타낸다. Symbol 로서컴파일시에만유효함 실행시에는메모리에잡히지않음

More information

<4D F736F F F696E74202D20C1A63132B0AD20B5BFC0FB20B8DEB8F0B8AEC7D2B4E7>

<4D F736F F F696E74202D20C1A63132B0AD20B5BFC0FB20B8DEB8F0B8AEC7D2B4E7> 제14장 동적 메모리 할당 Dynamic Allocation void * malloc(sizeof(char)*256) void * calloc(sizeof(char), 256) void * realloc(void *, size_t); Self-Referece NODE struct selfref { int n; struct selfref *next; }; Linked

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

Microsoft PowerPoint - e9.pptx

Microsoft PowerPoint - e9.pptx Kernel Programming 이란? 커널모드에서수행하는프로그램을작성하는것 임베디드리눅스커널프로그래밍 커널프로그래밍종류 Linux kernel core 기능추가 Linux kernel 알고리즘개선 Linux kernel 모듈프로그래밍 커널컴파일필요없음 2 Kernel Program vs. Application Program (1) Kernel Program

More information

商用

商用 商用 %{ /* * line numbering 1 */ int lineno = 1 % \n { lineno++ ECHO ^.*$ printf("%d\t%s", lineno, yytext) $ lex ln1.l $ gcc -o ln1 lex.yy.c -ll day := (1461*y) div 4 + (153*m+2) div 5 + d if a then c :=

More information