Changeset 9507 for trunk/src


Ignore:
Timestamp:
Dec 16, 2002, 2:37:07 AM (23 years ago)
Author:
bird
Message:

Symbol filename.

Location:
trunk/src/win32k/kKrnlLib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/kKrnlLib/include/options.h

    r8188 r9507  
    1 /* $Id: options.h,v 1.3 2002-04-01 13:51:16 bird Exp $
     1/* $Id: options.h,v 1.4 2002-12-16 01:37:07 bird Exp $
    22 *
    33 * Options.
     
    7070*******************************************************************************/
    7171/* NOINC */
    72 extern struct kKLOptions DATA16_GLOBAL options;  /* defined in d16Globl.c */
    73 extern USHORT DATA16_GLOBAL usVerMajor;
    74 extern USHORT DATA16_GLOBAL usVerMinor;
     72extern struct kKLOptions    options;  /* defined in d16Globl.c */
     73extern USHORT               usVerMajor;
     74extern USHORT               usVerMinor;
     75extern char                 szSymbolFile[128];
    7576
    7677#ifdef RING0
     
    7980    #pragma map(usVerMajor,     "_usVerMajor")
    8081    #pragma map(usVerMinor,     "_usVerMinor")
     82    #pragma map(szSymbolFile,   "_szSymbolFile")
    8183#endif
    8284#endif
  • trunk/src/win32k/kKrnlLib/src/d16Globl.c

    r8175 r9507  
    1 /* $Id: d16Globl.c,v 1.2 2002-04-01 12:47:53 bird Exp $
     1/* $Id: d16Globl.c,v 1.3 2002-12-16 01:36:57 bird Exp $
    22 *
    3  * d16globals - global data (16-bit)
     3 * Global data - everything in is 16-bit data segment!
    44 *
    5  * Copyright (c) 1999-2001 knut st. osmundsen
     5 * Copyright (c) 1999-2003 knut st. osmundsen <bird@anduin.net>
    66 *
    7  * Project Odin Software License can be found in LICENSE.TXT
     7 *
     8 * This file is part of kKrnlLib.
     9 *
     10 * kKrnlLib is free software; you can redistribute it and/or modify
     11 * it under the terms of the GNU General Public License as published by
     12 * the Free Software Foundation; either version 2 of the License, or
     13 * (at your option) any later version.
     14 *
     15 * kKrnlLib is distributed in the hope that it will be useful,
     16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18 * GNU General Public License for more details.
     19 *
     20 * You should have received a copy of the GNU General Public License
     21 * along with kKrnlLib; if not, write to the Free Software
     22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    823 *
    924 */
    10 
    11 /*******************************************************************************
    12 *   Defined Constants                                                          *
    13 *******************************************************************************/
    14 #define INCL_NOPMAPI
    15 
    1625/*******************************************************************************
    1726*   Header Files                                                               *
    1827*******************************************************************************/
     28#define INCL_NOPMAPI
    1929#include <os2.h>
    20 #include "devSegDf.h"
     30#include "..\..\..\..\include\odinbuild.h" /* FIXME */
    2131#include "options.h"
     32
    2233
    2334/*******************************************************************************
     
    2839 *       Uninitialized variables ends up in DATA32. */
    2940PFN         Device_Help = NULL;
    30 ULONG       TKSSBase16 = 0;
     41ULONG       pulTKSSBase32 = 0;
    3142USHORT      R0FlatCS16  = 0;
    3243USHORT      R0FlatDS16  = 0;
     
    3445ULONG       linDT2 = 0;                 /* dostable2 */
    3546BOOL        fInitTime   = TRUE;
    36 struct kKLOptions
    37             DATA16_GLOBAL options = DEFAULT_OPTION_ASSIGMENTS;
     47struct kKLOptions options = DEFAULT_OPTION_ASSIGMENTS;
    3848
    39 CHAR        szBuildDate[] = {__DATE__};
    40 CHAR        szBuildTime[] = {__TIME__};
     49char        szBuildDate[] = {__DATE__};
     50char        szBuildTime[] = {__TIME__};
    4151
    4252/* current OS and kernel info */
    43 ULONG  DATA16_GLOBAL    fKernel = 0xffffffff; /* Smp or uni kernel. */
    44 ULONG  DATA16_GLOBAL    ulKernelBuild = 0xffffffff; /* Kernel build. */
    45 USHORT DATA16_GLOBAL    usVerMajor = 0xffff;  /* OS/2 major ver - 20 */
    46 USHORT DATA16_GLOBAL    usVerMinor = 0xffff;  /* OS/2 minor ver - 30,40 */
     53ULONG       fKernel = 0xffffffff;       /* Smp or uni kernel. */
     54ULONG       ulKernelBuild = 0xffffffff; /* Kernel build. */
     55USHORT      usVerMajor = 0xffff;        /* OS/2 major ver - 20 */
     56USHORT      usVerMinor = 0xffff;        /* OS/2 minor ver - 30,40 */
     57ULONG       ulkKrnlLibBuild = ODIN32_BUILD_NR;
     58char        szSymbolFile[128] = {0};    /* The symbol file to load / loaded. */
    4759
  • trunk/src/win32k/kKrnlLib/src/d32Init.c

    r8175 r9507  
    1 /* $Id: d32Init.c,v 1.2 2002-04-01 12:48:41 bird Exp $
    2  *
    3  * d32init.c - 32-bits init routines.
    4  *
    5  * Copyright (c) 1998-1999 knut st. osmundsen
    6  *
    7  * Project Odin Software License can be found in LICENSE.TXT
     1/* $Id: d32Init.c,v 1.3 2002-12-16 01:36:46 bird Exp $
     2 *
     3 * d32init.c - 32bit init routins.
     4 *
     5 * Copyright (c) 2002 knut st. osmundsen <bird@anduin.net>
     6 *
     7 *
     8 * This file is part of kKrnlLib.
     9 *
     10 * kKrnlLib is free software; you can redistribute it and/or modify
     11 * it under the terms of the GNU General Public License as published by
     12 * the Free Software Foundation; either version 2 of the License, or
     13 * (at your option) any later version.
     14 *
     15 * kKrnlLib is distributed in the hope that it will be useful,
     16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18 * GNU General Public License for more details.
     19 *
     20 * You should have received a copy of the GNU General Public License
     21 * along with kKrnlLib; if not, write to the Free Software
     22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    823 *
    924 */
    1025#ifndef NOFILEID
    11 static const char szFileId[] = "$Id: d32Init.c,v 1.2 2002-04-01 12:48:41 bird Exp $";
     26static const char szFileId[] = "$Id: d32Init.c,v 1.3 2002-12-16 01:36:46 bird Exp $";
    1227#endif
    1328
     
    2944#define INCL_KKL_HEAP
    3045#define INCL_KKL_MISC
    31 #define INCL_KKL_LOG
    32 
    33 #define DWORD   ULONG                   /* exe386.h fixes */
    34 #define WORD    USHORT
    3546
    3647/*******************************************************************************
    3748*   Header Files                                                               *
    3849*******************************************************************************/
     50#include <kLib/kLib.h>
     51#include <kLib/kDevHlp.h>
     52
    3953#include <os2.h>
    40 #include <exe386.h>
    4154#include <string.h>
    4255
    43 #include "OS2Krnl.h"
    4456#include "kKrnlLib.h"
    4557
    46 #include "devSegDf.h"
    4758#include "options.h"
    4859#include "dev1632.h"
    4960#include "dev32.h"
    50 #include "dev32Hlp.h"
    51 #include "ProbKrnl.h"
    52 #include "ProbKrnlErrors.h"
    53 
    54 #ifdef R3TST
    55     #include "testcase.h"
    56 #endif
    57 
    58 
    59 /*******************************************************************************
    60 *   Global Variables                                                           *
    61 *******************************************************************************/
    62 PMTE        pKrnlMTE = NULL;
    63 PSMTE       pKrnlSMTE = NULL;
    64 POTE        pKrnlOTE = NULL;
    65 extern char callTab[1];
    6661
    6762
     
    7065*******************************************************************************/
    7166ULONG          readnum(const char *pszNum);
    72 #ifdef R3TST
    73 PMTE           GetOS2KrnlMTETst(void);
    74 #endif
    7567
    7668/* Note! these two have to be visible to some assembly programs. */
     69ULONG _System R0Addr32bit(ULONG ulParam, PFN pfn);
    7770ULONG _System R0Init(RP32INIT *pRpInit);
    78 ULONG _System R0Addr32bit(ULONG ulParam, PFN pfn);
    79 
    80 
    81 /* externs located in 16-bit data segement in ProbKrnl.c */
    82 extern ULONG    _TKSSBase16;
     71
     72
     73/**
     74 * Forwarder for ASMR0Addr32bit which only purpose is to
     75 * initate a logging sequence.
     76 * @returns what ever the function returned.
     77 * @param   ulParam     User argument.
     78 * @param   pfn         Address (32-bit FLAT) of the function to call.
     79 * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     80 */
     81ULONG R0Addr32bit(ULONG ulParam, PFN pfn)
     82{
     83    KLOGSTART2("ULONG", "ULONG ulParam, PFN pfn", ulParam, pfn);
     84    ULONG rc;
     85
     86    rc = pfn(ulParam);
     87
     88    KLOGSTOP(rc);
     89    return rc;
     90}
    8391
    8492
     
    8795 * @returns   Status word.
    8896 * @param     pRpInit  Pointer init request packet.
    89  * @sketch    Set TKSSBase32.
    90  *            Set default parameters.
     97 * @sketch    Set default parameters.
    9198 *            Parse command line options.
    9299 *            Show (kprint) configuration.
     
    104111    ULONG       ul;
    105112    APIRET      rc;
    106     LOCKHANDLE  lockhandle;
    107 
    108     pulTKSSBase32 = (PULONG)_TKSSBase16;
     113    KDHVMLOCK   lockhandle;
    109114
    110115    /*
     
    115120    while (pszTmp != NULL)
    116121    {
     122        /*
     123         * Skip [-/] and look for argument.
     124         */
    117125        pszTmp++; //skip [-/]
     126        pszTmp2 = strpbrk(pszTmp, ":=/- ");
     127        if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
     128            pszTmp2++;
     129        else
     130            pszTmp2 = NULL;
     131
     132        /*
     133         * The option switch.
     134         */
    118135        switch (*pszTmp)
    119136        {
    120137            case 'c':
    121138            case 'C': /* -C[1|2|3|4] or -Com:[1|2|3|4]  -  com-port no, def:-C2 */
    122                 pszTmp2 = strpbrk(pszTmp, ":=/- ");
    123                 if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
    124                     pszTmp2++;
    125                 else
     139                if (!pszTmp2)
    126140                    pszTmp2 = pszTmp + 1;
    127141                ul = readnum(pszTmp2);
     
    137151            case 'h':
    138152            case 'H': /* Heap options */
    139                 pszTmp2 = strpbrk(pszTmp, ":=/- ");
    140                 if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
     153                if (pszTmp2)
    141154                {
    142155                    ul = readnum(pszTmp2 + 1);
     
    153166            case 'l':
    154167            case 'L': /* -L[..]<:|=| >[<Y..|E..| > | <N..|D..>] */
    155                 pszTmp2 = strpbrk(pszTmp, ":=/- ");
    156                 if (pszTmp2 != NULL
    157                     && (pszTmp2[1] == 'Y' ||pszTmp2[1] == 'y' || pszTmp2[1] == 'E' || pszTmp2[1] == 'e')
    158                     )
    159                     options.fLogging = TRUE;
    160                 else
    161                     options.fLogging = FALSE;
     168                options.fLogging = (!pszTmp2
     169                                    &&  (   *pszTmp2 == 'Y'
     170                                         || *pszTmp2 == 'y'
     171                                         || *pszTmp2 == 'E'
     172                                         || *pszTmp2 == 'e'));
    162173                break;
    163174
     
    169180            case 'r':
    170181            case 'R': /* ResHeap options */
    171                 pszTmp2 = strpbrk(pszTmp, ":=/- ");
    172                 if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))
     182                if (!pszTmp2)
    173183                {
    174184                    ul = readnum(pszTmp2 + 1);
     
    183193                break;
    184194
     195            case 's':
     196            case 'S': /* Symbol file */
     197                szSymbolFile[0] = '\0';
     198                if (!pszTmp2)
     199                    strncat(szSymbolFile, pszTmp2, sizeof(szSymbolFile));
     200                break;
     201
     202
    185203            case 'v':
    186204            case 'V': /* verbose initialization */
     
    188206                break;
    189207        }
     208
     209        /* next option */
    190210        pszTmp = strpbrk(pszTmp, "-/");
    191211    }
     
    200220    #ifdef DEBUG
    201221    kprintf(("Options - Summary - Start\n"));
     222    kprintf(("\tszSymbolFile=%s\n", szSymbolFile));
    202223    if (options.fQuiet)
    203224        kprintf(("\tQuiet init\n"));
     
    210231        kprintf(("\tlogging disabled\n"));
    211232    kprintf(("\tCom port no.%03xh\n", options.usCom));
    212 
    213     kprintf(("\tKernel: v%d.%d  build %d%c type ",
    214                 usVerMajor,
    215                 usVerMinor,
    216                 ulKernelBuild,
    217                 (fKernel & KF_REV_MASK)
    218                     ? ((fKernel & KF_REV_MASK) >> KF_REV_SHIFT) + 'a'-1
    219                     : ' '
    220                 ));
    221     if (fKernel & KF_SMP)
    222         kprintf(("SMP "));
    223     else if (fKernel & KF_W4)
    224         kprintf(("W4 "));
    225     else
    226         kprintf(("UNI "));
    227     if (fKernel & KF_DEBUG)
    228         kprintf(("DEBUG\n"));
    229     else
    230         kprintf(("\n"));
    231 
    232233    kprintf(("\tcbSwpHeapInit=0x%08x  cbSwpHeapMax=0x%08x\n",
    233234             options.cbSwpHeapInit, options.cbSwpHeapMax));
     
    242243     * init sub-parts
    243244     */
     245    /* 32-bit devhelpers */
     246    kDHInit(Device_Help);
     247
    244248    /* functionimports. */
    245249    if ((rc = krnlInit()) != NO_ERROR)
     
    249253    }
    250254
    251     /* logging facility */
    252     if ((rc = kLogInit(0)) != NO_ERROR)
     255    /* kLib */
     256    if ((rc = kLibInit()) != NO_ERROR)
    253257    {
    254258        KLOGEXIT(rc);
     
    262266        return rc;
    263267    }
    264 
     268#if 0
    265269    /* heap */
    266270    if (heapInit(options.cbResHeapInit, options.cbResHeapMax,
     
    270274        return ERROR_D32_HEAPINIT_FAILED;
    271275    }
     276#endif
    272277
    273278    /* ... */
     
    285290    /* 32-bit code segment */
    286291    memset(SSToDS(&lockhandle), 0, sizeof(lockhandle));
    287     rc = D32Hlp_VMLock2(&CODE32START,
    288                         ((unsigned)&CODE32END & ~0xFFF) - (unsigned)&CODE32START, /* Round down so we don't overlap with the next request. */
    289                         VMDHL_LONG,
    290                         SSToDS(&lockhandle));
     292    rc = kDH_VMLock2(&CODE32START,
     293                     ((unsigned)&CODE32END & ~0xFFF) - (unsigned)&CODE32START, /* Round down so we don't overlap with the next request. */
     294                     VMDHL_LONG,
     295                     SSToDS(&lockhandle));
    291296    if (rc != NO_ERROR)
    292297        kprintf(("code segment lock failed with with rc=%d\n", rc));
     
    294299    /* 32-bit data segment */
    295300    memset(SSToDS(&lockhandle), 0, sizeof(lockhandle));
    296     rc = D32Hlp_VMLock2(&DATA32START,
    297                         &EH_DATAEND - &DATA32START,
    298                         VMDHL_LONG | VMDHL_WRITE,
    299                         SSToDS(&lockhandle));
     301    rc = kDH_VMLock2(&DATA32START,
     302                     &EH_DATAEND - &DATA32START,
     303                     VMDHL_LONG | VMDHL_WRITE,
     304                     SSToDS(&lockhandle));
    300305    if (rc != NO_ERROR)
    301306        kprintf(("data segment lock failed with with rc=%d\n", rc));
     
    351356}
    352357
    353 
    354 /**
    355  * Get kernel OTEs
    356  * This function set pKrnlMTE, pKrnlSMTE and pKrnlOTE.
    357  * @returns   Strategy return code:
    358  *            STATUS_DONE on success.
    359  *            STATUS_DONE | STERR | errorcode on failure.
    360  * @param     pKrnlInfo  Pointer to output buffer.
    361  *                       If NULL only the three global variables are set.
    362  * @status    completely implemented and tested.
    363  * @author    knut st. osmundsen
    364  * @remark    Called from IOCtl.
    365  *            WARNING! This function is called before the initroutine (R0INIT)!
    366  */
    367 ULONG GetKernelInfo32(PKRNLINFO pKrnlInfo)
    368 {
    369     KLOGENTRY1("ULONG","PKRNLINFO pKrnlInfo", pKrnlInfo);
    370     int     i;
    371     ULONG   rc;
    372 
    373     /* VerifyImportTab32 is called before the initroutine! */
    374     pulTKSSBase32 = (PULONG)_TKSSBase16;
    375 
    376     /* Find the kernel OTE table */
    377 #ifndef R3TST
    378     pKrnlMTE = GetOS2KrnlMTE();
    379 #else
    380     pKrnlMTE = GetOS2KrnlMTETst();
    381 #endif
    382     if (pKrnlMTE != NULL)
    383     {
    384         pKrnlSMTE = pKrnlMTE->mte_swapmte;
    385         if (pKrnlSMTE != NULL)
    386         {
    387             if (pKrnlSMTE->smte_objcnt <= MAXKRNLOBJECTS)
    388             {
    389                 pKrnlOTE = pKrnlSMTE->smte_objtab;
    390                 if (pKrnlOTE != NULL)
    391                 {
    392                     BOOL    fKrnlTypeOk;
    393 
    394                     /*
    395                      * Thats all?
    396                      */
    397                     if (pKrnlInfo == NULL)
    398                     {
    399                         KLOGEXIT(NO_ERROR);
    400                         return NO_ERROR;
    401                     }
    402 
    403                     pKrnlInfo->cObjects = (unsigned char)pKrnlSMTE->smte_objcnt;
    404 
    405                     /*
    406                      * Copy OTEs
    407                      */
    408                     for (i = 0; i < pKrnlInfo->cObjects; i++)
    409                     {
    410                         memcpy((void*)&pKrnlInfo->aObjects[i], &pKrnlOTE[i], sizeof(OTE));
    411                         kprintf2(("GetKernelInfo32: %d base=0x%08x size=0x%08x flags=0x%08x\n",
    412                                   i, pKrnlOTE[i].ote_base, pKrnlOTE[i].ote_size, pKrnlOTE[i].ote_flags));
    413                     }
    414                     rc = 0;
    415 
    416                     /*
    417                      * Search for internal revision stuff AND 'SAB KNL?' signature in the two first objects.
    418                      */
    419                     fKrnlTypeOk = FALSE;
    420                     pKrnlInfo->fKernel = 0;
    421                     pKrnlInfo->ulBuild = 0;
    422                     for (i = 0; i < 2 && pKrnlInfo->ulBuild == 0; i++)
    423                     {
    424                         const char *psz = (const char*)pKrnlOTE[i].ote_base;
    425                         const char *pszEnd = psz + pKrnlOTE[i].ote_size - 50; /* Last possible search position. */
    426 
    427                         while (psz < pszEnd)
    428                         {
    429                             if (strncmp(psz, "Internal revision ", 18) == 0 && (psz[18] >= '0' && psz[18] <= '9'))
    430                             {
    431                                 int j;
    432                                 kprintf2(("GetKernelInfo32: found internal revision: '%s'\n", psz));
    433 
    434                                 /* skip to end of "Internal revision " string. */
    435                                 psz += 18;
    436 
    437                                 /* Read number*/
    438                                 while ((*psz >= '0' && *psz <= '9') || *psz == '.')
    439                                 {
    440                                     if (*psz != '.')
    441                                         pKrnlInfo->ulBuild = (unsigned short)(pKrnlInfo->ulBuild * 10 + (*psz - '0'));
    442                                     psz++;
    443                                 }
    444 
    445                                 /* Check if build number seems valid. */
    446                                 if (   !(pKrnlInfo->ulBuild >=  8254 && pKrnlInfo->ulBuild <  8383) /* Warp 3 fp 32 -> fp 60 */
    447                                     && !(pKrnlInfo->ulBuild >=  9023 && pKrnlInfo->ulBuild <= 9036) /* Warp 4 GA -> fp 12 */
    448                                     && !(pKrnlInfo->ulBuild >= 14039 && pKrnlInfo->ulBuild < 14150) /* Warp 4.5 GA -> ?? */
    449                                     && !(pKrnlInfo->ulBuild >=  6600 && pKrnlInfo->ulBuild <= 6678) /* Warp 2.1x fix?? (just for fun!) */
    450                                       )
    451                                 {
    452                                     kprintf(("GetKernelInfo32: info summary: Build %d is invalid - invalid fixpack?\n", pKrnlInfo->ulBuild));
    453                                     rc = ERROR_D32_INVALID_BUILD;
    454                                     break;
    455                                 }
    456 
    457                                 /* Check for any revision flag */
    458                                 if ((*psz >= 'A' && *psz <= 'Z') || (*psz >= 'a' && *psz <= 'z'))
    459                                 {
    460                                     pKrnlInfo->fKernel |= (USHORT)((*psz - (*psz >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT);
    461                                     psz++;
    462                                 }
    463                                 if (*psz == ',') /* This is ignored! */
    464                                     *psz++;
    465 
    466                                 /* If this is an Aurora/Warp 4.5 or Warp 3 kernel there is more info! */
    467                                 if (psz[0] == '_' && (psz[1] == 'S' || psz[1] == 's'))  /* _SMP  */
    468                                     pKrnlInfo->fKernel |= KF_SMP;
    469                                 else
    470                                     if (*psz != ','
    471                                         && (   (psz[0] == '_' && psz[1] == 'W' && psz[2] == '4')  /* _W4 */
    472                                             || (psz[0] == '_' && psz[1] == 'U' && psz[2] == 'N' && psz[3] == 'I' && psz[4] == '4')  /* _UNI4 */
    473                                             )
    474                                         )
    475                                     pKrnlInfo->fKernel |= KF_W4 | KF_UNI;
    476                                 else
    477                                     pKrnlInfo->fKernel |= KF_UNI;
    478 
    479 
    480                                 /* Check if its a debug kernel (look for DEBUG at start of object 3-5) */
    481                                 if (!fKrnlTypeOk)
    482                                 {
    483                                     j = 3;
    484                                     while (j < 5)
    485                                     {
    486                                         /* There should be no iopl object preceding the debugger data object. */
    487                                         if ((pKrnlOTE[j].ote_flags & OBJIOPL) != 0)
    488                                             break;
    489                                         /* Is this is? */
    490                                         if ((pKrnlOTE[j].ote_flags & OBJINVALID) == 0
    491                                             && (pKrnlOTE[j].ote_flags & (OBJREAD | OBJWRITE)) == (OBJREAD | OBJWRITE)
    492                                             && strncmp((char*)pKrnlOTE[j].ote_base, "DEBUG", 5) == 0)
    493                                         {
    494                                             pKrnlInfo->fKernel |= KF_DEBUG;
    495                                             break;
    496                                         }
    497                                         j++;
    498                                     }
    499                                 }
    500 
    501                                 /* Display info */
    502                                 kprintf(("GetKernelInfo32: info summary: Build %d, fKernel=0x%x\n",
    503                                          pKrnlInfo->ulBuild, pKrnlInfo->fKernel));
    504 
    505                                 /* Break out */
    506                                 break;
    507                             }
    508 
    509                             /*
    510                              * Look for the SAB KNL? signature to check which kernel type we're
    511                              * dealing with. This could also be reached thru the selector found
    512                              * in the first element for the SAS_tables_area array.
    513                              */
    514                             if (!fKrnlTypeOk && strncmp(psz, "SAB KNL", 7) == 0)
    515                             {
    516                                 fKrnlTypeOk = TRUE;
    517                                 if (psz[7] == 'D')
    518                                     pKrnlInfo->fKernel |= KF_ALLSTRICT;
    519                                 else if (psz[7] == 'B')
    520                                     pKrnlInfo->fKernel |= KF_HALFSTRICT;
    521                                 else if (psz[7] != 'R')
    522                                     fKrnlTypeOk = FALSE;
    523                             }
    524 
    525                             /* next */
    526                             psz++;
    527                         } /* while loop searching for "Internal revision " */
    528                     } /* for loop on objects 0-1. */
    529 
    530                     /* Set error code if not found */
    531                     if (pKrnlInfo->ulBuild == 0)
    532                     {
    533                         rc = ERROR_D32_BUILD_INFO_NOT_FOUND;
    534                         kprintf(("GetKernelInfo32: Internal revision was not found!\n"));
    535                     }
    536                 }
    537                 else
    538                     rc = ERROR_D32_NO_OBJECT_TABLE;
    539             }
    540             else
    541                 rc = ERROR_D32_TOO_MANY_OBJECTS;
    542         }
    543         else
    544             rc = ERROR_D32_NO_SWAPMTE;
    545     }
    546     else
    547         rc = ERROR_D32_GETOS2KRNL_FAILED;
    548 
    549     if (rc != NO_ERROR)
    550         kprintf(("GetKernelInfo32: failed. rc = %d\n", rc));
    551 
    552     KLOGEXIT(rc);
    553     return (rc);
    554 }
    555 
    556 
    557 #ifdef R3TST
    558 /**
    559  * Creates a fake kernel MTE, SMTE and OTE for use while testing in Ring3.
    560  * @returns Pointer to the fake kernel MTE.
    561  * @status  completely implemented.
    562  * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    563  */
    564 PMTE GetOS2KrnlMTETst(void)
    565 {
    566     KLOGENTRY0("PMTE");
    567     static MTE    KrnlMTE;
    568     static SMTE   KrnlSMTE;
    569 
    570     KrnlMTE.mte_swapmte = &KrnlSMTE;
    571     KrnlSMTE.smte_objtab = &aKrnlOTE[0];
    572     KrnlSMTE.smte_objcnt = cObjectsFake;
    573 
    574     KLOGEXIT(&KrnlMTE);
    575     return &KrnlMTE;
    576 }
    577 
    578 #endif
    579 
    580 
    581 /**
    582  * Forwarder for ASMR0Addr32bit which only purpose is to
    583  * initate a logging sequence.
    584  * @returns what ever the function returned.
    585  * @param   ulParam     User argument.
    586  * @param   pfn         Address (32-bit FLAT) of the function to call.
    587  * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    588  */
    589 ULONG R0Addr32bit(ULONG ulParam, PFN pfn)
    590 {
    591     KLOGSTART2("ULONG", "ULONG ulParam, PFN pfn", ulParam, pfn);
    592     ULONG rc;
    593 
    594     rc = pfn(ulParam);
    595 
    596     KLOGSTOP(rc);
    597     return rc;
    598 }
Note: See TracChangeset for help on using the changeset viewer.