diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-30 14:44:45 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-30 14:44:45 -0400 |
commit | bed9d72177abe904979991a99cd191173579a567 (patch) | |
tree | c4b9aba045b8693cda706246bcbc7cdf0c58fc79 /src/sys/io/video | |
parent | de1c5a97ecfb41a4bfe8651c9341dc31c17e5cd0 (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/video')
-rw-r--r-- | src/sys/io/video/fbdev.c | 11 |
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 = { |