Autoconf: Maybe the First Example of Microsoft Pushing Features into the OS to Kill a Competitor

Back | vestris | 9/6/2011 |

Seventeen years ago I wrote autoconf that enabled DOS users to boot multiple configurations without any menus or pause. I admit, I copied the original source from SVM, but ended up working on it for a very long time and extending the features for at least two or three years. The name was unfortunate since GNU already had an autoconf, but I was completely unfamiliar with the *nix side of the world since all I had was a 386 PC. Autoconf went on to be widely used, especially in Europe until DOS 6.2 which introduced multiple configurations that were “good enough”. I spent a month writing a converter from DOS configurations into Autoconf configurations, but it was too late, Microsoft pushed me out of the multi-boot market by embedding a crappier default implementation into the operating system. Anyway, I forgive you, Bill.

Here’s the code that let you declare DEVICE=something.sys in your config.sys file. I included the juiciest commented parts below. The preamble is already priceless.

  1. ;----------------------------------------------------------------------------
  2. ; This code is so simple I just couldn't beleive it. So forget about all
  3. ; books on assembler, cause this DOES ALWAYS WORK and is the shortest way
  4. ; to do it!
  5. ;----------------------------------------------------------------------------

I used macros stolen from someone’s 3D rendering engine’s source code to avoid typing push and pop too many times. That someone was probably sitting next to me in the basement of Infomaniak in Geneva. ASM recursive macros must blow your mind!

  1. pushx macro r1, r2, r3, r4, r5, r6, r7, r8  ;that's a usefull macro
  2.     ifnb <r1>                               ;stolen it from the source
  3.     push r1                                 ;of a 3D vector engine...
  4.     pushx r2, r3, r4, r5, r6, r7, r8        ;pushx + 8 registers max
  5.     endif                                   
  6. endm                                        ;assembled depending from
  7.                                             ;pushed quantity
  8. popx macro r1, r2, r3, r4, r5, r6, r7, r8
  9.     ifnb <r1>
  10.     pop r1  
  11.     popx r2, r3, r4, r5, r6, r7, r8
  12.     endif
  13. endm

The following seems pretty magical to me right now. Oh yeah, otherwise it STUCKS!

  1. ORG 0000h                                    ;INDESPENSABLE, SINCE OTHERWISE IT STUCKS
  2.  
  3. driver_suiv     dw      -1                   ;ALL THIS IS NECESSARY FOR
  4.         dw      -1                           ;DOS COMPATIBILITY AND
  5. attribut        dw      8004h                ;CONFLICT AVOID, if you remove
  6. req             dw      offset sys_request   ;it will stuck the machine
  7. run             dw      offset init          ;CRAZY DOS!!!!
  8. nom_device      db      'NUL    '

Who uses DOS 3.2, seriously?

  1. lds     bx,dword ptr cs:[req_ofs]       ;verify the DOS rubbish
  2. mov     word ptr [bx+14],0              ;version -> stay resident
  3. mov     word ptr [bx+16],cs             ;or not
  4. push    bx                              ;who uses DOS 3.2 ????
  5. mov     ah,30h
  6. int     21h                             ;HAS TO STAY RESIDENT BEFORE
  7. pop     bx                              ;DOS 3.2, cause otherwise
  8. cmp     al,3                            ;IT WILL GO CRAZY

Finally …

  1. END                     ;oh finally the end...

The entire source for this gem is here. And I’ve published the complete autoconf source here on Github.