Skip to content

Releases

NativeCall 1.8.0

Choose a tag to compare

@Sdursun Sdursun released this 22 Nov 19:15

NativeCall 1.8.0: kernels on the PC under WinUAE

nativecall.library 1.8 (md5 c3494aa71d3bc719e1bbca48d1dd99ea), hypervisor 8 (armstub md5
6e6cf204a40e4389dc900d3d76f6213a, unchanged since 1.7.0: no need to touch the SD card), WinUAE host DLL
nativecall-windows-x86-64.dll (md5 ef64a6638df0868c206fc33c72895ff0).

The same program now runs its kernels on the Pi's ARM cores, on the PC's x64 processor under WinUAE, or as
68k code on any other Amiga: one SDK, one kernel source, one 68k binary.

New

  • WinUAE x64 backend: without the hypervisor, library 1.8 runs kernels on the PC through WinUAE's
    uaenative.library and a host DLL in WinUAE's plugins folder. nc_run_mp and nc_start_mp use a thread
    pool (all logical processors but one). Crashes, stack overflows and endless loops end the call with
    NC_ST_FAULT / NC_ST_TIMEOUT and WinUAE goes on; the log, fault details (with a backtrace) and statistics
    work as on the Pi. NCLog STATS and NCStatus say "WinUAE x64".
  • SDK: NC_X64 := 1 builds a module's kernels for the PC as well, without a C library (8 to 12 KB), and
    embeds them in the program next to the .narm. v1.7.0 binaries run on the PC too, unchanged, with their
    .nx64 next to them.
  • Byte order: the PC is little-endian. Parameter structures are converted by the compiler; plain arrays in
    68k memory use NC_GET16/32/F and NC_PUT16/32/F, which are plain accesses on the Pi (the .narm modules
    of all examples are byte for byte those of 1.7.0).
  • nc_now_us reads the PC's clock under WinUAE (the emulation's own clocks miss the time a kernel runs);
    nc_addr_ok accepts all of the Amiga's RAM there.

Fixes

  • mp3demo BENCH reported "No MP3 sound found" for files shorter than SECONDS (20 by default).
  • Projects that build their 68k side themselves: regenerate <prefix>_image.c (nc make narm); it now also
    holds the x64 module.

Measured under WinUAE (6.1 beta, 68060 JIT, a PC with 24 logical processors)

1280x720 WinUAE 68k PC, 1 thread PC, 23 threads gain (compute)
filterdemo 4.9 fps 59.7 fps 420.7 fps 129.6x
nbodydemo 13.7 fps 147.2 fps 693.2 fps 103.9x
raydemo 1.9 fps 16.7 fps 147.0 fps 96.5x
mandeldemo (Miter/s) 57.5 8146 142x

mandeldemo 640x480, the unchanged v1.7.0 binary: 58.5 Miter/s on WinUAE's 68k JIT, 6044 on the PC (103x).
On the A1200, library 1.8 gives the 1.7.0 figures (raydemo 18.4x on three cores, ncdemo 198 to 205 fps).

Tested

  • A1200 (PiStorm32-lite, Pi 4 8 GB, Emu68 1.1.0-beta.1), library 1.8: all ten examples built by GCC and by
    VBCC, hello with every test, and the v1.7.0 binaries.
  • WinUAE 6.1 beta 22/23: every hello test on the PC, a kernel recursing without end (caught on the emulation
    thread and on the pool), bench, mp3demo BENCH and an nbodydemo step compared with the 68k, the graphics
    demos at 1280x720, the programs without any .nx64 file next to them.
  • ./build.sh from a clean clone gives the 47 files of binaries/ byte for byte.

Not tested: other WinUAE versions or PCs, other Pi 4 RAM sizes on hardware. WinUAE 6.1 beta resets now and then
on a 640x480 AGA screen fed with WriteChunkyPixels, with or without NativeCall: use an RTG screen there.

Installing

  • Pi: nothing changes on the SD card. Replace nativecall.library in LIBS:, then Avail FLUSH or restart.
  • WinUAE: copy binaries/WinUAE/nativecall-windows-x86-64.dll to WinUAE's plugins folder, turn on
    Settings > Host > Miscellaneous > Allow native code, copy nativecall.library to LIBS:.

Assets: NativeCall-1.8.0.zip (source, SDK, and binaries/ built by ./build.sh), NativeCall.pdf,
SHA256SUMS.txt.

NativeCall 1.7.0

Choose a tag to compare

@Sdursun Sdursun released this 13 Nov 10:05

NativeCall 1.7.0: time limit, memory protection, log, status window, new demos

nativecall.library 1.7, hypervisor 8 (armstub md5 6e6cf204a40e4389dc900d3d76f6213a, library md5
4dec34cb18f35fe3b491d34de1a258b8).

If you built modules with SDK 1.5.0 or 1.6.0, rebuild them. Those SDKs left a module's .bss out of the
module file: a kernel with zero-initialised static or global variables wrote past its module and could corrupt
memory (a rare reset of the Amiga). Library 1.6 and newer also keep 64 KB of slack behind every module.
NOTES.md 26.7.

