| 1 | ; $Id: kLdrExeStub-os2.asm 29 2009-07-01 20:30:29Z bird $ | 
|---|
| 2 | ;; @file | 
|---|
| 3 | ; kLdr - OS/2 Loader Stub. | 
|---|
| 4 | ; | 
|---|
| 5 | ; This file contains a 64kb code/data/stack segment which is used to kick off | 
|---|
| 6 | ; the loader dll that loads the process. | 
|---|
| 7 | ; | 
|---|
| 8 |  | 
|---|
| 9 | ; | 
|---|
| 10 | ; Copyright (c) 2006-2007 Knut St. Osmundsen <bird-kStuff-spamix@anduin.net> | 
|---|
| 11 | ; | 
|---|
| 12 | ; Permission is hereby granted, free of charge, to any person | 
|---|
| 13 | ; obtaining a copy of this software and associated documentation | 
|---|
| 14 | ; files (the "Software"), to deal in the Software without | 
|---|
| 15 | ; restriction, including without limitation the rights to use, | 
|---|
| 16 | ; copy, modify, merge, publish, distribute, sublicense, and/or sell | 
|---|
| 17 | ; copies of the Software, and to permit persons to whom the | 
|---|
| 18 | ; Software is furnished to do so, subject to the following | 
|---|
| 19 | ; conditions: | 
|---|
| 20 | ; | 
|---|
| 21 | ; The above copyright notice and this permission notice shall be | 
|---|
| 22 | ; included in all copies or substantial portions of the Software. | 
|---|
| 23 | ; | 
|---|
| 24 | ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | 
|---|
| 25 | ; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | 
|---|
| 26 | ; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | 
|---|
| 27 | ; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | 
|---|
| 28 | ; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | 
|---|
| 29 | ; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | 
|---|
| 30 | ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | 
|---|
| 31 | ; OTHER DEALINGS IN THE SOFTWARE. | 
|---|
| 32 | ; | 
|---|
| 33 |  | 
|---|
| 34 | struc KLDRARGS | 
|---|
| 35 | .fFlags         resd 1 | 
|---|
| 36 | .enmSearch      resd 1 | 
|---|
| 37 | .szExecutable   resb 260 | 
|---|
| 38 | .szDefPrefix    resb 16 | 
|---|
| 39 | .szDefSuffix    resb 16 | 
|---|
| 40 | .szLibPath      resb (4096 - (4 + 4 + 16 + 16 + 260)) | 
|---|
| 41 | endstruc | 
|---|
| 42 |  | 
|---|
| 43 | extern _kLdrDyldLoadExe | 
|---|
| 44 |  | 
|---|
| 45 |  | 
|---|
| 46 | segment DATA32 stack CLASS=DATA align=16 use32 | 
|---|
| 47 | ..start: | 
|---|
| 48 | push    args | 
|---|
| 49 | jmp     _kLdrDyldLoadExe | 
|---|
| 50 |  | 
|---|
| 51 | ; | 
|---|
| 52 | ; Argument structure. | 
|---|
| 53 | ; | 
|---|
| 54 | align 4 | 
|---|
| 55 | args: | 
|---|
| 56 | istruc KLDRARGS | 
|---|
| 57 | at KLDRARGS.fFlags,         dd 0 | 
|---|
| 58 | at KLDRARGS.enmSearch,      dd 2 ;KLDRDYLD_SEARCH_HOST | 
|---|
| 59 | at KLDRARGS.szDefPrefix,    db '' | 
|---|
| 60 | at KLDRARGS.szDefSuffix,    db '.dll' | 
|---|
| 61 | ;    at KLDRARGS.szExecutable,   db 'tst-0.exe' | 
|---|
| 62 | at KLDRARGS.szLibPath,      db '' | 
|---|
| 63 | iend | 
|---|
| 64 |  | 
|---|
| 65 | segment STACK32 stack CLASS=STACK align=16 use32 | 
|---|
| 66 | ; pad up to 64KB. | 
|---|
| 67 | resb 60*1024 | 
|---|
| 68 |  | 
|---|
| 69 | global WEAK$ZERO | 
|---|
| 70 | WEAK$ZERO EQU 0 | 
|---|
| 71 | group DGROUP, DATA32  STACK32 | 
|---|
| 72 |  | 
|---|