aboutsummaryrefslogtreecommitdiff
path: root/kernel/drivers
diff options
context:
space:
mode:
authorMarvin Borner2021-05-19 00:43:40 +0200
committerMarvin Borner2021-05-19 00:43:40 +0200
commit98df498e8e8a07e33cc77a059876b940cb9b3c6a (patch)
tree57a2ff0fab411c91fba5512827c18124b092aa5d /kernel/drivers
parent45bfdffcb2e00fda595b3f9318469f6b0d29cbe4 (diff)
Smashed some bugs
Diffstat (limited to 'kernel/drivers')
-rw-r--r--kernel/drivers/fb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/drivers/fb.c b/kernel/drivers/fb.c
index 6a81434..7ef1088 100644
--- a/kernel/drivers/fb.c
+++ b/kernel/drivers/fb.c
@@ -31,14 +31,12 @@ static u32 fb_map_buffer(struct page_dir *dir)
assert(vbe);
struct memory_range r =
virtual_alloc(dir, memory_range_around((u32)vbe->fb, FB_SIZE), MEMORY_USER);
- printf("FB: %x+%x\n", r.base, r.size);
return r.base;
}
static u32 fb_owner = 0;
static res fb_ioctl(u32 request, void *arg1, void *arg2, void *arg3)
{
- UNUSED(arg2);
UNUSED(arg3);
switch (request) {
@@ -55,8 +53,12 @@ static res fb_ioctl(u32 request, void *arg1, void *arg2, void *arg3)
fb_owner = proc_current()->pid;
u32 fb = fb_map_buffer(proc_current()->page_dir);
- vbe->fb = (u8 *)fb;
- memcpy_user(arg1, vbe, size);
+
+ stac();
+ memcpy(arg1, vbe, size);
+ ((struct vbe_basic *)arg1)->fb = (u8 *)fb;
+ clac();
+
return EOK;
}
default: