Path: blob/master/arch/m68k/platform/68328/head-de2.S
10819 views
1#define MEM_END 0x00800000 /* Memory size 8Mb */23#undef CRT_DEBUG45.macro PUTC CHAR6#ifdef CRT_DEBUG7moveq #\CHAR, %d78jsr putc9#endif10.endm1112.global _start13.global _rambase14.global _ramvec15.global _ramstart16.global _ramend1718.data1920/*21* Set up the usable of RAM stuff22*/23_rambase:24.long 025_ramvec:26.long 027_ramstart:28.long 029_ramend:30.long 03132.text3334_start:3536/*37* Setup initial stack38*/39/* disable all interrupts */40movew #0x2700, %sr41movel #-1, 0xfffff30442movel #MEM_END-4, %sp4344PUTC '\r'45PUTC '\n'46PUTC 'A'47PUTC 'B'4849/*50* Determine end of RAM51*/5253movel #MEM_END, %a054movel %a0, _ramend5556PUTC 'C'5758/*59* Move ROM filesystem above bss :-)60*/6162moveal #_sbss, %a0 /* romfs at the start of bss */63moveal #_ebss, %a1 /* Set up destination */64movel %a0, %a2 /* Copy of bss start */6566movel 8(%a0), %d1 /* Get size of ROMFS */67addql #8, %d1 /* Allow for rounding */68andl #0xfffffffc, %d1 /* Whole words */6970addl %d1, %a0 /* Copy from end */71addl %d1, %a1 /* Copy from end */72movel %a1, _ramstart /* Set start of ram */73741:75movel -(%a0), %d0 /* Copy dword */76movel %d0, -(%a1)77cmpl %a0, %a2 /* Check if at end */78bne 1b7980PUTC 'D'8182/*83* Initialize BSS segment to 084*/8586lea _sbss, %a087lea _ebss, %a18889/* Copy 0 to %a0 until %a0 == %a1 */902: cmpal %a0, %a191beq 1f92clrl (%a0)+93bra 2b941:9596PUTC 'E'9798/*99* Load the current task pointer and stack100*/101102lea init_thread_union, %a0103lea 0x2000(%a0), %sp104105PUTC 'F'106PUTC '\r'107PUTC '\n'108109/*110* Go111*/112113jmp start_kernel114115/*116* Local functions117*/118119#ifdef CRT_DEBUG120putc:121moveb %d7, 0xfffff9071221:123movew 0xfffff906, %d7124andw #0x2000, %d7125beq 1b126rts127#endif128129130