Simplify the userland kernel as well

This commit is contained in:
Pierre Pronchery 2018-06-07 11:35:47 -04:00
parent 58e0cad31a
commit 5b900d2c7c
4 changed files with 25 additions and 7 deletions

View File

@ -67,6 +67,9 @@ _start:
call __stack_chk_setup
#endif
/* call the global constructors */
call _init
/* run the userland kernel */
push $0x0
push $0x0

21
tools/init.c Normal file
View File

@ -0,0 +1,21 @@
/* $Id$ */
/* Copyright (c) 2018 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS uKernel */
#include "drivers/bus.h"
#include "drivers/console.h"
#define TOOLS_BUS "tty"
#define TOOLS_CONSOLE "stdio"
int _init(void)
{
ukBus * bus;
bus = bus_init(TOOLS_BUS);
console_init(bus, TOOLS_CONSOLE);
return 0;
}

View File

@ -2,10 +2,4 @@
/* Copyright (c) 2018 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS uKernel */
#define KERNEL_BUS "tty"
#define KERNEL_CONSOLE "stdio"
#include "../src/kernel/main.c"

View File

@ -14,7 +14,7 @@ sources=start.S
[uKernel]
type=binary
sources=bus.c,console.c,main.c
sources=bus.c,console.c,init.c,main.c
ldflags=$(OBJDIR)start.o $(OBJDIR)../src/lib/libuKernel.a `$(CC) -print-libgcc-file-name`
depends=$(OBJDIR)start.o,$(OBJDIR)../src/lib/libuKernel.a