Linux and Motorola 68000 Emulator
I read an article that someone had managed to get Linux running on a Sega MegaDrive which has a Motorola 68000 CPU and no MMU. This inspired me to attempt something similar with the CP/M-68K emulator I made last year.
It turns out that not many changes are needed to the emulator. Primarily just adding a timer that gives an interrupt that can be acted upon. This is crucial for any multi-tasking operating system like Linux. I went for the simplest possible solution by just counting CPU instructions to tick the timer, since the emulator doesn't count individual cycles, but it works well enough. I also discovered a kind of bug with the STOP instruction, which was not detected previously when just running CP/M-68K; that it does not advance the program counter! This had to be fixed to avoid getting stuck. The STOP instruction will also now call usleep() to relax the host CPU since Linux on the 68000 uses this by default when idle and just waiting for interrupts. The necessary changes are included in version 0.2 that can be downloaded here or from the public GitHub, GitLab or Codeberg repositories.
To make a compatible Linux kernel and root filesystem I used a newer version 2026.8 version of Buildroot. This comes with Linux kernel version 7.1 by default which is also used. I had to make drivers for the timer, console and disks that are provided by the emulator by using the same TRAP mechanism as the custom CP/M-68K BIOS uses. The drivers were loosely based on the existing drivers to support Atari ST emulators that are already present in the kernel. Note that a patch is needed on the GCC compiler to avoid it creating unaligned memory accesses for the original Motorola 68000. The complete Buildroot configuration with patches can be downloaded here.
Building is done like this:
cd buildroot-2026.08
tar -xvzf cpm68emu-linux.tar.gz
make cpm68emu_defconfig
make -j32
For convenience, here is also a pre-built kernel and root filesystem. To start the cpm68emu emulator with Linux, use the following arguments:
./cpm68emu -b vmlinux.srec -e 0x400 rootfs.cramfs
The output should look like this, use "root"/"toor" to login:
Linux version 7.1.13 (kobolt@ryzen.lan) (m68k-buildroot-uclinux-uclibc-gcc.br_real (Buildroot 2026.08) 15.3.0, GNU ld (GNU Binutils) 2.45.1) #1 Sat Sep 26 11:49:48 CEST 2026
printk: legacy console [cpm68con0] enabled
uClinux with CPU MC68000
Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
Zone ranges:
DMA [mem 0x0000000000000000-0x0000000000ffffff]
Normal empty
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x0000000000000000-0x0000000000ffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x0000000000ffffff]
Kernel command line: root=/dev/cpm68disk0
printk: log buffer data + meta data: 131072 + 409600 = 540672 bytes
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Built 1 zonelists, mobility grouping on. Total pages: 4096
mem auto-init: stack:off, heap alloc:off, heap free:off
SLUB: HWalign=16, Order=0-1, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS: 32
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
Calibrating delay loop... 9.72 BogoMIPS (lpj=48640)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
VFS: Finished mounting rootfs on nullfs
Memory: 14324K/16384K available (868K kernel code, 450K rwdata, 96K rodata, 60K init, 184K bss, 1844K reserved, 0K cma-reserved)
devtmpfs: initialized
cpm68disk0: adding device as emulator disk A:
cpm68disk1: adding device as emulator disk B:
cpm68disk2: adding device as emulator disk C:
cpm68disk3: adding device as emulator disk D:
workingset: timestamp_bits=30 (anon: 26) max_order=12 bucket_order=0 (anon: 0)
io scheduler mq-deadline registered
io scheduler kyber registered
VFS: Mounted root (cramfs filesystem) readonly on device 240:0.
devtmpfs: mounted
VFS: Pivoted into new rootfs
Freeing unused kernel image (initmem) memory: 60K
This architecture does not have kernel memory protection.
Run /sbin/init as init process
Welcome to Buildroot
buildroot login: root
Password:
Jan 1 00:00:18 login[29]: root login on 'console'
~ # uname -a
uClinux buildroot 7.1.13 #1 Sat Sep 26 11:49:48 CEST 2026 m68k GNU/Linux
~ #