04디바이스드라이버

Size: px
Start display at page:

Download "04디바이스드라이버"

Transcription

1 Linux Device Drivers ETRI

2 ETRI 2

3 ETRI 3

4 File operation special file(=device file) (Character Device Driver) (Block Device Driver) (Network Device Driver) ETRI 4

5 Ex. (/dev/console), (/dev/ttys0) open, close, read, write Random Access File System Disk, Cdrom, Floppy socket(), bind(). Ethernet, PPP, ATM, ISDN ETRI 5

6 ETRI 6

7 ETRI 7

8 Ex. ttyxx: 4, hdaxx: 3, 2.2, (0~255) : 0, ( ) Ex. ttys0 : 48, ttys1 : 49 8 ETRI 8

9 ETRI 9

10 ETRI 10

11 struct file_operations init_module, cleanup_module gcc -c -D KERNEL -D MODULE -O2 hello.c register_chrdev(), register_blkdev(), register_netdev() struct file_operations dummy_fops = { open : dummy_open, // open read : dummy_read, // read write : dummy_write, // write release : dummy_release, // release ; ETRI 11

12 #mknod /dev/ {b,c ) #mknod /dev/led_dd c : #chmod ug+w /dev/led_dd #insmod.o ) #insmod led_dd.o #rmmod ) #rmmod led_dd (.o ) #lsmod depmod : (/lib/modules/*/modules.dep ) modprobe : modules.dep,. kerneld : / on modprobe / ETRI 12

13 main( ) / int init_module(void) : void cleanup_module(void) : dynamic linking : symbol argc/argv MODULE_PARM() : : ( b, h, i, l, s ) (ex, 2-4i ) int myint = 3; int myarray[4]; MODULE_PARM (myint, i ); MODULE_PARM (myarray, 2-4i ); insmod./hello.o myarray=1,4,3 ETRI 13

14 . #include <linux/module.h> : insmod f (minmor : 2.4.x) symbol (unresolved symbol error ) symbol export (/proc/ksyms ksyms ) inline optimizing : O ETRI 14

15 init_module() init_module() register_capability() register_capability() printk() cleanup_module() cleanup_module() unregister_capability() unregister_capability() ETRI 15

16 init_module() main() cleanup_module() register_chrdev(major,, ); unregister_chrdev( ); register_blkdev(major,, ); Unregister_blkdev( ); ETRI 16

17 file_operations struct file_operations { /* <linux/fs.h> */ struct module *owner; loff_t (*llseek) (struct file *, loff_t, int); ssize_t (*read) (struct file *, char *, size_t, loff_t *); ssize_t (*write) (struct file *, const char *, size_t, loff_t *); int (*readdir) (struct file *, void *, filldir_t); unsigned int (*poll) (struct file *, struct poll_table_struct *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); int (*flush) (struct file *); int (*release) (struct inode *, struct file *); int (*fsync) (struct file *, struct dentry *, int datasync); int (*fasync) (int, struct file *, int); int (*lock) (struct file *, int, struct file_lock *); ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *); ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *); ; ETRI 17

18 file_operations file_operations loff_t (*llseek)(struct file *, loff_t, int); read/write ssize_t (*read)(struct file *, char *, size_t, loff_t); ssize_t (*write)(struct file *, const char *, size_t, loff_t); int (*readaddr)(struct file *, void, filldir_t); unsigned int (*poll)(struct file *, struct poll_table_struct *); int (*ioctl)(strcut inode *, struct file *, unsigned int, unsigned long); ETRI 18

19 int (*mmap)(struct file *, struct vm_area_struct *); int (*open)(struct inode *, struct file *); int (*flush)(struct file *); int (*release)(struct inode *, struct file *); int (*fsync)(struct file *, struct dentry *); int (*fasync)(int, struct file *, int); int (*lock)(struct file *, int, struct file_lock *); ETRI 19

20 file_operation block_device_operation int (*open) (struct inode *inode, struct file *filp); int (*release) (struct inode *inode, struct file *filp); int (*ioctl) (struct inode *inode, struct file *filp, unsigned command, unsigned long argument); int (*check_media_change) (kdev_t dev); int (*revalidate) (kdev_t dev); read, write??? I/O, I/O, request request blk_init_queue(), blk_cleanup_queue() ETRI 20

21 Module init_module() Kernel register_blkdev() blk_init_queue() request() cleanup_module() unregister_blkdev() Blk_cleanup_queue() ETRI 21

22 module-init-tools (modprobe, insmod, rmmod, depmod, lsmod ) modules.conf modprobe.conf module aliases 2.4 MODULE_PARM module_param(name, type, perm) 2.4 MOD_INC_USE_COUNT try_module_get(&module) module_put() ETRI 22

23 2.4 version magic (,, SMP, ) link-once ELF 2.4 Makefile. vermagic.o.o.ko 2.4 ANSI C.read = simple_read ETRI 23

