C#, The Language For All Platforms – Now Including Windows 3.11 And DOS

The Microsoft .NET framework has been with us in one form or another since the millennium, and though it has remained largely the preserve of the Microsoft universe, it has found its way since then through a variety of implementations to other platforms including MacOS and GNU/Linux. In Microsoft terms though its history goes back only as far as Windows 98, earlier MS operating systems remain off-limits.

Just a glimmer of .NET in DOS and Windows 3.11 comes courtesy of [Michal Strehovský], who has successfully compiled .net C# code for both Windows 3.11 and DOS. An in-depth explanation comes courtesy of [Scott Hanselman], and it involves some tricks spanning the decades since the early 1990s. The .NET Core compiler’s object files can be fed into the linker that shipped with an ancient version of Microsoft’s C++ compiler, which when used with Microsoft’s Win32s compatibility layer that brought some of Windos NT’s APIs to the 16-bit OS, allows C# from 2020 to run as though it were 1992 again. Meanwhile the DOS version uses .NET Core’s ability to produce self-contained executables along with some very significant tricks to pare down the size of the finished program from many megabytes to an eventual DOS-suitable 27k. Remember the apocryphal Bill Gates quote, that “640k should be enough for anyone“, that refers to the maximum memory available to DOS without extra memory-extending tricks.

Neither piece of software is especially useful, and we can’t see a rush of C# coders to these new platforms. But we applaud him for his ingenuity, and getting old hardware to do new tricks is right up our alley. It’s certainly dredged up a few memories from back in the day for us. Meanwhile we’ve featured .NET in a few projects over the years, most recently on an FPGA.

.NET To FPGA With Hastlayer

There are lots of ways to use FPGAs. One way is to convert compute-bound software into hardware. This can increase speed and — in some cases — reduce power consumption. Typically, you’ll do this by writing in a subset of C, but Hastlayer can convert .NET assemblies into FPGA configurations with some limitations.

The Hungarian company behind Hastlayer claims they’ll eventually have to charge money for something but for now, the tool is free and they are promising to always have some free option. The interesting thing is that the .NET assemblies are essentially object code so you aren’t compiling source but rather an intermediate language that you can generate with many different language tools.

Continue reading “.NET To FPGA With Hastlayer”

DIY Air Cannon Snags Drones From The Sky

Who hasn’t had the experience of a pesky drone buzzing around that family picnic, or hovering over a suburban backyard where bikini-clad daughters are trying to sunbathe in peace? A shotgun used to suffice for such occasions, but with this compressed-air powered drone catcher, there’s no need to worry about illegally discharging a firearm to secure some privacy.

Before the comment line lights up with outrage, the above scenarios are presented entirely in jest. We do not condone the use of force on a drone, nor do we look favorably on those who use drones in a way that even hints at an invasion of privacy. We can all get along, and even though we hope [Make It Extreme]’s anti-drone gun will never be used in anger, it’s still a neat build that gives us lots of ideas. The rig is essentially four coaxial narrow-bore compressed-air cannons, each launching a slug attached to the corner of a lightweight net. A fairly complex set of linkages sets the spread of the barrels, and a pair of old oxygen tanks serve as reservoirs for the compressed air. A fast-acting dump valve is tripped by an interesting trigger mechanism mounted to a complicated stock and grip; we’d have liked to see more on the fabrication of that bit. The video below shows a test firing that results in a clean takedown of a drone, although we doubt the owner of the quad would characterize it as such.

This build is a bit of a departure from [Make It Extreme]’s usual fare of DIY tools like a shop-built vise or big belt sander, or their unusual vehicles like an off-road hoverboard. But it’s always great to watch a good fabrication video, no matter what the subject.

Continue reading “DIY Air Cannon Snags Drones From The Sky”

A DIY Net Gun To Catch Whatever You Want

Suspicious drones hovering about your property? Burglars or other ne’er-do-well test subjects giving you trouble? Need to catch a dog that keeps meandering through your workshop? [William Osman] suggests you build yourself a pneumatic net gun that can shoot 20-30 feet to catch them all.

The net gun is built largely out of PVC pipe; the air tank — filled via a tire valve — uses adapter fittings to shrink it down to a 1″ sprinkler valve, with an air gun to act as a trigger. The net launcher is made of four lengths of pipe bent with the use of a heat gun — an Occam’s Razor solution compared to his first attempt — and is coupled to the end, while the net loads in using wooden dowels with washers as weights. It won’t trap any large game, but it will certainly net you some fun.

Continue reading “A DIY Net Gun To Catch Whatever You Want”

Shell Game

A lot of us spend a lot of time switching between Windows and Linux. Now that platforms like the Raspberry Pi are popular, that number is probably increasing every day. While I run Linux on nearly everything I own (with the exception of a laptop), my work computers mostly run Windows. The laptop is on Windows, too, because I got tired of trying to get all the fancy rotation sensors and pen features working properly under Linux.

What I hate most about Windows is how hard is it to see what’s going on under the hood. My HP laptop works with a cheap Dell active stylus. Sort of. It is great except around the screen edges where it goes wild. Calibration never works. On Linux, I could drill down to the lowest levels of the OS if I were so inclined. With Windows, it is just tough.

War is Shell

One place where Linux always used to have an advantage over DOS and Windows was the shell. There are lots of variations available under Linux, but bash seems to be the current pick for most people. If you want more power, you can move to some alternatives, but even bash is pretty powerful if you learn how to use it and have the right external programs (if you don’t believe it, check out this web server).

Continue reading “Shell Game”

CC3000 WiFi Driver For .NET Micros

CC3000

The Netduino and other .NET Micro boards don’t seem to get much love, but that doesn’t mean they’re not able to use one of the coolest chips we’ve seen in a while. [Valkyrie] has written a driver for TI’s new CC3000 all-in-one WiFi chip, giving any .NET micro device a very small and very cheap WiFi connection.

A while back, [Chris Magagna] created a TI CC3000 library for the Arduino. [Valkyrie] fell out of his chair when he saw that post, as it meant the .NET Micro devices such as the Netduino could finally use this device. With a TI Launchpad and a logic analyzer, [Valkyrie] recorded all the SPI commands and responses eventually reconstructing the entire library.

As for how useful this is without any hardware, There’s already a CC3000 Gadgeteer module available from GHI Electronics.

.NET For The STM32 F4 Discovery Board

Here’s a technique that will let you use the .NET framework on an STM32 Discovery board. [Singular Engineer] was happy to learn that the .NET Micro Framework had been ported for STM32 chips. It’s doesn’t look like the port has hit a stable version yet, but these instructions will be enough to get you up and running. This lets you use managed code in the C# language to program an embedded device: the STM32 F4 Discovery board.

After flashing a new bootloader to the board a driver needs to be added for Windows to communicate with it. Above you can see that the board will enumerate as ‘STM32 .Net Test’. Once the driver is installed the rest of the firmware can be loaded on the board using a GUI supplied with the NETMF for STM32 package. That takes care of prepping the hardware, the rest is a painless process of configuring Visual Studio to use the board as a target. The ‘Hello World’ application then uses C# to blink an LED.