diff options
author | Marvin Borner | 2020-08-21 20:39:48 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-21 20:39:48 +0200 |
commit | f700ba6668dbdb91a03b2c5aa387eb4cabae8fcd (patch) | |
tree | b04a80efabb09c9da9726332ccd22cb5a325fe39 /apps | |
parent | 1339d96cea2c647991c178587008d6fc40772a78 (diff) |
Some things here and some things there
Diffstat (limited to 'apps')
-rw-r--r-- | apps/Makefile | 2 | ||||
-rw-r--r-- | apps/init.c | 13 | ||||
-rw-r--r-- | apps/link.ld | 6 | ||||
-rw-r--r-- | apps/wm.c | 13 |
4 files changed, 19 insertions, 15 deletions
diff --git a/apps/Makefile b/apps/Makefile index e36ec35..17af36a 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -9,7 +9,7 @@ OC = ../cross/opt/bin/i686-elf-objcopy # 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/ -fPIE -Duserspace +CFLAGS = $(CSFLAGS) -Wall -Wextra -nostdlib -nostdinc -fno-builtin -mgeneral-regs-only -std=c99 -m32 -pedantic-errors -I../libc/inc/ -I../libgui/inc/ -fPIE -Duserspace all: $(COBJS) diff --git a/apps/init.c b/apps/init.c index de87798..64fbde3 100644 --- a/apps/init.c +++ b/apps/init.c @@ -8,11 +8,14 @@ #include <sys.h> #include <vesa.h> -void main(struct vbe *vbe) +int main(int argc, char **argv) { - print("Init loaded.\n"); - int a = exec("/wm", vbe); + (void)argc; - if (a) - exit(); + printf("ARGC: %d\n", argc); + printf("ARGV: %x\n", argv); + printf("%s loaded.\n", argv[0]); + + exec("/wm", "wm", argv[1], NULL); + return 0; } diff --git a/apps/link.ld b/apps/link.ld index 84b2e2f..2b9599a 100644 --- a/apps/link.ld +++ b/apps/link.ld @@ -1,14 +1,14 @@ OUTPUT_FORMAT("elf32-i386") OUTPUT_ARCH(i386) -ENTRY(main) +STARTUP(libc.a) /* HUH */ +ENTRY(_start) SECTIONS { . = 0x00000000; .text : { - *(.text.main) - *(.text*) + *(.text) } .rodata : { @@ -16,11 +16,12 @@ void onkey(u32 scancode) } } -void main(char **argv) +int main(int argc, char **argv) { - struct vbe *vbe = (struct vbe *)argv[0]; + struct vbe *vbe = (struct vbe *)argv[1]; - print("WM loaded.\n"); + printf("%x\n", argc); + printf("%s loaded.\n", argv[0]); printf("VBE: %dx%d\n", vbe->width, vbe->height); const u32 color[3] = { 0, 0, 0 }; @@ -29,10 +30,10 @@ 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); + /* printf("onkey: %x\n", onkey); */ + /* map(EVENT_KEYBOARD, onkey); */ while (1) { }; - exit(); + return 0; } |