diff options
author | dzwdz | 2022-08-08 21:13:36 +0200 |
---|---|---|
committer | dzwdz | 2022-08-08 21:13:36 +0200 |
commit | 2f6f3ea54ad01f02e68a23345565c34eb47ad365 (patch) | |
tree | 5f5c97eca9ab1e6b61a2511d4864803f8bd11557 /src/user/app/mousedump | |
parent | cb04eada02bedc5b748e01b09a899dc139c4970f (diff) |
user: drawmouse for demoing mouse/graphic support
Diffstat (limited to 'src/user/app/mousedump')
-rw-r--r-- | src/user/app/mousedump/mousedump.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/user/app/mousedump/mousedump.c b/src/user/app/mousedump/mousedump.c deleted file mode 100644 index 04331a3..0000000 --- a/src/user/app/mousedump/mousedump.c +++ /dev/null @@ -1,32 +0,0 @@ -#include <camellia/syscalls.h> -#include <unistd.h> -#include <shared/container/ring.h> -#include <stdio.h> - -static uint8_t r_buf[64]; -static ring_t r = {(void*)r_buf, sizeof r_buf, 0, 0}; - -struct packet { - uint8_t stuff; - int8_t dx, dy; -} __attribute__((packed)); - -int main(void) { - char buf[64]; - handle_t fd = _syscall_open("/kdev/ps2/mouse", 15, 0); - if (fd < 0) { - fprintf(stderr, "couldn't open mouse\n"); - exit(1); - } - for (;;) { - int len = _syscall_read(fd, buf, sizeof buf, 0); - if (len == 0) break; - ring_put(&r, buf, len); - while (ring_size(&r) >= 3) { - struct packet p; - ring_get(&r, &p, sizeof p); - printf("%4d %4d\n", p.dx, p.dy); - } - } - return 0; -} |