From 0dd3f5e6f4f7607611ce23510858ab3597b5df9f Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 16 Aug 2020 17:13:32 +0200 Subject: Added events and map syscall --- apps/Makefile | 5 +++-- apps/wm.c | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/Makefile b/apps/Makefile index 390d181..e36ec35 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -6,9 +6,10 @@ LD = ../cross/opt/bin/i686-elf-ld OC = ../cross/opt/bin/i686-elf-objcopy # Flags to make the binary smaller TODO: Remove after indirect pointer support! -CSFLAGS = -mpreferred-stack-boundary=2 -fno-asynchronous-unwind-tables -Os +# TODO: Fix optimization flags (relocation of functions) +CSFLAGS = -mpreferred-stack-boundary=2 -fno-asynchronous-unwind-tables -O0 -CFLAGS = $(CSFLAGS) -Wall -Wextra -nostdlib -nostdinc -ffreestanding -ffunction-sections -fno-builtin -mgeneral-regs-only -std=c99 -m32 -pedantic-errors -Wl,-emain -I../libc/inc/ -I../libgui/inc/ -Wl,-emain -fPIE -Duserspace +CFLAGS = $(CSFLAGS) -Wall -Wextra -nostdlib -nostdinc -ffreestanding -ffunction-sections -fno-builtin -mgeneral-regs-only -std=c99 -m32 -pedantic-errors -Wl,-emain -I../libc/inc/ -I../libgui/inc/ -fPIE -Duserspace all: $(COBJS) diff --git a/apps/wm.c b/apps/wm.c index b9cae91..f4dac44 100644 --- a/apps/wm.c +++ b/apps/wm.c @@ -7,6 +7,11 @@ #include #include +void onkey() +{ + printf("KEY EVENT\n"); +} + void main(char **argv) { struct vbe *vbe = (struct vbe *)argv[0]; @@ -20,6 +25,9 @@ void main(char **argv) gui_init("/font/spleen-16x32.psfu"); gui_write(vbe, 50, 50, text, "hallo"); + printf("onkey: %x\n", onkey); + map(EVENT_KEYBOARD, onkey); + while (1) { }; exit(); -- cgit v1.2.3