Ignore:
Timestamp:
Oct 27, 1999, 4:03:01 AM (26 years ago)
Author:
bird
Message:

Corrections to make win32k work.
(And now it does work, at least at my test machine...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/dev32/devfirst.asm

    r847 r1467  
    1 ; $Id: devfirst.asm,v 1.1 1999-09-06 02:19:56 bird Exp $
     1; $Id: devfirst.asm,v 1.2 1999-10-27 02:02:54 bird Exp $
    22;
    33; DevFirst - entrypoint and segment definitions
     
    55; Copyright (c) 1999 knut st. osmundsen
    66;
     7; Project Odin Software License can be found in LICENSE.TXT
    78;
    89    .386p
     
    1213;
    1314    include devsegdf.inc
     15    include sas.inc
    1416
    1517;
     
    2931    public _strategyAsm0
    3032    public _strategyAsm1
     33    public _CallGetOTEs32
    3134    public _SSToDS_16a
     35    public GetOS2KrnlMTE
    3236
    3337
     
    3539; Externs
    3640;
     41    extrn _TKSSBase16:dword
     42    extrn GETOTES32:FAR
     43    .286p
    3744    extrn _strategy:near
    38     extrn CODE16END:byte
    39     extrn DATA16END:byte
    40     extrn _TKSSBase16:dword
    4145
    4246
     
    4650CODE16START label byte
    4751
     52    .286p
    4853;$win32ki entry point
    4954_strategyAsm0:
     
    5661    jmp     _strategyAsm
    5762
     63;;
     64; Stub which pushes parameters onto the stack and call the 16-bit C strategy routine.
     65; @returns   returns the return value of strategy(...)
     66; @author    knut st. osmundsen
    5867_strategyAsm proc far
    5968    push    es
     
    6675    mov     word ptr es:[bx+3], ax
    6776    add     sp, 2
    68 ;    int 3
    6977    retf
    7078_strategyAsm endp
    7179
    7280
    73 ;extern LIN   SSToDS_16a(void NEAR *pStackVar);
     81    .386p
     82;;
     83; Thunk procedure for R0Init32.
     84; @cproto    USHORT NEAR CallGetOTEs32(ULONG addressOTEBuf);
     85; @returns   Same as GetOTEs32.
     86; @param     addressOTEBuf  32-bit pointer to request data.
     87; @status    completely implemented.
     88; @author    knut st. osmundsen
     89_CallGetOTEs32 PROC NEAR
     90    ASSUME CS:CODE16
     91    push    ds
     92    push    word ptr [esp+6]            ; push high word.
     93    push    word ptr [esp+6]            ; push low word.
     94    call    far ptr FLAT:GETOTES32
     95    pop     ds
     96    retn
     97_CallGetOTEs32 ENDP
     98
     99
     100;;
     101; SSToDS - stack pointer to Flat pointer.
     102; @cproto    extern LIN   SSToDS_16a(void NEAR *pStackVar);
     103; @returns   ax:dx  makes up a 32-bit flat pointer to stack.
     104; @param     pStackVar  Stack pointer which is to be made a flat pointer.
     105; @equiv     SSToDS in 32-bit code.
     106; @sketch    Get Flat CS
     107;            Get TKSSBase address. (FLAT)
     108;            return *TKSSBase + pStackVar.
     109; @status    completely  implemented.
     110; @author    knut st. osmundsen
     111; @remark    es is cs, not ds!
    74112_SSToDS_16a proc near
    75113    assume CS:CODE16, DS:DATA16, ES:NOTHING
     114    mov     edx, ds:_TKSSBase16         ; get pointer held by _TKSSBase16 (pointer to stack base)
     115    call    far ptr FLAT:far_getCS      ; get flat selector.
    76116    push    es
    77     jmp far ptr FLAT:_SSToDS_16a_GetFLAT_32
    78 _SSToDS_16a_GetFLAT_16::
    79     mov     edx, ds:_TKSSBase16
    80     movzx   eax, word ptr ss:[esp + 4]
    81     add     eax, es:[edx]
     117    mov     es,  ax
     118    assume  es:FLAT
     119    mov     eax, es:[edx]               ; get pointer to stack base
     120    pop     es
     121    movzx   edx, word ptr ss:[esp + 2]  ; 16-bit stack pointer (parameter)
     122    add     eax, edx                    ; 32-bit stack pointer in eax
    82123    mov     edx, eax
    83     shr     edx, 16
    84     pop     es
     124    shr     edx, 16                     ; dx high 16-bit of 32-bit stack pointer.
    85125    ret
    86126_SSToDS_16a endp
     
    88128CODE16 ends
    89129
     130
     131;
     132; all segments have a <segmentname>START label at the start of the segment.
     133;
     134
    90135CODE32 segment
    91136CODE32START label byte
    92     ASSUME CS:CODE32
    93 _SSToDS_16a_GetFLAT_32:
    94     push    cs
    95     pop     es
    96     jmp far ptr CODE16:_SSToDS_16a_GetFLAT_16
     137
     138;;
     139; Gets the current cs.
     140; @cproto    none.
     141; @returns   CS
     142; @author    knut st. osmundsen
     143; @remark    internal method. called from 16-bit code...
     144far_getCS proc far
     145    ASSUME DS:nothing, ES:nothing
     146    mov     ax,  cs
     147    retf
     148far_getCS endp
     149
     150
     151
     152;;
     153; Gets the a 32-bit flat pointer to the OS/2 Kernel MTE.
     154; @cproto    extern PMTE _System GetOS2KrnlMTE(void);
     155; @returns   Pointer to kernel MTE.
     156; @status    completely implemented.
     157; @author    knut st. osmundsen
     158GetOS2KrnlMTE PROC NEAR
     159    push    es
     160
     161    mov     ax,  SAS_selector               ;70h - Read-only SAS selector.
     162    mov     es,  ax
     163    xor     ebx, ebx
     164    assume  ebx: PTR SAS
     165    mov     bx,  es:[ebx].SAS_vm_data       ;SAS_vm_data (0ch)
     166    assume  ebx: PTR SAS_vm_section
     167    mov     eax, es:[ebx].SAS_vm_krnl_mte   ;SAS_vm_krnl_mte (0ch)
     168
     169    pop     es
     170    ret
     171GetOS2KrnlMTE ENDP
    97172
    98173CODE32 ends
    99174
    100175
    101 ;
    102 ; all segments have a <segmentname>START label at the start of the segment.
    103 ;
    104176DATA16 segment
    105177DATA16START label byte
Note: See TracChangeset for help on using the changeset viewer.