2012-10-08 03:38:03 +02:00
|
|
|
#include "kernel/kernel.h" /* configures the kernel */
|
|
|
|
|
|
|
|
/* sections */
|
|
|
|
|
|
|
|
#include <machine/vm.h>
|
2013-01-13 17:20:11 +01:00
|
|
|
#include "kernel/kernel.h"
|
2012-10-08 03:38:03 +02:00
|
|
|
#include <minix/config.h>
|
|
|
|
#include <minix/const.h>
|
|
|
|
#include <minix/com.h>
|
|
|
|
#include <machine/asm.h>
|
|
|
|
#include <machine/interrupt.h>
|
|
|
|
#include "archconst.h"
|
|
|
|
#include "kernel/const.h"
|
|
|
|
#include "kernel/proc.h"
|
|
|
|
#include "sconst.h"
|
|
|
|
#include <machine/multiboot.h>
|
|
|
|
#include <machine/cpu.h>
|
|
|
|
|
|
|
|
#include "arch_proto.h" /* K_STACK_SIZE */
|
|
|
|
|
|
|
|
.text
|
|
|
|
/*===========================================================================*/
|
2014-02-07 08:46:29 +01:00
|
|
|
/* MINIX */
|
2012-10-08 03:38:03 +02:00
|
|
|
/*===========================================================================*/
|
|
|
|
.global MINIX
|
|
|
|
MINIX:
|
|
|
|
/* this is the entry point for the MINIX kernel */
|
|
|
|
b multiboot_init
|
|
|
|
|
|
|
|
multiboot_init:
|
2014-02-10 13:12:21 +01:00
|
|
|
ldr sp, =load_stack_start /* make usable stack */
|
2012-10-08 03:38:03 +02:00
|
|
|
mov fp, #0
|
|
|
|
bl _C_LABEL(pre_init)
|
|
|
|
|
|
|
|
/* Kernel is mapped high now and ready to go, with
|
2014-02-10 13:12:21 +01:00
|
|
|
* the boot info pointer returned by pre_init in r0.
|
|
|
|
* Set the highly mapped stack and initialize it.
|
|
|
|
*
|
|
|
|
* Afther that call kmain with r0 still pointing to boot info
|
2012-10-08 03:38:03 +02:00
|
|
|
*/
|
|
|
|
ldr sp, =k_initial_stktop
|
|
|
|
mov r1, #0
|
2014-02-10 13:12:21 +01:00
|
|
|
push {r1} /* Terminate stack */
|
|
|
|
ldr r2, =_C_LABEL(kmain) /* r0 holds kinfo_t ptr */
|
2013-01-13 17:20:11 +01:00
|
|
|
bx r2
|
2012-10-08 03:38:03 +02:00
|
|
|
|
|
|
|
/* not reached */
|
|
|
|
hang:
|
|
|
|
b hang
|
|
|
|
|
|
|
|
.data
|
|
|
|
load_stack:
|
|
|
|
.space 4096
|
|
|
|
load_stack_start:
|