Ignore:
Timestamp:
Sep 27, 2001, 5:08:35 AM (24 years ago)
Author:
bird
Message:

Win32k/kKrnlLib splittup: done the major stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/splittup/src/win32k/dev32/devfirst.asm

    r6280 r6841  
    1 ; $Id: devfirst.asm,v 1.9 2001-07-10 05:19:34 bird Exp $
     1; $Id: devfirst.asm,v 1.9.2.1 2001-09-27 03:08:14 bird Exp $
    22;
    33; DevFirst - entrypoint and segment definitions
     
    3333    public EH_DATASTART
    3434
    35 
    36     public _strategyAsm0
    37     public _strategyAsm1
    38     public _CallGetKernelInfo32
    39     public _CallElfIOCtl
     35    public _strategyAsm
    4036    public _CallWin32kIOCtl
    4137    public _CallWin32kOpen
    4238    public _CallWin32kClose
    4339    public _SSToDS_16a
    44     public GetOS2KrnlMTE
    45     public x86DisableWriteProtect
    46     public x86RestoreWriteProtect
    4740
    4841
     
    5043; Externs
    5144;
    52     extrn _TKSSBase16:dword
    53     extrn GETKERNELINFO32:FAR
    54     extrn ELFIOCTL:FAR
     45    extrn _TKSSBase:dword
    5546    extrn WIN32KIOCTL:FAR
    5647    extrn WIN32KOPEN:FAR
     
    6455    ASSUME CS:CODE16, DS:DATA16, ES:NOTHING, SS:NOTHING
    6556
    66 CODE16START label byte
     57CODE16START db 'CODE16START',0
     58
    6759
    6860    .286p
    69 ;$win32ki entry point
    70 _strategyAsm0:
    71 ;    int 3
    72     push    0
    73     jmp     _strategyAsm
    74 
    75 ;$win32k entry point
    76 _strategyAsm1:
    77 ;    int 3
    78     push    1
    79     jmp     _strategyAsm
    80 
    8161;;
    8262; Stub which pushes parameters onto the stack and call the 16-bit C strategy routine.
     
    9979    .386p
    10080;;
    101 ; Thunk procedure for R0Init32.
    102 ; @cproto    USHORT NEAR CallGetKernelInfo32(ULONG addressKrnlInfoBuf);
    103 ; @returns   Same as GetKernelInfo32.
    104 ; @param     addressKrnlInfoBuf  32-bit pointer to request data on stack.
    105 ; @status    completely implemented.
    106 ; @author    knut st. osmundsen
    107 _CallGetKernelInfo32 PROC NEAR
    108     ASSUME CS:CODE16
    109     push    ds
    110     push    word ptr [esp+6]            ; push high word.
    111     push    word ptr [esp+6]            ; push low word.
    112     call    far ptr FLAT:GETKERNELINFO32
    113     pop     ds
    114     ret
    115 _CallGetKernelInfo32 ENDP
    116 
    117 
    118 
    119 
    120 ;;
    121 ; Thunk procedure for .
    122 ; @cproto    USHORT NEAR CallElfIOCtl(void);
    123 ; @returns   Same as ElfIOCtl
    124 ; @param     address of IOCtl request packet (32-bit pointer).
    125 ; @status    completely implemented.
    126 ; @author    knut st. osmundsen
    127 _CallElfIOCtl PROC NEAR
    128     ASSUME CS:CODE16
    129     push    ds
    130     push    word ptr [esp+6]            ; push high word.
    131     push    word ptr [esp+6]            ; push low word.
    132     call    far ptr FLAT:ELFIOCTL
    133     pop     ds
    134     retn
    135 _CallElfIOCtl ENDP
    136 
    137 ;;
    13881; Thunk procedure for .
    13982; @cproto    USHORT NEAR CallWin32kIOCtl(void);
     
    189132
    190133
    191 
    192134;;
    193135; SSToDS - stack pointer to Flat pointer.
     
    204146_SSToDS_16a proc NEAR
    205147    assume CS:CODE16, DS:DATA16, ES:NOTHING
    206     mov     edx, ds:_TKSSBase16         ; get pointer held by _TKSSBase16 (pointer to stack base)
    207148    call    far ptr FLAT:far_getCS      ; get flat selector.
    208149    push    es
    209150    mov     es,  ax
    210151    assume  es:FLAT
    211     mov     eax, es:[edx]               ; get pointer to stack base
     152    mov     eax, es:_TKSSBase           ; get pointer to stack base
    212153    pop     es
    213154    movzx   edx, word ptr ss:[esp + 2]  ; 16-bit stack pointer (parameter)
     
    262203    ret
    263204GetOS2KrnlMTE ENDP
    264 
    265 
    266 ;;
    267 ; Disables the ring-0 write protection.
    268 ; It's used to help us write to readonly code segments and objects.
    269 ; @cproto   extern ULONG    _Optlink x86DisableWriteProtect(void);
    270 ; @return   Previous write protection flag setting.
    271 ; @uses     eax, edx
    272 ; @status   completely implemented.
    273 ; @author   knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    274 ; @remark   Used by importTabInit.
    275 x86DisableWriteProtect proc near
    276     cli
    277     mov     edx, cr0                    ; Get current cr0
    278     test    edx, 000010000h             ; Test for the WriteProtect flag (bit 16)
    279     setnz   al
    280     movzx   eax, al                     ; Old flag setting in eax (return value)
    281     and     edx, 0fffeffffh             ; Clear the 16th (WP) bit.
    282     mov     cr0, edx                    ;
    283     sti
    284     ret                                 ; return eax holds previous WP value.
    285 x86DisableWriteProtect endp
    286 
    287 
    288 ;;
    289 ; Restore the WP flag of CR0 to it's previous state.
    290 ; The call is intent only to be called with the result from x86DisableWriteProtect,
    291 ; and will hence only enable the WP flag.
    292 ; @cproto   extern ULONG    _Optlink x86RestoreWriteProtect(ULONG flWP);
    293 ; @return   Previous write protection flag setting.
    294 ; @param    eax - flWP  Boolean value. (1 = WP was set, 0 WP was clear)
    295 ; @uses     eax
    296 ; @status   completely implemented.
    297 ; @author   knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    298 ; @remark   Used by importTabInit.
    299 x86RestoreWriteProtect proc near
    300     test    eax, eax                    ; Check if the flag was previously clear
    301     jnz     x86RWP_set                  ; If set Then Set it back.
    302     jmp     x86RWP_end                  ; If clear Then nothing to do.
    303 x86RWP_set:
    304     cli
    305     mov     eax, cr0                    ; Get current cr0.
    306     or      eax, 000010000h             ; The the 16-bit (WP) bit.
    307     mov     cr0, eax                    ; Update cr0.
    308     sti
    309 
    310 x86RWP_end:
    311     ret
    312 x86RestoreWriteProtect endp
    313205
    314206
     
    367259
    368260CODE16_INIT segment
    369 CODE16_INITSTART label byte
     261CODE16_INITSTART db 'CODE16_INITSTART',0
    370262CODE16_INIT ends
    371263
    372264DATA16 segment
    373 DATA16START label byte
     265DATA16START label byte ; no string here!!
    374266DATA16 ends
    375267
    376268DATA16_BSS segment
    377 DATA16_BSSSTART label byte
     269DATA16_BSSSTART db 'DATA16_BSSSTART',0
    378270DATA16_BSS ends
    379271
    380272DATA16_CONST segment
    381 DATA16_CONSTSTART label byte
     273DATA16_CONSTSTART db 'DATA16_CONSTSTART', 0
    382274DATA16_CONST ends
    383275
    384276DATA16_INIT segment
    385 DATA16_INITSTART label byte
     277DATA16_INITSTART db 'DATA16_INITSTART',0
    386278DATA16_INIT ends
    387279
    388280DATA32 segment
    389 DATA32START label byte
     281DATA32START db 'DATA32START',0
    390282DATA32 ends
    391283
    392284BSS32 segment
    393 BSS32START label byte
     285BSS32START db 'BSS32START',0
    394286BSS32 ends
    395287
    396288CONST32_RO segment
    397 CONST32_ROSTART label byte
     289CONST32_ROSTART db 'CONST32_ROSTART',0
    398290CONST32_RO ends
    399291
    400292_VFT segment
    401 _VFTSTART LABEL BYTE
     293_VFTSTART db '_VFTSTART',0
    402294_VFT ends
    403295
    404296EH_DATA segment
    405 EH_DATASTART LABEL BYTE
     297EH_DATASTART db 'EH_DATASTART',0
    406298EH_DATA ends
    407299
Note: See TracChangeset for help on using the changeset viewer.