Changeset 16


Ignore:
Timestamp:
Sep 17, 2010, 11:45:29 AM (15 years ago)
Author:
markus
Message:

Changed wmakefile to use link.exe and alp.exe (Assembler) from DDK, now it compiles.

Location:
trunk/src/os2ahci
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/Makefile

    r13 r16  
    3535
    3636# main path to OS/2 DDK; this needs to be set before this makefile will work
     37!ifndef DDK
    3738DDK          = i:\ddk
     39!endif
    3840
    3941# main path to 16 bit C compiler
     42!ifndef CC16
    4043CC16         = i:\c600
     44!endif
    4145
    4246CC_INCLUDE   = -I$(DDK)\base\h \
  • trunk/src/os2ahci/init.asm

    r14 r16  
    1717                PUBLIC  _engine_hook         ; engine trigger context hook
    1818                PUBLIC  _dev_hdr             ; device driver header
     19                PUBLIC  __I4M                ; 32bit signed multiply routine
     20                PUBLIC  __U4M                ; 32bit unsigned multiply routine
     21                PUBLIC  __U4D                ; 32bit unsigned divide routine
     22                PUBLIC  __I4D                ; 32bit signed multiply routine
    1923                PUBLIC  _end_of_data         ; end of all data (label)
    2024                PUBLIC  _end_of_code         ; end of all code (label)
    21 
     25       
    2226; ----------------------------------------------------------------------------
    2327; Device Driver Header
     
    327331_engine_hook    ENDP
    328332
     333
     334; Unsigned long divide routine;
     335; taken from OS/2 Uniaud project, original author: Timur Tabi
     336__U4D           proc    near
     337                shl     edx,10h            ;; Load dx:ax into eax
     338                mov     dx,ax
     339                mov     eax,edx
     340                xor     edx,edx            ;; Zero extend eax into edx
     341                shl     ecx,10h            ;; Load cx:bx into ecx
     342                mov     cx,bx
     343                div     ecx                ;; Divide eax/ecx into eax
     344                mov     ecx,edx            ;; Load edx into cx:bx
     345                shr     ecx,10h
     346                mov     bx,dx
     347                mov     edx,eax            ;; Load eax into dx:ax
     348                shr     edx,10h
     349                ret
     350__U4D           endp
     351       
     352; Long multiply routine;
     353; taken from OS/2 Uniaud project, original author: Timur Tabi
     354__U4M           proc    near
     355                shl     edx,10h            ;; Load dx:ax into eax
     356                mov     dx,ax
     357                mov     eax,edx
     358                mov     dx,cx              ;; Load cx:bx into edx
     359                shl     edx,10h
     360                mov     dx,bx
     361                mul     edx                ;; Multiply eax*edx into edx:eax
     362                mov     edx,eax            ;; Load eax into dx:ax
     363                shr     edx,10h
     364                ret
     365__U4M           endp
     366
     367__I4M           proc    near
     368                shl     edx,10h            ;; Load dx:ax into eax
     369                mov     dx,ax
     370                mov     eax,edx
     371                mov     dx,cx              ;; Load cx:bx into edx
     372                shl     edx,10h
     373                mov     dx,bx
     374                mul     edx                ;; Multiply eax*edx into edx:eax
     375                mov     edx,eax            ;; Load eax into dx:ax
     376                shr     edx,10h
     377                ret
     378__I4M           endp
     379               
     380
     381; Signed long divide routine;
     382; taken from OS/2 Uniaud project, original author: Timur Tabi
     383__I4D           proc    near
     384                shl     edx,10h            ;; Load dx:ax into eax
     385                mov     dx,ax
     386                mov     eax,edx
     387                cdq                        ;; Sign extend eax into edx
     388                shl     ecx,10h            ;; Load cx:bx into ecx
     389                mov     cx,bx
     390                idiv    ecx                ;; Divide eax/ecx into eax
     391                mov     ecx,edx            ;; Load edx into cx:bx
     392                shr     ecx,10h
     393                mov     bx,dx
     394                mov     edx,eax            ;; Load eax into dx:ax
     395                shr     edx,10h
     396                ret
     397__I4D           endp
     398       
    329399                .286
    330400
  • trunk/src/os2ahci/os2ahci.c

    r14 r16  
    4141
    4242/* -------------------------- function prototypes -------------------------- */
     43
     44       void small_code_          (void);
    4345
    4446/* ------------------------ global/static variables ------------------------ */
     
    10171019}
    10181020
     1021/******************************************************************************
     1022 * small_code_ - this dummy func resolves the undefined reference linker
     1023 * error that occurrs when linking WATCOM objects with DDK's link.exe
     1024 */
     1025void small_code_(void)
     1026{
     1027}
  • trunk/src/os2ahci/wmakefile

    r15 r16  
    11###############################################################################
     2# wmakefile - makefile for os2ahci driver using WATCOM compiler
    23#
    3 # wmakefile - Watcom makefile for os2ahci driver
    4 #
    5 # NOTE: This is a wmake file! See here:
    6 # http://www.openwatcom.org/index.php/Using_wmake
    7 #
    8 
    9 #
    10 # Copyright (c) 2010 Markus Thielen, Christian Mueller.
     4# Copyright (c) 2010 Christian Mueller, Markus Thielen.
    115# Parts copied from/inspired by the Linux AHCI driver;
    126# those parts are (c) Linux AHCI/ATA maintainers
     
    2620#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2721
     22
    2823###############################################################################
    29 # wmake options
     24# Environment
    3025
    31 # disable prompt to delete out of date files on compile errors
    32 .ERASE   
     26# main path to OS/2 DDK; this needs to be set before this makefile will work
     27!ifndef DDK
     28DDK          = i:\ddk
     29!endif
     30
     31# main path to WATCOM installation
     32!ifndef WATCOM
     33WATCOM       = i:\watcom
     34!endif
     35
     36CC_INCLUDE   = -I$(DDK)\base\h \
     37               -I$(DDK)\base\ibmh \
     38               -I$(DDK)\base\src\dev\dasd\diskh \
     39               -I$(WATCOM)\h
     40
     41AS_INCLUDE   = -I:$(DDK)\base\inc \
     42               -I:$(DDK)\base\src\dev\dasd\diskinc
     43
     44LIB_DIRS     = $(DDK)\base\lib\ \
     45               $(DDK)\base\src\dev\dasd\devhlp\ \
    3346
    3447
    3548###############################################################################
    3649# Tool Chain
    37 
    38 AS            = wasm    # Watcom assembler 
    39 CC            = wcc     # Watcom 16bit compiler
    40 LD            = wlink   # Watcom linker
    41 
    42 
    43 ###############################################################################
    44 # Environment
    4550#
    46 # we need the following set before this makefile is called:
    47 #
    48 # WATCOM - to the base WATCOM installation directory
    49 # DDK    - to the base dir of the OS/2 DDK to use
    50 # PS     - the path separator (/ or \)
     51# This makefile uses the Watcom 16bit compiler.
     52# Linker and assembler are link.exe and alp.exe that ship with the OS/2 DDK
    5153#
    5254
    53 DDK          = $(%DDK)
    54 WATCOM       = $(%WATCOM)
    55 !ifndef %PS
    56 PS           = \
    57 !else
    58 PS           = $(%PS)
    59 !endif
     55AS            = $(DDK)\tools\alp.exe
     56CC            = wcc
     57LD            = $(DDK)\base\tools\link.exe
    6058
    61 CC_INCLUDE   = -I$(DDK)$(PS)BASE$(PS)H &
    62                -I$(DDK)$(PS)BASE$(PS)IBMH &
    63                -I$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DISKH &
    64                -I$(WATCOM)$(PS)h &
    65 
    66 AS_INCLUDE   = -I$(DDK)$(PS)BASE$(PS)INC &
    67                -I$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DISKINC
    68 
    69 #              the linker wants this on one line, no spaces...
    70 LIB_DIRS     = $(DDK)$(PS)BASE$(PS)LIB$;$(DDK)$(PS)BASE$(PS)SRC$(PS)DEV$(PS)DASD$(PS)DEVHLP;$(WATCOM)$(PS)LIB286$(PS)os2
    71 
     59AFLAGS        = -Mb
     60CFLAGS        = -ecc -bt=os2 -ms -zu -2 -w2 -wcd=138 -zp=1 -q -s -zdf
     61CFLAGS_DEBUG  = -d3 -hc
     62LFLAGS        = /noe /nod /packd /a:16 /batch /map /line
    7263
    7364###############################################################################
     
    7667TARGET   = os2ahci.add
    7768
    78 LIBS     = addcalls,dhcalls,doscalls,rmcalls,clibc
     69LIBS     = addcalls dhcalls doscalls rmcalls
    7970
    80 SRCS     = init.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c ctxhook.c
     71SRCS     = init.asm math.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c \
     72           ctxhook.c
    8173
    82 OBJS     = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj&
    83            ctxhook.obj
    84 
    85 #          the Watcom linker needs commas between object files
    86 LDOBJS   = init.obj,libc.obj,os2ahci.obj,pci.obj,ahci.obj,ata.obj,atapi.obj,&
     74OBJS     = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj \
    8775           ctxhook.obj
    8876
     
    9482clean:
    9583        rm -f $(OBJS) $(TARGET)
    96 
    97 
    98 ###############################################################################
    99 # compiler/linker flags
    100 
    101 AFLAGS        = -2 -bt=os2 -w3 -zq -ms
    102 CFLAGS        = -ecc -bt=os2 -ms -zu -2 -w2 -wcd=138 -zp=1 -q -s -zdf
    103 CFLAGS_DEBUG  = -d3 -hc
    104 LFLAGS        = name $(TARGET) system os2 dll initglobal option map option quiet &
    105                 option nodefaultlibs libpath $(LIB_DIRS) file $(LDOBJS) &
    106                 library $(LIBS) option nocaseexact #option packd=64k
    107 LFLAGS_DEBUG  = DEBUG CODEVIEW option cvpack
    108 
    109 !IFDEF DEBUG
    110 CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)
    111 LFLAGS = $(LFLAGS) $(LFLAGS_DEBUG)
    112 !ENDIF
    11384
    11485###############################################################################
     
    129100atapi.obj:    atapi.c    wmakefile $(INCS) ata.h atapi.h
    130101
    131 ctxhook.obj:  ctxhook.c  wmakefile $(INCS)
     102ctxhook.obj:  ctxhook.c  wmakefile $(INCS) ata.h atapi.h
    132103
    133104###############################################################################
     
    135106
    136107.asm.obj:
    137         $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm -fo=$*.obj
    138         wdis -l $*.obj
     108        $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm
    139109
    140110.c.obj:
     
    143113
    144114$(TARGET): $(OBJS) os2ahci.def wmakefile
    145         $(LD) $(LFLAGS)
     115        $(LD) $(LFLAGS) $(OBJS),$(TARGET),$*.map,$(LIB_DIRS) $(LIBS),$*.def
     116        mapsym os2ahci
    146117
     118
Note: See TracChangeset for help on using the changeset viewer.