xref: /minix/minix/kernel/arch/earm/head.S (revision 9f988b79)
1#include "kernel/kernel.h" /* configures the kernel */
2
3/* sections */
4
5#include <machine/vm.h>
6#include "kernel/kernel.h"
7#include <minix/config.h>
8#include <minix/const.h>
9#include <minix/com.h>
10#include <machine/asm.h>
11#include <machine/interrupt.h>
12#include "archconst.h"
13#include "kernel/const.h"
14#include "kernel/proc.h"
15#include "sconst.h"
16#include <machine/multiboot.h>
17#include <machine/cpu.h>
18
19#include "arch_proto.h" /* K_STACK_SIZE */
20
21.section .startup
22/*===========================================================================*/
23/*					MINIX				     */
24/*===========================================================================*/
25.global MINIX
26MINIX:
27/* this is the entry point for the MINIX kernel */
28	b multiboot_init
29
30.text
31multiboot_init:
32	ldr	sp, =load_stack_start	/* make usable stack */
33	mov	fp, #0
34	bl	_C_LABEL(pre_init)
35
36	/* Kernel is mapped high now and ready to go, with
37	 * the boot info pointer returned by pre_init in r0.
38	 * Set the highly mapped stack and initialize it.
39	 *
40	 * Afther that call kmain with r0 still pointing to boot info
41	 */
42	ldr	sp, =k_initial_stktop
43	mov	r1, #0
44	push	{r1}			/* Terminate stack */
45	ldr	r2, =_C_LABEL(kmain)	/* r0 holds kinfo_t ptr */
46	bx	r2
47
48	/* not reached */
49hang:
50	b hang
51
52.data
53load_stack:
54	.space 4096
55load_stack_start:
56