aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-02-21 18:11:26 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-02-21 18:11:26 +0200
commitb1322ac720b4a04175dae0e60e627e81e19f1cb9 (patch)
tree57be1038c2a5e9a5fdc9d16064408b52c0ef8d33 /drivers
parentCall global constructors (diff)
downloadkernel.cpp-b1322ac720b4a04175dae0e60e627e81e19f1cb9.tar.xz
Kconfig
Diffstat (limited to 'drivers')
-rw-r--r--drivers/Kconfig42
-rw-r--r--drivers/makefile18
2 files changed, 60 insertions, 0 deletions
diff --git a/drivers/Kconfig b/drivers/Kconfig
new file mode 100644
index 0000000..5f33772
--- /dev/null
+++ b/drivers/Kconfig
@@ -0,0 +1,42 @@
+menu "Drivers"
+
+ menu "Video"
+ config video0_enable
+ bool "Enable video0"
+ default y
+
+ choice video0_driver
+ prompt "video0 driver"
+ depends on video0_enable
+ config video0_driver_cga
+ bool "CGA"
+ config video0_driver_vga
+ bool "VGA"
+ endchoice
+
+ config VIDEO0_CLASS
+ string "video0 class"
+ default "CGA" if video0_driver_cga
+ default "VGA" if video0_driver_vga
+ depends on video0_enable
+ config VIDEO0_CONSOLE
+ bool "use video0 for debug output"
+ default y
+ depends on video0_enable
+ endmenu
+
+ menu "Serial ports"
+ config serial0_enable
+ bool "Enable serial0"
+ default y
+
+ config SERIAL0_CLASS
+ string "serial0 class"
+ default "SerialPort"
+ depends on serial0_enable
+ config SERIAL0_CONSOLE
+ bool "Use serial0 for debug output"
+ default y
+ depends on serial0_enable
+ endmenu
+endmenu
diff --git a/drivers/makefile b/drivers/makefile
index 0d9071a..ad255c4 100644
--- a/drivers/makefile
+++ b/drivers/makefile
@@ -1,2 +1,20 @@
CXX_OBJ += drivers/cga.o \
drivers/serial.o
+
+HWH := drivers/hardware.h
+autogen := $(autogen) $(HWH)
+
+$(HWH): .config
+ @echo " GEN $@"
+ @echo \/\* autogenerated hardware description \*\/ > $(HWH)
+ @echo \#pragma once >> $(HWH)
+ifdef CONFIG_video0_enable
+ @echo \#define HAS_VIDEO0 >> $(HWH)
+ @echo $(CONFIG_VIDEO0_CLASS) video0\; >> $(HWH)
+ @echo constexpr bool video0_console = true\; >> $(HWH)
+endif
+ifdef CONFIG_serial0_enable
+ @echo \#define HAS_SERIAL0 >> $(HWH)
+ @echo $(CONFIG_SERIAL0_CLASS) serial0\; >> $(HWH)
+ @echo constexpr bool serial0_console = true\; >> $(HWH)
+endif