Friday, April 14, 2017

Our April 1st website

Every year, it seems most of the Internet goes bonkers for April 1st, also known as "April Fools Day." Generally, I don't like to get involved in website "pranks." I recognize that I'm just not clever or funny enough to pull it off.

But this year, I decided to give it a shot anyway.

Rather than invent something fake with an intention of making a cheap joke, I decided to update the FreeDOS website. So for all day on April 1, the FreeDOS website was a "throwback" to the 1980s. If you missed it, this is what it looked like:


I swapped out the web stylesheet with one that used DOS colors, and loaded a VGA font copied from int10h.org.

Our "April 1st" website was very popular, and gave us a boost in website traffic and downloads of the FreeDOS 1.2 distribution. (Of course, some Internet wise guy decided to bot-attack us on the same day, maybe as his own "prank." Ironically, an attempted DOS attack on a website about DOS. But after you account for that in our website hits, we really did get more visitors that day.)

There's not much to this, so I figured I'd share the details and stylesheet in case you want to do this on your own website.

The FreeDOS website is built around HTML Version 5, using a pretty standard template. We structure every page like this:
header
logo | search
nav
main
nav
main text (section)
footer
nav
footer text (section)
There's some extra markup in there to make things look pretty, but that's the basic design of the website. For details, you can view the source of any page on our website.

