This commit is contained in:
2026-09-20 05:27:41 +02:00
parent 831308b2ad
commit 77f228df11
38 changed files with 465 additions and 115 deletions
+3
View File
@@ -12,4 +12,7 @@ config ACPI
help
Adds support for ACPI firmware, tables and devices.
source "dev/block/Kconfig"
source "dev/pci/Kconfig"
endmenu
+5
View File
@@ -0,0 +1,5 @@
menu "Block device drivers"
source "dev/block/nvme/Kconfig"
endmenu
+3
View File
@@ -0,0 +1,3 @@
if kconfig.get('CONFIG_NVME_CORE', 'n') != 'n'
subdir('nvme')
endif
+13
View File
@@ -0,0 +1,13 @@
menu "NVMe Support"
config NVME_CORE
bool
default y
config NVME_PCI
bool "NVMe via PCI transport"
default y
depends on PCI
depends on NVME_CORE
endmenu
+12
View File
@@ -0,0 +1,12 @@
#include <zinnia/cmdline.h>
#include <zinnia/module.h>
#include <zinnia/print.h>
void nvme_init(struct module* mod) {
log("Hello world from NVMe!\n");
}
void do_nvme(bool on) {}
CMDLINE_OPTION("nvme_on", "My description", do_nvme);
MODULE("NVME", "Marvin Friedrich", "ISC", "1.0", nvme_init);
+12
View File
@@ -0,0 +1,12 @@
nvme_sources = files('core.c')
if kconfig.get('CONFIG_NVME_PCI', 'n') == 'y'
nvme_sources += files('pci.c')
endif
modules += {
'nvme': {
'modular': true, #kconfig.get('CONFIG_NVME_CORE') == 'm',
'sources': nvme_sources,
},
}
View File
+1
View File
@@ -0,0 +1 @@
#pragma once
+5 -2
View File
@@ -1,9 +1,12 @@
subdir('common')
subdir('block')
if cfg.get('CONFIG_ACPI', 0) == 1
if kconfig.get('CONFIG_ACPI', 'n') == 'y'
subdir('acpi')
endif
if cfg.get('CONFIG_DT', 0) == 1
if kconfig.get('CONFIG_DT', 'n') == 'y'
subdir('dt')
endif
module_lds = meson.current_source_dir() / 'module.ld'
+101
View File
@@ -0,0 +1,101 @@
/* Linker script for kernel modules */
ENTRY(__module_start)
PHDRS
{
text PT_LOAD FLAGS(5);
rodata PT_LOAD FLAGS(4);
data PT_LOAD FLAGS(6);
dynamic PT_DYNAMIC FLAGS(6);
modversion 0x60000001;
modauthor 0x60000002;
moddesc 0x60000003;
modlicense 0x60000004;
modcmdline 0x60000005;
}
SECTIONS
{
. = ALIGN(CONSTANT(MAXPAGESIZE));
/* Code */
.text : {
*(.init .init.*)
*(.text .text.*)
*(.fini .fini.*)
*(.plt .plt.*)
} :text
. = ALIGN(CONSTANT(MAXPAGESIZE));
/* Read-only data */
.rodata : {
*(.rodata .rodata.*)
*(.hash .hash.*)
*(.got .got.*)
*(.got.plt .got.plt.*)
} :rodata
.cmdline : {
KEEP(*(.cmdline))
} :rodata :modcmdline
.mod.version : {
KEEP(*(.mod.version))
} :rodata :modversion
.mod.author : {
KEEP(*(.mod.author))
} :rodata :modauthor
.mod.desc : {
KEEP(*(.mod.desc))
} :rodata :moddesc
.mod.license : {
KEEP(*(.mod.license))
} :rodata :modlicense
. = ALIGN(CONSTANT(MAXPAGESIZE));
/* Read-Write data */
.data : {
*(.data)
*(.data.*)
} :data
/* Zero-initialized memory */
.bss : {
*(.*bss .*bss.*)
*(COMMON)
} :data
.dynsym : {
*(.dynsym .dynsym.*)
} :data
.dynstr : {
*(.dynstr .dynstr.*)
} :data
.rela.dyn : {
*(.rela.dyn .rela.dyn.*)
} :data
/* Dynamic tags */
.dynamic : {
*(.dynamic)
} :data :dynamic
/DISCARD/ :
{
*(.comment*)
*(.eh_frame*)
*(.rel.eh_frame*)
*(.relr.dyn .relr.dyn.*)
*(.gcc_except_table*)
*(.note*)
*(.interp)
}
}
+7
View File
@@ -0,0 +1,7 @@
menu "PCI bus drivers"
config PCI
bool "PCI core drivers"
default y
endmenu