Günlük

Kernel Options And System Debugging Düzenle


09 Kasım 2016 13:43:43 tarihinde Mehmet Özgür Bayhan tarafından yazılmıştır.


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


Yorum Yazın: