Update of /cvsroot/lapetus/lapetus/tests/shared
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3007
Added Files:
BART.LNK crt0.s makefile
Log Message:
-Bunch of dependencies
--- NEW FILE: crt0.s ---
!
! Bart's Custom Sega Saturn Start-Up Code
! Bart Trzynadlowski, 2001
! Public domain
!
! For use with the GNU C Compiler. This code has been tested with gcc version
! cygnus-2.7-96q3.
!
! Make sure this is the first file linked into your project, so that it is at
! the very beginning. Use the BART.LNK linker script. Load the resulting
! binary at 0x6004000 on the Sega Saturn and begin execution there.
!
.section .text
!
! Entry point
!
.global start
start:
!
! Clear BSS
!
mov.l bss_start,r0
mov.l bss_end,r1
mov #0,r2
lbss:
cmp/ge r0,r1
bt lbss_end
add #1,r0
mov.b r2,@r0
bra lbss
lbss_end:
!
! Set initial stack pointer. Stack is from 0x6002000-0x6003FFF
!
mov.l stack_ptr,r15
!
! Jump to main()
!
mov.l main_ptr,r0
jsr @r0
nop
!
! When main() terminates, jump back to the ARP entry point
!
mov.l arp_ptr,r0
jmp @r0
nop
nop
!
! Following is never reached, it was the from the original
! version of crt0.s
!
!
! Once _main() has terminated, disable interrupts and loop infinitely
!
mov #0xf,r0
shll2 r0
shll2 r0
ldc r0,sr
end:
bra end
nop
arp_ptr: .long 0x02000100
main_ptr: .long _main
stack_ptr: .long 0x6004000 ! stack is from 0x6002000-0x6003FFF
bss_start: .long __bss_start
bss_end: .long __bss_end
! This is to keep libc happy
.global _atexit
bra end
nop
--- NEW FILE: makefile ---
CC = sh-coff-gcc
AS = sh-coff-as
LD = sh-coff-ld
ifndef TARGETTYPE
TARGETTYPE = binary
endif
LDFLAGS = -nostartfiles --script ../shared/bart.lnk --oformat $(TARGETTYPE)
CRT0 = obj/crt0.o
LIBS = C:/PROGRA~1/KPITCU~1/GNUSHV~1/sh-coff/sh-coff/lib/libc.a \
C:/PROGRA~1/KPITCU~1/GNUSHV~1/sh-coff/lib/gcc/sh-coff/4.0-GNUSH_v0601/libgcc.a
obj/crt0.o: ../shared/crt0.s
$(AS) $< -o $@
--- NEW FILE: BART.LNK ---
/*
* Bart's Custom Sega Saturn Linker Script
* Bart Trzynadlowski, 2001
* Public domain
*
* For use with the GNU linker, ld. This script has been tested with ld
* version 2.6-96q3.
*
* This script allows code to be loaded at 0x6004000. Data follows immediately
* after the code, and BSS (uninitialized data) immediately after that. The
* output file is a plain binary image. Begin execution at the very beginning
* of the binary (0x6004000.)
*/
OUTPUT_FORMAT("binary")
SECTIONS
{
. = 0x6004000;
.text : { *(.text) }
.tors : {
___ctors = . ;
*(.ctors)
___ctors_end = . ;
___dtors = . ;
*(.dtors)
___dtors_end = . ;
}
.data : { *(.data) }
__bss_start = .;
.bss : { *(.bss) }
__bss_end = .;
_end = .;
}
|