1

User Image Kernel İletişim Yöntemleri Dec. 8, 2016, 9:41 a.m.
  1. Character Devices
  2. Netlink
  3. IOCTL
  4. System Calls
  5. Shared Memory


 

User Image QT Creator for kernel driver development Nov. 10, 2016, 11:12 a.m.

Autocomplete (For Qmake)

QMAKE_CXXFLAGS = -I/usr/src/linux-3.1.8-1-ARCH/include
QMAKE_CFLAGS = -I/usr/src/linux-3.1.8-1-ARCH/include


 

 

 

User Image Kernel Options And System Debugging Nov. 9, 2016, 2:43 p.m.

Debug Options For Kernel:


- Kernel hacking 
-- [*] Show timing information on printks 
-- [*] Magic SysRq key 
-- [*] Debug filesystem
-- [*] Kernel debugging 
-- [*] Detect Soft Lockups 
-- [ ] Collect scheduler statistics 
-- [*] Debug slab memory allocations 
-- [*] Memory leak debugging 
-- [*] RT Mutex debugging, deadlock detection 
-- [*] Spinlock debugging 
-- [*] Sleep-inside-spinlock checking 
-- [ ] kobject debugging 
-- [ ] Highmem debugging 
-- [ ] Compile the kernel with debug info

Mount debugfs

mount -t debugfs none /sys/kernel/debug

 

Test GPIO

echo 30 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio30/direction
cat /sys/class/gpio/gpio30/value
cat /sys/kernel/debug/gpio

 

Disable Peripherals

http://labs.isee.biz/index.php/Mux_instructions

Set sdmmc2_dat5 to gpio137 (mode 4):

# -> root@localhost:/sys/kernel/debug/omap_mux# 
cat sdmmc2_dat5
# Result
# name: sdmmc2_dat5.gpio_137 (0x48002166/0x136 = 0x0004), b ah3, t NA
# mode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE4
# signals: sdmmc2_dat5 | sdmmc2_dir_dat1 | cam_global_reset | sdmmc3_dat1 | gpio_137 | hsusb3_tll_stp | mm3_rxdp | safe_mode

# Set sdmmc2_dat5 to gpio137 (mode 4): 
echo 0x004 > sdmmc2_dat5 

# Check that gpio137 is in user space: 

# -> root@localhost:/sys/class/gpio# 
ls
# Result: export  gpio137  gpio138  gpio139  gpio170  gpio64  gpiochip0  gpiochip128  gpiochip160  gpiochip192  gpiochip32  gpiochip64  gpiochip96  unexport

 

List iomem and ioports

 

cat /proc/iomem
cat /proc/ioports

 

User Image GPIO June 16, 2016, 4:37 p.m.

echo 169 > /sys/class/gpio/export
# echo "in" > /sys/class/gpio/gpio169/direction
echo "out" > /sys/class/gpio/gpio169/direction
echo 0 > /sys/class/gpio/gpio169/value
echo 1 > /sys/class/gpio/gpio169/value
echo 169 > /sys/class/gpio/unexport

# if Kernel configuration ---> Kernel hacking ---> Debug FS enabled
# You can check who uses which gpio

mount -t debugfs none /sys/kernel/debug
cat /sys/kernel/debug/gpio

# pincontrol
# /sys/kernel/debug/pinctrl/

 

User Image Kernel Debug Mode Aug. 17, 2015, 4:01 p.m.
mount -t debugfs none /sys/kernel/debug/
cd /sys/kernel/debug/

 

User Image Device Tree Binaries Aug. 13, 2015, 11:17 a.m.

 

device-tree-compiler uygulamasına ihtiyacımız var

sudo apt-get install device-tree-compiler

DTB Dosyasını okunabilir  DTS dosyasına çevirmek için :

dtc -I dtb -O dts omap3-beagle.dtb > omap3-beagle.dts

 

DTS > DTB

dtc -I dts -O dtb -o /path/to/my-tree.dtb /path/to/my-tree.dts

 


1