Skip to main content

Linux Device Tree Pinctrl Tutorial

When porting drivers on a specific board for a comparatively new linux kernel, it is common to edit the linux device tree files to put together all the device configurations with register values, working modes and pin control offsets set to expected values.

Here in this post we focus on the exact steps one needs to find the correct pin control offset for specific devices. Here we'd take TI's AM4379 (AM437x) chip as an example for this tutorial.

Read more…

Manually UEFI Boot Linux and Windows 10 USB from Grub


Dead boot of Linux or Windows needs a lot of labor when sometimes it just does not work.

Legacy boot mode does not support hard drives that provides more than 2TB disk space, and mostly you would like to use UEFI mode for better Windows 10 support.

With this tutorial you may:

  1. Learn how to boot from a blank computer into grub via changing BIOS options
    • You need a working computer with Linux
    • Note: it may differ from BIOS to BIOS, but the basic idea does not change
  2. Learn how to boot from multiple different Linux distribution ISO images from a UEFI compatible USB device
  3. Learn how to boot Windows 10 USB in grub

Read more…



交叉熵是一个在 ML 领域经常会被提到的名词。在这篇文章里将对这个概念进行详细的分析。


假设 X 是一个离散型随机变量,其取值集合为 \( \chi \) ,概率分布函数为 \(p(x)=P_r(X=x), x \in X\) ,我们定义事件 \(X=x_0\) 的信息量为:

\( I(x_0) = − \log(p(x_0)) \)

可以理解为,一个事件发生的概率越大,则它所携带的信息量就越小, 而当 \(p(x_0)=1\) 时,熵将等于 0,也就是说该事件的发生不会导致任何信息量的增加。

Read more…

A Humble Introduction to the Basics of Unicode

Unicode诞生之前——单字节编码 (Single-Byte Encoding)


!"#$%&'()*+,-./0123456789:;<=>[email protected][\]^_`abcdefghijklmnopqrstuvwxyz{|}~
  • 7位二进制编码
  • 32个控制字符
  • 95个可显示字符
  • 基本通用,但经常使用替换和扩展
  • 适合英语的编码方式,但不适合其他语言


  • IBM提出Code Page概念
  • CP437 (Latin US)
  • CP737 (Greek)
  • Apple: Mac OS Roman
  • DEC: Multinational Character Set
  • ISO/IEC 8859
  • … 扩展ASCII种类不计其数

Read more…

A Humble Introduction to the Basics of GDB

What is GDB?

GDB is a user process that attaches on to another user process.

That's all.

Project Build Type

  • Debug build: gcc -g
    • Works with gdb
    • Shows source code
    • Easy mode
  • Release with debug information build:
    • Works with gdb
    • Shows source code, however messy because of optimizations
    • Hard mode
  • Release build: gcc -O2
    • Works with gdb
    • No source code information available
    • Debug with disassembled application
    • Hell mode

Read more…

Ubuntu 14.04 CUDA install

For Ubuntu 16.04 Users:

sudo apt-get -y install nvidia-361-updates-dev nvidia-prime nvidia-profiler \
  nvidia-settings nvidia-visual-profiler \
  nvidia-cuda-dev nvidia-cuda-toolkit nvidia-opencl-dev

And, that's it!

For Ubuntu 14.04 Users

Read more…

Show me the reason: Why did my network fail? (Show error messages from NetworkManager)

The method is for systemd users.

In order to show the error messages printed from your NetworkManager, you need to manually start it from your command line.

Here's the instructions:

systemctl mask NetworkManager.service
systemctl stop NetworkManager.service
NM_PPP_DEBUG=1 /usr/sbin/NetworkManager --no-daemon
systemctl unmask NetworkManager.service
systemctl restart NetworkManager.service