2022-06-13 리눅스_디바이스_드라이버_5

Featured image for 2022-06-13 리눅스_디바이스_드라이버_5

Makefile 연습 main.c Makefile -O2 : Optimization 최적화, 최적화 레벨 2 gdb라는 디버거를 사용할 때는 위의 CFLAGS를 사용한다. 이유는 -O2 옵션을 사용하면 최적화를 위해서 코드의 순서가 변형되기에 -g의 이용이 불가하다. 그래서 디버깅 때는 위에 라인을, 디버깅이 끝나면 아래 코드를 사용하도록 한다. gdb는 the GNU Project debugger다. 출처 : https://jangpd007.tistory.com/220 출처 : https://jangpd007.tistory.com/220 [참 놀라운 세상:티스토리] … 더 읽기

2022-06-13 리눅스_디바이스_드라이버_4

/dev 디렉터리 /dev 디렉터리?? In Unix-like operating systems, a device file or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. Linux의 모든 디바이스는 /dev 디렉터리 아래에 위치하고, 모두 file로 인식된다. These special files allow an application program to interact with a … 더 읽기

2022-06-05 리눅스_디바이스_드라이버_3

Featured image for 2022-06-05 리눅스_디바이스_드라이버_3

hello.c의 Makefile 주의점 : 넓게 띄어 쓴 부분은 tab을 사용한다. Space bar를 사용하면 오류 난다. 핵심은 커널의 소스가 있는 디렉터리와 hello.c가 위치한 디렉터리를 오가며 컴파일한다는 것이다. 완벽히 이해하려 노력했지만 모르는 것이 많아서 그럴 수 없었다. (교수님이 조금이라 설명해주시면 좋을 텐데…) 이해할 수 있게 된다면 그때 다시 와서 볼 수 있도록 하자. 출처 : https://kldp.org/node/73511 출처 … 더 읽기

2022-06-02 리눅스_디바이스_드라이버_2

설치 리눅스 드라이버 작업을 수행할 때는 슈퍼 유저로 작업한다. 출처 : https://junshim.github.io/linux kernel study/Linux_Kernel_Compile/ build-essential은 개발에 필요한 기본 라이브러리와 헤더 파일 등을 포함한다. 없으면 컴파일이 안될 수 있다. 추가로 ncurses 라이브러리들을 빌드하여 설치할 때 필요하다고 한다. libncurses5, libncurses5-dev : Developer’s libraries for ncurses. ncurses (new curses) is a programming library providing an application programming interface … 더 읽기