我在邮件列表里学英语
Communication is hard, especially with all the different personalities, languages, and
cultures involved in an international community like this.– Faith Ekstrand
It is rules and not our individual smarts that keep us from making mistakes.
– Faith Ekstrand
Cache 一致性
HiKey970
环境准备
WSL2 作为上位机
识别 Windows 11 Host 的 USB Serial Device
分别在 Windows 11 上安装 usbipd-win, 在 WSL2 上安装 user space tools for USB/IP
1 | Microsoft Windows [版本 10.0.22621.1702] |
WSL2 Ubuntu-20.04 创建 /dev/ttyUSB0
1 | [Thu Jun 15 19:19:44 2023] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(3) |
Recovery 模式应该连接哪个 Type-C (USB SERIAL) 接口
HiKey970 有两个 Type-C 接口,而且当板子被设置为 Recovery 模式时,两个接口均会被识别为“串口”。在左手边的 (J3101) 是用来访问 Debug UART 的,而在 HDMI 和 USB 中间的那个(J1801)是在 Recovery 模式下使用的。而且这两个接口是两个不同厂家提供的芯片,使用完全不同的内核驱动模块
- 前者(J3101):
Bus 001 Device 003: ID 04e2:1410 Exar Corp. XR21V1410 USB-UART IC
- 后者(J1801):
Bus 001 Device 002: ID 12d1:3609 Huawei Technologies Co., Ltd. USB SER
显示
flowchart LR
DPE["Display Engine<br>(display controller)"]
DSI["Display Serial Interface"]
HDMI["external HDMI converter"]
subgraph in-chip
DPE -- RGB timing --> DSI
end
DSI --> HDMI
参考
Syscall vs C routines
系统调用是 Linux 用户态程序与内核通信的接口。 每个特定的文件系统都会在自己的 file_operations
里提供各种文件操作接口,像 .open
, .close
, .ioctl
。系统调用会通过 VFS 的接口调用这些具体的实现,而对于应用程序来说,一般不会直接使用系统调用,而是调用 C 库函数 (C routines).
ioctl 这个系统调用的声明大概是这样:
1 | COMPAT_SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, compat_ulong_t, arg) |
ioctl 的 C 库函数 (Aarch64 实现):
1 | .text |
Linux Kernel Debugging
Distro | Ubuntu | Arch Linux |
---|---|---|
source | git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy | git@github.com:archlinux/linux.git |
initrd | sudo mkinitramfs -o /boot/initrd.img-KERNELVERSION KERNELVERSION |
sudo mkinitcpio --generate /boot/initramfs-KERNELVERSION.img --kernel KERNELVERSION |
grub | sudo update-grub |
sudo grub-mkconfig -o /boot/grub/grub.cfg |
KERNELVERSION
是make kernelrelease
的输出,同时也是sudo make modules_install
时在/lib/modules
创建的目录名
Knowledge from "[RFC] Plane color pipeline KMS uAPI"
Gamma LUT property
Gamma LUT (Look-Up Table) is a property that is used to correct the color and brightness of an image or video. Gamma LUT is basically a table of values that is used to map input values to output values, for example, it may map low input values to higher output values to brighten the image.
Gamma LUT is used to adjust the gamma curve of an image or video, which means it can be used to correct the brightness and contrast of an image. This property is commonly used in image and video processing applications, such as photo editing software, video editing software, and color grading tools.
Gamma LUT can also be used to correct color shifts caused by different lighting conditions or camera settings. By adjusting the gamma curve of an image or video, it is possible to create a more natural and accurate representation of the original scene.
Submitting My First Linux Kernel Patch
Linux 内核的 patch 是以纯文本的邮件形式进行提交和代码走查的,而且 patch 是先到内核子系统 maintainer 维护的 git tree, 再到 Linus Torvalds 的 main tree。本文主要是以一个 patch 提交的实例来记录一下整个过程中的一些具体操作要点,至于 kernel patch 提交的规范和操作细节内核文档 和各种博客文章有很多,这里不再赘述。