Development Env for Apps - FujiNetWIFI/fujinet-firmware GitHub Wiki

How to Setup a Development Env for Building FujiNet Apps

Pull down required code

Build

Building works perfectly using a Linux based host. Mac OSX should work but issues have been seen building cc65.

Build cc65:

$ PREFIX=/usr/local/cc65 make
$ sudo PREFIX=/usr/local/cc65 make install

Build an app for Apple2 platform:

$ cd /fujinet-apps/netcat/apple2

$ make
mkdir -p obj/apple2enh
cl65 -t apple2enh -c --create-dep obj/apple2enh/main.d -Os -DBUILD_APPLE2 -o obj/apple2enh/main.o src/main.c
cl65 -t apple2enh -c --create-dep obj/apple2enh/sp.d -Os -DBUILD_APPLE2 -o obj/apple2enh/sp.o src/sp.c
cl65 -t apple2enh  -o netcat obj/apple2enh/main.o obj/apple2enh/sp.o

The binary is created as a file name netcat. Now we need to wrap that into a bootable .po image.

$ make dist
cp dist.apple2/bootable.po dist.apple2/dist.po
java -jar dist.apple2/ac.jar -as dist.apple2/dist.po netcat.system sys <netcat

Now the .po disk image is created, move it to a location where you can mount it on your FujiNet. I have a folder setup to hold the files till I push them over into my TNFS server...

$ cp dist.apple2/dist.po ~/scratch/fujinet-app-staging/netcat-ssh.po

Build an App for Atari Platform

Build an app for Atari is a one step process. make will build, link and create a XEX file for the Atari. There is no need to wrap this xex file into an ATR as the FujiNet does this dynamically at load & boot time.

MediaTypeXEX in FujiNet firmware builds a synthetic disk with a DOS 2 filesystem, puts picoboot.bin in the first three sectors, which loads the first file on the disk, which as part of the process, a quick set of directory sectors is built to do this. all in memory.

~/.../netcat/atari(master)]$ make
mkdir -p obj/atari
cl65 -t atari -c --create-dep obj/atari/conio.d -Oris -o obj/atari/conio.o src/conio.c
src/conio.c:11: Warning: Pointer conversion to 'void *' from 'const char *' discards qualifiers
cl65 -t atari -c --create-dep obj/atari/err.d -Oris -o obj/atari/err.o src/err.c
cl65 -t atari -c --create-dep obj/atari/main.d -Oris -o obj/atari/main.o src/main.c
src/main.c:150: Warning: Pointer conversion to 'char *' from 'unsigned char * const' changes pointee signedness
src/main.c:203: Warning: Pointer conversion to 'const char *' from 'unsigned char * const' changes pointee signedness
cl65 -t atari -c --create-dep obj/atari/nio.d -Oris -o obj/atari/nio.o src/nio.c
cl65 -t atari -Wa -DDYN_DRV=0 -c --create-dep obj/atari/cio.d  -o obj/atari/cio.o src/cio.s
cl65 -t atari -Wa -DDYN_DRV=0 -c --create-dep obj/atari/intr.d  -o obj/atari/intr.o src/intr.s
cl65 -t atari -Wa -DDYN_DRV=0 -c --create-dep obj/atari/sio.d  -o obj/atari/sio.o src/sio.s
cl65 -t atari --mapfile netcat.map -o netcat.xex -C src/atari.cfg obj/atari/conio.o obj/atari/err.o obj/atari/main.o obj/atari/nio.o obj/atari/cio.o obj/atari/intr.o obj/atari/sio.o

$ cp netcat.xex ~/scratch/fujinet-app-staging/netcat-ssh.xex

Push files to a TNFS server

Your methods will vary. But get these new files onto a TNFS server so you and other can use them...

$ cd ~/scratch/fujinet-app-staging
$ scp netcat-ssh.po 192.168.3.33:fujinet_tnfsd/server_root/APPLE/
$ scp netcat-ssh.xex  192.168.3.33:fujinet_tnfsd/server_root/ATARI/

More apps are available to hack on...