[2] | 1 | ; $Id: kLdrA-os2.asm 2 2007-11-16 16:07:14Z bird $
|
---|
| 2 | ;; @file
|
---|
| 3 | ; kLdr - The Dynamic Loader, OS/2 Assembly Helpers.
|
---|
| 4 | ;
|
---|
| 5 |
|
---|
| 6 | ;
|
---|
| 7 | ; Copyright (c) 2006-2007 knut st. osmundsen <bird-kStuff-spam@anduin.net>
|
---|
| 8 | ;
|
---|
| 9 | ; This file is part of kStuff.
|
---|
| 10 | ;
|
---|
| 11 | ; kStuff is free software; you can redistribute it and/or
|
---|
| 12 | ; modify it under the terms of the GNU Lesser General Public
|
---|
| 13 | ; License as published by the Free Software Foundation; either
|
---|
| 14 | ; version 2.1 of the License, or (at your option) any later version.
|
---|
| 15 | ;
|
---|
| 16 | ; In addition to the permissions in the GNU Lesser General Public
|
---|
| 17 | ; License, you are granted unlimited permission to link the compiled
|
---|
| 18 | ; version of this file into combinations with other programs, and to
|
---|
| 19 | ; distribute those combinations without any restriction coming from
|
---|
| 20 | ; the use of this file.
|
---|
| 21 | ;
|
---|
| 22 | ; kStuff is distributed in the hope that it will be useful,
|
---|
| 23 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 24 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 25 | ; Lesser General Public License for more details.
|
---|
| 26 | ;
|
---|
| 27 | ; You should have received a copy of the GNU Lesser General Public
|
---|
| 28 | ; License along with kStuff; if not, write to the Free Software
|
---|
| 29 | ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
---|
| 30 | ; 02110-1301, USA
|
---|
| 31 | ;
|
---|
| 32 |
|
---|
| 33 | segment TEXT32 public align=16 CLASS=CODE use32
|
---|
| 34 |
|
---|
| 35 | ;
|
---|
| 36 | ; _DLL_InitTerm
|
---|
| 37 | ;
|
---|
| 38 | ..start:
|
---|
| 39 | extern _DLL_InitTerm
|
---|
| 40 | jmp _DLL_InitTerm
|
---|
| 41 |
|
---|
| 42 |
|
---|
| 43 | ;
|
---|
| 44 | ; kLdrLoadExe wrapper which loads the bootstrap stack.
|
---|
| 45 | ;
|
---|
| 46 | global _kLdrDyldLoadExe
|
---|
| 47 | _kLdrDyldLoadExe:
|
---|
| 48 | push ebp
|
---|
| 49 | mov ebp, esp
|
---|
| 50 |
|
---|
| 51 | ; switch stack.
|
---|
| 52 | ; extern _abStack
|
---|
| 53 | ; lea esp, [_abStack + 8192 - 4]
|
---|
| 54 | push dword [ebp + 8 + 20]
|
---|
| 55 | push dword [ebp + 8 + 16]
|
---|
| 56 | push dword [ebp + 8 + 12]
|
---|
| 57 | push dword [ebp + 8 + 8]
|
---|
| 58 |
|
---|
| 59 | ; call worker on the new stack.
|
---|
| 60 | extern _kldrDyldLoadExe
|
---|
| 61 | call _kldrDyldLoadExe
|
---|
| 62 |
|
---|
| 63 | ; we shouldn't return!
|
---|
| 64 | we_re_not_supposed_to_get_here:
|
---|
| 65 | int3
|
---|
| 66 | int3
|
---|
| 67 | jmp short we_re_not_supposed_to_get_here
|
---|
| 68 |
|
---|