/boot/trunk/arch/sparc64/loader/asm.S |
---|
37,9 → 37,62 |
nop |
memcpy: |
b memcpy |
nop |
.register %g2, #scratch |
.register %g3, #scratch |
add %o1, 7, %g1 |
and %g1, -8, %g1 |
cmp %o1, %g1 |
be,pn %xcc, 3f |
add %o0, 7, %g1 |
mov 0, %g3 |
0: |
brz,pn %o2, 2f |
mov 0, %g2 |
1: |
ldub [%g3 + %o1], %g1 |
add %g2, 1, %g2 |
cmp %o2, %g2 |
stb %g1, [%g3 + %o0] |
bne,pt %xcc, 1b |
mov %g2, %g3 |
2: |
jmp %o7 + 8 ! exit point |
mov %o1, %o0 |
3: |
and %g1, -8, %g1 |
cmp %o0, %g1 |
bne,pt %xcc, 0b |
mov 0, %g3 |
srlx %o2, 3, %g4 |
brz,pn %g4, 5f |
mov 0, %g5 |
4: |
sllx %g3, 3, %g2 |
add %g5, 1, %g3 |
ldx [%o1 + %g2], %g1 |
mov %g3, %g5 |
cmp %g4, %g3 |
bne,pt %xcc, 4b |
stx %g1, [%o0 + %g2] |
5: |
and %o2, 7, %o2 |
brz,pn %o2, 2b |
sllx %g4, 3, %g1 |
mov 0, %g2 |
add %g1, %o0, %o0 |
add %g1, %o1, %g4 |
mov 0, %g3 |
6: |
ldub [%g2 + %g4], %g1 |
stb %g1, [%g2 + %o0] |
add %g3, 1, %g2 |
cmp %o2, %g2 |
bne,pt %xcc, 6b |
mov %g2, %g3 |
jmp %o7 + 8 ! exit point |
mov %o1, %o0 |
jump_to_kernel: |
b jump_to_kernel |
nop |
/boot/trunk/arch/sparc64/loader/boot.S |
---|
28,11 → 28,36 |
#define INITIAL_STACK 0x0 |
.register %g2, #scratch |
.register %g3, #scratch |
.register %g6, #scratch |
.register %g7, #scratch |
.section BOOTSTRAP, "ax" |
.global start |
start: |
b 1f |
nop |
/* |
* This header forces SILO to load the image at 0x4000. |
* More precisely, SILO will think this is an old version of Linux. |
*/ |
.ascii "HdrS" |
.word 0 |
.half 0 |
.align 8 |
1: |
flushw |
# TODO: set initial stack |
set ofw, %l0 |
call init ! initialize OpenFirmware |
stx %o4, [%l0] |
b bootstrap |
nop |
/boot/trunk/arch/sparc64/loader/ofw.c |
---|
31,5 → 31,11 |
void write(const char *str, const int len) |
{ |
ofw_write(str, len); |
int i; |
for (i = 0; i < len; i++) { |
if (str[i] == '\n') |
ofw_write("\r", 1); |
ofw_write(&str[i], 1); |
} |
} |
/boot/trunk/arch/sparc64/loader/pack |
---|
40,7 → 40,7 |
ENTRY(start) |
SECTIONS { |
.boot 0x4000: AT (0) { |
.boot 0x4000: AT (0x4000) { |
*(BOOTSTRAP); |
*(.text); |
*(.rodata); |
74,7 → 74,6 |
echo "$TASK -> $OBJECT" |
echo " |
. = ALIGN(8192); |
*(.${BASENAME}_image);" >> "$LINK" |
echo " |
96,6 → 95,10 |
done |
echo ' } |
/DISCARD/ : { |
*(.comment); |
*(.note*); |
} |
}' >> "$LINK" |
echo " |