我要评分
获取效率
正确性
完整性
易理解

Compiling CMF

Obtain the CMF source code and compile and install CMF as instructed in this section.

Obtaining the Source Code

Run the following command to obtain the CMF source code:

git clone --branch v1.0.0 --depth 1 https://gitcode.com/boostkit/cmf.git

Compilation Procedure

  1. Install the complier.
    yum install -y gcc g++ make cmake boost-devel
  2. Install the kernel source code. Use yum to install the OS kernel source code.
    1. Check the kernel version of the current environment.
      uname -a
      The command output is as follows:
      Linux localhost.localdomain 5.10.0-216.0.0.115.oe2203sp4.aarch64 #1 SMP Thu Jun 27 15:22:10 CST 2024 aarch64 aarch64 aarch64 GNU/Linux

      The current kernel version is 5.10.0-216.0.0.115.oe2203sp4.

    2. Install the kernel source code of the corresponding version.
      yum install kernel-devel-5.10.0-216.0.0.115.oe2203sp4
  3. Compile the driver file.
    1. Go to the CMF source code path and create a build folder.
      mkdir build
    2. Go to the build folder.
      cd build
    3. Generate the build script.
      cmake ..
    4. Compile and generate the driver file.
      make drv
    5. Compile and generate the command line tool.
      make -j

      The driver file cman.ko is stored in the drv folder in the CMF root directory, and the command line tool devcman is stored in the build/uapi folder.

Driver Usage Description

  • Command for checking whether the driver is loaded
    lsmod | grep cman

    If the driver is successfully loaded, the following information is displayed.

    If the driver is not loaded, no information is displayed.

  • Command for loading the driver
    1. Go to the drv directory where the cman.ko file is stored.
      cd drv
    2. Load the driver.
      insmod ./cman.ko
  • Command for uninstalling the driver
    rmmod -s cman