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.c

    r141 r144  
    164164    rc = char_dev_input((RP_RWV _far *) req);
    165165    break;
    166    
     166
    167167  default:
    168168    rc = STDON | STATUS_ERR_UNKCMD;
     
    358358
    359359#ifdef ECS_BUILD
    360   ciprintf("This driver is licensed for use only in conjunction with eComStation.");
     360  ciprintf("This driver is licensed for use only in conjunction with eComStation.\n");
     361#else
     362  ciprintf("This is the Open Watcom build.\n");
    361363#endif
    362364
     
    455457
    456458    case OS2AHCI_IDC_BIOSMODE:
    457       /* reconfigure adapters in BIOS/int13 mode; needed for generating 
     459      /* reconfigure adapters in BIOS/int13 mode; needed for generating
    458460       * trap dumps on some machines. This is called by ACPI.PSD.
    459461       *
    460462       * To enter BIOS mode, we flush all write caches, turn off interrupts
    461        * and restore the BIOS configuration. This is exactly what 
     463       * and restore the BIOS configuration. This is exactly what
    462464       * apm_suspend() does.
    463465       */
     
    474476  case DSKSP_CAT_GENERIC:
    475477    return(ioctl_gen_dsk(ioctl));
    476    
     478
    477479  case DSKSP_CAT_SMART:
    478480    return(ioctl_smart(ioctl));
     
    15211523{
    15221524  _asm {
    1523 
    15241525    push ds
    15251526    push es
     
    15331534    mov si, OFFSET asm_krnl_exit
    15341535    mov dl, DevHlp_RegisterKrnlExit
    1535     call Device_Help
     1536
     1537    call dword ptr [Device_Help]
    15361538
    15371539    pop  di
Note: See TracChangeset for help on using the changeset viewer.