aboutsummaryrefslogtreecommitdiff
path: root/devices
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2023-10-08 19:50:00 +0300
committeraqua <aqua@iserlohn-fortress.net>2023-11-27 21:02:22 +0200
commitfc13fb2ba5993d06d9d6ae5e80bc337aebbdc119 (patch)
tree9607ab4d5f1d4069d4f761a0b25eada36088bd6b /devices
parentrules.mk: make include paths absolute (diff)
downloadkernel-fc13fb2ba5993d06d9d6ae5e80bc337aebbdc119.tar.xz
Use meson build system
Diffstat (limited to 'devices')
-rw-r--r--devices/include/keyboard.h (renamed from devices/keyboard.h)0
-rw-r--r--devices/include/mouse.h (renamed from devices/mouse.h)0
-rw-r--r--devices/include/pic.h (renamed from devices/pic.h)0
-rw-r--r--devices/include/ps2_controller.h (renamed from devices/ps2_controller.h)0
-rw-r--r--devices/include/uart.h (renamed from devices/uart.h)4
-rw-r--r--devices/include/vga.h (renamed from devices/vga.h)0
-rw-r--r--devices/meson.build27
-rwxr-xr-xdevices/mk14
-rw-r--r--devices/uart/uart_16550.h2
-rw-r--r--devices/uart/unittest_uart_16550.cc2
10 files changed, 31 insertions, 18 deletions
diff --git a/devices/keyboard.h b/devices/include/keyboard.h
index 5f4fcc2..5f4fcc2 100644
--- a/devices/keyboard.h
+++ b/devices/include/keyboard.h
diff --git a/devices/mouse.h b/devices/include/mouse.h
index a34ecb4..a34ecb4 100644
--- a/devices/mouse.h
+++ b/devices/include/mouse.h
diff --git a/devices/pic.h b/devices/include/pic.h
index c545c60..c545c60 100644
--- a/devices/pic.h
+++ b/devices/include/pic.h
diff --git a/devices/ps2_controller.h b/devices/include/ps2_controller.h
index d2f7e80..d2f7e80 100644
--- a/devices/ps2_controller.h
+++ b/devices/include/ps2_controller.h
diff --git a/devices/uart.h b/devices/include/uart.h
index 53a4f41..8b44519 100644
--- a/devices/uart.h
+++ b/devices/include/uart.h
@@ -5,7 +5,7 @@
#include <sys/io.h>
#else
-// from stdio
+/* from stdio */
typedef struct FILE {
int id;
void (*putc)(const struct FILE *, char);
@@ -13,7 +13,7 @@ typedef struct FILE {
void (*flush)(const struct FILE *);
} FILE;
-// from sys/io
+/* from sys/io */
unsigned char inb(unsigned short);
void outb(unsigned char, unsigned short);
diff --git a/devices/vga.h b/devices/include/vga.h
index df0d921..df0d921 100644
--- a/devices/vga.h
+++ b/devices/include/vga.h
diff --git a/devices/meson.build b/devices/meson.build
new file mode 100644
index 0000000..d6f4739
--- /dev/null
+++ b/devices/meson.build
@@ -0,0 +1,27 @@
+devs_srcs = files(
+ 'pic_8259.c',
+ 'uart/uart_16550.c',
+ 'vga.c',
+ 'i8042.c',
+ 'pckbd.c',
+ 'mouse.c',
+)
+devs_incl = include_directories('include')
+
+devs = declare_dependency(
+ link_with: static_library('devs', devs_srcs,
+ include_directories: devs_incl,
+ dependencies: [ libk, i686 ],
+ ),
+ include_directories: devs_incl,
+)
+
+# tests
+test('uart_16550',
+ executable('test_uart_16550', 'uart/uart_16550.c', 'uart/unittest_uart_16550.cc',
+ include_directories: devs_incl,
+ dependencies: [ gtest, gmock ],
+ native: true),
+ suite: 'dev'
+)
+
diff --git a/devices/mk b/devices/mk
deleted file mode 100755
index b27d945..0000000
--- a/devices/mk
+++ /dev/null
@@ -1,14 +0,0 @@
-#!../mach
-
-INCLUDES := -I../${ARCH}
-${ARCH}_CFLAGS += ${INCLUDES}
-${ARCH}_CXXFLAGS += ${INCLUDES}
-
-TARGETLIB += devs
-devs.SRCS = pic_8259.c uart/uart_16550.c vga.c i8042.c pckbd.c mouse.c
-
-HOSTTARGETBIN += uart/test_uart_16550
-uart/test_uart_16550.SRCS = uart/uart_16550.c uart/unittest_uart_16550.cc
-
-TESTS += uart/test_uart_16550
-
diff --git a/devices/uart/uart_16550.h b/devices/uart/uart_16550.h
index d4f470e..bbeb9b7 100644
--- a/devices/uart/uart_16550.h
+++ b/devices/uart/uart_16550.h
@@ -1,6 +1,6 @@
#pragma once
-#include "../uart.h"
+#include "uart.h"
int uart_thre(unsigned short port);
void uart_putc(const FILE *self, char a);
diff --git a/devices/uart/unittest_uart_16550.cc b/devices/uart/unittest_uart_16550.cc
index 16e7202..f8124bb 100644
--- a/devices/uart/unittest_uart_16550.cc
+++ b/devices/uart/unittest_uart_16550.cc
@@ -7,7 +7,7 @@ using ::testing::Return;
namespace k {
extern "C" {
-#include "../uart.h"
+#include "uart.h"
#include "uart_16550.h"
}
} // namespace k