kernel: add second example kext for dependency test

This commit is contained in:
2023-04-09 16:42:16 +01:00
parent c7fdb81ef9
commit 076a15e47b
4 changed files with 24 additions and 3 deletions

View File

@@ -6,4 +6,4 @@ id: net.doorstuck.socks.hello-world
license: BSD-3-Clause
copyright: Copyright © Max Wash 2023
sources:
- hello-world.c
- main.c

View File

@@ -1,7 +1,7 @@
#include <socks/printk.h>
#include <socks/kext.h>
kern_status_t online(struct kext *self)
static kern_status_t online(struct kext *self)
{
printk("Hello, world!");
return KERN_OK;
@@ -9,4 +9,4 @@ kern_status_t online(struct kext *self)
DEFINE_KEXT("net.doorstuck.socks.hello-world",
online, NULL,
"net.doorstuck.socks-kernel");
"net.doorstuck.socks.test-base");

View File

@@ -0,0 +1,9 @@
name: test-base
description: |
A sample kernel extension, demonstrating the structure of a kext.
No actual functionality.
id: net.doorstuck.socks.test-base
license: BSD-3-Clause
copyright: Copyright © Max Wash 2023
sources:
- main.c

12
kexts/test-base/main.c Normal file
View File

@@ -0,0 +1,12 @@
#include <socks/printk.h>
#include <socks/kext.h>
static kern_status_t online(struct kext *self)
{
printk("Kernel extension base online");
return KERN_OK;
}
DEFINE_KEXT("net.doorstuck.socks.test-base",
online, NULL,
KEXT_NO_DEPENDENCIES);