Virtual Apple2 FujiNet - FujiNetWIFI/fujinet-firmware GitHub Wiki

Install prerequisite packages for builds

Assuming you have a totally fresh install of Ubuntu 22, but running this whole thing won't hurt:

sudo apt install -y build-essential checkinstall zlib1g-dev libpcap-dev libssl-dev libyaml-dev libtool autoconf libslirp-dev libminizip-dev libboost-all-dev libsdl2-image-dev unzip curl wget git python3.10-venv libmbedtls-dev default-jre libserialport-dev

sudo snap install cmake --classic

Fork and pull Repos

Good practice is to put all the repo code into a directory called code This assumes you have forked all the repos so we can cleanly create PRs replace [GIT-USER] below with your git username....

fork AppleWin from Fujinet project into your own repo...- using web UI https://github.com/FujiNetWIFI/AppleWin.git

mkdir code
cd code
git clone [email protected]:[GIT-USER]/fujinet-platformio
git clone [email protected]:[GIT-USER]/fujinet-apps
git clone [email protected]:[GIT-USER]/AppleWin

[Now we add an upstream remote so we can use the upstream script to keep current...]

cd fujinet-apps
git remote add upstream https://github.com/FujiNetWIFI/fujinet-apps
git fetch --all

cd ../fujinet-platformio
git remote add upstream https://github.com/FujiNetWIFI/fujinet-platformio
git fetch --all

cd ../AppleWin
git remote add upstream https://github.com/FujiNetWIFI/AppleWin
git fetch --all

Builds

Build each of the major components:

  • Linux version of AppleWin -with fenrocks SLIP SP Mods
  • FujiNet-PC - it's contained in the fujinet-platformIO repo now
  • cc65 - the 6502 cross assembler to build the Apple applications for FujiNet
  • Apple Apps - some test applications that will use the FujiNet-PC and the AppleWin

APPLEWIN

cd AppleWin
git remote add upstream https://github.com/FujiNetWIFI/AppleWin.git
git fetch --all
git checkout linux
# as per instructions at https://github.com/markjfisher/AppleWin/tree/linux?tab=readme-ov-file#build
# you have to checkout the git submodules
git submodule update --init --recursive
mkdir build
cd build
# You can also use RELEASE instead of DEBUG if you're not going to be doing any gdb style debugging
cmake -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SA2=on .. 
make

To run it

# logs are hardcoded to /tmp/AppleWin.log by the app if you specify --log
# the configuration file is at ~/.applewin/applewin.conf, you can remove slots if you have issues in that file
# sa2 stands for "SDL Apple 2", i.e. sa2
# use "./sa2 -h" to see help, defaults to x11:

./sa2 --log

# can also specify gfx, e.g. x11, wayland.
SDL_VIDEODRIVER=wayland ./sa2

Preset Configs and Services

(this comes from the work done by Superbenk to make ready-to-run VM images) This will setup your system and pre-configure it all for SmartPort and Fujinet. Below this are manual directions.

FN_PATH="${P_FN_PATH:-/home/$P_USERNAME/FujiNet}" INSTALL_PATH="$FN_PATH/AppleWin" mkdir -p "$FN_PATH" cd "$FN_PATH"

mkdir -p ~/.applewin
cat <<EOF > ~/.applewin/applewin.conf
[Configuration\Slot 0]
Card type=17

# FujiNet-PC
[Configuration\Slot 7]
Card type=25

[Configuration\Slot Auxiliary]
Card type=13

[sa2\geometry]
width=800
height=600
x=324
y=88

[Configuration]
Video Emulation=1
Video Style=0
Monochrome Color=12632256
Video Refresh Rate=2
EOF

This creates a startup scrip for AppleWin in your Home Directory.

cat <<EOF > ~/start-applewin.sh
#!/usr/bin/env bash 

LOAD_DISK=""
if [[ -n "\$1" ]]
then
  LOAD_DISK="-1 \$1"
fi 

sudo systemctl start fn-pc-apple
sleep 2
/usr/local/bin/sa2 --log \$LOAD_DISK

while true
do 
  if ! pgrep -lf sa2 
  then 
    sudo systemctl stop fn-pc-apple 
    exit 0 
  fi 
  sleep 1 
done 
EOF

chmod +x ~/start-applewin.sh

This creats a desktop icon for Applewin to start it.

cat <<EOF > ~/AppleWin.desktop
[Desktop Entry]
Encoding=UTF-8
Name=FujiNet AppleWin
Comment=FujiNet connected to AppleWin for Linux
Type=Application
Exec=~/start-applewin.sh
Icon=/usr/local/share/applewin/resource/APPLEWIN.ICO
EOF

chmod +x ~/AppleWin.desktop
gio set -t string ~/AppleWin.desktop metadata::xfce-exe-checksum "$(sha256sum ~/AppleWin.desktop | awk '{print $1}')"

Manual Configuration

Once running, open the configuration menu (System/Settings), open the Hardware TAB, In an empty slot (I've been using slot 5), choose "SPoverSLIP".

This will load the card.

If you exit AppleWin, your config is saved to the previously mentioned applwin.conf. Then when you run it again, it'll auto start with the card in.

You can preconfigure your config to load SPoverSLIP with the following section: [Configuration\Slot 5] Card type=25

change the Slot number as you desire.

[Insert images]

FujiNet-PC

  • Build FujiNet-PC for AppleWin
  • Assuming you have never done this.
  • Assuming you have follow the above part and installed all the packages as mentioned in the previous section

Install PIO

$ cd ~
$ curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
$ python3 ./get-platformio.py
$ export PATH=$PATH:~/.platformio/penv/bin
$ echo "export PATH=$PATH:~/.platformio/penv/bin" >> ~/.bashrc
$ pio platform install espressif32
$ pip install jinja2

[Ok now go into the fujinet dir and build FujiNet-PC:]

$ cd ~/code/fujinet-platformio

$ ./build.sh -p APPLE

[... lots of output...]
[100%] Built target dist
Built PC version in build/dist folder

[run Fujinet-PC]
./build/dist/run-fujinet

You will see output:

Retrying in 5 seconds...
12:29:05.787492 > Resolving hostname "localhost"
12:29:05.787599 > Resolved to address 127.0.0.1

[go into AppleWin - Settings/Hardware/Slot5 pick SPoverSLIP] [screenshot]

output will change to:

12:29:20.820917 > 
Drive: 09

Build Applications

Build and install cc65

[cd to root of your softare repos] [we need to install cc65 to compile the Apple Test Apps to use in AppleWin]

$ cd ~/code
$ git clone https://github.com/cc65/cc65.git
$ cd cc65
$ make
$ sudo make avail

[This builds both the cc65 binaries (located in the 'bin' subdirectory) and the cc65 libraries. Now cc65 is fully functional without further steps. Enter sudo make avail. This creates symbolic links to the binaries in '/usr/local/bin'.]

[now go into the FujiNet Apps Repo - where the Actual app is located.]

cd ~/code/fujinet-apps/httpbin

$ chmod 755 ../apple-tools/add-bas.sh
$ make TARGETS=apple2 clean all dist po

$ cp dist/httpbin.po ~/code/fujinet-platformio/distfiles/SD/

More TBA

END

⚠️ **GitHub.com Fallback** ⚠️