Skip to content

olatov/fp-kernel-hello

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

FP Hello Linux kernel module

References

Specs

Tested on Debian 12, kernel 6.1.0-28-amd64, FPC 3.3.1.

Make sure you have Free Pascal compiler, the kernel build tools, and kernel headers installed.

sudo apt install fpc build-essential linux-headers-$(uname -r)

Usage

$ cd src

$ make
...
make[1]: Leaving directory '/usr/src/linux-headers-6.1.0-28-amd64'

$ sudo insmod fpkmhello.ko

$ sudo dmesg
...
[10388.929879] KERNEL:INFO:Hello from Free Pascal!

$ lsmod | grep fpkmhello
fpkmhello              28672  0

$ sudo rmmod fpkmhello

$ sudo dmesg
...
[10388.929879] KERNEL:INFO:Hello from Free Pascal!
[10421.320454] KERNEL:INFO:Bye-bye!

Troubleshooting

Compiling system.pas
system.pas(12,10) Error: Duplicate identifier "Char"

You may get this error depending on which version FPC (e.g. 3.2.2) you're using. Try removing the line

Char = #0..#255;

from system.pas file.

About

Hello world Linux kernel module built in Free Pascal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published