Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- Would be nice to have a Rust compiler as wellby ladyanita22
- Only if they invent a 64 bit DOS extender.by mrlonglong
- You can do DOS target software with Rust... it's pretty limited and the tooling around it isn't nearly complete enough to make anything easy. That said, if you want to make something akin to a Zork text mode game or similar there's that... you can also use ANSI escape codes as another possibility for CP437 text mode interaction.by tracker1
- Vibe coders are just going to be staring at this and go... where'd you get that blue mode in Cursor?by sgt
- From the soydev extension.by grg0
- Curious as to whether there are any real-world use cases for doing this (other than curiosity) in DOS. If so, I'd love to hear about them.by dardeaup
- I suppose there could be a use for programming for computers that would otherwise be ewaste, although I'm not sure how much ewaste is out there that can run DOS but not, say, Linux or a BSD. Lots has already been trashed or recycled, and my impression is that retrocomputing enthusiasts are thinning out the market as well.by actuallyalys
- MS-DOS was a reasonable bootloader for Linux and Windows 95; I imagine FreeDOS might be a better one if you wanted to do hobby OSDev. Historically you could get hard real time performance for things like controlling steppers from your parallel port under MS-DOS, but nowadays you'd just use Freeduino or an iCE40. Also maybe brushless motors.by kragen
- Almost zero, the non-zero ones are about supporting legacy software/hardware. Also I would not touch C on any DOS platform, since the great Turbo Pascal exists for it. Nothing else even compares to it.by unnouinceput
- (Not development in C)
I've used FreeDOS for doing BIOS updates. In the pre-UEFI days it was common for manufacturers to provide BIOS updates as a DOS executable, apparently with the expectation that the customer would be able to dig up some old MS-DOS disk somewhere.
I suppose nowadays there isn't much use for that anymore thanks to doing FW updates via UEFI capsules. Though at least on the Linux side (LVFS/fwupd) it seems most PC clone vendors aren't on board yet.
by jabl - I have it on my to-do list to install FreeDOS on bare metal to set up a retro gaming box. Tried once, but for some reason the installer failed writing to disk. Anyway, if anyone is making new FreeDOS games, I'll gladly pay for them, and it'll give me an excuse to go down that avenue again.by grg0
- I hobby-code for DOS, partly because of nostalgia, but much also because it (specifically DOSBox, or DOSBox-X) is such a fantastic and stable virtual machine. No one is going to deprecate even some minor part of the API. And some emulators give you fun features like allowing any screen resolution to be set up to run in fullscreen on a modern monitor (exposed using standard VESA API inside of DOS).
There are some other retro computer or consoles that could probably be just as useful for this. But DOSBox (as well as QEMU+FreeDOS, for those that prefer that) are nice because they have fully open source implementation from the CPU-level up to the user utilities, so there is no need to mess with dodgy ROM downloads or such to get things working.
by 1313ed01 - I used FreeDOS once to run ancient software which controlled an industrial size oven. The client was having an ever increasing challenge of sourcing IDE disks (in 2008) so I was contracted to find a solution.
Eventually we settled on industrial PCs, solid state media and FreeDOS.
It was significantly cheaper than replacing the oven at £1M each.... in 50 of their factories worldwide.
by comprev - Tangentially related: I was getting awful screen tearing in dosbox with a gl @ 4K@60hz rendering target.
Switching to 1080p@240Hz fixed it. The problem was that 60Hz was close to, but not the framerate the old game asked for.
by hedora - The typical 320x200 mode that games used back then ran at 70Hz.by Narishma
- I don't know the answer, just asking the question: Is/Was curses available at the time? https://en.wikipedia.org/wiki/Curses_%28programming_library%...
I only remember conio at the time, but without internet you just used what Microsoft gave you. The BBSes I used may have had it, but it's hard to use something if you don't know it exists.
It does look like there is a recent port: https://github.com/wmcbrine/PDCurses
So my guess is curses was not available to DOS at the time, only Unix systems.
by xx__yy - AFAIK, curses worked with ANSI codes while conio directly accessed the screen buffer. ANSI support on DOS wasn’t enabled commonly as it needed a separate device driver, ANSI.SYS, to work, and it usually made DOS text output slower.
So, even if curses were available on DOS at the time, nobody would have preferred to use it.
by sedatk - Most of us coding at the time only cared about Turbo Vision, starting with Turbo Pascal 6. and Turbo C++ 3.0.
Or the other variant being TUI libraries for Clipper.
By 1994, most folks on PC were already doing Windows 3.x, and only using MS-DOS for games.
I only got to learn about curses years later.
by pjmlp - I'm guessing that PC-Hack 1.0, the ancestor of Nethack, contains a fair subset of curses, and pdcurses is from 01987 according to the bottom of https://github.com/wmcbrine/PDCurses/blob/master/docs/HISTOR.... But on the IBM, curses mostly solved the problem of porting Unix software to MS-DOS. The problems it solved on Unix, like minimizing characters transmitted to the terminal, papering over differences between terminal types, and setting cbreak mode, just didn't exist.by kragen
- On conio.h under GNU/Linux or Unix, it might be mimicked with trivial functions and escape codes.
I did similar stuff with TCL and some at-xy lookalike from Forth or 'print at' from the old Basic.
And rewritting these Basic games into C, TCL or whatever it's really fun (and you can defnitively kill the spaghetti code):
https://github.com/GReaperEx/bcg
You can just run BW Basic for FreeDOS, but that's no challenge...
by anthk - Is there really a difference between writing a DOS program and writing a FreeDOS program? You just need a period-accurate compiler that can target DOS. Maybe OpenWatcom, maybe DJGPP.
With HXDOS, you can also write a Win32 console-mode program and run it on DOS. 7-zip is an example of a program compatible with HXDOS.
by Dwedit - Not really, I was expecteding the tutorial to somehow dig out Turbo C, or Quick C.by pjmlp
- The Digital Mars compiler for DOS is available for free.by WalterBright
- The "difference" is, that this is the FreeDOS project, thus they focus on that environment.
- To the list of compiler listed I want to mention this one as well, that is my compiler of choice for 16-bit C in (Free)DOS these days (because it has a MIT license, it's very small, and it runs great inside of DOS itself so no need to mess with cross-compilation and I know if I have an environment like FreeDOS or DOSBox set up I can both compile and run my code, and I will never have to re-install or reconfigure anything when moving between different host systems):
https://github.com/microsoft/MS-DOS/tree/main/v4.0/src/TOOLS
(Not only Microsoft's C compiler in that directory, but also MASM, MAKE, and a bunch of other tools. 1-2 MB of files and you have an entire toolchain for 16-bit DOS.)
by 1313ed01 - Interesting, "All files within this repo are released under the MIT License as per the LICENSE file stored in the root of this repo," but did they include the source for the toolchain? I may be looking in the wrong place...by kragen