Skip to content

fpgasystems/dma-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dma-driver

Build Kernel Module/Driver

  1. Install prerequisites, e.g. on Ubuntu install the following packages:
$ apt install build-essential linux-headers-generic
  1. Build kernel module
$ cd dma/driver/driver
$ make

Setup Hugepages

  1. Create a group for users of hugepages, and retrieve its GID (in this example, 1001) then add yourself to the group.
$ groupadd hugetlbfs

$ getent group hugetlbfs

$ adduser dasidler hugetlbfs
  1. Edit /etc/sysctl.conf and add this text to specify the number of pages you want to reserve (see page-size)
# Allocate 8192*2MiB for HugePageTables
vm.nr_hugepages = 8192

# Members of group hugetlbfs(1001) can allocate "huge" shared memory segments
vm.hugetlb_shm_group = 1001
  1. Create a mount point for the file system
$ mkdir /media/huge
  1. Add this line in /etc/fstab (The mode 1770 allows anyone in the group to create files but not unlink or rename each other's files.)
# hugetlbfs
hugetlbfs /media/huge hugetlbfs mode=1770,gid=1001 0 0
  1. Reboot

  2. Add the following line to /etc/security/limits.conf to configure the amount of memory a user can lock, so an application can't crash your operating system by locking all the memory.

@hugetlbfs	hard	memlock		1048576

Build Example Application

  1. Install prerequisites, e.g. on Ubuntu install the following packages:
$ apt install libboost-program-options-dev cmake
  1. Compile example application
$ cd dma-driver/sw
$ mkdir build && cd build
$ cmake ../src
$ make

Run Example Application/Benchmark

  1. Load kernel module if not loaded yet.
$ cd dma-driver/driver
$ insmod xdma_driver.ko
  1. Run the Application (requires root permission)
$ cd dma-driver/sw/build
$ ./dma-example

Read FPGA Debug Registers

  1. Load kernel module if not loaded yet.
$ cd dma-driver/driver
$ insmod xdma_driver.ko
  1. Run the Application (requires root permission)
$ cd dma-driver/sw/build
$ ./debug

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published