24 2.4 devfs_register(), file_oeprations devfs_mk_cdev() devfs_mk_bdev() workqueue interface Mutual exclusion with seqlocks Sleeping and waking up Dealing with interrupts USB driver API changes open ioctl. ETRI 24

25 ETRI 25

26 ETRI 26

27 OS OS ETRI 27

28 (base address irq ) ETRI 28

29 : : CPU : CPU.. I/O I/O I/O I/O get_free_page() : 2, 128KB kmalloc() :,, 128KB vmalloc() : get_user(), put_user() : copy_to_user(), copy_from_user() : ETRI 29

30 : request_irq() : free_irq() : #cat /proc/interrupts IRQ (cf. Bottom half) Blocking : Non-blocking : gdb CPU, ETRI 30

31 mmap(), munmap() LED : 0x LED : 8 8 LED ON/OFF ( 1: ON, 0: OFF) ETRI 31

32 #include <stdlib.h> #include <stdio.h> #define ADDR_OF_LED 0x int main(void) { /* */ if ((fd=open("/dev/mem",o_rdwr O_SYNC)) < 0) { perror("mem open fail\n"); exit (1) ; led_addr = mmap(null, 1, PROT_WRITE, MAP_SHARED, fd, ADDR_OF_LED); (1) if ( led_addr < 0 ){ /* */ printf("\n8bit LED IO Blink Example\n"); *led_addr = 0xAA; (2) blink_count = 10; blink_delay = ; for ( i=0; i<blink_count; i++) { *led_addr ^= 0xFF; (3) usleep(blink_delay); (4) *led_addr = 0x00; munmap(led_addr, 1); (5) close(fd); return 0; ETRI 32

33 ETRI 33

34 Key Button : 0x Key Button : 8 8 ( 1: ON, 0: OFF) #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> #include <asm/fcntl.h> #include <stdio.h> #define ADDR_OF_LED 0x #define ADDR_OF_KEYS0x int main(void) { int fd; unsigned char *led_addr, *kb_addr; unsigned char kb_input, shift_direction='l'; unsigned char val, val2; if ((fd=open("/dev/mem",o_rdwr O_SYNC)) < 0) { ETRI 34

