virtualbox-5.2.24 dkms build failed against x86_32 kernel 5.1.0-rc1+

kernel 5.1 相比 5.0 又发生了新的变化,导致 virtualbox-5.2.24 的编译又失败了,是 2 个 commit 引起的变化:

  • commit 746c9398f5ac2b3f5730da4ed09e99ef4bb50b4a
    arch: move common mmap flags to linux/mman.h
    ...
  • commit 736706bee3298208343a76096370e4f6a5c55915
    get rid of legacy 'get_ds()' function
    ...

解决方法是修改 /usr/src/virtualbox-5.2.24/r0drv/linux/the-linux-kernel.h

#include <asm/mman.h …
more ...

初识 relay

详细的 GUIDE 参考 Documentation/filesystems/relay.txt

A 'relay channel' is a kernel->user data relay mechanism implemented as a set of per-cpu kernel buffers ('channel buffers'), each represented as a regular file ('relay file') in user space. Kernel …

more ...

virtualbox-5.2.24 dkms build failed against x86_32 kernel 5.0.0-rc2+

最近想在本子上装个 virtualbox 跑个 winxp,旧本子,一直用的 32 位 Debian,内核经常更新,现在版本是 5.0.0-rc2+

apt install virtualbox virtualbox-dkms 安装完后,建立虚拟机的时候报错,说不能加载 vboxdrv 模块

dkms build

想着可能是因为内核新,所以 dkms 工作没做好,干脆跑一下 dkms build。结果一跑,报错了:

    # dkms build -m virtualbox -v 5.2.24

    Kernel preparation unnecessary for this kernel.  Skipping...

    Building …
more ...

atomic_xchg & atomic_cmpxchg

If someone wants to use xchg(), cmpxchg() and their variants, linux/atomic.h should be included rather than asm/cmpxchg.h, unless the code is in arch/* and can take care of itself.

    "compare and swap" atomically:
        1) Compares "old" with the value currently at …
more ...