source: ada-examples/hello_world_ada/pc386-elf2boot @ 2059da6

ada-examples-4-10-branchada-examples-4-9-branch
Last change on this file since 2059da6 was db9a1d1, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 27, 2007 at 2:40:55 PM

2007-09-27 Joel Sherrill <joel.sherrill@…>

  • README: New tests. Clean up. Rework so all tests use the same shared Makefile for the hard logic of producing an executable.
  • Makefile, pc386-elf2boot: New files.
  • Makefile.anybsp: Removed.
  • Property mode set to 100755
File size: 1.1 KB
Line 
1#! /bin/sh
2#
3#  Script for pc386 BSP to convert ELF files to GRUB bootable images
4#
5
6if [ "X${RTEMS_MAKEFILE_PATH}" = "X" ] ; then
7  echo RTEMS_MAKEFILE_PATH is not set
8  exit 1
9fi
10
11BSPINC=${RTEMS_MAKEFILE_PATH}/Makefile.inc
12if [ ! -r ${BSPINC} ] ; then
13  echo "${BSPINC} does not exist."
14  echo "Is your BSP installed?"
15  exit 1
16fi
17
18OBJCOPY=`grep ^OBJCOPY_FOR_TARGET ${BSPINC} | cut -d'=' -f2`
19
20set -x
21
22if [ $# -ne 2 ] ; then
23  echo "Usage: $0 elf_file boot_file"
24  exit 1
25fi
26if [ ! -r ${BSPINC} ] ; then
27  echo "${BSPINC} does not exist."
28  echo "Is your BSP installed?"
29  exit 1
30fi
31
32echo ${OBJCOPY}
33elf=${1}
34bt=${2}
35
36tmpbin=${elf}.bin
37tmpbin=${elf}.bin
38exit 0
39
40# Constants for relocating
41HEADERADDR=0x00097E00
42START16FILE=$(RTEMS_MAKEFILE_PATH)/lib/start16.bin
43START16ADDR=0x00097C00
44RELOCADDR=0x00100000
45
46# Tool helpers
47${OBJCOPY} -O elf32-i386 \
48  --remove-section=.rodata \
49  --remove-section=.comment \
50  --remove-section=.note \
51  --strip-unneeded ${MAIN}.obj $@
52${OBJCOPY} -O binary ${MAIN}.obj ${MAIN}.bin
53${RTEMS_MAKEFILE_PATH}/build-tools/bin2boot -v \
54  ${MAIN}.bt ${HEADERADDR} \
55  ${START16FILE} ${START16ADDR} 0 ${MAIN}.bin ${RELOCADDR} 0
56
57exit 0
Note: See TracBrowser for help on using the repository browser.