在 Apple M1 上试用 Gentoo/Prefix
背景
上一次折腾 Gentoo/Prefix 是五年多以前,当时还是用的 Intel Mac,最近需要探索一下在现在的 macOS 系统上用 Gentoo/Prefix 会遇到哪些问题,因此今天在 Apple M1 上重新尝试一次。
上一次折腾 Gentoo/Prefix 是五年多以前,当时还是用的 Intel Mac,最近需要探索一下在现在的 macOS 系统上用 Gentoo/Prefix 会遇到哪些问题,因此今天在 Apple M1 上重新尝试一次。
本文的内容已经整合到知识库中。
STP(Spanning Tree Protocol)可以在 802.1D-1998 第 8 章中找到。STP 协议工作在交换机上,需要根据交换机连接的拓扑,自动计算出一个生成树,并且把不在生成树上的边禁用,这样即使连接的拓扑有环路,禁用以后就没有环了。有了 STP 以后,连接交换机的时候就可以刻意连成环,从而提供冗余。
之前用 libvirtd + virt-manager 做 Linux 上的虚拟化,好处是比较轻量级,但是远程控制起来比较麻烦,要么通过 RDP 访问 virt-manager 的 UI,要么就用 cockpit 在网页里去配置虚拟机。此时就会比较怀念 VMware ESXi 的网页,但是 ESXi 装完以后,宿主机就很不自由了,很多东西没法自定义。最后就想到在 Debian 上装一个 Proxmox VE,希望得到一个比较好的中间态。
OpenLDAP 是一个开源的用户系统实现,主要支持 LDAP 协议,可以给其他系统提供用户认证。下面讨论了如何在 Docker 中部署 OpenLDAP。
最近设计了一款 PMOD SPI NOR Flash 扩展板,搭载了 W25Q128 SPI NOR Flash 芯片。在 jlc 生产回来以后,通过 JLink 连接到电脑上进行测试,看看是否可以用 JLink 操作 SPI NOR Flash。
In short, the commit introduced by Linux 6.2.13:
commit 0d30989fe9a176565d360376d4bc2ea1c61cbbac
Author: Liam R. Howlett <Liam.Howlett@oracle.com>
Date: Fri Apr 14 14:59:19 2023 -0400
mm/mmap: regression fix for unmapped_area{_topdown}
commit 58c5d0d6d522112577c7eeb71d382ea642ed7be4 upstream.
The maple tree limits the gap returned to a window that specifically fits
what was asked. This may not be optimal in the case of switching search
directions or a gap that does not satisfy the requested space for other
reasons. Fix the search by retrying the operation and limiting the search
window in the rare occasion that a conflict occurs.
Link: https://lkml.kernel.org/r/20230414185919.4175572-1-Liam.Howlett@oracle.com
Fixes: 3499a13168da ("mm/mmap: use maple tree for unmapped_area{_topdown}")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
While fixing a BUG, a new BUG is introduced, causing MAP_32BIT to fail to work sometimes, and Xilinx's Digilent driver uses this parameter, causing mmap to fail and unable to recognize the FPGA.
The new BUG has been fixed in [PATCH v2] maple_tree: Make maple state reusable after mas_empty_area().
简单来说,Linux 6.2.13 引入的 commit:
commit 0d30989fe9a176565d360376d4bc2ea1c61cbbac
Author: Liam R. Howlett <Liam.Howlett@oracle.com>
Date: Fri Apr 14 14:59:19 2023 -0400
mm/mmap: regression fix for unmapped_area{_topdown}
commit 58c5d0d6d522112577c7eeb71d382ea642ed7be4 upstream.
The maple tree limits the gap returned to a window that specifically fits
what was asked. This may not be optimal in the case of switching search
directions or a gap that does not satisfy the requested space for other
reasons. Fix the search by retrying the operation and limiting the search
window in the rare occasion that a conflict occurs.
Link: https://lkml.kernel.org/r/20230414185919.4175572-1-Liam.Howlett@oracle.com
Fixes: 3499a13168da ("mm/mmap: use maple tree for unmapped_area{_topdown}")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
修复了 BUG 的同时,引入了新的 BUG,导致 MAP_32BIT 有时无法工作,而 Xilinx 的 Digilent 下载器代码使用了这个参数,导致 mmap 失败,无法识别 FPGA。
新 BUG 在 [PATCH v2] maple_tree: Make maple state reusable after mas_empty_area() 中被修复。
在给 Alinx AX7021 适配 LiteX 的时候,遇到一个问题:PL 上没有连接串口,只有 PS 连接了串口,如果用 RISC-V 软核的话,就会面临无串口可用的情况,除非在扩展 IO 上自己定义一个串口。
因此研究了一下 LiteX 自带的 UART over JTAG 功能,在 Alinx AX7021 中调试出来了。
本文的内容已经整合到知识库中。
DRAM 一直有一个比较麻烦的初始化过程,就是 DRAM Training,其中很重要的一步就是计算出各个数据线相对于时钟的偏移(skew)。这个偏移是怎么来的呢?
我们知道,对于 SRAM,如果想要更多的位宽,只需要把地址线和控制信号连接到多个 SRAM 上,然后把 SRAM 的数据信号并行连接到 FPGA 上就可以了,但是前提是要尽量保证等长,否则一样有偏移的问题。DRAM 也是采用类似的方法进行扩展的,但是 DRAM 通常需要并行连接很多个芯片,例如 8 个 x8 的芯片的合并成一个 64 位的 DDR SDRAM。此时数据线依然是并行连接,但是地址线和控制信号就出现了走线困难:很难在那么小的空间里,等长地把地址和控制信号分布到各个芯片上,而且还有信号完整性的问题。
Arty A7 是一款 Digilent 出品的 FPGA 开发板,为了在它上面跑 Linux,可以用 LiteX 生成由 VexRiscv 作为 RISC-V 核心的 SoC,最后可以在开发板上把 Linux 跑起来。
群友上个月提了一个未知来源问题:
实现一个你自己的 printf(int, ...)
函数,该函数包含可变参数。为简便期间,假设所有参数均为 int 类型。
首先从 https://www.sco.com/support/update/download/product.php?pfid=12&prid=20 下载 SCO OpenServer 的安装 ISO。尝试过用 QEMU 启动,但是会卡在无法读取硬盘的错误上。
最后使用 VirtualBox 7.0.6 成功启动,注意创建虚拟机的时候不要给太多内存,例如 4GB 就起不来,2GB 可以。硬盘我也只给了 4GB 的空间。
在 https://www.sco.com/support/update/download/product.php?pfid=1&prid=6 可以看到 UnixWare 7.1.4 的相关下载,其中首先要下载 UnixWare 的安装 ISO:https://www.sco.com/support/update/download/release.php?rid=346,尝试过用 QEMU 启动,会遇到找不到 CD-ROM 的问题,虽然通过设置 ATAPI_DMA_DISABLE=YES
解决了,但是又遇到了找不到硬盘的问题。
最后换成了 VirtualBox 7.0.6。用 VirtualBox 创建虚拟机的时候,不要给太多内存,4GB 就会无法启动,2GB 可以,硬盘也不要给太多,4GB 就足够。
宿主机环境是 Debian bookworm,不需要像其他教程那样自己编译 qemu,直接 apt install 即可。
通过 google 可以搜索到 AIX 7.2 的 ISO,下载第一个 ISO 到本地,然后在 QEMU 中启动安装镜像:
首先从 https://www.sco.com/support/update/download/release.php?rid=218 下载 SCO OpenServer 的安装 ISO 和从 https://www.sco.com/support/update/download/release.php?rid=187 下载 Supplement CD 5 ISO,然后用 QEMU 启动,这次需要用图形界面:
Chisel 3.6 很快就要发布了(目前最新版本是 3.6.0-RC2),这个大版本的主要更新内容就是引入了 CIRCT 的 firtool 作为 FIRRTL 到 Verilog 的转换流程:
The primary change in Chisel v3.6.0 is the transition from the Scala FIRRTL
Compiler to the new MLIR FIRRTL Compiler. This will have a minimal impact on
typical Chisel user APIs but a large impact on custom compiler flows. For
more information, please see the ROADMAP.
因此提前测试一下 firtool,看看其和 Scala FIRRTL Compiler 有哪些区别,是否有更好的输出。
今年的龙芯杯又开始报名了,我来写一篇关于协同仿真(cosim)的博客蹭蹭热度。下面的内容参考了一些已有的协同仿真的框架,例如 ibex co-sim 和 OpenXiangShan/difftest。