From: Lawrence S. <ljs...@us...> - 2013-02-10 21:06:17
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "An ethernet program loader for the Dreamcast.". The branch, master has been updated via 9007aa015d0ef84b25ff693848866396f904dae8 (commit) from 03f30ac98fdf5922dc340bda093edace58c03535 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9007aa015d0ef84b25ff693848866396f904dae8 Author: Lawrence Sebald <blu...@ne...> Date: Sun Feb 10 16:05:28 2013 -0500 Add in a new 1st_read for dcload-ip (completely in assembly) and bump the version number to 1.0.5. ----------------------------------------------------------------------- Summary of changes: Makefile.cfg | 4 +- target-src/1st_read/1st_read.c | 41 ------- target-src/1st_read/Makefile | 54 +++------- target-src/1st_read/asm.h | 22 ---- target-src/1st_read/crt0.S | 99 ----------------- target-src/1st_read/dc3.x | 228 ---------------------------------------- target-src/1st_read/dc4.x | 228 ---------------------------------------- target-src/1st_read/loader.s | 98 +++++++++++++++++ target-src/1st_read/memcpy.S | 221 -------------------------------------- 9 files changed, 113 insertions(+), 882 deletions(-) delete mode 100644 target-src/1st_read/1st_read.c delete mode 100644 target-src/1st_read/asm.h delete mode 100644 target-src/1st_read/crt0.S delete mode 100644 target-src/1st_read/dc3.x delete mode 100644 target-src/1st_read/dc4.x create mode 100644 target-src/1st_read/loader.s delete mode 100644 target-src/1st_read/memcpy.S diff --git a/Makefile.cfg b/Makefile.cfg index d5e5bcd..26e8fc8 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -23,8 +23,6 @@ BFDINCLUDE = /opt/dc/sh-elf/include #BFDINCLUDE = /usr/local/include # sh-elf-stuff - # Replace with 3 if you're using gcc < 4.x -TARGETCCVER = 4 TARGETCC = sh-elf-gcc TARGETCFLAGS = -O2 -ml -m4-single-only TARGETOBJCOPY = sh-elf-objcopy @@ -32,7 +30,7 @@ TARGETLD = sh-elf-ld # you generally shouldn't change this unless you are making forked # versions (or test versions) -VERFLAGS = -DDCLOAD_VERSION=\"1.0.4\" +VERFLAGS = -DDCLOAD_VERSION=\"1.0.5\" TARGETCFLAGS += $(VERFLAGS) HOSTCFLAGS += $(VERFLAGS) diff --git a/target-src/1st_read/1st_read.c b/target-src/1st_read/1st_read.c deleted file mode 100644 index 7b14ea1..0000000 --- a/target-src/1st_read/1st_read.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of the dcload Dreamcast ethernet loader - * - * Copyright (C) 2001 Andrew Kieschnick <an...@au...> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include <string.h> - -#define TARGET1 (unsigned int *)0x8c004000 -#define TARGET2 (unsigned int *)0x8c00f400 - -extern void disable_cache(void); - -extern unsigned int binary_dcload_bin_start; -extern unsigned int binary_dcload_bin_size; -extern unsigned int binary_exception_bin_start; -extern unsigned int binary_exception_bin_size; - -int main(void) -{ - memcpy(TARGET1, &binary_dcload_bin_start, binary_dcload_bin_size); - memcpy(TARGET2, &binary_exception_bin_start, binary_exception_bin_size); - - disable_cache(); - (*(void (*)()) 0x8c004000) (); -} diff --git a/target-src/1st_read/Makefile b/target-src/1st_read/Makefile index fa37e1b..bffede7 100644 --- a/target-src/1st_read/Makefile +++ b/target-src/1st_read/Makefile @@ -1,49 +1,23 @@ include ../../Makefile.cfg -CC = $(TARGETCC) -CFLAGS = $(TARGETCFLAGS) -INCLUDE = -I../../target-inc -OBJCOPY = $(TARGETOBJCOPY) -LD = $(TARGETLD) +TARGET = 1st_read.bin -OBJECTS = crt0.o 1st_read.o disable.o memcpy.o dcload.o exception.o - -.c.o: - $(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $< - -.S.o: - $(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $< - -.s.o: - $(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $< - -all: 1st_read.bin 1st_read.srec - -dcload.bin: ../dcload/dcload.bin - cp $< $@ - -exception.bin: ../dcload/exception.bin - cp $< $@ - -dcload.o: dcload.bin - $(LD) -A sh -b binary --oformat elf32-shl $< -o $@ -r -EL --no-warn-mismatch - -exception.o: exception.bin - $(LD) -A sh -b binary --oformat elf32-shl $< -o $@ -r -EL --no-warn-mismatch - -1st_read.bin: 1st_read - $(OBJCOPY) -O binary $< $@ - -1st_read.srec: 1st_read - $(OBJCOPY) -O srec $< $@ - -1st_read: $(OBJECTS) - $(CC) $(CFLAGS) -Wl,-Tdc$(TARGETCCVER).x -nostartfiles -nostdlib $^ -o $@ -lgcc +all: rm-elf $(TARGET) .PHONY : clean clean: - rm -f $(OBJECTS) 1st_read dcload.bin exception.bin + -rm -f $(TARGET) 1st_read.bin loader.elf .PHONY : distclean distclean: clean - rm -f 1st_read.bin 1st_read.srec + +.PHONY : rm-elf +rm-elf: + -rm -f $(TARGET) loader.elf + +loader.elf: loader.s disable.s ../dcload/dcload.bin ../dcload/exception.bin + $(TARGETCC) $(TARGETCFLAGS) -o $@ loader.s disable.s -nostartfiles \ + -nostdlib -Ttext=0x8c010000 -Wa,-I../dcload + +1st_read.bin: loader.elf + $(TARGETOBJCOPY) -R .stack -O binary $^ $@ diff --git a/target-src/1st_read/asm.h b/target-src/1st_read/asm.h deleted file mode 100644 index ed27fdb..0000000 --- a/target-src/1st_read/asm.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifdef __STDC__ -# define _C_LABEL(x) _ ## x -#else -# define _C_LABEL(x) _/**/x -#endif -#define _ASM_LABEL(x) x - -#define _ENTRY(name) \ - .text; .align 2; .globl name; name: - -#define ENTRY(name) \ - _ENTRY(_C_LABEL(name)) - -#if (defined (__sh2__) || defined (__sh3__) || defined (__SH3E__) \ - || defined (__SH4_SINGLE__) || defined (__SH4__)) || defined(__SH4_SINGLE_ONLY__) -#define DELAYED_BRANCHES -#define SL(branch, dest, in_slot, in_slot_arg2) \ - branch##.s dest; in_slot, in_slot_arg2 -#else -#define SL(branch, dest, in_slot, in_slot_arg2) \ - in_slot, in_slot_arg2; branch dest -#endif diff --git a/target-src/1st_read/crt0.S b/target-src/1st_read/crt0.S deleted file mode 100644 index 32b0db0..0000000 --- a/target-src/1st_read/crt0.S +++ /dev/null @@ -1,99 +0,0 @@ - .section .text - .global start - .global _atexit -start: - mov.l setup_cache_k,r0 - mov.l p2_mask,r1 - or r1,r0 - jmp @r0 - nop -setup_cache: - mov.l ccr_addr,r0 - mov.w ccr_data,r1 - mov.l r1,@r0 - mov.l start_2_k,r0 - nop - nop - nop - nop - nop - nop - nop - jmp @r0 - nop -start_2: - mov.l old_stack_k,r14 - mov.l r15,@r14 - mov.l old_pr_k,r14 - sts pr,r15 - mov.l r15,@r14 - mov.l stack_k,r15 - - ! zero out bss - mov.l edata_k,r0 - mov.l end_k,r1 - mov #0,r2 -start_l: - mov.l r2,@r0 - add #4,r0 - cmp/ge r0,r1 - bt start_l - - mov.l set_fpscr_k, r1 - jsr @r1 - mov #0,r4 - lds r3,fpscr - - ! call the mainline - mov.l main_k,r0 - jsr @r0 - nop - - mov.l old_pr_k,r14 - mov.l @r14,r15 - lds r15,pr - mov.l old_stack_k,r14 - mov.l @r14,r15 - -_atexit: - rts - nop - - .align 4 -set_fpscr_k: - .long ___set_fpscr -stack_k: - .long _stack -edata_k: - .long _edata -end_k: - .long _end -main_k: - .long _main -old_stack_k: - .long _old_stack -old_pr_k: - .long _old_pr -_old_stack: - .long 0 -_old_pr: - .long 0 -setup_cache_k: - .long setup_cache -start_2_k: - .long start_2 -p2_mask: - .long 0xa0000000 -ccr_addr: - .long 0xff00001c -ccr_data: - .word 0x090b - - .align 4 - -#ifdef __ELF__ - .section .stack,"aw" -#else - .section .stack -#endif - diff --git a/target-src/1st_read/dc3.x b/target-src/1st_read/dc3.x deleted file mode 100644 index 5ea23dc..0000000 --- a/target-src/1st_read/dc3.x +++ /dev/null @@ -1,228 +0,0 @@ -/* Sega Dreamcast linker script */ - -OUTPUT_FORMAT("elf32-shl", "elf32-shl", - "elf32-shl") -OUTPUT_ARCH(sh) -ENTRY(start) - SEARCH_DIR(/usr/local/dcdev/sh-elf/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; */ - -MEMORY -{ - ram (rwx) : ORIGIN = 0x8c010000, LENGTH = 0xfe0000 -} - -SECTIONS -{ - /* Read-only sections, merged into text segment: */ -/* . = 0x1000;*/ - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rel.init : { *(.rel.init) } - .rela.init : { *(.rela.init) } - .rel.text : - { - *(.rel.text) - *(.rel.text.*) - *(.rel.gnu.linkonce.t*) - } - .rela.text : - { - *(.rela.text) - *(.rela.text.*) - *(.rela.gnu.linkonce.t*) - } - .rel.fini : { *(.rel.fini) } - .rela.fini : { *(.rela.fini) } - .rel.rodata : - { - *(.rel.rodata) - *(.rel.rodata.*) - *(.rel.gnu.linkonce.r*) - } - .rela.rodata : - { - *(.rela.rodata) - *(.rela.rodata.*) - *(.rela.gnu.linkonce.r*) - } - .rel.data : - { - *(.rel.data) - *(.rel.data.*) - *(.rel.gnu.linkonce.d*) - } - .rela.data : - { - *(.rela.data) - *(.rela.data.*) - *(.rela.gnu.linkonce.d*) - } - .rel.ctors : { *(.rel.ctors) } - .rela.ctors : { *(.rela.ctors) } - .rel.dtors : { *(.rel.dtors) } - .rela.dtors : { *(.rela.dtors) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rel.sdata : - { - *(.rel.sdata) - *(.rel.sdata.*) - *(.rel.gnu.linkonce.s*) - } - .rela.sdata : - { - *(.rela.sdata) - *(.rela.sdata.*) - *(.rela.gnu.linkonce.s*) - } - .rel.sbss : { *(.rel.sbss) } - .rela.sbss : { *(.rela.sbss) } - .rel.bss : { *(.rel.bss) } - .rela.bss : { *(.rela.bss) } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - .init : - { - KEEP (*(.init)) - } =0 - .plt : { *(.plt) } - .text : - { - *(.text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - } =0 - _etext = .; - PROVIDE (etext = .); - .fini : - { - KEEP (*(.fini)) - } =0 - .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) } - .rodata1 : { *(.rodata1) } - /* Adjust the address for the data segment. We want to adjust up to - the same address within the page on the next page up. */ - . = ALIGN(128) + (. & (128 - 1)); - .data : - { - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - SORT(CONSTRUCTORS) - } - .data1 : { *(.data1) } - .eh_frame : { *(.eh_frame) } - .gcc_except_table : { *(.gcc_except_table) } - .ctors ALIGN(4): - { - ___ctors = .; - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - ___ctors_end = .; - } - .dtors : - { - ___dtors = .; - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - ___dtors_end = .; - } - .got : { *(.got.plt) *(.got) } - .dynamic : { *(.dynamic) } - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata : - { - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - } - _edata = .; - PROVIDE (edata = .); - __bss_start = .; - .sbss : - { - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.scommon) - } - .bss : - { - *(.dynbss) - *(.bss) - *(.bss.*) - *(COMMON) - /* Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections. */ - . = ALIGN(32 / 8); - } - . = ALIGN(32 / 8); - _end = .; - PROVIDE (end = .); - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } ...<truncated>... hooks/post-receive -- An ethernet program loader for the Dreamcast. |