Initial commit

This commit is contained in:
Inex Code 2023-03-21 11:19:59 +03:00
commit eea26837fb
6 changed files with 69 additions and 0 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

18
.idea/misc.xml Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MakefileSettings">
<option name="linkedExternalProjectsSettings">
<MakefileProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="version" value="2" />
</MakefileProjectSettings>
</option>
</component>
<component name="MakefileWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
obj-m += hello.o
# make -C $(nix-build -E '(import <nixpkgs> {}).linux.dev' --no-out-link)/lib/modules/*/build M=$(pwd)
all:
make -C /nix/store/f0b11y3qv1y0l3yvwkl88m181fnbmn80-linux-5.15.92-dev/lib/modules/*/build M=/home/inex/dev/Linux modules
clean:
make -C /nix/store/f0b11y3qv1y0l3yvwkl88m181fnbmn80-linux-5.15.92-dev/lib/modules/*/build M=/home/inex/dev/Linux clean

25
hello.c Normal file
View File

@ -0,0 +1,25 @@
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Inex Code");
MODULE_DESCRIPTION("A hello world");
MODULE_VERSION("0.0.2");
static char *whom = "world";
module_param(whom, charp, 0);
static int howmany = 1;
module_param(howmany, int, 0);
static int __init hello_init(void) {
int i;
for (i = 0; i < howmany; i++)
printk(KERN_INFO "Hello %s.\n", whom);
return 1;
}
static void __exit hello_goodbye(void) {
printk(KERN_INFO "Goodbye cruel %s.\n", whom);
}
module_init(hello_init);
module_exit(hello_goodbye);