Homebrew An OS From Scratch? Snowdrop Shows How It’s Done

Ever wondered what it would take to roll your own OS? [Sebastian]’s Snowdrop OS might just provide you with some insight into that process, and maybe even some inspiration.

[Sebastian] created Snowdrop completely from scratch, using only x86 assembly language. It’s more than just bare-bones, and boasts a number of useful utilities and programs including a BASIC interpreter and linker (for creating standalone BASIC executables.) That’s not even touching on the useful essentials, like multitasking and a GUI framework. There are even a number of resources specifically for making game development easier. Because as [Sebastian] puts it, what’s a operating system without games?

Interested in giving Snowdrop a try, or peek at the source code? The binaries and sources section has all you need, and the other headings at the top of the page will send you to the various related goodies. If you have a few minutes, we recommend you watch a walkthrough of the various elements and features of Snowdrop in this video tour (embedded after the page break.)

Snowdrop is an ambitious project, but we’re not surprised that [Sebastian] has made it work; we’ve seen his low-level software skills before, with his fantastic efforts around the classic stand-up arcade game, Knights of the Round.

Continue reading “Homebrew An OS From Scratch? Snowdrop Shows How It’s Done”

AVX-512: When The Bits Really Count

For the majority of workloads, fiddling with assembly instructions isn’t worth it. The added complexity and code obfuscation generally outweigh the relatively modest gains. Mainly because compilers have become quite fantastic at generation code and because processors are just so much faster, it is hard to get a meaningful speedup by tweaking a small section of code. That changes when you introduce SIMD instructions and need to decode lots of bitsets fast. Intel’s fancy AVX-512 SIMD instructions can offer some meaningful performance gains with relatively low custom assembly.

Like many software engineers, [Daniel Lemire] had many bitsets (a range of ints/enums encoded into a binary number, each bit corresponding to a different integer or enum). Rather than checking if just a specific flag is present (a bitwise and), [Daniel] wanted to know all the flags in a given bitset. The easiest way would be to iterate through all of them like so:

while (word != 0) {
  result[i] = trailingzeroes(word);
  word = word & (word - 1);
  i++;
}

The naive version of this look is very likely to have a branch misprediction, and either you or the compiler would speed it up by unrolling the loop. However, the AVX-512 instruction set on the latest Intel processors has some handy instructions just for this kind of thing. The instruction is vpcompressd and Intel provides a handy and memorable C/C++ function called _mm512_mask_compressstoreu_epi32.

The function generates an array of integers and you can use the infamous popcnt instruction to get the number of ones. Some early benchmark testing shows the AVX-512 version uses 45% fewer cycles. You might be wondering, doesn’t the processor downclock when wide 512-bite registers are used? Yes. But even with the downclocking, the SIMD version is still 33% faster. The code is up on Github if you want to try it yourself.

Arduino IDE Creates Bootable X86 Floppy Disks

Arguably the biggest advantage of the Arduino ecosystem is how easy it is to get your code running. Type a few lines into the IDE, hit the button, and in a few seconds you’re seeing an LED blink or some text get echoed back over the serial port. But what if that same ease of use didn’t have to be limited to microcontrollers? What if you could use the Arduino IDE to create computer software?

That’s exactly what boot2duino, a project developed by [Jean THOMAS] hopes to accomplish. As you might have guessed from the name, the code you write in the Arduino is turned into a bootable floppy disk image that you can stick into an old PC. After a few seconds of beeping and grinding your “Hello World” should pop up on the monitor, and you’ve got yourself the world’s biggest Arduino.

A minimal x86 Arduino sketch.

Now to be clear, this isn’t some kind of minimal Linux environment that boots up and runs a compiled C program. [Jean] has created an Arduino core that provides basic functionality on x86 hardware. Your code has full control over the computer, and there’s no operating system overhead to contend with. As demonstrated in a series of videos, programs written with boot2duino can display text, read from the keyboard, and play tones over the PC’s speaker.

The documentation for boot2duino says the project serves no practical purpose, but we’re not so sure. While the feature set is minimal, the low overhead means you could theoretically press truly ancient PCs into service. There’s certainly an appeal to being able to write your code on a modern OS and effortlessly deploy it on a retrocomputer, from somewhat modernized versions of early computer games to more practical applications. If any readers end up exploring this concept a bit further, be sure to let us know how it goes.