New

  • Time limit: a kernel that runs too long (1 s by default, nc_set_timeout) is stopped and the call
    returns NC_ST_TIMEOUT. An endless loop no longer locks the machine.
  • Memory protection: native code sees only the RAM the 68k sees. The hypervisor's code and page tables are
    read-only, Emu68's private memory is hidden, every stack has a guard page.
  • Log and fault details: nc_printf in kernels, the NCLog tool, registers and a backtrace of the last
    fault, nc addr2line for source lines.
  • Job cancel: nc_cancel; the jobs of a program that exits or crashes are cancelled.
  • Status: NCStatus (MUI window, with icon) and NCLog STATS: is NativeCall active, native load per ARM
    core, SoC temperature, the programs with native modules.
  • PiReboot NOW: restarts the Pi from the Amiga, so a new armstub loads without cutting power.
  • Demos: raydemo (ray tracing), voxeldemo (landscape), nbodydemo, filterdemo, mp3demo (MP3 player
    decoding on an idle core); ncdemo on all cores.
  • Faster 68k fallback: default 68k compiler flags tuned for Emu68's JIT (NOTES.md 27).

Measured on the A1200 (Pi 4, 640x480 16-bit RTG, GCC)

68k native, 3 cores gain
raydemo 1.9 fps 33.6 fps 18.4x
filterdemo 9.7 fps 125.3 fps 15.5x
nbodydemo 6.0 fps 61.0 fps 10.9x
voxeldemo 40.7 fps 198.3 fps 6.0x
ncdemo 50.4 fps 204.6 fps 4.1x
MP3 decoding (1 core) 27.8x real time 198x real time 7.1x

Tested

All ten examples from these binaries, built by GCC and by VBCC, on one A1200 (PiStorm32-lite, Pi 4 8 GB, Emu68
1.1.0-beta.1). All QEMU scenarios with this armstub binary. Not tested: other Pi 4 RAM sizes on hardware, the
new demos without RTG. Details in README.md.

Upgrading

Replace nativecall-armstub.bin on the SD card and nativecall.library in LIBS:, then power the Pi off and
on. Old and new library and hypervisor versions work with each other; missing features fall back. NCStatus
needs MUI 3.8 or newer.

Assets: NativeCall-1.7.0.zip (source, SDK, and binaries/ built by ./build.sh), NativeCall.pdf,
SHA256SUMS.txt.

NativeCall 1.6.0

Choose a tag to compare

@Sdursun Sdursun released this 08 Nov 19:46

NativeCall 1.6.0: hypervisor 5, any Pi 4 RAM size

The armstub no longer needs the 8 GB Pi 4. Hypervisor 5 reads the device tree at boot and takes the top
2 MB of the RAM Emu68 would use, so the 68k sees 2 MB less Fast RAM. If the device tree does not look as
expected, the armstub starts Emu68 like the stock one, without native calls, instead of a black screen.

  • nativecall-armstub.bin: hypervisor 5 (md5 6866ecb90b7116a03f521b19ebc13f62).
  • nativecall.library 1.5 is unchanged; nothing changes for 68k programs.
  • Tested on the A1200 (Pi 4 8 GB, total_mem=2048): hello (GCC and VBCC) and bench passed.
  • 1, 2 and 4 GB layouts are tested in QEMU only (new raspi4b setup, real armstub started like the
    firmware, parser test on 16 layouts). See NOTES.md section 25.

Install and rollback: INSTALL.md. Upgrading from 1.5.0: replace nativecall-armstub.bin on the SD card
and power the Pi off and on.

Assets: NativeCall-1.6.0.zip (source, SDK, and binaries/ built by ./build.sh), NativeCall.pdf,
SHA256SUMS.txt.

NativeCall 1.5.0

Choose a tag to compare

@Sdursun Sdursun released this 05 Nov 18:21

First release of NativeCall: native AArch64 calls for 68k Amiga programs on a PiStorm with a Raspberry Pi 4 and an unmodified Emu68.

nativecall.library 1.5, hypervisor 4 (armstub md5 0d8169cb555b157083dbdff559056982).

Requires a Raspberry Pi 4 with 8 GB. On a Pi with less RAM this armstub gives a black screen; removing the armstub= line from config.txt recovers. See INSTALL.md.

Assets

  • NativeCall-1.5.0.zip: the SDK and all sources, README.md, docs/NativeCall.pdf, and binaries/:
    • nativecall-armstub.bin for the SD card
    • Libs/nativecall.library for LIBS:
    • gcc/ and vbcc/: the example programs hello, cputest, bench, ncdemo, mandeldemo
  • NativeCall.pdf: what NativeCall is and how it works
  • SHA256SUMS.txt

What it does

  • nc_call, nc_run: kernels on ARM, with a 68k fallback from the same source
  • nc_run_mp: also on the two ARM cores Emu68 leaves idle
  • nc_start_mp / nc_wait: jobs on the helper cores while the 68k keeps running
  • SDK for VBCC and GCC, built in Docker; modules embedded in the program

On the A1200 test machine: NEON Mandelbrot on 3 cores is 8.8x the 68k in iterations per second, and a software 3D demo goes from 44.6 to 169.3 fps. GPU-limited programs gain little. See RESULTS.md.

Test status

  • QEMU, unmodified Emu68: the hv and base runs passed on this commit.
  • A1200: hello (GCC and VBCC) and mandeldemo ran from these binaries on hypervisor 4; cputest on hypervisor 3.
  • bench and ncdemo: these builds have not run on hardware; earlier builds did.
  • All hardware results come from one machine. async_log and ppc_enable with several cores have not been tested.