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.



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

NetBSD releases before v7 are in archive:
	https://cdn.netbsd.org/pub/NetBSD/NetBSD-archive/

v7.0 support ended in June 2020, rest are still supported.


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

Fetching NetBSD v8.1 binaries (which work better than latest v9.1):

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

* Get Hatari compatible kernel:
	wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.1/atari/binary/kernel/kern-SMALL030.gz
	gunzip kern-SMALL030.gz
	mv kern-SMALL030 small030.bsd

* Get minimal install sets (base & config files):
	wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.1/atari/binary/sets/base.tgz
	wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.1/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-8.1/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 --monitor vga --machine falcon --dsp none --mmu on -s 14 .

   Note: BSD seems to render correctly only with VGA monitor, and it
   doesn't work at all without MMU.

2. Run "loadbsd.ttp" and give "-b small030.bsd" as an argument

   Note: You need "-b" option if you want kernel to ask for root
   drive, otherwise you can just drag the kernel file to TTP.


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 SCU & VME emulation, but changing SCU/VME register access
    to error out, doesn't help like it does with Linux.  Maybe SCC
    issue?

* Falcon / netbsd-FALCON kernel:

  - Freezes at SCSI bus scanning unless there's IDE device
    => Same as with Linux, Hatari SCSI emulation isn't good enough

  - NetBSD v1.6.2, v2.1 and v8.1 all fail at boot, after recognizing
    floppy and IDE, to "MMU fault" panic or trap 2 (Without '-b'
    option, you end up in BSD kernel debugger).

  - NetBSD v9.x outputs garbage to Atari screen, output will become
    correctly visible only when boot fails.

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


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

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