Continue reading “Arduino IDE Creates Bootable X86 Floppy Disks”

the SoM module used to power a Dell Mini 1210, in an extended SODIMM form-factor

When Dell Built A Netbook With An X86 System-on-Module

Just like with pre-touchscreen cellphones having fancy innovative features that everyone’s forgotten about, there’s areas that laptop manufacturers used to venture in but no longer dare touch. On Twitter, [Kiwa] talks a fascinating attempt by Dell to make laptops with user-replaceable CPU+RAM modules. In 2008, Dell released the Inspiron Mini 1210, with its CPU, chipset and RAM soldered to a separate board in an “extended SODIMM” form-factor – not unlike the Raspberry Pi Compute Modules pre-CM4! Apparently, different versions of such “processor cards” existed for their Inspiron Mini lineup, with varying amounts of RAM and CPU horsepower. With replacement CPU+RAM modules still being sold online, that makes these Dell netbooks to be, to our knowledge, the only x86 netbooks with upgradable CPUs.

You could try and get yourself one of these laptops or replacement CPU modules nowadays, if you like tinkering with old tech – and don’t mind having a subpar experience on even Linux, thanks to the Poulsbo chipset’s notorious lack of openness. Sadly, Dell has thoroughly abandoned the concept of x86 system-on-module cards, and laptops have been getting less modular as we go – we haven’t been getting socketed CPUs since the third generation of mobile Intel boards, and even RAM is soldered to the motherboard more and more often. In theory, the “CPU daughterboard” approach could improve manufacturing yields and costs, making it possible to use a simpler large board for the motherboard and only have the CPU board be high-layer-count. However, we can only guess that this wasn’t profitable enough overall, even with all the theoretical upsides. Or, perhaps, Google-style, someone axed this project internally because of certain metrics unmet.

If you think about it, a laptop motherboard is a single-board computer; however, that’s clearly not enough for our goals of upgradability and repairability. If you’re looking to have your own way and upgrade your laptop regardless of manufacturer’s intentions, here’s an old yet impressive story about replacing the soldered-in CPU on the original Asus EEE, and a more recent story about upgrading soldered-in RAM in a Dell XPS ultrabook. And if you’re looking for retrocomputing goodness, following [Kiwa] on Twitter is a must – last seen liveblogging restoration and renovation of a Kaypro someone threw out on the curb.

The Linux X86 Journey To Main()

Have you ever had a program crash before your main function executes? it is rare, but it can happen. When it does, you need to understand what happens behind the scenes between the time the operating system starts your program and your first line of code in main executes. Luckily [Patrick Horgan] has a tutorial about the subject that’s very detailed. It doesn’t cover statically linked libraries but, as he points out, if you understand what he does cover, that’s easy to figure out on your own.

The operating system, it turns out, knows nothing about main. It does, however, know about a symbol called _start. Your runtime library provides this. That code contains some stack manipulation and eventually calls __libc_start_main which is also provided by the library. Continue reading “The Linux X86 Journey To Main()”

Software Defined… CPU?

Everything is better when you can program it, right? We have software-defined radios, software-defined networks, and software-defined storage. Now a company called Ascenium wants to create a software-defined CPU. They’ve raised millions of dollars to bring the product to market.

The materials are a bit hazy, but it sounds as though the idea is to have CPU resources available and let the compiler manage and schedule those resources without using a full instruction set. A system called Aptos lets the compiler orchestrate those resources.

Continue reading “Software Defined… CPU?”

Where Are All The Cheap X86 Single Board PCs?

If we were to think of a retrocomputer, the chances are we might have something from the classic 8-bit days or maybe a game console spring to mind. It’s almost a shock to see mundane desktop PCs of the DOS and Pentium era join them, but those machines now form an important way to play DOS and Windows 95 games which are unsuited to more modern operating systems. For those who wish to play the games on appropriate hardware without a grubby beige mini-tower and a huge CRT monitor, there’s even the option to buy one of these machines new: in the form of a much more svelte Pentium-based PC104 industrial PC.

Continue reading “Where Are All The Cheap X86 Single Board PCs?”