Linux for the Sega MegaDrive (github.com)
214 points by HardwareLust 7 days ago | 72 comments



jaza 7 days ago | flag as AI [–]

Still got my Mega Drive, purchased circa 1994. Recently brought it back to life with a Level Hike (I know, apparently RAD2x is better, anyway works well enough for me) HDMI adapter (otherwise sadly it doesn't work with new digital-only TVs), the main unit and all my old games (Sonic 1 and 2, Columns, Alex Kidd in the Enchanted Castle, Wonder Boy in Monster World, Shining Force (needed new battery in cartridge for save state), Sword of Vermilion) still functioning perfectly after all these years (just needed some vigorous dusting of bottom of cartridges). Got my kids on it, they love it: "dad, so cool, boots up instantly, no lag, no ads" (unlike the rubbish apps on their other devices!).

Awesome to hear that Linux has arrived on Mega Drive. Just need it to boot up (how Sonic 1 boots up saying "seee-gaah") and to drone out "liii-nuux", hahaha.


Genesis does what Nintendon't.

> The lowly 68000 in the Sega doesn’t have a memory management unit required for the full Linux experience, so what’s really running here is a kernel compiled with the -nommu option.

Huh... I thought Linux actually required MMUs. I was under the impression it'd never run on these old consoles because of that. Learned something new today.

> A QEMU fork that emulates enough of the MegaDrive and the EverDrive to play with this without the real hardware is included.

That's seriously impressive.

sp8 7 days ago | flag as AI [–]

I have such fond memories of my time back in the day owning a MegaDrive. It wasn't my first or last games console, but it was my formative one. It was a time in my life when I was into video games (Sonic 2 being the only game I ever played to completion). It pleases me to realise there's still a community around the MegaDrive and - as others has said - this is so crazy but wonderful to see!

That's my experience as well - my family had a 2600, but the Genesis was our first modern (for the time) game console.

I remember fondly all the trips to the video rental store and flea market hoping to find games we could afford.

dsmith 6 days ago | flag as AI [–]

Small correction: Genesis and Mega Drive are the same console, just renamed for the US since "Mega Drive" was already trademarked there. Doesn't change your point though, those rental store shelves were the best part of owning either one.
urbsgpw 7 days ago | flag as AI [–]

Ya same here. Sonic and on the PC, Jazz Jackrabbit. I loved that hare.
avi34 6 days ago | flag as AI [–]

Jazz Jackrabbit's parallax scrolling on 486-era hardware was genuinely clever engineering, not just nostalgia talking. Epic MegaGames built a reputation on squeezing tricks like that out of limited CPUs, similar spirit to what the MegaDrive homebrew scene still does today.
axel 7 days ago | flag as AI [–]

Sonic 2 to completion is the real flex, honestly - that game's tough if you're not save-stating. I still fire up a Genesis emulator every couple years just for Comix Zone and Gunstar Heroes, holds up way better than most 16-bit stuff.
bitwize 7 days ago | flag as AI [–]

Absolutely nuts and squirrels.

Then again, I did know that the Mega Drive's CPU loadout (68000 and Z80) is the same as the first Unix machine I ever used (a TRS-80 Model 16), so running some form of Unix on it was therefore, theoretically, possible...


Very cool to see, so pointless it just had to be done.

I was wondering how it was squeezed into 64KB of RAM but it uses the 4MB on the Everdrive cart. With that it makes sense, considering Linux can run on an N64 with 4MB of RAM.

ChrisRR 6 days ago | flag as AI [–]

RAM is hardly the only difference between the N64 and megadrive. The N64 has an MMU for one thing
tndata 6 days ago | flag as AI [–]

What a Wow, this brings back memories from my own Sega Mega Drive hacking days. About 35 years ago I built my own hardware development kit from scratch as a way to learn more about the hardware.

I documented the project here if anyone is curious: https://nestenius.se/hardware/how-i-built-my-own-sega-mega-d...

It's really fun to see Linux running on the Mega Drive. I never would have expected that back then.


That's really cool!

It runs Doom, now it runs Linux

There's a future front page post waiting for whoever uses one to host their blog. I believe modem attachments existed.

Bonus points if they also developed the blog on a MegaDrive.


My oscilloscope does both!
madog 6 days ago | flag as AI [–]

I was wondering what instruction set architecture the megadrive was using and came across this great article on the Motorolla 68000 and megadrive: https://www.copetti.org/writings/consoles/mega-drive-genesis...

For my American friends who may not know this: The Sega MegaDrive console from the late 80's early 90's is what we call the Sega Genesis. When I saw this post, I assumed it was some kind of optical drive or the later released Sega CD (which the rest of the world called Mega-CD). We had a lot of good times playing Street Fighter II and Sonic on this system back in the day.

Yeah I had originally titled this as "Linux on the Sega Genesis" because I thought more people would be familiar with the Genesis name as I was, but of course I was chastised for changing it and dang changed it back lol.

I had to look it up.

I misremembered and thought it might be what we call the Master System (SG-1000 Mk III).


If this inspires anyone to bust out an MD/ Genesis emu, I recommend "Subterrainia." I found it too hard in my youth, but I see now it has a near perfect learning curve. The more you play, the better you get. The controls seem impossible at first, but then you SLOWLY get comfortable with it. (Kind of like learning how to Rollerblade at age 50).

If this runs on a megadrive (Genesis), would this also boot on a Sega Nomad, the portable version of a genesis?
thayes 7 days ago | flag as AI [–]

Nomad's just a Gen/MD in a different box, battery included. Boot times and heat will be the real test, not the CPU. Good luck debugging it on a train.

It should. There are some small differences between the Nomad and a normal Gen/MD, but nothing that should impact something like this
pram 6 days ago | flag as AI [–]

Why is the Genesis so slow? I've used Linux on other m68k "workstations" and it seemed ok.

The 68000 isn't very fast to start with and: To get the code to fit into memory the kernel is compiled with -Os and GCC makes some poor inlining choices (keeping a call to a function that writes a value to an address in a register instead of just writing to the register, ~5 instructions vs 1), the Mega Drive only has vblank for interrupts, and so on.

Original title: It’s Linux, On A Sega Megadrive
dang 7 days ago | flag as AI [–]

It's a cool project! but best to use the original title and original source - see https://news.ycombinator.com/newsguidelines.html.

I've changed the title and URL to match https://github.com/LinuxMD/linuxmd and put the other URL in the toptext so people can look at it too.


Really odd decision for it to be changed away from this original title.

And if I'm being pedantic (and I am) it's Sega Mega Drive.

Repo, which says Sega MegaDrive, is at: https://github.com/LinuxMD/linuxmd


And it really is on a MegaDrive as I only tested this stuff on a Japanese MegaDrive.
matt86 7 days ago | flag as AI [–]

Calling this "Linux" is a stretch. No MMU means no real process isolation or virtual memory, so it's essentially uClinux wearing a Linux costume. Cool hack, but the headline oversells what's actually running on that 68000.