HTS221 temperature conversion 데이터 시트에 수식을 정확하게 써야지, linear interpolation을 머 이리 어렵게 썼는지.. U가 or 같은데, 정확하게 어떤 의미로 썼는지 모르겠다. 하. T0_DegC, T_DegC, T1_DegC, T0_OUT, T_OUT, T1_OUT을 모두 확인 한 후에 위 그래프로 알아서 구하라는 말이었다. 미친!!! 위 식대로 하면 172도를 볼 수 있다. stack overflow에 있듯이 T0_degC, T1_degC가 10비트임을 인식해야 한다. T0T1MSB에…… sensehat i2c hts221 계속 읽기


unkown symbol
insmod 실행 시 unknown symbol 에러 가끔 모듈을 컴파일 하여 insmod로 추가할 때 unknown symbol 에러로 추가가 안 될 경우가 있다. xpad.c를 따라할 때 해당 함수를 찾아 지우고 했지만, 이번 sensehat을 사용하려는 기본 함수는 지울 수 없어 이유를 찾아야 했다. [ 8890.395611] sensehat_core: loading out-of-tree module taints kernel. [ 8890.395805] sensehat_core: Unknown symbol __devm_regmap_init_i2c (err…… unkown symbol 계속 읽기
linux pages
Pages 연속된 메모리를 할당을 테스트 했다. dmes로 보면 어느 정도 출력하다 끊어 버린다. 마지막 데이터를 확인 했다. #include<linux/kernel.h> #include<linux/init.h> #include<linux/module.h> #include <linux/slab.h> #include <linux/mempool.h> #define PAGES_ORDER 2 char* data; static int __init hello_world_init(void) /* Constructor */ { printk(KERN_INFO “hello, pages\n”); /* memory 할당*/ data = (char*)__get_free_pages(GFP_KERNEL, PAGES_ORDER); if (!data){ printk(“no pages allocated\n”); return ENOMEM; }…… linux pages 계속 읽기
linux memory pools
memory pools cache memory에 이어 memory pools를 실습했다. 역시 책만 보면 잘 모른다. nvme 드라이버- drivers/nvme/target/io-cmd-file.c – 중 mempool 관련 코드를 찾을 수 있다. #include<linux/kernel.h> #include<linux/init.h> #include<linux/module.h> #include <linux/slab.h> #include <linux/mempool.h> #define scullc_quantum 16 /* declare one cache pointer: use it for all devices */ /* kmem_cache_t 가 kmem_cache로 변경됨*/ struct kmem_cache *scullc_cache; static const…… linux memory pools 계속 읽기
linux cache memory
cache memroy 실습 linux device driver, 8장을 실습 했다. 컴파일 하여 실행하기 전에는 어떻게 돌아가는지 잘 알 수 없다. scullc을 보고 따라하려 했으나 잘 모르겠다. 메모리를 cache로 선언하고 일반 메모리를 쓰듯이 하면 된다. #include<linux/kernel.h> #include<linux/init.h> #include<linux/module.h> #include <linux/slab.h> #define scullc_quantum 16 /* declare one cache pointer: use it for all devices */ /* kmem_cache_t 가…… linux cache memory 계속 읽기