FREEDOS: WHAT'S THE NEXT STEP? Jim Hall 3/5/00 We've seen a lot of activity on the FreeDOS mailing list lately. Things have definitely taken a new turn, and I like where we are headed. The next big step for FreeDOS is adding international support. Any good software project will need to reach a broader audience than the users for whom it was first intended. With FreeDOS, our original user base was largely a group of hackers, scientists, engineers, students from the United States. They all spoke English, or at least spoke English well enough to exchange ideas and contribute to the code. On this initial set of strengths, FreeDOS became very popular. People used FreeDOS because Microsoft was no longer supporting MS-DOS, and users needed something to use to run their favorite DOS programs without resorting to Windows. However, the days of FreeDOS as a ``hacker's OS'' are gone. In today's world, FreeDOS has gone to work. People are using FreeDOS in ways that we could not have imagined in 1994. In the last six years, the popularity and ease-of-use of FreeDOS has moved it into schools and businesses. FreeDOS has also moved out of the country. We now see people using FreeDOS in Brazil, Russia, Japan, China, Germany, Italy, and Spain, to name a few. The primary language for these countries is not English. It cannot be easy to use an entire operating system in a language that is not your own. And I thought high-school Spanish class was hard! How, then, can we make it easier for international users to use FreeDOS? At the same time, how do we support new languages without adding making the code ``bloated''? The core set of developers are still hackers, after all, and we're always concerned about keeping our programs lean and mean, yet useful. How do we strike a balance? The answer is to add internationalization to FreeDOS and its utilities. On the surface, this sounds like a simple statement. It isn't. The implementation, and the choosing of the implementation, is not always easy. We have seen a recent interest on the FreeDOS mailing list in adding internationalization to FreeDOS. This new support can be tackled on several fronts, depending on the application: 1. International users can re-map their keyboard to use the local keyboard layout using XKEYB. This doesn't require updating any other programs. (However, XKEYB doesn't yet support all keyboard languages.) 2. If your local ASCII extended character set does not match your language, you can update the code page using CHCP. This doesn't require any program changes, either. But it does require a working CHCP, however. 3. The locale (the country-specific conventions for displaying dates, time, currency, sort order) can be set for any program that needs to support multiple locales. MS-DOS provided the Country command in CONFIG.SYS to do this. However, the programmer would need to implement this using some kind of API, and ideally that API would interface with something like COUNTRY.SYS. There has been some discussion on this point on the FreeDOS mailing list. The problem with adding locale support to FreeDOS applications is that the usual way of including this support (the setlocale family of functions) are not implemented in most DOS compilers, or are at least only providing the generic ``C'' locale. I think we have a lot of work left to do with supporting multiple locales. 4. A program can output messages in different languages by using a message catalog. It is this method of program internationalization that has received the most attention on the FreeDOS mailing list, and I think the attention is well-deserved. A message catalog offers tremendous ``bang for the buck.'' With only a little effort, a programmer can immediately make a program accessible to people around the world. The general concept of using catalogs is simple: when the program starts up, it determines what the local language setting should be. We have decided to use the simple method of using the LANG environment variable, in the form ``xx-YY'' to distinguish any local dialects. (The English language as spoken in the United States would be ``en-US'', but in the United Kingdom the setting would be ``en-UK''. Similarly, the French language as spoken in France would be ``fr-FR'', Spanish in Spain would be ``es-ES'' and Spanish in Mexico ``es-MX''.) Once the program knows what the local language is, the program must open the appropriate database that is the language catalog. This catalog must contain all the strings that the program will wish to display to the user. Each time the program needs to print a message, it first retrieves that message from the catalog using a database key. Sound simple? The hard part comes in choosing an implementation. There are currently two excellent libraries that support message catalogs: Cats, and Steffen Kaiser's MSGLIB. A review of the two libraries, and a comparison of their features and differences, is well out of the scope of this article. For that, I suggest you visit the FreeDOS web site, or look at the FreeDOS Europe Project. Of course, none of the above really addresses the last remaining point of true international support: Unicode character sets. Each of the options above assumes a ``Western'' character set: the letters A-Z, a-z, the numbers 0-9, and various punctuaction and special characters. Sure, with this character set you can support English, Spanish, French, German, Italian, Portuguese, and other ``Western'' languages. However, it leaves out other languages, such as Chinese and Japanese. Unicode will be the hardest piece of the puzzle to fit into FreeDOS. I doubt this will even be worked on until we have achieved the first four points of internationalization. But we'll get there. >> Jim Hall is the founder of the FreeDOS Project.