Re: [hatari-devel] Basic cpu testsuite

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 05/01/2018 09:53 AM, Thorsten Otto wrote:
On Dienstag, 1. Mai 2018 08:34:32 CEST Thomas Huth wrote:
so that we could tell people to
put that libcmini.a in the lib directory of their cross-compiler
installation, but I only ran from one problem into the other while
trying to make that work in the "--tos none" mode.

Most likely similar problems than i had, ie. making sure that the startup code
does not call any GEMDOS functions that aren't supported in tos-less mode.
Another option would be to catch those calls in Hatari, and either emulate
them, or return -32 if that works.

I currently think we rather should
continue to recommend AHCC for creating testing binaries insted

Of course that will make setting up an environment to compile the tests much
more complicated.

I did some improvements to Hatari tooling and wrote a script on top of
that which makes use of AHCC for compiling the tests pretty trivial.

See attached file.

After building latest Hatari from Mercurial and installing it to
system (so that up to date Hatari tools are in PATH), and doing the
few steps in the script help output, it can be used like this:
   /path/to/ahccst.bin/ahcc-make.sh natfeats/nf_ahcc.prj

And it will compile you a new version of that project.



Sorry, Thorsten. When I got some spare time, I might convert some of your
tests to AHCC and add these to the Hatari repository, if that's ok for
you.

Yes, of course, i have no problem with that.


	- Eero
#!/bin/sh

set -e

# which AHCC compiler and EmuTOS image to use
cmd=ahccst_p.ttp
tos=etos512k.img
# build dir under AHCC
build=build.tmp

usage ()
{
	echo "usage: ${0##*/} <AHCC *.PRJ file>"
	cat << EOF

Script for building SW with AHCC project files with Hatari,
using AHCC & EmuTOS.

Set up:
1. Extract AHCC zip & fix file access rights:
	$ wget http://members.chello.nl/h.robbers/ahccst.zip
	$ unzip -LL ahccst.zip
	$ chmod -R +r ahccst.bin/
2. Copy/symlink EmuTOS $tos image to AHCC directory
3. Copy/symlink this script to AHCC directory

This way script can locate AHCC & EmuTOS without extra configuration
when it is run from the AHCC directory.

When you run it from there, it will then symlink the given project
file directory under AHCC directory and build it there, so that AHCC
can access everything needed.

EOF
	echo "ERROR: $1!"
	exit 1
}

# check arguments
if [ -z $(which realpath) ]; then
	usage "'realpath' utility missing"
fi
if [ $# -ne 1 ]; then
	usage "argument missing"
fi
prj=$(realpath $1)
if [ \! -f $prj ]; then
	usage "project file not found"
fi

# get full project path and PRJ name without path
prjdir=${prj%/*}
prj=${prj##*/}
# startup code for Hatari tests
startup=$prjdir/../startup.s

# get AHCC dir from script name and switch there
ahccdir=${0%/*}
cd $ahccdir

# check that AHCC & EmuTOS are there
if [ \! -f $cmd ]; then
	usage "$ahccdir/$cmd compiler missing"
fi
if [ \! -f $tos ]; then
	usage "$ahccdir/$tos TOS missing"
fi

# check whether we can use hard-coded build dir
if [ -f $build ]; then
	usage "existing $ahccdir/$build dir/file, remove it out of way if it's redundant"
fi

# for Hatari tests we may also need special startup code.
# If that's beside the project dir, link it to AHCC dir
if [ -f $startup ]; then
	if [ -f ${startup##*/} ]; then
		usage "refusing to overwrite existing $ahccdir/${startup##*/}"
	fi
	ln -sv $startup
fi

# link project directory to AHCC dir too
ln -sv $prjdir $build

# Video can't be disabled as AHCC expects key press at end of compile
#export SDL_VIDEODRIVER=dummy
export SDL_AUDIODRIVER=dummy

cmd="hatari-prg-args -q --gemdos-case lower --confirm-quit no \
  --fast-forward yes --fastfdc on --timer-d on --sound off \
  --conout 2 -s 14 -m --machine megast --tos $tos --log-level warn \
  --  $cmd $build\\$prj"
echo "$cmd"

$cmd

# AHCC directory cleanup
if [ -h ${startup##*/} ]; then
	rm -v ${startup##*/}
fi
rm -v $build


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/