전체 글42 charter device driver - 1. 간단한 module 만들기 간단한 module을 만들어보자 module_init()함수에 함수 지정하면 insmod로 module을 insert 할 때 호출된다 module_exit()함수에 함수 지정하면 rmmod로 module을 delete 할 때 호출된다 간단한 module을 만들어보자 #include static int __init hello_init(void) { pr_info("Hello world init\n"); return 0; } static void __exit hello_exit(void) { pr_info("Hello world exit\n"); } module_init(hello_init); module_exit(hello_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("e.. 2023. 5. 21. unflatten_device_tree -> __unflatten_device_tree 분석 device tree 파일을 자료구조에 넣는 함수이다 /** * unflatten_device_tree - create tree of device_nodes from flat blob * * unflattens the device-tree passed by the firmware, creating the * tree of struct device_node. It also fills the "name" and "type" * pointers of the nodes so the normal device-tree walking functions * can be used. */ void __init unflatten_device_tree(void) { __unflatten_device_tree(initial_b.. 2023. 5. 17. pintos 만들어 보기 pintos는 스탠포드 대학교에서 만든 교육용 os이다 아래 사이트는 스탠포드 대학교에서 올려준 자료이다 Pintos Projects: Table of Contents (stanford.edu) 큰 목차는 아래와 같다 Project 1: Threads Project 2: Multiprogramming Project 3: Virtual Memory Project 4: File Systems 시간 날때마다 하나씩 정리해가면서 만들어보자 아래는 KAIST OS Lab에서 올라온 자료인데 좋아보여서 가져와봤다 Pintos Slides - KAIST OS Lab 2023. 5. 15. 디버깅 방법 1. device tree를 컴파일한 bcm2710-rpi-3-b.dtb를 hexdump를 사용하여 아스키코드로 확인 가능하다 hexdump bcm2710-rpi-3-b.dtb -C 00000000 d0 0d fe ed 00 00 80 ab 00 00 00 48 00 00 73 d4 |...........H..s.| 00000010 00 00 00 28 00 00 00 11 00 00 00 10 00 00 00 00 |...(............| 00000020 00 00 0c d7 00 00 73 8c 00 00 00 00 00 00 00 00 |......s.........| 00000030 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 |............ 2023. 5. 12. 이전 1 ··· 7 8 9 10 11 다음