start kernel 之后没有任何输出

一、对此一般有多种调试方法与调查方向,可能的原因如下:
1、串口的引脚是否配置正确,例如pincltrl指定的Debug串口引脚,串口选错没有
2、串口的直连与交叉问题
3、查看bootargs传过去的console=是否正确,例如ttyXX是否正确,波特率
4、内核使用的command Line是uboot的还是内核的,还是dtb中chosen字段中的

二、调查方法串口硬件问题的调查可以使用示波器与逻辑分析仪来确认

三、串口软件配置问题的调查可以使用在uboot查看log_buf的方法来查看问题出在哪里
当内核在start kernel之后,没有任何输出,等一会于用reset按键软reset,并停在uboot命令行中,使用下面方法来查看kenrel的log_buf,即printk存储log的地方。
在内核编译目录下面的System.map中找到__log_buf的位置,例如:
这个表示log_buf位于内核虚拟地址0x80dcdd84的位置,这个地方是直接映射段,因此对于imx6而言就是0x10dcdd84。
于是在uboot中使用md命令来查看这段区域的内容:
uart1.png

然后一直回车,最后可以看到内核最后使用的bootargs/commandLine:
uart2.png

kernel command line传入新的内核支持四种方式来组成commandline:
1、使用uboot中的
2、使用内核配置中的
3、使用uboot+内核配置中的
4、使用dtb中的chosen中的bootargs
这些都在menuconfig中可以看到,因此如果你在内核中看到的commandline与自己从uboot中传入的不一样,那么检查下面选项:
uart3.png

How to Deploy Google BBR on CentOS 7 in GCP

BBR (Bottleneck Bandwidth and RTT) is a new congestion control algorithm which is contributed to the Linux kernel TCP stack by Google. With BBR in place, a Linux server can get significantly increased throughput and reduced latency for connections. Besides, it's easy to deploy BBR because this algorithm requires only updates on the sender side, not in the network or on the receiver side.

In this article, I will show you how to deploy BBR on a Vultr CentOS 7 KVM server instance.

Prerequisites

A Vultr CentOS 7 x64 server instance.
A sudo user.

Step 1: Upgrade the kernel using the ELRepo RPM repository

In order to use BBR, you need to upgrade the kernel of your CentOS 7 machine to 4.9.0. You can easily get that done using the ELRepo RPM repository.

Before the upgrade, you can take a look at the current kernel:

uname -r
This command should output a string which resembles:

3.10.0-514.2.2.el7.x86_64
As you see, the current kernel is 3.10.0.

Install the ELRepo repo:

**sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm**
Install the 4.9.0 kernel using the ELRepo repo:

sudo yum --enablerepo=elrepo-kernel install kernel-ml -y
Confirm the result:

rpm -qa | grep kernel
If the installation is successful, you should see kernel-ml-4.9.0-1.el7.elrepo.x86_64 among the output list:

kernel-ml-4.9.0-1.el7.elrepo.x86_64
kernel-3.10.0-514.el7.x86_64
kernel-tools-libs-3.10.0-514.2.2.el7.x86_64
kernel-tools-3.10.0-514.2.2.el7.x86_64
kernel-3.10.0-514.2.2.el7.x86_64
Now, you need to enable the 4.9.0 kernel by setting up the default grub2 boot entry.

Show all entries in the grub2 menu:

sudo egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d '
The result should resemble:

CentOS Linux 7 Rescue a0cbf86a6ef1416a8812657bb4f2b860 (4.9.0-1.el7.elrepo.x86_64)
CentOS Linux (4.9.0-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-bf94f46c6bd04792a6a42c91bae645f7) 7 (Core)
Since the line count starts at 0 and the 4.9.0 kernel entry is on the second line, set the default boot entry as 1:

sudo grub2-set-default 1
Reboot the system:

sudo shutdown -r now
When the server is back online, log back in and rerun the uname command to confirm that you are using the correct Kernel:

uname -r
You should see the result as below:

4.9.0-1.el7.elrepo.x86_64

Step 2: Enable BBR

In order to enable the BBR algorithm, you need to modify the sysctl configuration as follows:

**echo 'net.core.default_qdisc=fq' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p**
Now, you can use the following commands to confirm that BBR is enabled:

sudo sysctl net.ipv4.tcp_available_congestion_control
The output should resemble:

net.ipv4.tcp_available_congestion_control = bbr cubic reno
Next, verify with:

sudo sysctl -n net.ipv4.tcp_congestion_control
The output should be:

bbr
Finally, check that the kernel module was loaded:

lsmod | grep bbr
The output will be similar to:

tcp_bbr 16384 0

Step 3 (optional): Test the network performance enhancement

In order to test BBR's network performance enhancement, you can create a file in the web server directory for download, and then test the download speed from a web browser on your desktop machine.

