본문 바로가기

device

linux shell 의 sysfs에서 device-tree 뽑아내는 방법 dtc 라는 tool 을 사용하면 된다. dtc -I fs -O dts -o output.dts /proc/device-tree 더보기
linux devicetree - interrupt 원본 : liunx Documentation/devicetree/bindings/arm/gic.txt linux document 의 설명이 애매해서 좀 더 풀어서 남긴다. ex)interrupt-controller@2c001000 {compatible = "arm,cortex-a15-gic";#interrupt-cells = ;interrupt-controller;reg = , , , ;interrupts = ;}; #이 있다고 주석이 아니다. 3 이라는 숫자는 interrupts = 에 3개의 값이 들어감을 의미한다. The 1st cell is the interrupt type; 0 for SPI interrupt.. 더보기
MBR 혹은 partition table dump 명령어, device node 로 부터 ufs, emmc dump dd if=/dev/block/vold/disk:8,0 of=/data/local/tmp/mbr-dump bs=512 count=1 dd if=/dev/block/vold/disk:179,64 of=/data/local/tmp/mbr-dump bs=512 count=1 dd if=/dev/block/vold/disk:179,0 of=/data/local/tmp/dump bs=512 count=1 - usb storage low image 위치 /dev/block/vold/disk:8,0 혹은 /dev/block/sda => dump 뜨면 MBR 부터 떠짐 /dev/block/sda1 => dump 뜨면 partition 부터 떠짐 /data/local/tmp/mbr-dump dd if=/dev/block.. 더보기
loop device and losetup 원문 : https://cafe.naver.com/taskers/10933 loop는 이미지파일을 블록 디바이스로 인식되게 해주는 디바이스 드라이버입니다.즉, 이미지 파일을 마운트 시켜줍니다. 쉽게 말해서 윈도우즈의 데몬툴이나 시디스페이스 같은 것이라 보면 됩니다.그러나 그 기능과 성능은 훨씬 강력합니다. 아래는 loop를 이용하여 100MB짜리 vfat 이미지를 마운트하는 예제입니다. 진행하려면 비지박스와 루팅은 필수입니다.터미널이나 ADB Shell에서 진행하세요. 1. 일단 dd를 이용해서 100메가짜리 공파일을 뜹니다. dd if=/dev/zero of=/mnt/sdcard/vdrive.img bs=1000000 count=100 dd : 덤프를 뜹니다. if=[덤프대상] of=[덤프결과]/dev.. 더보기
dtb(device tree blob) file parser(command) on linux fdtdump dtb_file.dtb > /tmp/test.txt 더보기
makedev makedev (3) #include dev_t makedev(unsigned int maj, unsigned int min); unsigned int major(dev_t dev); unsigned int minor(dev_t dev); linux device driver 는 major num 와 minor num 로 관리되는데 이 두 number 를 하나의 type 으로 정의한 것이 dev_t 이다. makedev system call 은 실제 '/dev' 에 device node 를 생성하는 것이 아닌,단순히 major, minor number 를 조합해서 dev_t type 을 생성해 주는 역할이다. makedev (8) 반면에 makedev 실행 파일은 실제로 '/dev' 에 주어진 major .. 더보기
block device 의 stat 정보 해석하기 cat /sys/block//stat 의 정보 Name units description ---- ----- ----------- read I/Os requests number of read I/Os processed read merges requests number of read I/Os merged with in-queue I/O read sectors sectors number of sectors read read ticks milliseconds total wait time for read requests write I/Os requests number of write I/Os processed write merges requests number of write I/Os merged with in-.. 더보기
android 에서 eMMC 의 hw 이름 출력하는 방법 (nexus5) cat /sys/class/block/mmcblk0/device/name 더보기
kernel list 항목 삭제 항목을 삭제할때 얻는 item(객체) 은 list_for_each_entry 가 아닌 list_for_each_entry_safe 로 얻은 item 이어야 한다. *자세한 설명은 kernel document 참고 ex) #include struct packet { u8data_1; u8data_2; struct list_head p_packet_list; }; LIST_HEAD(g_packet_list); void func() { struct packet* p_pkt, *scratch; ... list_for_each_entry_safe(p_pkt, scratch, &g_packet_list, p_packet_list) { list_del(&p_pkt->p_packet_list); kfree(p_pkt).. 더보기