Changeset 16
- Timestamp:
- Sep 17, 2010, 11:45:29 AM (15 years ago)
- Location:
- trunk/src/os2ahci
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/Makefile
r13 r16 35 35 36 36 # main path to OS/2 DDK; this needs to be set before this makefile will work 37 !ifndef DDK 37 38 DDK = i:\ddk 39 !endif 38 40 39 41 # main path to 16 bit C compiler 42 !ifndef CC16 40 43 CC16 = i:\c600 44 !endif 41 45 42 46 CC_INCLUDE = -I$(DDK)\base\h \ -
trunk/src/os2ahci/init.asm
r14 r16 17 17 PUBLIC _engine_hook ; engine trigger context hook 18 18 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 19 23 PUBLIC _end_of_data ; end of all data (label) 20 24 PUBLIC _end_of_code ; end of all code (label) 21 25 22 26 ; ---------------------------------------------------------------------------- 23 27 ; Device Driver Header … … 327 331 _engine_hook ENDP 328 332 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 329 399 .286 330 400 -
trunk/src/os2ahci/os2ahci.c
r14 r16 41 41 42 42 /* -------------------------- function prototypes -------------------------- */ 43 44 void small_code_ (void); 43 45 44 46 /* ------------------------ global/static variables ------------------------ */ … … 1017 1019 } 1018 1020 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 */ 1025 void small_code_(void) 1026 { 1027 } -
trunk/src/os2ahci/wmakefile
r15 r16 1 1 ############################################################################### 2 # wmakefile - makefile for os2ahci driver using WATCOM compiler 2 3 # 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. 11 5 # Parts copied from/inspired by the Linux AHCI driver; 12 6 # those parts are (c) Linux AHCI/ATA maintainers … … 26 20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 27 21 22 28 23 ############################################################################### 29 # wmake options24 # Environment 30 25 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 28 DDK = i:\ddk 29 !endif 30 31 # main path to WATCOM installation 32 !ifndef WATCOM 33 WATCOM = i:\watcom 34 !endif 35 36 CC_INCLUDE = -I$(DDK)\base\h \ 37 -I$(DDK)\base\ibmh \ 38 -I$(DDK)\base\src\dev\dasd\diskh \ 39 -I$(WATCOM)\h 40 41 AS_INCLUDE = -I:$(DDK)\base\inc \ 42 -I:$(DDK)\base\src\dev\dasd\diskinc 43 44 LIB_DIRS = $(DDK)\base\lib\ \ 45 $(DDK)\base\src\dev\dasd\devhlp\ \ 33 46 34 47 35 48 ############################################################################### 36 49 # Tool Chain 37 38 AS = wasm # Watcom assembler39 CC = wcc # Watcom 16bit compiler40 LD = wlink # Watcom linker41 42 43 ###############################################################################44 # Environment45 50 # 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 51 53 # 52 54 53 DDK = $(%DDK) 54 WATCOM = $(%WATCOM) 55 !ifndef %PS 56 PS = \ 57 !else 58 PS = $(%PS) 59 !endif 55 AS = $(DDK)\tools\alp.exe 56 CC = wcc 57 LD = $(DDK)\base\tools\link.exe 60 58 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 59 AFLAGS = -Mb 60 CFLAGS = -ecc -bt=os2 -ms -zu -2 -w2 -wcd=138 -zp=1 -q -s -zdf 61 CFLAGS_DEBUG = -d3 -hc 62 LFLAGS = /noe /nod /packd /a:16 /batch /map /line 72 63 73 64 ############################################################################### … … 76 67 TARGET = os2ahci.add 77 68 78 LIBS = addcalls ,dhcalls,doscalls,rmcalls,clibc69 LIBS = addcalls dhcalls doscalls rmcalls 79 70 80 SRCS = init.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c ctxhook.c 71 SRCS = init.asm math.asm libc.c os2ahci.c pci.c ahci.c ata.c atapi.c \ 72 ctxhook.c 81 73 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,& 74 OBJS = init.obj libc.obj os2ahci.obj pci.obj ahci.obj ata.obj atapi.obj \ 87 75 ctxhook.obj 88 76 … … 94 82 clean: 95 83 rm -f $(OBJS) $(TARGET) 96 97 98 ###############################################################################99 # compiler/linker flags100 101 AFLAGS = -2 -bt=os2 -w3 -zq -ms102 CFLAGS = -ecc -bt=os2 -ms -zu -2 -w2 -wcd=138 -zp=1 -q -s -zdf103 CFLAGS_DEBUG = -d3 -hc104 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=64k107 LFLAGS_DEBUG = DEBUG CODEVIEW option cvpack108 109 !IFDEF DEBUG110 CFLAGS = $(CFLAGS) $(CFLAGS_DEBUG)111 LFLAGS = $(LFLAGS) $(LFLAGS_DEBUG)112 !ENDIF113 84 114 85 ############################################################################### … … 129 100 atapi.obj: atapi.c wmakefile $(INCS) ata.h atapi.h 130 101 131 ctxhook.obj: ctxhook.c wmakefile $(INCS) 102 ctxhook.obj: ctxhook.c wmakefile $(INCS) ata.h atapi.h 132 103 133 104 ############################################################################### … … 135 106 136 107 .asm.obj: 137 $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm -fo=$*.obj 138 wdis -l $*.obj 108 $(AS) $(AFLAGS) $(AS_INCLUDE) $*.asm 139 109 140 110 .c.obj: … … 143 113 144 114 $(TARGET): $(OBJS) os2ahci.def wmakefile 145 $(LD) $(LFLAGS) 115 $(LD) $(LFLAGS) $(OBJS),$(TARGET),$*.map,$(LIB_DIRS) $(LIBS),$*.def 116 mapsym os2ahci 146 117 118
Note:
See TracChangeset
for help on using the changeset viewer.