From 98df498e8e8a07e33cc77a059876b940cb9b3c6a Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 19 May 2021 00:43:40 +0200 Subject: Smashed some bugs --- kernel/drivers/fb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'kernel/drivers') 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: -- cgit v1.2.3