Contents
--------

0. Status summary
1. NetBSD Atari HW support history
2. Fetching NetBSD binaries
3. Testing NetBSD kernel
4. Kernel issues
5. Installing NetBSD


0. Status summary
-----------------

Apparently NetBSD works fine with WinUAE Amiga emulation.  However,
none of the NetBSD kernel variants or versions boots yet with Hatari.
This just documents how to test them.

According to NetBSD docs: "A minimal system should have a 68030 CPU,
4MB RAM (of which 2MB can be ST-RAM) and a SCSI or IDE disk."


1. NetBSD Atari HW support history
----------------------------------

Atari HW supported by NetBSD is listed in wiki:
	http://wiki.netbsd.org/ports/atari/

NetBSD releases of interest:
* 1995: v1.1, initial Atari TT/Falcon support
* 1996: v1.2, Stable Atari support
* 1998: v1.3, Medusa Hades, Riebl ethernet and Falcon IDE support,
              FAT32 & EXT2 support, XFree86, pkgsource packages system
* 1999: v1.4, new virtual memory system & full USB support, m68k Linux compat
* 2002: v1.6, last non-SMP release, ELF format binaries, multibyte locales
* 2004: v2.0, POSIX threads and SMP support, m68k GCC 3.3.1
* 2005: v2.1, last release including install floppies
* 2009: v5.0, 1:1 threading model and many scheduling changes, switch from
              XFree86 to Xorg, initial support for Clang as system compiler
* 2012: v6.0, TLS and Atari EtherNEC support
* 2015: v7.0, m68k FPE supports all math functions, kernel Lua scripting
* 2018: v8.0, Userland uses PIE by default, support for building without
              crypto removed, remove XFree86 completely, GCC 5.5
* 2020: v9.0, GCC 7.4, LLVM 7.0, reworked SATA & USB3 support, shadow FB
              + anti-aliasing support
* 2024: v10.0, GCC 10, Linux compat disabled by default

NetBSD v8.x and earlier releases are in archive:
	https://cdn.netbsd.org/pub/NetBSD/NetBSD-archive/

(Only releases newer than those are still supported.)


2. Fetching NetBSD binaries
---------------------------

Fetching latest NetBSD binaries:

* Get TOS kernel loader "loadbsd.ttp":
	wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/atari/installation/misc/loadbsd.ttp

* Get Hatari compatible kernel:
	wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/atari/binary/kernel/netbsd-SMALL030.gz
	gunzip -c netbsd-SMALL030.gz > small030.bsd

* Get minimal install sets (base & config files, base is tens of MBs):
	wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/atari/binary/sets/base.tgz
	wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/atari/binary/sets/etc.tgz
  (what the other sets are, is listed in the install manual.)

* Get installer floppy image:
	wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/atari/installation/miniroot/sysinst.fs.gz
	gunzip sysinst.fs.gz


3. Testing NetBSD kernel
------------------------

1. Start Hatari with the directory having the downloaded files:
	hatari --machine falcon --dsp none --mmu on -s 14 .

2. Drag "small030.bsd" to "loadbsd.ttp" to run kernel.

(You need "-b" option instead of just dropping desired kernel
on TTP, if you want kernel to ask for root drive upfront.)


4. Kernel issues
----------------

* 030 (Mega)ST(e) / netbsd-SMALL030 kernel:

  - double address/bus error immediately on boot
    => no ST models supported?

* TT / netbsd-ATARITT kernel:

  - freezes very early at boot, in loop checking bits in a non-IO
    address, which remains zero with Hatari.  It could be due to
    missing VME emulation, but changing VME register access to
    error out (--vme off), does not help like it does with Linux.
    Maybe VME autovector issue?

* Falcon / netbsd-FALCON kernel:

  - NetBSD v9.x or newer output initially garbage to VGA screen,
    output will become correctly visible only later in boot.
    With RGB screen, output is correct from the start.

  - Startup fails to floppy timeout and kernel not being able to
    mount "sysinst.fs" contents from Hatari floppy drive.

Unlike with Linux, 030 cache and prefetch emulation doesn't have
impact on NetBSD boot.  Neither does 32-bit addressing / TT-RAM.


5. Installing NetBSD
--------------------

Building (modified) kernel from sources:
	http://www.netbsd.org/docs/guide/en/chap-kernel.html

Full installation instructions:
	https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/atari/INSTALL.html
