Initialize the platform directly

This commit is contained in:
Pierre Pronchery 2019-09-05 23:03:27 +02:00
parent b6157e0035
commit 2dc44905d9
4 changed files with 10 additions and 18 deletions

View File

@ -65,6 +65,13 @@ auxv_done:
# endif
#endif
/* initialize the platform */
#ifdef __PIC__
call platform_init
#else
call platform_init
#endif
/* run the userland kernel */
#ifdef __ELF__
pop %rcx

View File

@ -71,8 +71,8 @@ _start:
/* call the global constructors */
call _init
/* initialize the userland */
call init
/* initialize the platform */
call platform_init
/* run the userland kernel */
call main

View File

@ -1,15 +0,0 @@
/* $Id$ */
/* Copyright (c) 2018 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS uKernel */
#include <kernel/platform.h>
/* init */
int init(void)
{
platform_init();
return 0;
}

View File

@ -35,7 +35,7 @@ sources=start.S
[uKernel]
type=binary
sources=bus.c,clock.c,console.c,init.c,platform.c,main.c
sources=bus.c,clock.c,console.c,platform.c,main.c
ldflags=$(OBJDIR)crti.o $(OBJDIR)crtbegin.o $(OBJDIR)start.o $(OBJDIR)libk.a $(OBJDIR)crtend.o $(OBJDIR)crtn.o `$(CC) -print-libgcc-file-name`
depends=$(OBJDIR)crtbegin.o,$(OBJDIR)crtend.o,$(OBJDIR)start.o,$(OBJDIR)libk.a