Menu

Tools

Brian Ruthven

Tools required

This is the list of tools needed to build SpecOS and the versions currently used:

  • Solaris Studio 12 compiler (or GCC, with modifications - see [GNU tools] for details)
  • Solaris "make"
  • SDCC 3.4.1 (#9058)
  • Boost headers (1.53.0) - needed for SDCC
  • Hex2bin (1.0.10)
  • Z80asm (1.8)
  • libspectrum (1.1.1) - needed by debugger
  • libdsk (1.3.3) - needed by cpmtools
  • cpmtools (2.13)

Only the SDCC version is explicitly required, as replacing the compiler-supplied crt can break easily as the compiler advances. A later version of SDCC introduced new linker sections which SpecOS doesn't yet support, so the resulting binary is missing the initialised variables.

dskform (from libdsk) and cpmcp (from cpmtools) are used to create or update a disk image as part of the build. As there seems to be no way of writing a boot sector directly, a small basic loader is copied to the disk as a file called "DISK" so it can boot the disk, install the boot sector and boot it. Subsequent boots will use the boot sector, not the basic loader.

Compilation notes

If building SDCC from source, it requires Boost headers:

  1. Unpack boost to its target location, e.g. /sw/boost_1_53_0

  2. Set CXXFLAGS to point to boost:

    $ setenv CXXFLAGS -I/sw/boost_1_53_0
  1. Configure for Z80 only:
    $ ./configure --prefix=/sw --disable-ucsim --disable-sdcdb \
        --disable-mcs51-port --disable-z180-port --disable-r2k-port \
        --disable-r3ka-port --disable-gbz80-port --disable-ds390-port \
        --disable-ds400-port --disable-pic14-port --disable-pic16-port \
        --disable-hc08-port --disable-s08-port --disable-stm8-port
  1. gmake

  2. gmake install

Hex2bin needed some modifications to the Makefile to compile on Solaris:

--- Makefile    Sun Mar 11 23:04:16 2012
+++ ../../Hex2bin-1.0.10/Makefile   Mon Jul  1 21:13:30 2013
@@ -1,8 +1,8 @@
 # Makefile hex2bin
 WIN_GCC = amd64-mingw32msvc-gcc

-INSTALL_DIR = /usr/local
-MAN_DIR = $(INSTALL_DIR)/man/man1
+INSTALL_DIR = /sw
+MAN_DIR = $(INSTALL_DIR)/share/man/man1

 all: hex2bin mot2bin hex2bin.1

@@ -24,4 +24,4 @@
    cp hex2bin.1 $(MAN_DIR)

 clean:

-   rm core *.o hex2bin mot2bin
+   rm -f core *.o hex2bin mot2bin

Z80asm needed some code (prototype) changes to compile on Solaris:

diff -r z80asm-1.8/gnulib/getopt.c /download/z80asm-1.8/gnulib/getopt.c
196c196
< extern char *getenv ();
---
> extern char *getenv (char *);
diff -r z80asm-1.8/gnulib/getopt.h /download/z80asm-1.8/gnulib/getopt.h
144c144
< extern int getopt ();
---
> extern int getopt (int argc, char *const *argv, const char *optstring);

All the other tools are a simple configure/gmake combination:

$ ./configure --prefix=/sw
$ gmake
$ gmake install

Related

Wiki: GNU tools
Wiki: Home

MongoDB Logo MongoDB