반응형 분류 전체보기22 [Device Driver-3] Device Driver 등록 및 실행 작업 환경 -메인 OS : Windows 8.1K(Intel Core i5-4590) -작업 OS : Ubuntu 14.04 64bit(VirtualBox) -장 비 명 : H-Smart4412 1. skeleton.c - Device Driver 뼈대 작성 #include #include #include #include #define DEV_NAME "SKELETON" MODULE_LICENSE("GNU"); int test_major = 0; int result; int skeleton_open(struct inode *inode, struct file *filp); int skeleton_release(struct inode *inode, struct file *filp); ssize_t skele.. 2016. 12. 26. [Device Driver-2] kernel 등록 및 실행 작업 환경 -메인 OS : Windows 8.1K(Intel Core i5-4590) -작업 OS : Ubuntu 14.04 64bit(VirtualBox) -장 비 명 : H-Smart4412 1. hellocall.c - Kernel에서 Hello - sys call 출력 #include asmlinkage long sys_hellocall() { printk("Hello -sys call \n"); return 0; } 생성 후 /Smart4412/Development/Source/Kernel/kernel_4412/kernel 로 복사 2. Kernel에 코드 등록 cd /Smart4412/Development/Source/Kernel/kernel_4412/kernel vi Makefile obj-.. 2016. 12. 26. [Device Driver-1] Device Driver 개요 작업 환경 -메인 OS : Windows 8.1K(Intel Core i5-4590) -작업 OS : Ubuntu 14.04 64bit(VirtualBox) -장 비 명 : H-Smart4412 1. Device Driver -Kernel - H/W간의 연결 통로 2. 디바이스 드라이버 종류 -Charactor Device Driver : 문자 단위로 데이터 이동 -Block Device Driver : 디스크의 블록 단위로 데이터 이동(일반적으로 4kb) -Network Device Driver : 네트워크 데이터 이동(만질 일이 거의 없다) -H/W 성능이 좋아져서 문자,블록 디바이스 드라이버의 경계가 모호해짐 3. 장치 파일 -장치 유형 c : Charactor Device Driver b : Bl.. 2016. 12. 26. [Kernel Porting-6] H-Smart4412 Tact Switch 작동하기 작업 환경 -메인 OS : Windows 8.1K(Intel Core i5-4590) -작업 OS : Ubuntu 14.04 64bit(VirtualBox) -장 비 명 : H-Smart4412 1. tact.c - Tact Switch 입력 번호 띄우기 #include #include #include #include #include #include #include #include #define tact_d "/dev/tactsw" int main() { int tact; unsigned char c; if((tact = open(tact_d,O_RDWR)) < 0) { perror("open"); exit(1); } while(1) { read(tact,&c,sizeof(c)); if(c) break;.. 2016. 12. 26. 이전 1 2 3 4 5 6 다음 반응형