linux 调试用到知识点

ubuntu 崩溃,进入grub解救:

内存不够导致系统崩溃,进入不了linux系统(grub rescure)

系统crash函数追溯

在kernel的根目录下,利用Makefile中用的CROSS COMPILE目录下的gdb,如输入prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-gdb vmlinux  回车后,当提示Reading symbols from vmlinux...done.后输入对应PC address,如log中的0xffffffc0005ec450,即可定位到具体某一行了。注意一定要保证vmlinux是对应Image时的那个。

关机命令:

adb shell setprop sys.powerctl shutdown

无线adb

设备插上usb线
pc$adb tcpip 5555 
设备拔掉usb线
pc$adb connect 设备ip:5555
注:设备 和pc在同一局域网

linux 很诡异的上网问题

内网的IP网段是192.168.40.××,而我虚拟机的wmnet地址正好是192.168.40.0,而这时pc可以通过dhcp获取ip地址,但是无法上网,ping网关总是显示destination unreachable,

修改后如下图,可以正常上网。

linux 调试用到知识点_第1张图片


根据已有ramdisk镜像修改/替换ramdisk部分内容的方法:

 

1:unzip the image
mv ./ramdisk.img ./ramdisk.img.gz
gunzip ./ramdisk.img.gz
 
2:restore the image
 
mkdir ramdisk
cd ./ramdisk/
cpio -i -F ../ramdisk.img
 
 
3:Modify the files you want
 
 
4:package the new image
 
rm -f ../ramdisk.img
find . | cpio -o -H newc > ../ramdisk.img.unzip
cd ..
gzip -c ./nramdisk.img.unzip > ./ramdisk.img.gz
rm -f ./ramdisk.img.unzip
mv ./ramdisk.img.gz ./ramdisk.img


tinyplay 播放音乐时比特位数:

当时播放24bit时无声音,添加229/230两行即可。

external/tinyalsa/tinyplay.c

211 void play_sample(FILE *file, unsigned int card, unsigned int device, unsigned int channels,
212                  unsigned int rate, unsigned int bits, unsigned int period_size,
213                  unsigned int period_count)
214 {
215     struct pcm_config config;
216     struct pcm *pcm;
217     char *buffer;
218     int size;
219     int num_read;
220 
221     config.channels = channels;
222     config.rate = rate;
223     config.period_size = period_size;
224     config.period_count = period_count;
225     if (bits == 32)
226         config.format = PCM_FORMAT_S32_LE;
227     else if (bits == 16)
228         config.format = PCM_FORMAT_S16_LE;
229     else if (bits == 24)
230         config.format = PCM_FORMAT_S24_LE;

virtualbox添加用户组

查看当前用户名:
sharl@sharl-laptop:~$ whoami
sharl

查看vbox 所在的组:
sharl@sharl-laptop:~$ cat /etc/group | grep vbox
vboxusers:x:125:sharl

将当前用户加入vbox组:
usermod -a -G vboxusers gsc

WIFI模块硬件问题

晶振的电容可以工作还不行,还要注意频偏,27pF--->12pF 频偏

发射功率,功率发射和接收引脚,焊接电容会对其产生影响(ap6335的2脚)

      [*]     cfg80211 wireless extensions compatibility 
 	<*>   cfg80211 - wireless configuration API 



[*] Network device support  --->
	[*]   Network core driver support
	[*]   Wireless LAN  --->
		 <*>   Broadcom FullMAC wireless cards support                                                         │ │  
  │ │                                (/system/etc/firmware/fw_bcm4339a0_ag.bin) Firmware path                                              │ │  
  │ │                                (/system/etc/firmware/nvram_ap6335.txt) NVRAM path 

wifi channel

美国1-11
中国1-13
日本1-14

由于该引脚的时钟没有提供,

所以固件下载进去了,但是并没有运行起来。

<4>[c0][   37.351856] dhd_bus_devreset: == WLAN ON ==
<4>[c0][   37.359254] F1 signature read @0x18000000=0x16224335
<4>[c0][   37.372608] F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2
<4>[c0][   37.379252] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
<4>[c0][   37.385914] dhdsdio_probe_init: set use_rxchain 1 from config.txt
<4>[c0][   37.391856] dhd_conf_read_config: Ignore config file /system/etc/firmware/config.txt
<4>[c0][   37.399754] Final fw_path=/system/etc/firmware/fw_bcm4339a0_ag.bin
<4>[c0][   37.406259] Final nv_path=/system/etc/firmware/nvram_ap6335.txt
<4>[c0][   37.412536] Final conf_path=/system/etc/firmware/config.txt
<4>[c0][   37.545454] NVRAM version: AP6335_NVRAM_V1.7_04102014
<4>[c0][   37.550536] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
<4>[c0][   38.054435] dhdsdio_htclk: HT Avail timeout (1000000): clkctl 0x50
<4>[c0][   38.059648] dhd_bus_init: clock state is wrong. state = 1
<4>[c0][   38.564473] dhdsdio_htclk: HT Avail timeout (1000000): clkctl 0x50
<4>[c0][   38.570100] dhd_net_bus_devreset: dhd_bus_devreset: -1
<4>[c0][   38.575145] dhd_prot_ioctl : bus is down. we have nothing to do
<4>[c0][   38.581404] dhd_net_bus_devreset: dhd_bus_devreset: -35
<4>[c0][   38.587199] wifi_platform_set_power = 0
<4>[c0][   38.591046] ======== PULL WL_REG_ON LOW! ========
<4>[c0][   38.596147] wl_android_wifi_on: Failed
<4>[c0][   38.600142] dhd_open : wl_android_wifi_on failed (-1)
<4>[c0][   38.605528] dhd_stop: Enter ddd9b800
<4>[c0][   38.609470] wl_android_wifi_off in 1
<4>[c0][   38.613292] wl_android_wifi_off in 2: g_wifi_on=0
<4>[c0][   38.618351] wl_android_wifi_off out
<4>[c0][   38.622222] dhd_stop: Exit
<4>[c0][   38.625208] dhd_open: Exit ret=-1

LPO I External Low Power Clock input (32.768KHz)

tcpdump抓数据

tcpdump -i wlan0 host 10.0.0.29 -w tcpdumlog.txt

音响D类功放输出

电感换成密封的,否则会有声响;抗饱和电感;电容的选材,是x7R,稳定性好的。

kernel hang时找到对应命令行

在kernel的根目录下,利用Makefile中用的CROSS COMPILE目录下的gdb,如输入prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-gdb vmlinux
               回车后,当提示Reading symbols from vmlinux...done.后输入对应PC address,如log中的0xffffffc0005ec450,即可定位到具体某一行了。注意一定要保证vmlinux是对应Image时的那个。

查看系统状态命令

busybox mpstat -P ALL 2
busybox watch -d -n 1 "cat /sys/bus/platform/drivers/e

android6.0切制tonybox


USB声卡调试

此错误原因是数据线过长,导致信号质量不好,另外还有-110的错误,也是信号质量不好导致的问题。

linux 调试用到知识点_第2张图片

你可能感兴趣的:(linux)