The use case would be things like undistracted writing or displaying sheet music, turning on from a cold boot and being ready to go at a moment's notice.
I know about FreeDOS, which is ultra fast to start and simple, but there's no GUI. I know about TempleOS, but that's a bit too esoteric. And I know about say, Windows 3.1, but that won't run natively on modern hardware.
I've searched for e.g. "very simple fast booting linux" but that just turns up results like Arch Linux, or how to make Ubuntu boot faster.
Is there anything out there?
If the goal is more educational LFS is a terrific tool that shows you pretty much everything that goes into building an OS and from there you can make it as minimal as you want
There's also a version based on Debian, but I haven't used it thus far.
TC is a highly modular distro, and really comfy to hand-tailor to one's needs (e.g. for building a single-application system): all booted packages are listed in a single config file, excluded files or processes in another, etc. This, combined with a RAM-booted system, means that it's really easy to return to a pristine system when you mess something up.
As for booting, it's not lightning fast (not quite like FreeDOS). But this depends on the amount of packages you want to load on startup, how much X stuff you have, whether the /home partition is also loaded to RAM or kept on the disk, etc.
My favorite feature with regard to the RAM booting is that this gives me a dead silent system, at least on less complicated setups.
I've been a more or less daily TC user for 6-7 years, since version 6.4. I can confirm that I used it in 2017-2018 on a Thinkpad T42 to produce lengthy radio programs for my country's Public Broadcasting with Non DAW. Setting up sound and wifi may require fiddling at times, but I've always succeeded thus far on our old Dells and Thinkpads. For a really minimal system, though, I think TC is really solid. The software repos are also not bad, highly encouraging user contributions. Read the Corebook (2013) [3] for a detailed overview of the system.
What's also important is that TC is in active development, current version 12.0 is from February 2021. The message board is lively and helpful.
1: https://distrowatch.com/table.php?distribution=tinycore
Booting on real hardware will most likely be successful with a Raspberry Pi, or Thinkpad, those seem to be the most common for these small OS's to target.
Or you could boot Linux straight to qemu with your OS of choice.
Edit: Or Alpine Linux running Sway may be a decent option, though it's definitely some assembly required.
If you want to run Windows 3.1, you might try running it on a hypervisor? Although you're still not getting SMP support or gobs of ram that way.
Someone else mentioned Serenity, which is awesome IMO, and probably the surest bet in terms of something lightweight yet modern and relevant.
A long time ago I remember playing around with the Syllable OS, which got to a fairly decent level of development, but sadly fell apart. That one's sadly only interesting from a history perspective, but still fascinating to look at.
I definitely have to +1 the idea of playing around with things like LFS and Buildroot, although I'd suggest a gentler ramp-up by way of something like Slackware, which exposes a lot of low-level knobs and components that you can progressively pick up on as you go along. I incidentally got my start on Slackware on an ancient laptop with no Wi-Fi or Ethernet, installing from a partially corrupted CD. The net result was actually surprisingly awesome, I had no distractions or ADHD catnip to have to deal with, and enough packages installed that the base system more or less worked. It was just the programming stuff (gcc etc) that failed, haha. But... sed worked, and grep, and bash. And so it was that I wound up learning regular expressions pretty much inside out. It was remarkably easy because I had absolutely no distractions. It ended up working too well; the bulk of the package viewer/installer GUI I'd started writing was an entire screenful of regex at one point, and I had to give up because looking at it gave me a headache :/. But I've never had a problem leveraging grep or sed ever since.
I've also played around with booting Linux kernels with minimal initramfs images on relatively ancient hardware (Celeron/Pentium/Core2 class) and found you can generally boot an optimally-configured kernel in less than 1 second if you set the loglevel to 0 during early boot - printing dmesg to screen as the kernel boots is a necessarily synchronous operation, given that the text about what is happening next must by definition make it to the screen before the thing happens in order for the info to actually useful ("ok, so it crashed here"), and while scrolling VGA is trivially fast nowadays the time does still add up. Setting loglevel=0 doesn't disable the internal ring buffer, it just disables printing it to the screen, allowing everything to initialize and reach userspace in maybe 450ms on 10-15 year old hardware, and probably reasonably less on just about everything newer (haven't benchmarked my current machines). This leaves you plenty of room to play around in userspace (start X or Wayland, connect to Wi-Fi, etc) and go from there, and presents a fun full-stack optimal integration opportunity (if you like this sort of thing, look into kiosk systems). I've missed that sort of tweaking, been meaning to get back into it. It's genuinely fun. "Why, again, do I even need udev?" (I only start udev on my Slackware box if I absolutely need it.)
What a great question! (Everybody who's reading this, please upvote!)
OK, so you've got all kinds of choices in this area!
First off, I assume, because/ you mentioned FreeDOS/TempleOS/Windows 3.1 -- that you're looking for an x86 (Intel/AMD) OS.
First question: 32-bit or 64-bit?
32-bit OS's will run on older hardware (20+ years old!) -- but (in general!) you'll be limited to a max of 4GB of usable RAM...
64-bit will, of course, run on newer hardware, but in general will be a little bit more complex than an old, Open Source, "barebones" OS'es...
Second question: Windows compatible or not?
You want the OS to be Open Source right? That would rule out any version of Windows -- but that wouldn't rule out ReactOS (https://reactos.org/). Many Windows programs will run on ReactOS -- but some might not, and/or have interesting bugs -- so "buyer beware" as they say.
But, in terms of overall lines of code and complexity, ReactOS is probably the least simple Free and Open Source OS'es, next to Linux itself...
You might be actually looking for two things, or rather three:
1) Simple Open Source Non-Graphical Command-Line OS.
2) Open Source Graphical Window Manager / Windowing System For That OS.
3) Example Source Code (for that OS and Window Manager) which implements a text editor, an audio player app, a calculator, etc.
Also, keep in mind that unless #2 is written to be as simple as possible (and thus uses only simple monospaced bitmap fonts) -- then you're also going to be dealing with a font rendering subsystem -- which is going to add to the complexity and thus learning curve -- of the codebase...
If you've got an underlying Non-Graphical OS like FreeDOS (or any other) -- if that OS does not prohibit direct hardware access to the video card, OR if the underlying OS can specifically be requested to give direct hardware access to a program it runs -- then you might try writing a program to implement GUI features on that non-GUI OS... it would be a great programming exercise!
But if you don't, I'm sure such GUI's (ideally, simple ones, not X/Windows AKA X11, nor the Windowing code in Windows/ReactOS) must exist -- just search GitHub...
Maybe that's what to do...
Search GitHub for GUI's or simple OS'es that implement GUI's... find one that is as simple/understandable as you desire -- and that's your go-to OS for this!
Anyway, Good Luck in your quest!