History log of /src/sys/arch/virt68k/
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.13 17-Dec-2025 thorpej

Add MODULAR option.


1.12 27-Aug-2025 isaki

options<space><tab>


1.11 23-Aug-2025 isaki

Disable viogpu* on virt68k.
virt68k does not have rasops and wscons (yet?).
Need to pullup netbsd-11.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.10 27-Mar-2025 riastradh

branches: 1.10.2;
virtio(4): Consolidate kernel configs.

No functional change intended.

Leave `# XXX ?' comments where I don't know why the driver in
question is excluded. (Typical reason is that PAGE_SIZE is not 4096
but I didn't investigate -- if you do investigate, please either
update the comment if you determine a reason, or enable the driver if
you don't.)

PR kern/59211: vio9p(4): missing from various GENERICs and MAKEDEVs


1.9 01-Nov-2024 mlelstv

Add drvctl driver.


1.8 23-Sep-2024 rin

virt68k: GENERIC: Add some features required by ATF

- NULLFS, PUFFS, and putter
- SYSV{MSG,SEM,SHM}
- {,sw}crypto


1.7 16-Jul-2024 riastradh

viocon(4): Add to various kernel configs.


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.6 19-Jan-2024 thorpej

branches: 1.6.2;
Revert unintended commit.


1.5 19-Jan-2024 thorpej

Adjust the clockframe to be the same as what the common m68k interrupt
dispatch code expects.


1.4 08-Jan-2024 thorpej

Add PROCFS and MSDOSFS.


1.3 02-Jan-2024 thorpej

Add a driver for the Qemu Virtual System Controller that can be used
to halt or reset the system.


1.2 02-Jan-2024 thorpej

Comment out LOCKDEBUG.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.6 20-Nov-2025 thorpej

Defflag the M060SP option in one place, and make sure to include opt_m060sp.h
(and opt_fpsp.h) in the right places.

PR port-m68k/59776


1.5 08-Nov-2025 thorpej

__HAVE_NEW_PMAP_68K glue.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.4 13-Jan-2024 thorpej

branches: 1.4.4;
Switch to common m68k vector table.


1.3 09-Jan-2024 thorpej

Remove duplicated / slightly-tweaked loadustp() (load user segment table)
routines from all of the m68k ports using the shared pmap. Instead, in
pmap_init(), set up a function pointer to the appropriate mmu_load_urp*()
function in mmu_subr.s.


1.2 02-Jan-2024 thorpej

Add a driver for the Qemu Virtual System Controller that can be used
to halt or reset the system.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 03-Jan-2024 thorpej

Add gftty at char 12.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.3 09-Nov-2025 thorpej

Use __HAVE_NEW_PMAP_68K for all virt68k.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 02-Jan-2024 thorpej

If the loader passed us a RAM disk, use it as the root file system.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.3 05-Mar-2024 isaki

Fix two problems that the time runs late on virt68k.
- The time between the time the alarm occurred and the time read by
TIME_* register in the next interrupt handler was not accumulated.
- With the one-shot timer method, once the host time prolongs, the
guest time will never be able to catch up with the host time again.
New one does:
- The driver maintains its (guest's) time (as sc_alarm_time) and always
set the next alarm sc_interval_ns after the previous alarm.
- gfrtc_set_alarm() takes an absolute time instead of a relative time
as the argument.
PR kern/57980. Confirmed on QEMU.


1.2 12-Jan-2024 mlelstv

The interrupt handler needs to clear the interrupt condition
before re-arming the timer. Otherwise the timer could expire
again before clearing the interrupt, the interrupt gets lost
and the clock stops.

On real hardware that could only occur if the timer interval
is extremely short or if there is a higher-than-clock interrupt
that delays processing. In the emulated world however, time
can progress non-continously and this happens often under load.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 06-Jan-2024 thorpej

Put some meat on the bones of the Goldfish TTY driver. Works well enough
for sysinst.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.2 17-Sep-2025 thorpej

Use device_compatible_{match,lookup}_strlist().


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 06-Jan-2024 thorpej

Fix dump paste-o. Halt works properly. Reboot does reboot, but the
new kernel instance crashes early.


1.1 02-Jan-2024 thorpej

Add a driver for the Qemu Virtual System Controller that can be used
to halt or reset the system.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 09-Mar-2024 isaki

Fix a null dereference.
free_interrupts may be called even when sc_ih has not been assigned yet.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.2 30-Nov-2024 christos

Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

branches: 1.1.2;
Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 20-Jan-2024 thorpej

Hygiene.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.8 14-Nov-2025 thorpej

Clean up bootinfo startup:
- Be more explicit about whats PA vs VA, and make sure by the end of
bootinfo_startup1(), everything is set up for VA for subsequent
bootinfo calls.
- No longer need the "reloff" argument to bootinfo_startup2().


1.7 06-Nov-2025 thorpej

Split bootinfo_start() into bootinfo_startup1() (pre-MMU-enbled)
and bootinfo_startup2() (post-MMU-enabled). Use proper VA<->PA
relocation where called for (even though virt68k is VA==PA).

Move virt68k / bootinfo specific code out of pmap_bootstrap(),
and handle it in bootinfo_startup2().


1.6 06-Nov-2025 thorpej

Change bootinfo_start() to return the address representing the end
of the boot info structure. Use this in early bootstrap to avoid
a global reference before the MMU is enabled.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.5 08-Jan-2024 thorpej

Add bootinfo_getarg(), which gets the name kernel command line argument
and returns its value (sort of like getenv()).


1.4 06-Jan-2024 thorpej

The RAM disk specified by bootinfo is not necessarily loaded along with
the static kernel image. Map is separately and account for it in the
available memory segments.


1.3 02-Jan-2024 thorpej

Detect a RND seed passed in by the loader.
XXX We don't actually *do* anything with it yet.


1.2 02-Jan-2024 thorpej

Move the initrd setup into bootinfo.c


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 20-Jan-2024 thorpej

Hygiene.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.7 20-Jan-2024 thorpej

Largely unify the <machine/cpu.h> headers on the m68k platforms.


1.6 19-Jan-2024 thorpej

Adjust the clockframe to be the same as what the common m68k interrupt
dispatch code expects.


1.5 18-Jan-2024 thorpej

Make the M68K_MMU_* defines real kernel options, available in opt_m68k_arch.h.
For 68030, 68040, and 68060, infer M68K_MMU_MOTOROLA. For 68010 and 68020, it
must be an explicit option (set in std.${MACHINE} or, in the case of hp300,
inferred from the specific model option).


1.4 09-Jan-2024 thorpej

Remove duplicated / slightly-tweaked loadustp() (load user segment table)
routines from all of the m68k ports using the shared pmap. Instead, in
pmap_init(), set up a function pointer to the appropriate mmu_load_urp*()
function in mmu_subr.s.


1.3 02-Jan-2024 thorpej

Provide a mechanism for a system reset controller to register to be used
to reset/halt the system.


1.2 02-Jan-2024 thorpej

Collect some garbage.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 20-Jan-2024 thorpej

Hygiene.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 20-Jan-2024 thorpej

Hygiene.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 20-Jan-2024 thorpej

Hygiene.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 19-Jan-2024 thorpej

Adjust the clockframe to be the same as what the common m68k interrupt
dispatch code expects.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 20-Jan-2024 thorpej

Hygiene.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 20-Jan-2024 thorpej

Hygiene.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.1 30-Nov-2024 christos

branches: 1.1.4;
Create a new header lwp_private.h to contain _lwp_getprivate_fast,
_lwp_gettcb_fast, _lwp_settcb and remove them from mcontext.h, so that:
1. we don't need special hacks to hide them
2. we can include <lwp.h> where needed to get the necessary prototypes
without redefining them locally.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.5 24-Nov-2025 thorpej

Since we're batting 1.000 on "platforms that adopt new-pmap_68k that also
use machine_bootmap[]", just remove the option (it looks like it would
be opted into on every platform).


1.4 14-Nov-2025 thorpej

Introduce a hook for machine-specific code to influence pmap_bootstrap1()
in the new pmap_68k.

The pmap_bootmap structure allows machine-specific code to:
- Specify "keepout" ranges, intended to clamp the managed kernel address
space to keep it out of regions mapped using Transparent Translation
(usually devices).
- Allocate unmanaged kernel virtual address ranges (usually for devices).
- Optionally map physical addresses to those virtual address ranges (guess
what this might be used for!).

VM_MAX_KERNEL_ADDRESS is now run-time calculated. It starts off as
the very last page of the kernel virtual address space, and is reduced
as it encounters KEEPOUT areas.

Initially, use this on luna68k, news68k, and virt68k to KEEPOUT the
TT-mapped ranges.

While here, add some missing RELOC()s; no difference on VA==PA platforms,
but bound to blow up eventually.


1.3 08-Nov-2025 thorpej

Remove vestigal error checking.


1.2 08-Nov-2025 thorpej

__HAVE_NEW_PMAP_68K glue.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.2 08-Nov-2025 thorpej

__HAVE_NEW_PMAP_68K glue.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 20-Jan-2024 thorpej

Hygiene.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 20-Jan-2024 thorpej

Hygiene.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 13-Jan-2024 thorpej

Switch to common m68k vector table.


1.8 01-Dec-2025 thorpej

G/C unused P1PAGES.


1.7 14-Nov-2025 thorpej

Introduce a hook for machine-specific code to influence pmap_bootstrap1()
in the new pmap_68k.

The pmap_bootmap structure allows machine-specific code to:
- Specify "keepout" ranges, intended to clamp the managed kernel address
space to keep it out of regions mapped using Transparent Translation
(usually devices).
- Allocate unmanaged kernel virtual address ranges (usually for devices).
- Optionally map physical addresses to those virtual address ranges (guess
what this might be used for!).

VM_MAX_KERNEL_ADDRESS is now run-time calculated. It starts off as
the very last page of the kernel virtual address space, and is reduced
as it encounters KEEPOUT areas.

Initially, use this on luna68k, news68k, and virt68k to KEEPOUT the
TT-mapped ranges.

While here, add some missing RELOC()s; no difference on VA==PA platforms,
but bound to blow up eventually.


1.6 12-Nov-2025 thorpej

In the __HAVE_NEW_PMAP_68K case, don't need to leave room at the top
of the kernel VA space for kernel PTE array, because the new pmap doesn't
put it at a fixed address.


1.5 08-Nov-2025 thorpej

Remove vestigal error checking.


1.4 08-Nov-2025 thorpej

__HAVE_NEW_PMAP_68K glue.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.3 08-Feb-2025 tsutsui

Bump DFLSSIZ from 512KB to 2MB on all hp300 pmap m68k ports.

Some modern applications could require 512KB buffer on stack and
no particular comment on port-m68k@:
https://mail-index.netbsd.org/port-m68k/2025/02/02/msg000893.html


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 06-Jan-2024 thorpej

branches: 1.2.2;
The RAM disk specified by bootinfo is not necessarily loaded along with
the static kernel image. Map is separately and account for it in the
available memory segments.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.7 04-Oct-2025 thorpej

Use device_{get,set}prop_bool() for "is-console".


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.6 09-Mar-2025 mlelstv

Don't try to identify the boot device. This regulary fails
for wedge devices and cannot handle wedge names.

Instead, let the kernel resolve the device passed as boot arg later.


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.5 08-Jan-2024 thorpej

branches: 1.5.2;
Accept "root=xxx" for the root device and "flags=xxx" as the boothowto
flags from the kernel command line arguments.


1.4 07-Jan-2024 thorpej

Don't to go IPL0 right before calling main(), instead call spl0() at the
end of cpu_configure(). It seems that Qemu doesn't reset pending interrupts
correctly after a RESET request, which was causing an explosion when an
interrupt was delivered to the new kernel instance. This change makes
reboot work.

Thx to mlelstv@ for figuring out what the problem was.


1.3 02-Jan-2024 thorpej

Move the initrd setup into bootinfo.c


1.2 02-Jan-2024 thorpej

If the loader passed us a RAM disk, use it as the root file system.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.14 30-Nov-2025 thorpej

pmap_bootstrap1() has some macros to aid translation between virtual and
physical addresses. Move these into <m68k/pmap_68k.h> and put them into
two groups.

The first group (PMAP_BOOTSTRAP_RELOC_GLOB() and PMAP_BOOTSTRAP_RELOC_PA())
are for referencing global symbols and physical addresses from within the
context of pmap_bootstrap1() (or similar function) itself.

The second group (PMAP_BOOTSTRAP_VA_TO_PA() and PMAP_BOOTSTRAP_PA_TO_VA())
are for translating addresses that will be used in the context of the running
kernel once the MMU is enabled.

The former group is necessary because some platforms may call pmap_bootstrap1()
with the MMU *enabled* but running on foreign mappings whereby global
references work without relocation but access to physical addresses require
relocation (this is the case on mac68k systems that place the frame buffer
at physical address $0000.0000, in which case MacOS uses the MMU to simulate
the traditional MacOS memory map and we're running on those mappings when
the kernel starts).

Systems with special requirements (see above) can override each of these
macros individually by simply defining them in <machine/pmap.h> before
including <m68k/pmap_68k.k>.


1.13 30-Nov-2025 thorpej

physmem is a psize_t (see uvm_page.c). Make the type used in the RELOC()
macro match, even though there's no practical difference on an IPL32 system.


1.12 14-Nov-2025 thorpej

Clean up bootinfo startup:
- Be more explicit about whats PA vs VA, and make sure by the end of
bootinfo_startup1(), everything is set up for VA for subsequent
bootinfo calls.
- No longer need the "reloff" argument to bootinfo_startup2().


1.11 06-Nov-2025 thorpej

Split bootinfo_start() into bootinfo_startup1() (pre-MMU-enbled)
and bootinfo_startup2() (post-MMU-enabled). Use proper VA<->PA
relocation where called for (even though virt68k is VA==PA).

Move virt68k / bootinfo specific code out of pmap_bootstrap(),
and handle it in bootinfo_startup2().


1.10 06-Nov-2025 thorpej

Change bootinfo_start() to return the address representing the end
of the boot info structure. Use this in early bootstrap to avoid
a global reference before the MMU is enabled.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.9 09-Jun-2025 andvar

s/kenrnel/kernel/ in comment.


1.8 11-Nov-2024 riastradh

virt68k/bootinfo.c: Nix trailing whitespace.

No functional change intended.


1.7 01-Nov-2024 mlelstv

Make compilable without GFTTY


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.6 08-Jan-2024 thorpej

branches: 1.6.2;
Add bootinfo_getarg(), which gets the name kernel command line argument
and returns its value (sort of like getenv()).


1.5 06-Jan-2024 thorpej

Implement bootinfo_setup_rndseed(). Thx Riastradh@ for the suggestion.


1.4 06-Jan-2024 thorpej

The RAM disk specified by bootinfo is not necessarily loaded along with
the static kernel image. Map is separately and account for it in the
available memory segments.


1.3 02-Jan-2024 thorpej

Detect a RND seed passed in by the loader.
XXX We don't actually *do* anything with it yet.


1.2 02-Jan-2024 thorpej

Move the initrd setup into bootinfo.c


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.4 09-Nov-2025 kre

Further disentangle horrid code.

This time it has a chance of working... (perhaps, I hope).


1.3 09-Nov-2025 kre

Redo previous to (hopefully) avoid gcc barfing.

This also changes the code from positively foul (new vars declared
in the middle of an expression - really??) to simply cringeworthy.

With any luck, this will allow the virt68k port to build again.


1.2 08-Nov-2025 thorpej

__HAVE_NEW_PMAP_68K glue.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.2 08-Jan-2024 thorpej

Use aprint_error() rather than a bare printf() in a few spots, and
an aprint_normal() in some others.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.5 05-Dec-2025 thorpej

Some tidy-up of the MMU-enable code:
- Use defined constants rather than magic numbers for the 68040 %cacr
and 68060 %cacr and %pcr bits.
- Clean up some comments.
- Use a more robust comparison against mmutype for the 68040-or-68060
case (and improve the comment, as well).
- Make sure all final jumps to Lmmuenabled are non-PC-relative, and add
such a jump to the final (68851/68030) case rather than letting it simply
fall through. This is in service of making this code sharable as an
includable code fragment on platforms with different requirements (i.e.
systems that don't have a VA==PA environment when this code runs).


1.4 14-Nov-2025 thorpej

No need to export VM_MAX_KERNEL_ADDRESS here.


1.3 07-Nov-2025 thorpej

G/C the PTE/STE bits definitions from genassym.cf; they're not used by
assembly code, with the exception of PG_FRAME, which is not actually
used with PTEs but rather to truncate regular virtual addresses. As
such, provide an independent definition for it derived from PGOFSET,
decoupling it from PTE bits. XXX Should rename it to PGFRAME eventually.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.2 08-Jul-2025 thorpej

Use the new common TT register configuration functions and generally
streamline the code that enables the MMU.


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.1 02-Jan-2024 thorpej

branches: 1.1.2;
Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.4 01-Nov-2024 mlelstv

Catch stray interrupts.
The message reports the CPU interrupt level.


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.3 19-Jan-2024 thorpej

branches: 1.3.2;
Adjust the clockframe to be the same as what the common m68k interrupt
dispatch code expects.


1.2 02-Jan-2024 thorpej

Bump date.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.32 11-Dec-2025 thorpej

{hp300,luna68k,mvme68k,news68k,virt68k}_init() -> machine_init(), to
facilitate future code de-duplication.


1.31 05-Dec-2025 thorpej

Use the sharable MMU enablement code fragment.


1.30 05-Dec-2025 thorpej

Some tidy-up of the MMU-enable code:
- Use defined constants rather than magic numbers for the 68040 %cacr
and 68060 %cacr and %pcr bits.
- Clean up some comments.
- Use a more robust comparison against mmutype for the 68040-or-68060
case (and improve the comment, as well).
- Make sure all final jumps to Lmmuenabled are non-PC-relative, and add
such a jump to the final (68851/68030) case rather than letting it simply
fall through. This is in service of making this code sharable as an
includable code fragment on platforms with different requirements (i.e.
systems that don't have a VA==PA environment when this code runs).


1.29 04-Dec-2025 thorpej

Disable caches earlier. Use relative labels in MMU enablement code.


1.28 04-Dec-2025 thorpej

Initialize %sfc and %dfc in pmap_bootstrap2(), rather than duplicating
4 lines (including comment) across 11 locore.s files.


1.27 14-Nov-2025 thorpej

Call bootinfo_startup2() from virt68k_init().


1.26 14-Nov-2025 thorpej

Clean up bootinfo startup:
- Be more explicit about whats PA vs VA, and make sure by the end of
bootinfo_startup1(), everything is set up for VA for subsequent
bootinfo calls.
- No longer need the "reloff" argument to bootinfo_startup2().


1.25 11-Nov-2025 thorpej

Fix a ~30-year-old bug: pass the correct address to m68881_restore()
when setting the null FP context after probing for the FPU. Thanks to
Isaki-san for the pointing it out and to Tsusui-san for the testing work
that prompted Isaki-san's analysis.

(This bug has propagated from the hp300 port to just about everywhere
else over the years; an ancient ruin in the garden. The question about
whether this is even strictly necessary will be addressed separately.)


1.24 07-Nov-2025 thorpej

Let pmap_bootstrap() round the "nextpa" argument to a page boundary.


1.23 06-Nov-2025 thorpej

pmap_bootstrap() -> pmap_bootstrap1(). NFC.


1.22 06-Nov-2025 thorpej

Split bootinfo_start() into bootinfo_startup1() (pre-MMU-enbled)
and bootinfo_startup2() (post-MMU-enabled). Use proper VA<->PA
relocation where called for (even though virt68k is VA==PA).

Move virt68k / bootinfo specific code out of pmap_bootstrap(),
and handle it in bootinfo_startup2().


1.21 06-Nov-2025 thorpej

Change bootinfo_start() to return the address representing the end
of the boot info structure. Use this in early bootstrap to avoid
a global reference before the MMU is enabled.


1.20 06-Nov-2025 thorpej

Don't hard-code RAM start as $0000.0000. Instead, dynamically compute
our relocation offset, and use it to access globals rather than assume
VA==PA.

XXX MMU enable / disable still assumes this, for now.


1.19 04-Nov-2025 thorpej

Use the return lwp0 u-area return value from pmap_bootstrap2(), rather
than referencing lwp0uarea directly.


1.18 04-Nov-2025 thorpej

Rename pmap_bootstrap_finalize() to pmap_bootstrap2(), and change it
to return a pointer to the lwp0 u-area (in preparation for an upcoming
change).

Other than the return value, NFC.


1.17 06-Sep-2025 riastradh

paravirt_membar_sync(9): New memory barrier.

For use in paravirtualized drivers which require store-before-load
ordering -- irrespective of whether the kernel is built for a single
processor, or whether the (virtual) machine is booted with a single
processor.

This is even required on architectures that don't even have a
store-before-load ordering barrier, like m68k; adding, e.g., a virtio
bus is _as if_ the architecture has been extended with relaxed memory
ordering when talking with that new bus. Such architectures need
some way to request the hypervisor enforce that ordering -- on m68k,
that's done by issuing a CASL instruction, which qemu maps to an
atomic r/m/w with sequential consistency ordering in the host.

PR kern/59618: occasional virtio block device lock ups/hangs


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.16 08-Jul-2025 thorpej

branches: 1.16.2;
Use the new common TT register configuration functions and generally
streamline the code that enables the MMU.


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.15 19-Jan-2024 thorpej

branches: 1.15.2;
Adjust the clockframe to be the same as what the common m68k interrupt
dispatch code expects.


1.14 18-Jan-2024 isaki

Set TT0 register to recognize the I/O space even on the 68030 case.

http://mail-index.netbsd.org/port-m68k/2024/01/17/msg000870.html


1.13 17-Jan-2024 thorpej

Make sigcode.s and sunos_sigcode.s build as their own stand-alone files.


1.12 17-Jan-2024 thorpej

Make compat_13_sigreturn13.s and compat_16_sigreturn14.s build as their
own stand-alone files and G/C the now-empty sigreturn.s.


1.11 17-Jan-2024 thorpej

G/C intrcnt[].


1.10 16-Jan-2024 thorpej

Build m68k/support.s on its own; don't include it from locore.s


1.9 13-Jan-2024 thorpej

Switch to common m68k vector table.


1.8 12-Jan-2024 thorpej

Make getsr() an inline in <m68k/psl.h> and G/C all of the now-redudant
copies.


1.7 12-Jan-2024 thorpej

Remove getsp(); nothing uses it.


1.6 09-Jan-2024 thorpej

Properly implement mm_md_physacc() and garbage-collect the now unused
"lowram" variable (hold-over from hp300 lineage).


1.5 09-Jan-2024 thorpej

Statically-initialize the '851 / '030 protorp with MMU51_SRP_BITS. In
pmap_init(), re-initialize protorp with MMU51_CRP_BITS. Remove the now-
redundant code that does this in each of the m68k platforms.


1.4 09-Jan-2024 thorpej

Remove duplicated / slightly-tweaked loadustp() (load user segment table)
routines from all of the m68k ports using the shared pmap. Instead, in
pmap_init(), set up a function pointer to the appropriate mmu_load_urp*()
function in mmu_subr.s.


1.3 07-Jan-2024 thorpej

Don't to go IPL0 right before calling main(), instead call spl0() at the
end of cpu_configure(). It seems that Qemu doesn't reset pending interrupts
correctly after a RESET request, which was causing an explosion when an
interrupt was delivered to the new kernel instance. This change makes
reboot work.

Thx to mlelstv@ for figuring out what the problem was.


1.2 02-Jan-2024 thorpej

Provide a mechanism for a system reset controller to register to be used
to reset/halt the system.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.22 20-Dec-2025 skrll

Convert all cnpollc callers to using true/false for consistency.


1.21 17-Dec-2025 thorpej

Implement the machdep.broken_rmc sysctl. Obviously, virt68k can never
really have a broken /RMC, but this is a r/w sysctl node that allows
the value to be toggled for testing.


1.20 11-Dec-2025 thorpej

{hp300,luna68k,mvme68k,news68k,virt68k}_init() -> machine_init(), to
facilitate future code de-duplication.


1.19 11-Dec-2025 andvar

Fix various typos in comments.


1.18 20-Nov-2025 thorpej

Defflag the M060SP option in one place, and make sure to include opt_m060sp.h
(and opt_fpsp.h) in the right places.

PR port-m68k/59776


1.17 18-Nov-2025 thorpej

G/C "maxmem" -- nothing actually references it.


1.16 14-Nov-2025 thorpej

Introduce a hook for machine-specific code to influence pmap_bootstrap1()
in the new pmap_68k.

The pmap_bootmap structure allows machine-specific code to:
- Specify "keepout" ranges, intended to clamp the managed kernel address
space to keep it out of regions mapped using Transparent Translation
(usually devices).
- Allocate unmanaged kernel virtual address ranges (usually for devices).
- Optionally map physical addresses to those virtual address ranges (guess
what this might be used for!).

VM_MAX_KERNEL_ADDRESS is now run-time calculated. It starts off as
the very last page of the kernel virtual address space, and is reduced
as it encounters KEEPOUT areas.

Initially, use this on luna68k, news68k, and virt68k to KEEPOUT the
TT-mapped ranges.

While here, add some missing RELOC()s; no difference on VA==PA platforms,
but bound to blow up eventually.


1.15 14-Nov-2025 thorpej

Call bootinfo_startup2() from virt68k_init().


1.14 12-Nov-2025 thorpej

Use pmap_init_kcore_hdr().


1.13 08-Nov-2025 thorpej

__HAVE_NEW_PMAP_68K glue.


1.12 06-Nov-2025 thorpej

Don't include <machine/pte.h> directly.


1.11 06-Nov-2025 thorpej

Move all of the msgbuf initialization out of pmap_bootstrap() and into
virt68k_init(). pmap_bootstrap() is now free of virt68k-specific stuff.


1.10 06-Nov-2025 thorpej

Split bootinfo_start() into bootinfo_startup1() (pre-MMU-enbled)
and bootinfo_startup2() (post-MMU-enabled). Use proper VA<->PA
relocation where called for (even though virt68k is VA==PA).

Move virt68k / bootinfo specific code out of pmap_bootstrap(),
and handle it in bootinfo_startup2().


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.9 05-Mar-2024 thorpej

branches: 1.9.4;
Move the at-shutdown call to resettodr() from cpu_reboot() to kern_reboot().

It's a small step, but it's a step.


1.8 13-Jan-2024 thorpej

Switch to common m68k vector table.


1.7 09-Jan-2024 thorpej

Properly implement mm_md_physacc() and garbage-collect the now unused
"lowram" variable (hold-over from hp300 lineage).


1.6 08-Jan-2024 thorpej

Accept "root=xxx" for the root device and "flags=xxx" as the boothowto
flags from the kernel command line arguments.


1.5 06-Jan-2024 thorpej

Fix stupid typo in cpu_set_reset_func().


1.4 06-Jan-2024 thorpej

The RAM disk specified by bootinfo is not necessarily loaded along with
the static kernel image. Map is separately and account for it in the
available memory segments.


1.3 02-Jan-2024 thorpej

Provide a mechanism for a system reset controller to register to be used
to reset/halt the system.


1.2 02-Jan-2024 thorpej

Detect a RND seed passed in by the loader.
XXX We don't actually *do* anything with it yet.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.14 30-Nov-2025 thorpej

physmem is a psize_t (see uvm_page.c). Make the type used in the RELOC()
macro match, even though there's no practical difference on an IPL32 system.


1.13 12-Nov-2025 thorpej

Stash away the kernel relocation offset used by the Hibler/Utah
pmap's pmap_init_kcore_hdr(). This is a nop for systems that map
the kernel VA==PA, but is included for completeness.


1.12 07-Nov-2025 thorpej

Let pmap_bootstrap() round the "nextpa" argument to a page boundary.


1.11 06-Nov-2025 thorpej

pmap_bootstrap() -> pmap_bootstrap1(). NFC.


1.10 06-Nov-2025 thorpej

Move all of the msgbuf initialization out of pmap_bootstrap() and into
virt68k_init(). pmap_bootstrap() is now free of virt68k-specific stuff.


1.9 06-Nov-2025 thorpej

G/C the legacy-and-unused "mem_size" pmap variable, but preserve it for the
machdep cases where it was used (atari, mac68k).


1.8 06-Nov-2025 thorpej

Split bootinfo_start() into bootinfo_startup1() (pre-MMU-enbled)
and bootinfo_startup2() (post-MMU-enabled). Use proper VA<->PA
relocation where called for (even though virt68k is VA==PA).

Move virt68k / bootinfo specific code out of pmap_bootstrap(),
and handle it in bootinfo_startup2().


1.7 06-Nov-2025 thorpej

Use macros to convert between virtual and physical addresses, and use
them consistently rather than assuming VA==PA, as was done in a few
places.

Mark a couple of items that are virt68k-specific.


1.6 06-Nov-2025 thorpej

Change the signature of pmap_bootstrap() to return a paddr_t, the
next available PA after the static memory allocation performed in
pmap_bootstrap() itself.

NFC for now -- eventually, this will be used to move system-specific
code out of pmap_bootstrap(), and thus make it more sharable between
system types. (Necessary, but not sufficient, as the kids say...)


1.5 04-Nov-2025 thorpej

Rename pmap_bootstrap_finalize() to pmap_bootstrap2(), and change it
to return a pointer to the lwp0 u-area (in preparation for an upcoming
change).

Other than the return value, NFC.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.4 02-Jan-2024 thorpej

Remove yet another remnant of debugging.


1.3 02-Jan-2024 thorpej

Collect more garbage.


1.2 02-Jan-2024 thorpej

G/C some scratch-pad notes.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


1.5 20-Dec-2025 skrll

Convert all cnpollc callers to using true/false for consistency.


Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
1.4 23-Sep-2024 rin

virt68k: trap: Fix ksi_code for T_TRAP{,15}|T_USER

Fix ATF failures for lib/libc/sys/t_ptrace_wait*:{,set}step*.

XXX
It would be really nice if we can factor out copy-paste b/w
m68k ports...


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.3 25-Feb-2024 mlelstv

branches: 1.3.2;
Don't crash in copyin/copyout when a NULL pointer is passed.


1.2 20-Jan-2024 thorpej

Largely unify the <machine/cpu.h> headers on the m68k platforms.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.


Revision tags: perseant-exfatfs-base-20250801 perseant-exfatfs-base-20240630 perseant-exfatfs-base
1.3 13-Jan-2024 thorpej

Switch to common m68k vector table.


1.2 02-Jan-2024 thorpej

Remove non-applicable comments.


1.1 02-Jan-2024 thorpej

Add a port to the Qemu m68k "virt" platform, a 68040-based virtual machine
with VirtIO I/O devices.

This is a work-in-progress, but "successfully mounts root file system
and then complains about missing /sbin/init that is, in fact, not there"
seems like a good checkpoint.