2 | execute NetBSD kernel
4 | written by Yasha (ITOH Yasufumi)
7 | $NetBSD: execkern.S,v 1.2 2001/06/12 16:57:27 minoura Exp $
9 #include <machine/asm.h>
12 #define MFP 0x00E88000 /* MFP */
13 #define MFP_IERA (MFP+0x07) /* (B) interrupt enable reg A */
14 #define MFP_IERB (MFP+0x09) /* (B) interrupt enable reg B */
15 #define MFP_RSR (MFP+0x2B) /* (B) USART receiver status reg */
18 #define SRAM 0x00ED0000 /* SRAM start addr */
19 #define SRAM_MEMSZ (SRAM + 8) /* (L) size of main memory */
24 | a3+4 section #1 image top address
25 | a3+8 section #1 size
26 | a3+12 section #1 gap size
28 | a3+n-12 section #XK_NSEC image top address
29 | a3+n-8 section #XK_NSEC size
30 | a3+n-4 section #XK_NSEC gap size
32 | a3+n (reserved) (d5)
34 | a3+n+8 boothowto (d7)
35 | a3+n+12 entry address (absolute address)
37 #ifndef XK_NO_C_INTERFACE
40 ENTRY_NOPROFILE(exec_kernel)
42 moveal %sp@+,%a3 | struct execkern_arg *
45 moveal %a3@+,%a1 | load address
54 moveal %a3@+,%a0 | section image address
55 movel %a3@+,%d0 | section size
58 movel %a3@+,%d0 | section gap
63 | stop MFP interrupts (for compatibility)
70 | start(load_addr, mem_max, kernel_end)
76 movel %d0,%sp@- | arg #3 (end of kernel)
77 movel SRAM_MEMSZ,%sp@- | arg #2 (RAM size from SRAM)
78 movel %d3,%sp@- | arg #1 (load address)
81 movel %a3@+,%d5 | (reserved)
82 movel %a3@+,%d6 | boot device
83 movel %a3@+,%d7 | boot howto
85 movel %a3@+,%a0 | entry address
87 moveml %a3@+,%d5-%d7/%a0
90 | clear unused registers
103 jsr %a0@ | execute NetBSD kernel
106 | ??? returned from kernel -- issue software reset
108 moveml 0x00ff0000,#0x0101 | get RESET vectors (%d0: ssp, %a0: pc)
109 moveml #0x0101,%a1@ | put them at 0x00000000 (for Xellent)
110 .long 0x4E7B9801 | movec %a1,%vbr
111 jmp %a0@ | go to reset address
118 | copy %d0 bytes from higher (%a0) to lower (%a1) address
124 | clear %d0 bytes at %a1
125 | do nothing if %d0 is zero