본문 바로가기

Embedded/Device Driver

[Device Driver] 대소문자 변환 Device Driver 만들기 작업 환경-메인 OS : Windows 8.1K(Intel Core i5-4590)-작업 OS : Ubuntu 14.04.5 LTS 64bit(VirtualBox)-장 비 명 : Hybus-Smart4412 1. 초기설정 - mkdir device --> device 디렉토리에 examdrv.c 와 Makefile을 만든다. examdrv.c/*뼈대 작성*/#include #include #include #include #include #include #include #define DEVICE_NAME "examdrv"#define MYDRV_MAX_LENGTH4096#define MIN(a, b) (((a) < (b)) ? (a) : (b)) struct class *myclass;struct cdev.. 더보기
[Device Driver] A~Z 출력 작업 환경-메인 OS : Windows 8.1K(Intel Core i5-4590)-작업 OS : Ubuntu 14.04.5 LTS 64bit(VirtualBox)-장 비 명 : Hybus-Smart4412 1. 초기설정 - mkdir device --> device 디렉토리에 mydrv.c 와 Makefile을 만든다. mydrv.c/*뼈대 작성*/#include #include #include #include #include #include #include #define DEVICE_NAME "mydrv"#define MYDRV_MAX_LENGTH4096#define MIN(a, b) (((a) < (b)) ? (a) : (b)) struct class *myclass;struct cdev *mycd.. 더보기
[Device Driver] 커널에 Device Driver 등록 및 실행 작업 환경-메인 OS : Windows 8.1K(Intel Core i5-4590)-작업 OS : Ubuntu 14.04.5 LTS 64bit(VirtualBox)-장 비 명 : Hybus-Smart4412 1. 초기설정 - mkdir device --> device 디렉토리에 skeleton.c 와 Makefile을 만든다. skeleton.c/*뼈대 작성*/#include #include #include #include #include MODULE_LICENSE("GPL"); int result; int skeleton_open(struct inode *inode, struct file *filp) {printk("Device Open!!\n");return 0;} int skeleton_releas.. 더보기
[Device Driver] 커널에 Systemcall 등록 및 실행 작업 환경-메인 OS : Windows 8.1K(Intel Core i5-4590)-작업 OS : Ubuntu 14.04.5 LTS 64bit(VirtualBox)-장 비 명 : Hybus-Smart4412 1. 초기설정 - cd ~/Smart4412/Development/Source/Kernel/kernel_4412/kernel- hellocall.c를 만든다 hellocall.c#include asmlinkage long sys_hellocall(){printk("==========\n");printk("Hello ~ sys call\n");printk("==========\n");return 0;} 2. Kernel에 코드 등록- cd /Smart4412/Development/Source/Kerne.. 더보기
[Device Driver] Kernel에 hello.c 등록 작업 환경-메인 OS : Windows 8.1K(Intel Core i5-4590)-작업 OS : Ubuntu 14.04.5 LTS 64bit(VirtualBox)-장 비 명 : Hybus-Smart4412 1. 초기설정 - mkdir device --> device 디렉토리에 hello.c 와 Makefile을 만든다. hello.c#include#include#include MODULE_LICENSE("GPL"); int module_start_te(){printk("Hello\n");return 0;} int module_end_te(){printk("Bye\n");return 0;} module_init(module_start_te);module_exit(module_end_te); Makefil.. 더보기