35 perror("mem open fail\n"); exit ( 1 ) ; led_addr = mmap(null,1,prot_write,map_shared,fd, ADDR_OF_LED); kb_addr = mmap(null,1,prot_read,map_shared,fd, ADDR_OF_KEYS); (1) if ( led_addr < 0 kb_addr < 0 ) { close(fd); printf("mmap error: led_addr(%x) kb_addr(%x)\n", led_addr, kb_addr); exit(2); printf("\n8bit LED IO & Key Button Control Example\n"); printf(" \n"); printf(" push the s1, then left shift\n"); printf(" push the s8, then right shift\n"); printf(" otherwise exit\n"); printf(" \n"); *led_addr = 0; val = 0; val2 = 0; ETRI 35

36 while(shift_direction!= 'q') { if(shift_direction == 'l') { (2) val2 = (~( val >> 7)) & 0x1; val = (val << 1) val2; else if( shift_direction == 'r') { val2 = (~(val << 7)) & 0x80; val = (val >> 1) val2; *led_addr = val; (3) kb_input = ~(*kb_addr); (4) if( kb_input!= 0x0) { (5) if((kb_input&0x1) == 0x1) shift_direction = 'r'; else if((kb_input&0x80) == 0x80) shift_direction = 'l'; else shift_direction = 'q'; usleep(100000); *led_addr = 0x00; (6) munmap(led_addr, 1); munmap(kb_addr,1); close(fd); return 0; ETRI 36

37 #define MODULE #include <linux/module.h> int init_module(void) { printk( <1>Hello World\n ); return 0; void cleanup_module(void) { printk( <1>Goodbye world\n ); root# gcc c hello.c root# insmod hello.o root# rmmod hello ETRI 37

38 #include <linux/kernel.h> #include <linux/module.h> #include <linux/fs.h> #define DEV_NAME "virtual_device" int virtual_device_open(struct inode *, struct file *); int virtual_device_release(struct inode *, struct file *); ssize_t virtual_device_write(struct file *, const char *, size_t, loff_t *) ; ssize_t virtual_device_read(struct file *, char *, size_t, loff_t *); //Global variable static int virtual_device_usage = 0; static int virtual_device_major = 0; ETRI 38

39 /* Virtual Device file operation */ static struct file_operations vd_fops = { NULL, NULL, (void *)virtual_device_read, (void *)virtual_device_write, /* */ (void *)virtual_device_open, NULL, (void *)virtual_device_release, /* */ ; int init_module(void) { int major_num; major_num = register_chrdev(0, DEV_NAME,&vd_fops); if(major_num < 0) { /* */ virtual_device_major = major_num; return 0; ETRI 39

40 void cleanup_module(void) { if( unregister_chrdev(virtual_device_major, DEV_NAME)<0 ) printk(kern_warning"%s DRIVER CLEANUP FAIL\n", DEV_NAME); /* other cleanup code */ // Functions... int virtual_device_open(struct inode *minode, struct file *mfile) { printk("virtual_device open function called!!\n"); if(virtual_device_usage!= 0) return -EBUSY; MOD_INC_USE_COUNT; virtual_device_usage = 1; return 0; int virtual_device_release(struct inode *minode, struct file *mfile) { printk("virtual_device release function called!!\n"); MOD_DEC_USE_COUNT; virtual_device_usage = 0; return 0; ETRI 40

41 ssize_t virtual_device_write(struct file *inode, const char *gdata, size_t length, loff_t *off_what) { printk("virtual_device write function called!!\n"); return length; ssize_t virtual_device_read(struct file *inode, char *gdata, size_t length, loff_t *off_what) { printk("virtual_device read function called!!\n"); return length; ETRI 41

42 ETRI 42

43 , /dev ETRI 43

44 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #define DEV_NAME "/dev/virtual_device int main(int argc, char **argv) { int dev; char buff[10]; printf( Device driver test.\n ); dev = open (DEV_NAME, O_RDWR); if (dev == -1) { printf( device file open error!!\n ); exit(1); write( dev, "1234", 4 ); real( dev, buff, 4); close(dev); ETRI 44

45 #rmmod virtual_driver ETRI 45

46 LCD ETRI 46

47 LCD : LCD LCD ETRI 47

48 #include <linux/module.h> /* include */ #include "textlcd_drv.h void setcommand(unsigned short command){ command &= 0x00FF; outl((command 0x0000),TEXTLCDPORT_ADDRESS); udelay(50); void writebyte(char ch) { unsigned short data; data = ch & 0x00FF; outl((data 0x100),TEXTLCDPORT_ADDRESS); udelay(50); void initialize_textlcd(){ function_set(2,0); //Function Set:8bit,display 2lines,5x7 mod display_control(1,0,0); // Display on, Cursor off clear_display(); // Display clear entry_mode_set(1,0); // Entry Mode Set : shift right cursor return_home(); // go home udelay(2000); ETRI 48

49 void write_string(int row, char *str,int length){ command = row? command + 0x40 : command; setcommand(command); for(i=0;i<length;i++) { /* str LCD */ int function_set(int rows, int nfonts){ unsigned short command = 0x30; if(rows == 2) command = 0x08; else if(rows == 1) command &= 0xf7; else return -1; command = nfonts? (command 0x04) : command; setcommand(command); return 1; int display_control(int display_enable, int cursor_enable, int nblink){ unsigned short command = 0x08; command = display_enable? (command 0x04) : command; command = cursor_enable? (command 0x02) : command; command = nblink? (command 0x01) : command; setcommand(command); return 1; ETRI 49

50 int cusrsor_shit(int set_screen, int set_rightshit){ command = set_rightshit? (command 0x04) : command; setcommand(command); int entry_mode_set(int increase, int nshift){ setcommand(command); int return_home(){ setcommand(command); int clear_display(){ unsigned short command = 0x01; setcommand(command); int set_ddram_address(int pos){ ETRI 50

51 /* */ static int textlcdport_open(struct inode *minode, struct file *mfile) { initialize_textlcd(); return 0; static int textlcdport_release(struct inode *minode, struct file *mfile) { MOD_DEC_USE_COUNT; textlcdport_usage = 0; return 0; static ssize_t textlcdport_write(struct file *inode, ) { struct strcommand_varible strcommand; copy_from_user(&strcommand,gdata,32); if(strcommand.rows == 0) write_string(0,strcommand.buf,strcommand.strlength); else if(strcommand.rows == 1) write_string(1,strcommand.buf,strcommand.strlength); return length; ETRI 51

52 static int textlcdport_ioctl(struct inode *inode, struct file *file,unsigned int cmd,unsigned long gdata) { struct strcommand_varible strcommand; copy_from_user(&strcommand,(char *)gdata,32); switch(cmd){ case TEXTLCD_COMMAND_SET: setcommand(strcommand.command); break; case TEXTLCD_FUNCTION_SET: function_set((int)(strcommand.rows+1), (int)(strcommand.nfonts)); break; case TEXTLCD_DISPLAY_CONTROL: display_control((int)strcommand.display_enable, (int)strcommand.cursor_enable,(int)strcommand.nblink); break; case TEXTLCD_CURSOR_SHIFT: cusrsor_shit((int)strcommand.set_screen, return 0; static struct file_operations textlcd_fops = { write : textlcdport_write, ioctl : textlcdport_ioctl, open : textlcdport_open, release : textlcdport_release, ; ETRI 52

53 int init_module(void){ int result; result = register_chrdev(textlcdport_major,textlcdport_name, &textlcd_fops); if(result < 0) { printk(kern_warning"can't get any major\n"); return result; textlcdport_major = result; if(!check_region(textlcdport_address,textlcdport_address_range)) request_region(textlcdport_address,textlcdport_address_range, TEXTLCDPORT_NAME); else printk(kern_warning"can't get IO Region 0x%x\n", TEXTLCDPORT_ADDRESS); printk("init module, textlcdport major number : %d\n",result); return 0; void cleanup_module(void) { release_region(textlcdport_address,textlcdport_address_range); if(unregister_chrdev(textlcdport_major,textlcdport_name)) printk(kern_warning"%s DRIVER CLEANUP FALLED\n", TEXTLCDPORT_NAME); ETRI 53

54 ETRI 54

55 , /dev ETRI 55

56 #include <stdio.h> /* */ #include <sys/ioctl.h> #define TEXTLCDPORT_BASE 0xbc #define TEXTLCD_COMMAND_SET _IOW(TEXTLCDPORT_BASE,0,32) #define TEXTLCD_WRITE_BYTE _IOW(TEXTLCDPORT_BASE,8,32) struct strcommand_varible { char rows; char nfonts; char display_enable; char cursor_enable; char nblink; char set_screen; char set_rightshit; char increase; char nshift; char pos; char command; char strlength; char buf[20]; ; ETRI 56

57 int main(int argc, char **argv) { int i,dev; char welcome[20] = "Welcome to"; char welcome2[20] = "the embeded World!"; struct strcommand_varible strcommand; strcommand.rows = 0; /* strcommand */ strcommand.command = 1; printf("\nlcd Test program!!\n"); dev = open("/dev/textlcd_driver", O_WRONLY O_NDELAY ); if (dev!= -1) { ioctl(dev,textlcd_clear,&strcommand,sizeof(strcommand)); printf("write: %s\n", welcome); strcommand.pos = 10; strcommand.strlength = strlen(welcome); memcpy(strcommand.buf, welcome,20); write(dev, &strcommand, sizeof(strcommand)); strcommand.pos = 40; ioctl(dev,textlcd_dd_address,&strcommand,sizeof(strcommand)); printf("write: %s\n", welcome2); for(i=0;i<strlen(welcome2);i++) { memcpy(&strcommand.buf[0],&welcome2[i],1); ioctl(dev,textlcd_write_byte,&strcommand,sizeof(strcommand)); close(dev); ETRI 57

58 #rmmod textlcd_driver ETRI 58

59 ETRI 59

60 USB Host Controller USB Devices and Transfer Characteristics Enumeration and Device Descriptors USB Device Drivers USB Configuring USB Devices USB Transfers ETRI 60

61 PC USB , 12Mbit/s USB 2.0, Mater/Slave, ETRI 61

62 Compaq, Microsoft, National Semiconductor, Intel,, CPU ETRI 62

63 Self Powered: Bus Powered: USB Both: Low speed device:, 1.5Mbit/s Full speed device:, 12Mbit/s 90% 10Mbit/s ETRI 63

64 ETRI 64

65 3 reguest, send, configure send, request, Ex., SCSI polling Bulk interrupt request ETRI 65

66 -GET_STATUS -CLEAR_FEATURE -SET_FEATURE -SET_ADDRESS -GET_DESCRIPTOR -SET_DESCRIPTOR -GET_CONFIGURATION -SET_CONFIGURATION -GET_INTERFACE -SET_INTERFACE -SYNCH_FRAME ETRI 66

67 ETRI 67

68 USB USB, 1~127 ETRI 68

69 USB Spec. ETRI 69

70 ,, ETRI 70

71 ,,,,,,,,, Application USB Core application Application interface ETRI 71

72 2 USB ETRI 72

73 struct usb_driver { const char *name; void *(*probe)(struct usb_device *, unsigned int); void (*disconnect)(struct usb_device *, void *); struct list_head driver_list; struct file_operation *fops; int minor; name: module probe:,,, disconnect: USB, probe driver_list:, {NULL, NULL fops: minor:, 16 ETRI 73

74 void *probe( struct usb_device *dev, unsigned int interface ) { struct driver_context *context; /* Device Vendor ID Product ID interface.*/ if( dev->descriptor.idvendor == 0xXXXX && dev->descriptor.idproduct == 0xXXXX && interface == 1 ) { MOD_INC_USE_COUNT; /* Module usage count.*/ /* Driver resource. */ context = allocate_driver_resources(); /* Bind device context return.*/ return context; return NULL; ETRI 74

75 Static void disconnect(struct usb_device *usbdev, void *drv_context) { /* driver_context pointer.*/ struct driver_context *s = drv_context; /* remove pending flag setting. */ s->remove_pending = 1; /* driver sleeping part.*/ wake_up( &s->wait ); /* Driver device data structure release. */ sleep_on( &s->remove_ok ); /* resource free.*/ free_driver_resources(s); /* Module usage count.*/ MOD_DEC_USE_COUNT; ETRI 75

76 USB int usb_register(struct usb_driver *drv); void usb_deregister(struct usb_driver *drv); void usb_driver_claim_interface(struct usb_driver *driver, struct usb_interface *iface, void *drv_context); Probe int usb_interdace_claimed(struct usb_interface *iface); void usb_driver_release_interface(struct usb_driver *driver, struct usb_interface *iface); ETRI 76

77 int usb_set_configuration(struct usb_device *dev, int configuratoin); int usb_set_interface(struct usb_device *dev, int interface, int alternate); int usb_get_device_descriptor(struct usb_device *dev); int usb_get_descriptor(struct usb_device *dev, unsigned char desctype, unsigned char descindex, void *buf, int size); int usb_get_string(struct usb_device *dev, unsigned short langid, unsigned char index, void *buf, int size); int usb_string(struct usb_device *dev, int index, char *buf, size_t size); int usb_get_status(struct usb_device *dev, int type, int target, void *data); Int usb_clear_halt(struct usb_device *dev, int pipe); ETRI 77

78 int usb_get_protocol(struct usb_device *dev); int usb_set_protocol(struct usb_device *dev, int protocol); int usb_get_report(struct usb_device *dev, unsigned char type, unsigned char id, unsigned char index, void *buf, int size); int usb_set_idle(struct usb_device *dev, int duration, int report_id); ETRI 78

79 A B C A1 A2 A3 B1 B2 B3 C1 C2 C3 A1 B1 C1 A2 B2 C2 A3 B3 C3 Token Data Handshake ETRI 79

80 Control transfer Control information control endpoint,. Ex.) device descriptor host input control transfer Bulk transfer bulk endpoint 64 bytes data. IN/OUT, IN, OUT data device. lossless data, latency., host (bandwidth) bulk transfer. Interrupt transfer bulk transfer interrupt endpoint, interrupt endpoint 64 bytes. interrupt endpoint, polling interval millisecond. Isochronous transfer 1023 bytes data isochronous endpoint, isochronous enpoint. data, (audio). ETRI 80

81 // Isochronous packet descriptor. typedef struct { unsigned int offset; unsigned int length; // expected length unsigned int actual_length; unsigned int status; iso_packet_descriptor_t, *piso_packet_descriptor_t; struct urb; typedef void (*usb_complete_t)(struct urb *); // URB data structure typedef struct urb { spinlock_t lock; // lock for the URB void *hcpriv; // private data for host controller struct list_head urb_list; // list pointer to all active urbs struct urb *next; // pointer to next URB struct usb_device *dev; // pointer to associated USB device unsigned int pipe; // pipe information int status; // returned status unsigned int transfer_flags; //USB_DISABLE_SPD USB_ISO_ASAP USB_URB_EARLY_COMPLETE void *transfer_buffer; // associated data buffer int transfer_buffer_length; // data buffer length int actual_length; // actual data buffer length unsigned char *setup_packet; // setup packet (control only) // int start_frame; // start frame (iso/irq only) int number_of_packets; // number of packets in this request (iso/irq only) int interval; // polling interval (irq only) int error_count; // number of errors in this transfer (iso only) int timeout; // timeout (in jiffies) void *context; usb_complete_t complete; // context for completion routine // pointer to completion routine iso_packet_descriptor_t iso_frame_desc[0]; urb_t, ETRI *purb_t; 81

82 Ex. ETRI 82

83 Low speed: 5Mbps Full speed: 15Mbps High speed: 480Mbps ETRI 83

84 ETRI 84

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 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 프레젠테이션 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

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

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

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

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

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

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

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

슬라이드 1

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

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

교육지원 IT시스템 선진화

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

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

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

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

교육지원 IT시스템 선진화

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

More information

untitled

untitled Block Device Driver in Linux Embedded System Lab. II Embedded System Lab. II 2 Define objective of applications using device Study Hardware manual (Registers) (vector number) Understand interface to related

More information

(Microsoft PowerPoint - Device Driver [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - Device Driver [\310\243\310\257 \270\360\265\345]) 목차 Device Driver 커널프로그램 Kernel program Kernel program 유의사항 Kernel module 디바이스드라이버 Character/Block device driver Device driver 구조 Device driver 작성절차및 module 등록 LED 디바이스드라이버 Kernel Program (1) 커널프로그램과응용프로그램과비교

More information

(Microsoft PowerPoint - Device Driver [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - Device Driver [\310\243\310\257 \270\360\265\345]) Device Driver 커널프로그램 Kernel program 목차 Kernel program 유의사항 Kernel module 디바이스드라이버 Character/Block device driver Device driver 구조 Device driver 작성절차및 module 등록 LED 디바이스드라이버 Kernel Program (1) 커널프로그램과응용프로그램과비교

More information

PowerPoint 프레젠테이션

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

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

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

Microsoft PowerPoint - IOControl [호환 모드]

Microsoft PowerPoint - IOControl [호환 모드] 목차 Input/Output Control I/O Control Mechanism mmap function munmap function RAM Area Access LED Control 4 digits 7 Segment Control Text LCD Control 1 2 I/O Control Mechanism (1) I/O Control Mechanism (2)

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

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

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

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

디바이스드라이버 (Device Driver) Driver is literally a subject which drive a object. 응용프로그램에서하드웨어장치를이용해서데이터를직접읽고쓰거나제어해야하는경우에디바이스드라이버를이용 하드웨어를제어하는프로그램과애플리케이션에서

디바이스드라이버 (Device Driver) Driver is literally a subject which drive a object. 응용프로그램에서하드웨어장치를이용해서데이터를직접읽고쓰거나제어해야하는경우에디바이스드라이버를이용 하드웨어를제어하는프로그램과애플리케이션에서 임베디드시스템설계강의자료 7 Device Driver (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 디바이스드라이버 (Device Driver) Driver is literally a subject which drive a object. 응용프로그램에서하드웨어장치를이용해서데이터를직접읽고쓰거나제어해야하는경우에디바이스드라이버를이용 하드웨어를제어하는프로그램과애플리케이션에서디바이스를제어하기위한자료구조와함수의집합

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

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

PowerPoint 프레젠테이션

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

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

제1장 Unix란 무엇인가?

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

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

<4D F736F F F696E74202D205BBAB0C3B75D20B8AEB4AABDBA20B5F0B9D9C0CCBDBA20B5E5B6F3C0CCB9F620B8F0B5A82E >

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

More information

제12장 파일 입출력

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

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

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

제1장 Unix란 무엇인가?

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

More information

Chap 7

Chap 7 Chap 7 FPGA 디바이스 1. FPGA 디바이스 1.1. External FPGA Device Driver FPGA 모듈을제어하는디바이스드라이버를작성하는방법에대해서알아보도록한다. 이모듈은 Achro-i.MX6Q의 External Connector에연결된다. 본교재에는 FGPA 펌웨어소스코드가포함되어있지않지만 VHDL로작성할수있다. FGPA 관련소스는패키지에포함되어있는바이너리를이용하면된다.

More information

CD-RW_Advanced.PDF

CD-RW_Advanced.PDF HP CD-Writer Program User Guide - - Ver. 2.0 HP CD-RW Adaptec Easy CD Creator Copier, Direct CD. HP CD-RW,. Easy CD Creator 3.5C, Direct CD 3.0., HP. HP CD-RW TEAM ( 02-3270-0803 ) < > 1. CD...3 CD...5

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

untitled

untitled CAN BUS RS232 Line Ethernet CAN H/W FIFO RS232 FIFO IP ARP CAN S/W FIFO TERMINAL Emulator COMMAND Interpreter ICMP TCP UDP PROTOCOL Converter TELNET DHCP C2E SW1 CAN RS232 RJ45 Power

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

/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

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

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770>

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

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

교육지원 IT시스템 선진화

교육지원 IT시스템 선진화 Module 10: 디바이스드라이버기초 ESP30076 임베디드시스템프로그래밍 (Embedded System Programming) 조윤석 전산전자공학부 주차별목표 디바이스드라이버란? 디바이스드라이버주요함수알아보기 디바이스드라이버기본골격구성하기 2 디바이스드라이버프로그래밍 리눅스커널의구조 커널프로그래밍 리눅스커널의핵심 (core) 기능추가 리눅스커널알고리즘개선

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

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

휠세미나3 ver0.4

휠세미나3 ver0.4 andromeda@sparcs:/$ ls -al dev/sda* brw-rw---- 1 root disk 8, 0 2014-06-09 18:43 dev/sda brw-rw---- 1 root disk 8, 1 2014-06-09 18:43 dev/sda1 brw-rw---- 1 root disk 8, 2 2014-06-09 18:43 dev/sda2 andromeda@sparcs:/$

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

À©µµ³×Æ®¿÷ÇÁ·Î±×·¡¹Ö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

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

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

More information

RaspberryPi 커널컴파일및커널모듈 1 제 13 강 커널컴파일및커널모듈 커널컴파일가상주소 (mmap() 함수 ) 에의한디바이스제어커널모듈및커널모듈테스트커널모듈에의한입출력디바이스제어 (LED, BTN) 커널모듈을커널에포함하기

RaspberryPi 커널컴파일및커널모듈 1 제 13 강 커널컴파일및커널모듈 커널컴파일가상주소 (mmap() 함수 ) 에의한디바이스제어커널모듈및커널모듈테스트커널모듈에의한입출력디바이스제어 (LED, BTN) 커널모듈을커널에포함하기 RaspberryPi 커널컴파일및커널모듈 1 제 13 강 커널컴파일및커널모듈 커널컴파일가상주소 (mmap() 함수 ) 에의한디바이스제어커널모듈및커널모듈테스트커널모듈에의한입출력디바이스제어 (LED, BTN) 커널모듈을커널에포함하기 RaspberryPi 커널컴파일및커널모듈 2 커널컴파일 * 커널소스컴파일 : 가상머신에서 10여분소요 : 라즈베리파이보드에서 90여분소요

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

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

2009년 상반기 사업계획

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

More information

Chap 6 모듈프로그래밍및 디바이스드라이버구현

Chap 6 모듈프로그래밍및 디바이스드라이버구현 Chap 6 모듈프로그래밍및 디바이스드라이버구현 Chap 6. 모듈프로그래밍및디바이스드라이버구현 1. 모듈프로그래밍 1.1. Kernel Module 1.1.1. Kernel Module 모듈은커널의구성요소로서, 리눅스시스템이부팅된후에동적으로 load, unload 할수있다. 이런특징으로인해커널을다시컴파일하거나시스템을재부팅하지않고도커널의일부분을교체할수있다.

More information

chap8.PDF

chap8.PDF 8 Hello!! C 2 3 4 struct - {...... }; struct jum{ int x_axis; int y_axis; }; struct - {...... } - ; struct jum{ int x_axis; int y_axis; }point1, *point2; 5 struct {....... } - ; struct{ int x_axis; int

More information

°ø°³¼ÒÇÁÆ®-8È£

°ø°³¼ÒÇÁÆ®-8È£ 2007. 08 No.8 IT World 운영체제 미들웨어 데이터베이스 웹프로그래밍까지 표준화된공개SW 컴퓨팅환경이지원합니다. 글로벌표준의공개SW 환경은 핵심애플리케이션뿐만아니라다양한플랫폼에서도활용됩니다. 2 2007. 08No.8 Contents Special Editorial 04 Best Practice 08 12 16 20 24 26 Insight 32

More information

PowerPoint 프레젠테이션

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

More information

Microsoft PowerPoint - chap2

Microsoft PowerPoint - chap2 제 2 장. 파일입출력 (File I/O) 숙대창병모 1 목표 파일의구조및특성을이해한다. 파일을열고닫는다. 파일로부터데이터를읽고쓴다. 파일현재위치변경 기타파일제어 숙대창병모 2 2.1 파일구조 숙대창병모 3 What is a file? a file is a contiguous sequence of bytes no format imposed by the operating

More information

ARMBOOT 1

ARMBOOT 1 100% 2003222 : : : () PGPnet 1 (Sniffer) 1, 2,,, (Sniffer), (Sniffer),, (Expert) 3, (Dashboard), (Host Table), (Matrix), (ART, Application Response Time), (History), (Protocol Distribution), 1 (Select

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

<4D F736F F F696E74202D FB8DEB8F0B8AE20B8C5C7CE205BC8A3C8AF20B8F0B5E55D>

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

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

10X56_NWG_KOR.indd

10X56_NWG_KOR.indd 디지털 프로젝터 X56 네트워크 가이드 이 제품을 구입해 주셔서 감사합니다. 본 설명서는 네트워크 기능 만을 설명하기 위한 것입니다. 본 제품을 올바르게 사 용하려면 이 취급절명저와 본 제품의 다른 취급절명저를 참조하시기 바랍니다. 중요한 주의사항 이 제품을 사용하기 전에 먼저 이 제품에 대한 모든 설명서를 잘 읽어 보십시오. 읽은 뒤에는 나중에 필요할 때

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 APUE(File InO)

Microsoft PowerPoint APUE(File InO) Linux/UNIX Programming 문양세강원대학교 IT특성화대학컴퓨터과학전공 강의목표및내용 강의목표 파일의특성을이해한다. 파일을열고닫는다. 파일로부터데이터를읽고쓴다. 기타파일제어함수를익힌다. 강의내용 파일구조 (UNIX 파일은어떤구조일까?) 파일관련시스템호출 시스템호출의효율과구조 Page 2 What is a File? A file is a contiguous

More information

untitled

untitled CAN BUS RS232 Line CAN H/W FIFO RS232 FIFO CAN S/W FIFO TERMINAL Emulator COMMAND Interpreter PROTOCOL Converter CAN2RS232 Converter Block Diagram > +- syntax

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

PowerPoint Presentation

PowerPoint Presentation GPU-based Keylogger Jihwan yoon 131ackcon@gmail.com Index Who am I Keylogger, GPU GPU based Keylogging - Locating the keyboard buffer - Capturing KEYSTROKES Demo About me Who am I 윤지환 CERT-IS reader BOB

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

목차 제 1 장 inexio Touch Driver소개... 3 1.1 소개 및 주요 기능... 3 1.2 제품사양... 4 제 2 장 설치 및 실행... 5 2.1 설치 시 주의사항... 5 2.2 설치 권고 사양... 5 2.3 프로그램 설치... 6 2.4 하드웨

목차 제 1 장 inexio Touch Driver소개... 3 1.1 소개 및 주요 기능... 3 1.2 제품사양... 4 제 2 장 설치 및 실행... 5 2.1 설치 시 주의사항... 5 2.2 설치 권고 사양... 5 2.3 프로그램 설치... 6 2.4 하드웨 최종 수정일: 2010.01.15 inexio 적외선 터치스크린 사용 설명서 [Notes] 본 매뉴얼의 정보는 예고 없이 변경될 수 있으며 사용된 이미지가 실제와 다를 수 있습니다. 1 목차 제 1 장 inexio Touch Driver소개... 3 1.1 소개 및 주요 기능... 3 1.2 제품사양... 4 제 2 장 설치 및 실행... 5 2.1 설치 시

More information

Microsoft PowerPoint APUE(File InO).ppt

Microsoft PowerPoint APUE(File InO).ppt 컴퓨터특강 () [Ch. 3] 2006 년봄학기 문양세강원대학교컴퓨터과학과 강의목표및내용 강의목표 파일의특성을이해한다. 파일을열고닫는다. 파일로부터데이터를읽고쓴다. 기타파일제어함수를익힌다. 강의내용 파일구조 (UNIX 파일은어떤구조일까?) 파일관련시스템호출 시스템호출의효율과구조 Page 2 1 What is a File? A file is a contiguous

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

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

10주차.key

10주차.key 10, Process synchronization (concurrently) ( ) => critical section ( ) / =>, A, B / Race condition int counter; Process A { counter++; } Process B { counter ;.. } counter++ register1 = counter register1

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

1.LAN의 특징과 각종 방식

1.LAN의 특징과 각종 방식 0 Chapter 1. LAN I. LAN 1. - - - - Switching - 2. LAN - (Topology) - (Cable) - - 2.1 1) / LAN - - (point to point) 2) LAN - 3) LAN - 2.2 1) Bound - - (Twisted Pair) - (Coaxial cable) - (Fiber Optics) 1

More information

chap10.PDF

chap10.PDF 10 C++ Hello!! C C C++ C++ C++ 2 C++ 1980 Bell Bjarne Stroustrup C++ C C++ C, C++ C C 3 C C++ (prototype) (type checking) C C++ : C++ 4 C C++ (prototype) (type checking) [ 10-1] #include extern

More information

슬라이드 1

슬라이드 1 23. Sockets Input/Output Operations 일반대학원컴퓨터과학과 최윤기 (filterk7@gmail.com) Connection-oriented Model Client-Server 간통싞전에, 미리핚쌍의소켓을연결해두는개념. socket() 의 type argument 에 SOCK_STREAM 으로지정. TCP(Transmission Control

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

¼ÒÇÁÆ®-12È£-ÃÖÁ¾¿Ï¼º

¼ÒÇÁÆ®-12È£-ÃÖÁ¾¿Ï¼º IT World 2008. 05 No.12 Focus Interview Best Practice Open Mind 2008. 05 No.12 Contents Special Editorial Best Practice 04 08 12 16 20 22 24 28 30 Insight 34 36 40 42 46 Tech Guide 50 56 62 News & Trend

More information

Microsoft PowerPoint APUE(File InO).pptx

Microsoft PowerPoint APUE(File InO).pptx Linux/UNIX Programming 문양세강원대학교 IT대학컴퓨터과학전공 강의목표및내용 강의목표 파일의특성을이해한다. 파일을열고닫는다. 파일로부터데이터를읽고쓴다. 기타파일제어함수를익힌다. 강의내용 파일구조 (UNIX 파일은어떤구조일까?) 파일관련시스템호출 시스템호출의효율과구조 Page 2 What is a File? A file is a contiguous

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

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

Smart Power Scope Release Informations.pages

Smart Power Scope Release Informations.pages v2.3.7 (2017.09.07) 1. Galaxy S8 2. SS100, SS200 v2.7.6 (2017.09.07) 1. SS100, SS200 v1.0.7 (2017.09.07) [SHM-SS200 Firmware] 1. UART Command v1.3.9 (2017.09.07) [SHM-SS100 Firmware] 1. UART Command SH모바일

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

5.스택(강의자료).key

5.스택(강의자료).key CHP 5: https://www.youtube.com/watch?v=ns-r91557ds ? (stack): (LIFO:Last-In First-Out):. D C B C B C B C B (element) C (top) B (bottom) (DT) : n element : create() ::=. is_empty(s) ::=. is_full(s) ::=.

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

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D> 뻔뻔한 AVR 프로그래밍 The Last(8 th ) Lecture 유명환 ( yoo@netplug.co.kr) INDEX 1 I 2 C 통신이야기 2 ATmega128 TWI(I 2 C) 구조분석 4 ATmega128 TWI(I 2 C) 실습 : AT24C16 1 I 2 C 통신이야기 I 2 C Inter IC Bus 어떤 IC들간에도공통적으로통할수있는 ex)

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

untitled

untitled 1... 2 System... 3... 3.1... 3.2... 3.3... 4... 4.1... 5... 5.1... 5.2... 5.2.1... 5.3... 5.3.1 Modbus-TCP... 5.3.2 Modbus-RTU... 5.3.3 LS485... 5.4... 5.5... 5.5.1... 5.5.2... 5.6... 5.6.1... 5.6.2...

More information