**sudo yum install httpd -y
sudo systemctl start httpd.service
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload
cd /var/www/html
sudo dd if=/dev/zero of=500mb.zip bs=1024k count=500**
Finally, visit the URL http://[your-server-IP]/500mb.zip from a web browser on your desktop computer, and then evaluate download speed.

That's all. Thank you for reading.

How to Deploy Google BBR on CentOS 6 in GCP

BBR (Bottleneck Bandwidth and RTT) is a new congestion control algorithm which is contributed to the Linux kernel TCP stack by Google. With BBR in place, a Linux server can get significantly increased throughput and reduced latency for connections. Besides, it's easy to deploy BBR because this algorithm requires only updates on the sender side, not in the network or on the receiver side.

In this article, I will show you how to deploy BBR on a Vultr CentOS 7 KVM server instance.

Prerequisites

A Vultr CentOS 6 x64 server instance.
A sudo user.

Step 1: Upgrade the kernel using the ELRepo RPM repository

In order to use BBR, you need to upgrade the kernel of your CentOS 7 machine to 4.9.0. You can easily get that done using the ELRepo RPM repository.

Before the upgrade, you can take a look at the current kernel:

uname -r
This command should output a string which resembles:

2.6.32-642.15.1.el6.x86_64
As you see, the current kernel is 2.6.32.

Install the ELRepo repo:

sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
Install the 4.10.4 kernel using the ELRepo repo:

sudo yum --enablerepo=elrepo-kernel install kernel-ml -y
Confirm the result:

rpm -qa | grep kernel
If the installation is successful, you should see kernel-ml-4.10.4-1.el6.elrepo.x86_64 among the output list:

dracut-kernel-004-409.el6_8.2.noarch
kernel-2.6.32-573.el6.x86_64
kernel-ml-4.10.4-1.el6.elrepo.x86_64
kernel-headers-2.6.32-642.15.1.el6.x86_64
abrt-addon-kerneloops-2.0.8-40.el6.centos.x86_64
kernel-2.6.32-642.15.1.el6.x86_64
kernel-firmware-2.6.32-642.15.1.el6.noarch
libreport-plugin-kerneloops-2.0.9-32.el6.centos.x86_6

Now, you need to enable the 4.10.4 kernel by setting up the default grub boot entry.

Show all entries in the grub2 menu:

sudo sed -i 's:default=.*:default=0:g' /etc/grub.conf

Reboot the system:

sudo shutdown -r now
When the server is back online, log back in and rerun the uname command to confirm that you are using the correct Kernel:

uname -r
You should see the result as below:

4.10.4-1.el6.elrepo.x86_64

Step 2: Enable BBR

In order to enable the BBR algorithm, you need to modify the sysctl configuration as follows:

echo 'net.core.default_qdisc=fq' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
Now, you can use the following commands to confirm that BBR is enabled:

sudo sysctl net.ipv4.tcp_available_congestion_control
The output should resemble:

net.ipv4.tcp_available_congestion_control = bbr cubic reno
Next, verify with:

sudo sysctl -n net.ipv4.tcp_congestion_control
The output should be:

bbr
Finally, check that the kernel module was loaded:

lsmod | grep bbr
The output will be similar to:

tcp_bbr 16384 0

Step 3 (optional): Test the network performance enhancement

In order to test BBR's network performance enhancement, you can create a file in the web server directory for download, and then test the download speed from a web browser on your desktop machine.

sudo yum install httpd -y
sudo server httpd start
cd /var/www/html
sudo dd if=/dev/zero of=500mb.zip bs=1024k count=500
Finally, visit the URL http://[your-server-IP]/500mb.zip from a web browser on your desktop computer, and then evaluate download speed.

That's all. Thank you for reading.

android studio gradle的问题

1、相信大家都遇到每次升级了android studio之后,gradle又要同步的这个痛苦过程,因为gradle被墙,所以只能用其他办法下载压缩包。
2、自定义gradle路径每次都要麻烦一下,这次采用官方推荐的办法,不知道会不会也存在一样的问题,如下图所示:
gradle.png
3、下载gradle并配置
gradle2.png
下载下来的安装包放到gradle配置的相应目录,默认如下图,注意对应的版本号和路径
gradle3.png

将程序从windows移植到linux(信号量和事件)

关于复杂的多线程和多进程应用程序的映射指南
随着开发人员将一些普及的 Windows® 应用程序迁移到 Linux™ 平台,企业中正在进行的向开放源码迁移的浪潮有可能引发极大的移植问题。这个由三部分组成的系列文章提供了一个映射指南,并附有一些例子,以简化从 Windows 到 Linux 的转移。本文是系列文章的第 2 部分,将介绍两种同步对象类型:信号量和事件。

- 阅读剩余部分 -