Category Archives: Development

Bitfield Pitfalls

Some time ago I ran into a bug that had been dormant for some time. The problem involved expressions where one of the operands is a bit-field. To demonstrate the problem, I will present a reduced example: #include <stdio.h> #include … Continue reading

Posted in C, Development, Standards | 4 Comments

DOS Memory Management

The memory management in DOS is simple, but that simplicity may be deceptive. There are several rather interesting pitfalls that programming documentation often does not mention. DOS 1.x (1981) had no explicit memory management support. It was designed to run … Continue reading

Posted in Development, DOS, Microsoft, PC history | 23 Comments

Cracking DXP and SXD

There are situations where software is available only in the form of a floppy image. This goes especially for historic hardware drivers and patches, which were often distributed only in the form of floppy images. This method was quite popular … Continue reading

Posted in Archiving, Development, Floppy Images | 4 Comments

The OS/2 Display Driver Zoo

I have recently explored (again) the possibility of writing a high-res display driver for virtualized OS/2. But I ran (again) into a dizzying array of possible solutions, each with its own advantages and a good deal of drawbacks. OS/2 display … Continue reading

Posted in Development, Documentation, Graphics, IBM, OS/2 | 31 Comments

Time Trouble

Last Friday I had a moment of panic. While investigating why different run-time libraries might interpret file timestamps differently, I noticed that even Windows doesn’t always agree with itself. When was dos4gw.exe last modified, at 10:14 PM or 9:14 PM? … Continue reading

Posted in Bugs, Development, Microsoft | 20 Comments

Learn Something Old Every Day, Part XIV: read() Return Value May Surprise

Last week I amused myself by porting some source code from Watcom C to Microsoft C. In general that is not difficult, because Watcom C was intended to achieve a high degree of compatibility with Microsoft’s C dialect. Yet one … Continue reading

Posted in C, Development | 11 Comments

I Thought I Found a Bug…

So I was working on improving a DOS emulator, when I found that something seemingly trivial wasn’t working right when COMMAND.COM was asked to do the following: echo AB> foo.txtecho CD>> foo.txt Instead of ABCD, foo.txt contained ABBC. I verified … Continue reading

Posted in Bugs, C, Development, Watcom | 26 Comments

Stack Checking on OS/2

A while ago I was involved in debugging a seemingly simple yet mysterious problem: A piece of code (a fairly simple interface DLL) built with the Open Watcom compiler was failing with a bogus stack overflow error. The mystery was … Continue reading

Posted in Debugging, Development, OS/2, Watcom | Leave a comment

Programming NetBIOS on OS/2

Recently I spent some time trying to understand a piece of networking code, and it turned out to be far more difficult than it should have been. The code in question is the NetBIOS interface of C-Kermit and was originally … Continue reading

Posted in Development, Documentation, IBM, Microsoft, Novell, OS/2 | 25 Comments

Learn Something Old Every Day, Part XII: Strange File Resizing on DOS

Someone recently asked an interesting question: Why do Microsoft C and compatible DOS compilers have no truncate() and/or ftruncate() library functions? And how does one resize files on DOS? OK, that’s actually two questions. The first one is easy enough … Continue reading

Posted in Computing History, CP/M, Development, Documentation, DOS, Microsoft | 29 Comments