Backward compatibility quirks

Hardly anyone has heard of the DOS-777 operating system. And this really existed. True, in reality it was the most common MS DOS with minor changes, designed to run on a single computer and run a single program. This clone owes its appearance in some way to the problem of backward compatibility. But first things first.



A new and important program suddenly behaved in a completely mysterious way. This infuriated its authors so much that it was decided to disassemble MS DOS, understand the nuances of its work and find the causes of strange errors. Now, even in passion, hardly anyone will dare to disassemble, for example, Windows-10 and understand all its features. But then, in the early 90s, when the operating system consisted of three relatively small files, their disassembly and analysis took two weeks.



Many small features were discovered that are unlikely to be of interest to anyone now. But in those days, according to the results of this analysis, it was even possible to fill in the missing names of the fields of the internal MS DOS tables, which in one of the books of the System Programmer's Library series edited by the Frolovs (Dialogue MEPhI publishing house) were designated as “reserved”.



I repeat, it is unlikely that all these subtleties are of interest to anyone now, but the three found nuances, one way or another related to the problem of backward compatibility, are perhaps worth mentioning.



Nuance first. The earliest "TSR" programs, for example, "SideKick", looked for the address of the OS internal "busy" flag directly from the context of commands inside MS DOS. In the next versions, this context changed, and a documented function of requesting a flag appeared, but several "old" commands were specially moved to the data segment (they did not get control) so that ancient programs still find the right context. An analogy comes to mind with the launch of a new ship named after its legendary predecessor. Then, according to tradition, a slab is cut out of the old hull and attached as a memorial plaque to the new ship. So, all versions of MS DOS carried on board a small piece of the very first version of 1981.



The next nuance was more curious. It turned out that before running any EXE file, MS DOS checks a certain context in a certain place among its commands. If it is there, the OS slightly "pushes" the neighboring commands and adds the PUSH CX and POP CX commands.







LOOP, , - MicroSoft, , . : « MS DOS !» . , MicroSoft , , . , CX. MS DOS POP CX, , MicroSoft . ( , ) , .



, , , , , . . , , , , , . 8086 . : .. (16 20) .. (16 20). , , , ( ). . 19- ( ) 64 .







1986 32- , 30 ( 32, ). , «» .







«». , - . , , 20- , ! : .



, , , «640 » . «expanded», - 64- «» , MicroSoft MS DOS, , , 640 .





MS DOS . DOS , , , . DOS … , ? ? ? . , DOS , (.. PSP) . ( DOS) . , .







: DOS, , , .





DOS, , . , DOS , . DOS-777 , .







, , . MMX, FPU. : , , FPU. MMX, .





-, : , MMX, ( ) , , Windows. , - MMX . - MMX FPU . - - Windows , MMX, .



Thus, the problem of backward compatibility objectively exists, and sometimes it is necessary to solve it. But if in the first two examples given the solution was ingenious, and most importantly, hidden for users who do not need this compatibility, then in the last two examples an attempt at compatibility (in my opinion, far-fetched!) Led to pretentious hardware solutions and gave rise to problems. Moreover, compatibility even then was much better and easier was provided by a specially designed virtual 8086 mode.



The main problem of any backward compatibility is that every year there are fewer and fewer users who need it. And everyone has to take it into account.








All Articles