[2] | 1 | ; $Id: kLdrExeStub-os2.asm 2 2007-11-16 16:07:14Z 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-spam@anduin.net>
|
---|
| 11 | ;
|
---|
| 12 | ; This file is part of kStuff.
|
---|
| 13 | ;
|
---|
| 14 | ; kStuff is free software; you can redistribute it and/or
|
---|
| 15 | ; modify it under the terms of the GNU Lesser General Public
|
---|
| 16 | ; License as published by the Free Software Foundation; either
|
---|
| 17 | ; version 2.1 of the License, or (at your option) any later version.
|
---|
| 18 | ;
|
---|
| 19 | ; In addition to the permissions in the GNU Lesser General Public
|
---|
| 20 | ; License, you are granted unlimited permission to link the compiled
|
---|
| 21 | ; version of this file into combinations with other programs, and to
|
---|
| 22 | ; distribute those combinations without any restriction coming from
|
---|
| 23 | ; the use of this file.
|
---|
| 24 | ;
|
---|
| 25 | ; kStuff is distributed in the hope that it will be useful,
|
---|
| 26 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 27 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 28 | ; Lesser General Public License for more details.
|
---|
| 29 | ;
|
---|
| 30 | ; You should have received a copy of the GNU Lesser General Public
|
---|
| 31 | ; License along with kStuff; if not, write to the Free Software
|
---|
| 32 | ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
---|
| 33 | ; 02110-1301, USA
|
---|
| 34 | ;
|
---|
| 35 |
|
---|
| 36 | struc KLDRARGS
|
---|
| 37 | .fFlags resd 1
|
---|
| 38 | .enmSearch resd 1
|
---|
| 39 | .szExecutable resb 260
|
---|
| 40 | .szDefPrefix resb 16
|
---|
| 41 | .szDefSuffix resb 16
|
---|
| 42 | .szLibPath resb (4096 - (4 + 4 + 16 + 16 + 260))
|
---|
| 43 | endstruc
|
---|
| 44 |
|
---|
| 45 | extern _kLdrDyldLoadExe
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 | segment DATA32 stack CLASS=DATA align=16 use32
|
---|
| 49 | ..start:
|
---|
| 50 | push args
|
---|
| 51 | jmp _kLdrDyldLoadExe
|
---|
| 52 |
|
---|
| 53 | ;
|
---|
| 54 | ; Argument structure.
|
---|
| 55 | ;
|
---|
| 56 | align 4
|
---|
| 57 | args:
|
---|
| 58 | istruc KLDRARGS
|
---|
| 59 | at KLDRARGS.fFlags, dd 0
|
---|
| 60 | at KLDRARGS.enmSearch, dd 2 ;KLDRDYLD_SEARCH_HOST
|
---|
| 61 | at KLDRARGS.szDefPrefix, db ''
|
---|
| 62 | at KLDRARGS.szDefSuffix, db '.dll'
|
---|
| 63 | ; at KLDRARGS.szExecutable, db 'tst-0.exe'
|
---|
| 64 | at KLDRARGS.szLibPath, db ''
|
---|
| 65 | iend
|
---|
| 66 |
|
---|
| 67 | segment STACK32 stack CLASS=STACK align=16 use32
|
---|
| 68 | ; pad up to 64KB.
|
---|
| 69 | resb 60*1024
|
---|
| 70 |
|
---|
| 71 | global WEAK$ZERO
|
---|
| 72 | WEAK$ZERO EQU 0
|
---|
| 73 | group DGROUP, DATA32 STACK32
|
---|
| 74 |
|
---|