It was fairly straightforward to create a web stylesheet to redefine the website colors to look like a DOS terminal. Here is the stylesheet we used: (you'll need to download your own copy of the VGA fonts for this to work)
@font-face {
  font-family: 'VGAsquarePx';
  src: url(int10h.org/vga_squarepx.eot);
  src: url(int10h.org/vga_squarepx.eot?#iefix) format('embedded-opentype'),
       url(int10h.org/vga_squarepx.woff2) format('woff2'),
       url(int10h.org/vga_squarepx.woff) format('woff'),
       url(int10h.org/vga_squarepx.ttf) format('truetype');
  font-weight: normal;
  font-style: normal;
}
/* define a black "stipple" background with DOS font */
body {
  background:
    radial-gradient(black 15%, transparent 16%) 0 0,
    radial-gradient(black 15%, transparent 16%) 8px 8px,
    radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 0 1px,
    radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 8px 9px;
  background-color:#282828;
  background-size:16px 16px;
  color: #aaa;
  font-family: 'VGAsquarePx', serif;
  font-size: 20pt;
  margin: 0;
}
/* links are cyan, hover is bright yellow */
a {
  color: #0aa;
  text-decoration: none;
}
a:hover {
  color: #ff5;
}
/* headings and bold text are bright white */
h1,h2,h3,h4,
b, strong {
  color: #fff;
  font-size: 1em;
  font-style: normal;
  font-weight: normal;
  margin: 0;
}
/* italic text is green */
em, i {
  color: #0a0;
  font-style: normal;
}
/* define content areas */
header, main, footer {
  margin: 0 auto;
  padding: 1em 0;
  max-width: 800px;
}
/* use black on cyan text for header */
header {
  background-color: #0aa;
  color: #000;
}
  /* insert the "April 1st" text */
  header > h1::before {
    content: "Today is April 1, 2017!";
  }
  header > h1 img {
    display: block;
    width: 300px;
  }
  header > form {
  }
    header > form fieldset {
      border: none;
    }
  /* use black on gray for navigation */
  nav {
    background-color: #aaa;
    color: #000;
  }
    nav a {
      color: #000;
    }
    nav img {
      display: none;
    }
    nav span {
    }
    nav > ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
      text-align: center;
    }
      nav > ul li {
        display: inline;
        margin: 0 .5em;
      }
/* use white on blue for main text */
main {
  background-color: #00a;
  color: #aaa;
}
  main > nav {
  }
    main > nav li::before {
      content: ">";
    }
  main > section {
  }
  main div.third img {
    display: block;
  }
/* use black on brown text for footer */
footer {
  background-color: #a50;
  color: #000;
}
  footer > nav {
  }
  footer > section {
  }
The April 1st website was only meant for the one day, but I have to admit that I really liked it. And from your responses on social media and via email, I think a lot of other people enjoyed it too! Maybe the "throwback" design will make a reappearance sometime in the future. This seems like something to bring out for special occasions.

Monday, February 20, 2017

Why DOS has sixteen colors

Over at my blog about the usability of open source software, I recently wrote about the readability of DOS applications. This was a followup to an earlier article about how websites are becoming unreadable. I also provided a simple Bash script to compute the contrast ratios of text.

In writing about the readability of DOS applications, I wanted to expand on the color palette for DOS text, but it didn't seem to fit the article. I thought I'd write about it here.

Do you wonder why DOS only supports sixteen colors for text? With DOS, you had a color palette of sixteen colors, enumerated 0 (black) to 15 (white). Backgrounds were limited to the first eight colors:
BackgroundForeground
  1. Black
  2. Blue
  3. Green
  4. Cyan
  5. Red
  6. Magenta
  7. Brown
  8. White ("Light Gray")
  1. Black
  2. Blue
  3. Green
  4. Cyan
  5. Red
  6. Magenta
  7. Brown
  8. White ("Light Gray")
  9. Bright Black ("Gray")
  10. Bright Blue
  11. Bright Green
  12. Bright Cyan
  13. Bright Red
  14. Bright Magenta
  15. Yellow
  16. Bright White
The origins go back to CGA, the Color/Graphics Adapter from the earlier PC-compatible computers. This was a step up from the plain monochrome displays; as the name implies, monochrome could only display black or white. CGA could display a limited range of colors.

CGA supports mixing red (R), green (G) and blue (B) colors. In its simplest form, RGB is either "on" or "off." In this case, you can mix the RGB colors in 2×2×2=8 ways. Let me represent that in a simple table showing the binary and decimal representations of RGB:
000(0)Black
001(1)Blue
010(2)Green
011(3)Cyan
100(4)Red
101(5)Magenta
110(6)Yellow
111(7)White
To double the number of colors, CGA added an extra bit called the "intensifier" bit. With the intensifier bit set, the red, green and blue colors would be set to their maximum values. Without the intensifier bit, each RGB value would be set to a "midrange" intensity. Let's represent that intensifier bit as an extra 1 or 0 in the binary color representation, as iRGB:
0000(0)Black
0001(1)Blue
0010(2)Green
0011(3)Cyan
0100(4)Red
0101(5)Magenta
0110(6)Yellow
0111(7)White
1000(8)Bright Black
1001(9)Bright Blue
1010(10)Bright Green
1011(11)Bright Cyan
1100(12)Bright Red
1101(13)Bright Magenta
1110(14)Bright Yellow
1111(15)Bright White
But there's a problem: 0000 Black and 1000 Black are the same color. There's no red, green or blue color to intensify, so black is black whether or not the "intensifier" bit is set. To get around this limitation, CGA actually implemented a modified iRGB definition, using two intermediate values, at about one-third and two-thirds intensity. Most "normal" mode (0–7) colors used values at the two-thirds intensity, with the exception of yellow which was assigned a one-third green value that turned the color brown. Translating from "normal" mode to "bright" mode, convert zero values to the one-third intensity, and two-thirds values to full intensity.

Here's another iteration of the color table, using 0x0 to 0xF for the color range, with 0x5 and 0xA as the one-third and two-thirds intensities, respectively:
0000(#000)Black
0001(#00A)Blue
0010(#0A0)Green
0011(#0AA)Cyan
0100(#A00)Red
0101(#A0A)Magenta
0110(#A50)Brown
0111(#AAA)White
1000(#555)Bright Black
1001(#55F)Bright Blue
1010(#5F5)Bright Green
1011(#5FF)Bright Cyan
1100(#F55)Bright Red
1101(#F5F)Bright Magenta
1110(#FF5)Bright Yellow
1111(#FFF)Bright White
And that's how DOS got sixteen text colors! That's also why you'll often see "brown" labeled "yellow" in some references, because it started out as plain "yellow" before the intensifier bit. Similarly, you may also see "gray" represented as "Bright Black," because "gray" is really "black" with the intensifier bit set.

You may wonder why only eight background colors? Note that DOS also supported a "Blink" attribute. With this attribute set, your text could blink on and off. The "Blink" bit was encoded at the end of the foreground and background bit-pattern:
Bbbbffff
That's a full byte! Counting from right to left: four bits to represent the text foreground color (0000 Black to 1111 Bright White), three bits to code the background color (000 Black to 111 White) and one bit for the "Blink" attribute.

Sunday, February 12, 2017

Posting FreeDOS news

FreeDOS is community-driven, and we want to hear about how people are using FreeDOS, and what new things they are developing for it. When cool new things come to us, we like to post news items on the FreeDOS website about it. Sometimes, we may put it on our FreeDOS Twitter instead.

We don't have hard rules or guidelines for what we post as news on the website versus what we prefer to put on Twitter, but generally what I do is this:

  1. If it's an update to an existing open source DOS program we already include in FreeDOS, or an update to a program everyone knows about, then post it as news
  2. If it's a new open source DOS program that's just getting off the ground, tweet it instead
  3. If it's a new open source DOS program that's gone through several updates and is clearly going to be around for a while, post it as news
  4. If it's a new open source DOS program by a current FreeDOS contributor, could be either news or tweet, depending.

And anything that's posted as news also gets tweeted.

So if you are doing something cool in FreeDOS, and especially if you are updating or contributing to a DOS program, please let us know!

The best way to share your news is to join the FreeDOS community via the freedos-devel or freedos-user email lists, and make announcements there so everyone can see it. We often pick up news items from those forums to post on the website or on Twitter.

Tuesday, January 31, 2017

Workaround for Help bug

Updated so you don't need to hard-code your preferred language.

There's a bug in the HELP.EXE program on FreeDOS 1.2. If you try to run Help with the language set to anything other than English, it hangs. I don't know why, but I haven't looked at the code. (I'm not the maintainer. But if you'd like to fix this bug, email me.)

Here's a simple workaround to get Help working on your system, regardless of what language you use:

1. Rename the HELP.EXE program
C:
CD \FDOS\BIN
REN HELP.EXE HHELP.EXE
2. Create a new HELP.BAT program
EDIT HELP.BAT
3. Add these lines to HELP.BAT
@ECHO OFF
SET OLDLANG=%LANG%
SET LANG=EN
C:\FDOS\BIN\HHELP.EXE
SET LANG=%OLDLANG%
4. Save and exit

This workaround is a "wrapper" that always sets the language to English before running the Help command. Here, I've renamed the HELP.EXE program to HHELP.EXE, so it will show up next to HELP.BAT when you view the directory.

Note that in DOS, batch files (*.BAT) are just shortcuts to what you would type at the command line. So in HELP.BAT, you need to save your language so you can set it back to whatever you usually use, or it will remain English.

Friday, January 27, 2017

100,000 downloads

We released FreeDOS 1.2 on December 25, and since then we have seen keen interest in the latest version of FreeDOS. As of January 26, we had 100,000 downloads of FreeDOS 1.2. That's just a month and a day to reach this major milestone.

While FreeDOS 1.2 is the latest version, we do see some folks still downloading the older 1.0 and 1.1 releases. If you consider downloads for all versions of FreeDOS we actually reached "100,000 since December 25" on January 25, a month after the release of FreeDOS 1.2. That's pretty cool too!


If you're curious, our peak day for FreeDOS 1.2 was December 27, at just over 12,000 downloads. And That's pretty impressive! We figure releasing the new version on Christmas Day meant some FreeDOS users weren't able to download it right away, because they were visiting family for the holidays.

We're holding steady now at about 1,800 to 1,900 downloads of FreeDOS 1.2 per day.

It's interesting to compare the difference between FreeDOS 1.2 and 1.1. In the previous version, released January 2, 2012, we didn't see nearly the same initial interest in FreeDOS. Our peak day for FreeDOS 1.1 was a few months later, in April 2012, as though people suddenly found out about FreeDOS. We reached 100,000 downloads of FreeDOS 1.1 on May 24, 2012.


So I think we've done something right with the new version of FreeDOS. I'm very excited by FreeDOS 1.2! I think the latest FreeDOS is a great little operating system that meets a lot of needs.

Saturday, December 31, 2016

FreeDOS then and now

In the 1980s and 1990s, I used MS-DOS for everything. I had used MS-DOS systems for a long time, and regularly used MS-DOS and DOS applications for my work. I had taught myself C programming, and wrote DOS utilities to improve MS-DOS and expand its functionality. While I also used Linux since 1993, I thought DOS was the best system for me, with its rich catalog of useful applications that helped me as an undergraduate physics student—mostly analyzing lab data and writing papers for class.

So I was disappointed in 1994 when I read articles where Microsoft announced that the next version of Windows would do away with MS-DOS. "DOS was dead," so they said. But I didn't like Windows. If you remember what Microsoft Windows 3.1 looked like, you'll know it was clunky and awkward. If Windows 4.0 was going to be anything like that, I wanted nothing to do with it.

I started FreeDOS in 1994 with a small post to the comp.os.msdos.apps group on Usenet. Almost immediately, other developers contacted me, and we began work creating our own version of DOS that would be compatible with MS-DOS. I packaged my own extended DOS utilities, as did others, and we found other public domain or open source programs that replaced other DOS commands. A few months later, we released our first FreeDOS Alpha distribution. This interested new developers to join FreeDOS. From there, FreeDOS grew very quickly.

Our FreeDOS History page has a timeline of interesting events in FreeDOS history. Let me share just the major milestones:
1994
  • Free-DOS Alpha 1 (16 September 1994)
  • Free-DOS Alpha 2 (December 1994)
1995
  • Free-DOS Alpha 3 (January 1995)
  • Free-DOS Alpha 4 (June 1995)
1996
  • FreeDOS Alpha 5 (10 August 1996)
1997
  • FreeDOS Alpha 6 (November 1997)
1998
  • FreeDOS Beta 1 "Orlando" (25 March 1998)
  • FreeDOS Beta 2 "Marvin" (28 October 1998)
1999
  • FreeDOS Beta 3 "Ventura" (21 April 1999)
2000
  • FreeDOS Beta 4 "Lemur" (9 April 2000)
  • FreeDOS Beta 5 "Lara" (10 August 2000)
2001
  • FreeDOS Beta 6 "Midnite" (18 March 2001)
  • FreeDOS Beta 7 "Spears" (7 September 2001)
2002
  • FreeDOS Beta 8 "Methusalem" (7 April 2002)
2003
  • FreeDOS Beta 9 RC1 (July 2003)
  • FreeDOS Beta 9 RC2 (23 August 2003)
  • FreeDOS Beta 9 RC3 (27 September 2003)
2004
  • FreeDOS Beta 9 RC4 (5 February 2004)
  • FreeDOS Beta 9 RC5 (20 March 2004)
  • FreeDOS Beta 9 (28 September 2004)
  • FreeDOS Beta 9 SR1 (30 November 2004)
2005
  • FreeDOS Beta 9 SR2 (30 November 2005)
2006
  • FreeDOS 1.0 (3 September 2006)
2007
2008
2009
2010
2011
2012
  • FreeDOS 1.1 (2 January 2012)
2013
2014
2015
2016
  • FreeDOS 1.2 RC1 (31 October 2016)
  • FreeDOS 1.2 RC2 (24 November 2016)
  • FreeDOS 1.2 (25 December 2016)
Before FreeDOS 1.0, we released frequent Alpha and Beta versions. After FreeDOS 1.0, we went into a "stable" mode where FreeDOS doesn't need to change very quickly.

Earlier this week, we announced the FreeDOS 1.2 distribution. In many ways, FreeDOS has changed a lot since 1994. But under the covers, FreeDOS is still just DOS.

In our Alpha releases, FreeDOS (then "Free-DOS") was a collection of commands and a few extra utilities. Our DOS kernel was pretty bare-bones back then, and didn't support networking or CDROM drives. But FreeDOS could run a lot of popular programs and games, including compilers, and became quite popular. Over time, developers have added to FreeDOS and built it up to what it is today. FreeDOS 1.2 now includes a ton of useful utilities, graphical desktops, games, and other tools that help people to develop embedded systems, run legacy software, or just play classic DOS games.

While it's interesting to look back on how FreeDOS has changed since 1994, it's also important to mark how computing has changed in that time.

User londonpopstar on Imgur found an old Best Buy ad from October 23, 1994. That's the same year we started the FreeDOS Project. Check out what personal computing looked like at the time, via this sample:


Personal computers were based on the Intel '486 processor in 1994. The Pentium processor had been available since 1993, but the cost-to-performance wasn't really there until 1994 or 1995. It's safe to say that most users at home ran a '486. Notebooks were a thing, but were much bulkier than the ones you find today. And to make them cost-effective, most ran a '486 in 1994. From the Best Buy ad:
ModelCPUSpeedMemoryDriveCost
DesktopsIBM486DX250MHz4MB363MB$1397
Acer486DX266MHz8MB540MB$1576
Packard Bell486DX266MHz8MB720MB$1798
Compaq486DX266MHz8MB420MB$1798
LaptopsCompaq, 8.4" display486DX240MHz4MB250MB$2598
Compaq, 9.5" display486DX240MHz4MB250MB$3298
Today's computers are much more powerful. Using today's Best Buy as a comparison, the most-recommended Intel desktop is a Dell Inspiron desktop with 6th Gen Intel Core i3-6100 (3.7GHz) processor, 8GB memory, and 1TB hard drive for $379.99. The top-recommended Intel laptop is a Dell Inspiron laptop with 13.3" display, 7th Gen Intel Core i5-7200U (2.5GHz) mobile processor, 8GB memory, and 256GB solid state drive for $599.99.

Let's compare. The 1994 Acer is the "middle of the road" desktop, so let's use that as our point of reference.
19942016
CPU486DX2 (32-bit)Core i3 (64-bit)
Speed66MHz3.7GHz = 3,700MHz
Memory8MB8GB = 8,000MB
Drive540MB1TB = 1,000GB = 1,000,000MB
Cost$1,576$380
So desktop computers have gone from 32-bit to dual-core 64-bit, now 56× faster, 1000× the memory, and over 1800× the storage. All that for a quarter the price (not adjusted dollars). Today's laptops are one-fifth the price but over 62× faster, 2000× the memory, and 1000× the storage. Computers have gotten faster and cheaper.

And that's if you even use a traditional "computer" anymore. Many people use the Cloud for most of their day-to-day computing: responding to email, writing documents, or planning events. For that, you can just as easily use something like a Google Chromebook (most are $300) which has very little on-board storage but provides a platform to do everything via the Cloud.

But when you think about it, much of your "computing" tasks can be done on a smartphone. The ever-present smartphone does pretty much everything your 1994 computer could do, and also includes a phone, GPS, and camera. Comparison to 1994 is pretty tough; back then, the most popular mobile phone was the Nokia, but it was just something you called people with.

And how you run FreeDOS has changed, too. In 1994, almost everyone ran FreeDOS directly on hardware. Typically, you installed FreeDOS in a separate hard drive partition on your computer, and used a boot-selector to let you boot FreeDOS when you wanted. But today, most people prefer to run FreeDOS inside a virtual machine or PC emulator; we also recommend that on our website. You can still run FreeDOS on a modern computer, but it's just easier to use a PC emulator instead.

I'm amazed at how far FreeDOS has changed. From 1994, when you ran FreeDOS directly on a '486 computer with 8MB memory and 500MB hard drive—to today, when most people run FreeDOS inside a virtual machine on a much more powerful computer. Computing has definitely changed. But it's nice to know that FreeDOS is still just DOS, and you can run your old DOS programs on it.

Thursday, December 29, 2016

More screenshots from FreeDOS 1.2

I use FreeDOS to develop FreeDOS, to run a few favorite programs, and to play games. And it's for that last one that I want to share a few more screenshots.

I run Linux (Fedora 25) on my computer at home, and I boot FreeDOS inside a PC emulator. These days, I usually use QEMU. So here are some screenshots of FreeDOS 1.2 running a few popular shareware DOS games inside QEMU:

Blood:

Doom:

Heretic:

Jill of the Jungle:

Commander Keen:

Quake:

Rise of the Triad:

Tomb Raider:

What were your favorite classic DOS games?