meta: Add some magic to figure out what modules to build

This commit is contained in:
K. Lange 2022-02-06 22:08:20 +09:00
parent 9f03252e3a
commit b9b24f6190
18 changed files with 28 additions and 3 deletions

View File

@ -40,7 +40,8 @@ KERNEL_SOURCES += $(wildcard kernel/arch/${ARCH}/*.S)
# Kernel modules are one file = one module; if you want to build more complicated
# modules, you could potentially use `ld -r` to turn multiple source objects into
# a single relocatable object file.
MODULES = $(patsubst modules/%.c,$(BASE)/mod/%.ko,$(wildcard modules/*.c))
ARCH_ENABLED_MODS = $(shell util/valid-modules.sh $(ARCH))
MODULES = $(patsubst modules/%.c,$(BASE)/mod/%.ko,$(foreach mod,$(ARCH_ENABLED_MODS),modules/$(mod).c))
EMU = qemu-system-${ARCH}

View File

@ -1,6 +1,7 @@
/**
* @file kernel/audio/ac97.c
* @brief Driver for the Intel AC'97.
* @package x86_64
*
* Simple PCM interface for the AC'97 codec when used with the
* ICH hardware interface. There are other hardware interfaces

View File

@ -1,6 +1,7 @@
/**
* @brief AHCI Block Device Driver
* @file modules/ahci.c
* @package x86_64
*
* @warning This is a stub driver.
*

View File

@ -1,6 +1,7 @@
/**
* @brief (P)ATA / IDE disk driver
* @file modules/ata.c
* @package x86_64
*
* @warning This is very buggy.
*

View File

@ -1,6 +1,7 @@
/**
* @file modules/dospart.c
* @brief DOS MBR partition table mapper
* @package x86_64
*
* Provides partition entries for disks.
*

View File

@ -1,6 +1,7 @@
/**
* @file kernel/net/e1000.c
* @brief Intel Gigabit Ethernet device driver
* @package x86_64
*
* @copyright
* This file is part of ToaruOS and is released under the terms

View File

@ -1,6 +1,7 @@
/**
* @file kernel/audio/es1371.c
* @brief Driver for the Ensoniq ES1371.
* @package x86_64
*
* @ref http://www.vogons.org/download/file.php?id=13036&sid=30df81e15e2521deb842a79f451b1161
*

View File

@ -1,6 +1,7 @@
/**
* @file modules/ext2.c
* @brief Implementation of the Ext2 filesystem.
* @package x86_64
*
* @warning There are many known bugs in this implementation.
*

View File

@ -1,6 +1,7 @@
/**
* @file kernel/audio/hda.c
* @brief Driver for the Intel High Definition Audio.
* @package x86_64
*
* @warning This is a stub driver.
*

View File

@ -1,6 +1,7 @@
/**
* @file modules/i965.c
* @brief Bitbanged modeset driver for a ThinkPad T410's Intel graphics.
* @package x86_64
*
* This is NOT a viable driver for Intel graphics devices. It assumes Vesa
* has already properly set up the display pipeline with the needed timings

View File

@ -1,6 +1,7 @@
/**
* @file modules/iso9660.c
* @brief ISO9660 "High Sierra" CD file system driver.
* @package x86_64
*
* @copyright
* This file is part of ToaruOS and is released under the terms

View File

@ -1,6 +1,7 @@
/**
* @file modules/pcspkr.c
* @brief PC beeper device interface
* @package x86_64
*
* Use with @ref apps/beep.c to play music.
*

View File

@ -1,6 +1,7 @@
/**
* @file modules/piix4.c
* @brief Intel PIIX4 ISA Bridge Driver
* @package x86_64
*
* @copyright
* This file is part of ToaruOS and is released under the terms

View File

@ -1,6 +1,8 @@
/**
* @file modules/test.c
* @brief Test module.
* @package x86_64
* @package aarch64
*
* Load with various arguments to do things like crash the
* kernel or print tracebacks.

View File

@ -1,6 +1,7 @@
/**
* @file kernel/arch/x86_64/vbox.c
* @brief VirtualBox Guest Additions driver
* @package x86_64
*
* Implements the following features:
* - Absolute mouse cursor positioning

View File

@ -1,6 +1,7 @@
/**
* @file kernel/arch/x86_64/vmware.c
* @brief VMware/QEMU mouse and VMWare backdoor driver.
* @package x86_64
*
* Supports absolute mouse cursor and resolution setting.
*
@ -34,7 +35,6 @@
#include <kernel/args.h>
#include <kernel/module.h>
#ifdef __x86_64__
#include <kernel/arch/x86_64/ports.h>
#define VMWARE_MAGIC 0x564D5868 /* hXMV */
@ -522,4 +522,3 @@ struct Module metadata = {
.fini = fini,
};
#endif

View File

@ -1,6 +1,7 @@
/**
* @brief xHCI Host Controller Driver
* @file modules/xhci.c
* @package x86_64
*
* @warning This is a stub driver.
*

9
util/valid-modules.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
for mod in $DIR/../modules/*.c; do
fgrep -q "@package $1" "$mod" || continue
echo -n $mod | sed s'#.*/\([^/]*\)\.c#\1 #'
done
echo