summaryrefslogtreecommitdiff
path: root/src/sys/io
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-30 14:44:45 -0400
committerIan Moffett <ian@osmora.org>2025-09-30 14:44:45 -0400
commitbed9d72177abe904979991a99cd191173579a567 (patch)
treec4b9aba045b8693cda706246bcbc7cdf0c58fc79 /src/sys/io
parentde1c5a97ecfb41a4bfe8651c9341dc31c17e5cd0 (diff)
kern: mac: Add MAC resource querying
Introduce a feature where a program with the correct rights may get information about a MAC object Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/io')
-rw-r--r--src/sys/io/video/fbdev.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sys/io/video/fbdev.c b/src/sys/io/video/fbdev.c
index 1464f0c..9ebad7a 100644
--- a/src/sys/io/video/fbdev.c
+++ b/src/sys/io/video/fbdev.c
@@ -39,6 +39,7 @@
#include <io/video/fbdev.h>
#include <vm/map.h>
#include <vm/mmu.h>
+#include <string.h>
static struct fb_info info;
@@ -88,6 +89,14 @@ fbdev_map(struct mac_border *mbp, struct mac_map_args *args)
}
static int
+fbdev_getattr(struct mac_border *mbp, void *p, size_t len)
+{
+ len = MIN(len, sizeof(struct fb_info));
+ memcpy(p, &info, len);
+ return 0;
+}
+
+static int
fbdev_init(struct module *modp)
{
struct bootvar_fb *fbvar;
@@ -123,7 +132,7 @@ fbdev_init(struct module *modp)
static struct mac_ops ops = {
.map = fbdev_map,
.sync = NULL,
- .getattr = NULL
+ .getattr = fbdev_getattr
};
struct mac_border g_fbdev_border = {