From 1e1889b89a59ef090851d779941049f7f96c45bc Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 26 Aug 2020 01:12:36 +0200 Subject: Some cursor things --- kernel/drivers/mouse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kernel/drivers/mouse.c') diff --git a/kernel/drivers/mouse.c b/kernel/drivers/mouse.c index 64204c3..a5f5d0c 100644 --- a/kernel/drivers/mouse.c +++ b/kernel/drivers/mouse.c @@ -1,5 +1,6 @@ // MIT License, Copyright (c) 2020 Marvin Borner +#include #include #include #include @@ -29,6 +30,8 @@ void mouse_handler() case 2: mouse_byte[2] = inb(0x60); + free(event); + event = malloc(sizeof(*event)); event->magic = MOUSE_MAGIC; event->diff_x = mouse_byte[1]; event->diff_y = mouse_byte[2]; @@ -76,8 +79,6 @@ char mouse_read() void mouse_install() { - event = malloc(sizeof(*event)); - u8 status; // Enable auxiliary mouse device -- cgit v1.2.3