8000 GitHub - tina908/LinuxBSP: 임베디드 리눅스 BSP
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tina908/LinuxBSP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinuxBSP

image

리눅스 드라이버

  • insmod - 해당 모듈 적재

  • rmmod - 적재된 모듈 제거

  • dmesg - 시스템 부팅 메세지 확인

  • mkmod - 드라이브에 대한 특수 파일 작성

  • modinfo - 리눅스 모듈 조회

  • cat /proc/misc - 연결 되어 있는 장치 확인

image

image

image

image

p87

디바이스 노드 만들기

image

pi@pi06:/mnt/ubuntu_nfs $ cat /proc/devices

image

주번호 장치이름
주번호는 디바이스를 구분하기 위해 사용
부번호는 동일한 디바이스가 여러 개 있을 때 이를 구분하기 위해 사용 (채널, 파티션개념)

ubuntu@ubuntu06:~/pi_bsp/drivers/p87$ gcc mknod.c -o testmknod

ubuntu@ubuntu06:~/pi_bsp/drivers/p87$ sudo ./testmknod

image

p106_hello

ubuntu@ubuntu06:~/pi_bsp/drivers/p106_hello$ make

pi@pi06:/mnt/ubuntu_nfs $ insmod hello.ko

pi@pi06:/mnt/ubuntu_nfs $ dmesg

image

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod hello

image

106_led

ubuntu@ubuntu06:~/pi_bsp/drivers/p106_led$ make

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod led.ko

image

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod led.ko

image

image

p122_led

ubuntu@ubuntu06:~/pi_bsp/drivers/p122_led$ make

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod led.ko 

image

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod led

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod led.ko  twostring="abcd 1234"

image

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod led

p184_led

ubuntu@ubuntu06:~/pi_bsp/drivers/p184_led$ make

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod call_dev.ko

pi@pi06:/mnt/ubuntu_nfs $ ./call_app

image

에러 발생 시

pi@pi06:/mnt/ubuntu_nfs $ sudo mknod /dev/calldev c 230 0

pi@pi06:/mnt/ubuntu_nfs $ sudo chmod 777 /dev/calldev

pi@pi06:/mnt/ubuntu_nfs $ ./call_app

image image

8번 키를 누르면 종료

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod call_dev

struct

ubuntu@ubuntu06:~/pi_bsp/drivers$ gcc struct.c -o struct

ubuntu@ubuntu06:~/pi_bsp/drivers$ ./struct

image

p238_ledkey

ubuntu@ubuntu06:~/pi_bsp/drivers/p238_ledkey$ make

pi@pi06:/mnt/ubuntu_nfs $ sudo mknod /dev/ledkey c 230 0

pi@pi06:/mnt/ubuntu_nfs $ sudo chmod 666 /dev/ledkey

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod ledkey_dev.ko

pi@pi06:/mnt/ubuntu_nfs $ ./ledkey_app 0x55

image

image

1번 키 누르면 firefox 웹 브라우저 오픈

image

2번 키 누르면 firefox 웹 브라우저 kill

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod ledkey_dev

p238_ledkey_blockio

ubuntu@ubuntu06:~/pi_bsp/drivers/p238_ledkey_blockio$ make

pi@pi06:/mnt/ubuntu_nfs $ sudo mknod /dev/calldev c 230 0

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod ledkey_dev.ko

pi@pi06:/mnt/ubuntu_nfs $ sudo chmod 666 /dev/calldev

pi@pi06:/mnt/ubuntu_nfs $ ./ledKey_app

image

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod ledkey_dev

p270_minor_ledkey

ubuntu@ubuntu06:~/pi_bsp/drivers/p270_minor_ledkey$ make

pi@pi06:/mnt/ubuntu_nfs $ sudo mknod /dev/minor_led c 230 0

pi@pi06:/mnt/ubuntu_nfs $ sudo mknod /dev/minor_key c 230 0

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod minor_dev.ko

pi@pi06:/mnt/ubuntu_nfs $ sudo chmod 666 /dev/minor_led

pi@pi06:/mnt/ubuntu_nfs $ sudo chmod 666 /dev/minor_key

pi@pi06:/mnt/ubuntu_nfs $ ./minor_app

image

p306_ledkey_ioctl_rw

ubuntu@ubuntu06:~/pi_bsp/drivers/p306_ledkey_ioctl_rw$ make

p335_kerneltimer_ledkey_dev

ubuntu@ubuntu06:~/pi_bsp/drivers/p335_kerneltimer_ledkey_dev$ make

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod kerneltimer.ko timerVal=50 ledVal=0X55

pi@pi06:/mnt/ubuntu_nfs $ sudo mknod /dev/kerneltimer c 230 0

pi@pi06:/mnt/ubuntu_nfs $ sudo chmod 666 /dev/kerneltimer

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod kerneltimer_dev.ko

pi@pi06:/mnt/ubuntu_nfs $ ./kerneltimer_app 0x55

image

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod kerneltimer

키를 누르면 해당 번호의 LED가 켜지고 나머지는 꺼졌다가, 그 후 나머지 LED는 켜지고 눌린 키의 LED는 꺼집니다.
이 상태가 반복하면서 껐다켰다 반복, 8번 키를 눌렀을 때 종료
led on/off 속도 : timerVal=50
초기 상태 : ledVal=0X55

p399_ledkey_poll_new

ubuntu@ubuntu06:~/pi_bsp/drivers/p399_ledkey_poll_new$ make

pi@pi06:/mnt/ubuntu_nfs $ sudo mknod /dev/ledkey c 230 0

pi@pi06:/mnt/ubuntu_nfs $ sudo chmod 666 /dev/ledkey

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod ledkey_dev.ko

pi@pi06:/mnt/ubuntu_nfs $ ./ledkey_app 0xff

image

poll time out 대기시간은 2초
키를 누르면 해당 번호의 LED가 켜짐
스위치 255 하면 다 켜짐 0은 다꺼짐 (2진수) 8번 키를 누르거나 q스위치를 눌렸을 때 종료

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod ledkey

p432_ledkey_poll

ubuntu@ubuntu06:~/pi_bsp/drivers/p432_ledkey_poll$ make

pi@pi06:/mnt/ubuntu_nfs $ sudo mknod /dev/ledkey c 230 0

pi@pi06:/mnt/ubuntu_nfs $ sudo chmod 666 /dev/ledkey

pi@pi06:/mnt/ubuntu_nfs $ sudo insmod ledkey_dev.ko

pi@pi06:/mnt/ubuntu_nfs $ ./ledkey_app 0xff

image

image

image

poll time out 대기시간은 2초
키를 누르면 해당 번호의 LED가 켜짐
스위치 255 하면 다 켜짐 0은 다꺼짐 (2진수) 8번 키를 누르거나 q스위치를 눌렸을 때 종료

pi@pi06:/mnt/ubuntu_nfs $ sudo rmmod ledkey

About

임베디드 리눅스 BSP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0