Ignore:
Timestamp:
Jan 3, 2013, 1:22:56 PM (13 years ago)
Author:
rousseau
Message:

Fixed the Open Watcom build

Building with Open Watcom produced a non working driver.

Causes & Fixes

o Enum types were 8 bits when using WCC

This caused the functions with variable arguments to fail.
Adding the -ei compiler-flag to WCC solved this issue.

o Incorrect inline assembler syntax to call DeviceHelp in os2ahci.c

DeviceHelp is a 16:16 far pointer residing in memory.
MASM interprets 'call DeviceHelp' differently than WASM.
The correct syntax is: 'call dword ptr [DeviceHelp]'.

o Missing segments from TGROUP in init.asm

WLINK then generates the AUTO class, most probably causing incorrect
relocation fixups.

Enhancements

o WASM (or JWASM) can now be used instead of ALP
o WCC can now be used instead of CL
o The Open Watcom linker (WLINK) can now be used instead of LINK
o Streamlined both makefiles a notch so it's easy to use both tool-chains

To investigate

o CL barks about a missing prototype for DevHelp_Yield() in lib.c

The prototype is actually defined in dhcalls.h but CL still barks.

o Using WCC with ALP and WLINK produces an oversized image

Probaly due to misplaced BSS segments. WCC with ALP and LINK produces
a normal sized image however.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/os2ahci.h

    r141 r144  
    2828
    2929/* IMPORTANT NOTE: The DDK headers require tight structure packing and this
    30  * is controlled via compiler parameters. Thus, all stuctures in os2ahci.sys
     30 * is controlled via compiler parameters. Thus, all stuctures in os2ahci.add
    3131 * are expected to be byte-aligned without the need of explicit pragma pack()
    3232 * directives. Where possible, the structures are layed out such that words
     
    4949#include <reqpkt.h>
    5050
     51/* NOTE: (Rousseau)
     52 * The regular dhcalls.h from $(DDK)\base\h also works.
     53 * The devhelp.h from $(DDK)\base\h produces inline assembler errors.
     54 * The modified devhelp.h from ..\include works OK and is used because it
     55 * generates a slightly smaller driver image.
     56 */
    5157#ifdef __WATCOMC__
    5258/* include WATCOM specific DEVHELP stubs */
     
    106112#define dddphex   if (debug > 2) phex
    107113
    108 /* verbosity console print macros 
     114/* verbosity console print macros
    109115 * (we use 'i' in ciprintf here to avoid name clash
    110116 * with vprintf-like funcs)
     
    380386  SG_TO_BUF,                           /* copy from S/G list to buffer */
    381387  BUF_TO_SG                            /* copy from buffer to S/G list */
    382 } SG_MEMCPY_DIRECTION; 
     388} SG_MEMCPY_DIRECTION;
    383389
    384390/* -------------------------- function prototypes -------------------------- */
Note: See TracChangeset for help on using the changeset viewer.