Ignore:
Timestamp:
Feb 21, 2000, 5:45:47 AM (26 years ago)
Author:
bird
Message:

ProbKrnl and code for importing krnl symbols has been enhanched.
Now we'll lock 32-bit segments into memory too.
And some other fixes...

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

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/dev16/d16init.c

    r1678 r2836  
    1 /* $Id: d16init.c,v 1.4 1999-11-10 01:45:30 bird Exp $
     1/* $Id: d16init.c,v 1.5 2000-02-21 04:45:45 bird Exp $
    22 *
    33 * d16init - init routines for both drivers.
     
    4848 * @remark    pRpIn and pRpOut points to the same memory.
    4949 */
    50 USHORT _near dev0Init(PRPINITIN pRpIn, PRPINITOUT pRpOut)
     50USHORT NEAR dev0Init(PRPINITIN pRpIn, PRPINITOUT pRpOut)
    5151{
    5252    Device_Help = pRpIn->DevHlpEP;
     
    7070 * @remark    pRpIn and pRpOut points to the same memory.
    7171 */
    72 USHORT _near dev1Init(PRPINITIN pRpIn, PRPINITOUT pRpOut)
     72USHORT NEAR dev1Init(PRPINITIN pRpIn, PRPINITOUT pRpOut)
    7373{
    7474    APIRET          rc;
     
    103103            }
    104104            else
    105                 npszErrMsg = "DosDevIOCtl failed.\n\r";
     105            {
     106                APIRET rc2 = rc;
     107                NPSZ   npsz;
     108                            /*0123456789012345678901234567890 1*/
     109                npszErrMsg = "DosDevIOCtl failed. rc=       \n\r";
     110
     111                npsz  = &npszErrMsg[29];
     112                do
     113                {
     114                    *npsz-- = (char)((rc2 % 10) + '0');
     115                    rc2 = rc2/10;
     116                } while (rc2 > 0);
     117            }
     118
    106119            DosClose(hDev0);
    107120        }
     
    133146 * @param     pRp  Generic IO Control request packet.
    134147 */
    135 USHORT R0Init16(PRP_GENIOCTL pRp)
     148USHORT NEAR R0Init16(PRP_GENIOCTL pRp)
    136149{
    137150    USHORT usRc = STATUS_DONE;
    138151    APIRET rc;
    139     PDOSTABLE  pDT;
    140     PDOSTABLE2 pDT2;
    141152
    142153    /* First we're to get the DosTable2 stuff. */
    143     rc = DevHelp_GetDOSVar(9, 0, &pDT);
     154    rc = initGetDosTableData();
    144155    if (rc == NO_ERROR)
    145156    {
     
    150161        ULONG ulLinData;
    151162
    152         pDT2 = (PDOSTABLE2)((char FAR *)pDT + pDT->cul*4 + 1);
    153         TKSSBase16 = (ULONG)pDT2->pTKSSBase;
    154         R0FlatCS16 = (USHORT)pDT2->R0FlatCS;
    155         R0FlatDS16 = (USHORT)pDT2->R0FlatDS;
    156163        if (!DevHelp_VirtToLin(SELECTOROF(pRp->ParmPacket), OFFSETOF(pRp->ParmPacket), &ulLinParm)
    157164            &&
     
    159166            )
    160167        {
    161             if (!(rc = DevHelp_VMLock(VMDHL_LONG | VMDHL_WRITE | VMDHL_VERIFY,
     168            if (!(rc = DevHelp_VMLock(VMDHL_LONG | VMDHL_WRITE,
    162169                                ulLinParm, sizeof(D16R0INITPARAM),
    163170                                (LIN)~0UL, SSToDS_16(&hLockParm[0]), &cPages))
    164171                &&
    165                 !DevHelp_VMLock(VMDHL_LONG | VMDHL_WRITE | VMDHL_VERIFY,
     172                !DevHelp_VMLock(VMDHL_LONG | VMDHL_WRITE,
    166173                                ulLinData, sizeof(D16R0INITDATA),
    167174                                (LIN)~0UL, SSToDS_16(&hLockData[0]), &cPages)
     
    215222    return usRc;
    216223}
     224
     225
     226
     227/**
     228 * Gets the data we need from the DosTables.
     229 * This data is TKSSBase16, R0FlatCS16 and R0FlatDS16.
     230 * @returns   Same as DevHelp_GetDosVar.
     231 * @status    completely implemented.
     232 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     233 * @remark    If you are not sure if TKSSBase16 is set or not, call this.
     234 *            After R0Init16 is called TKSSBase16 _is_ set.
     235 *            IMPORTANT! This function must _not_ be called after the initiation of the second device driver!!!
     236 */
     237USHORT NEAR initGetDosTableData(void)
     238{
     239    APIRET     rc;
     240    PDOSTABLE  pDT;
     241    PDOSTABLE2 pDT2;
     242
     243    if (TKSSBase16 != 0)
     244        return NO_ERROR;
     245
     246    /* First we're to get the DosTable2 stuff. */
     247    rc = DevHelp_GetDOSVar(9, 0, &pDT);
     248    if (rc == NO_ERROR)
     249    {
     250        pDT2 = (PDOSTABLE2)((char FAR *)pDT + pDT->cul*4 + 1);
     251        TKSSBase16 = (ULONG)pDT2->pTKSSBase;
     252        R0FlatCS16 = (USHORT)pDT2->R0FlatCS;
     253        R0FlatDS16 = (USHORT)pDT2->R0FlatDS;
     254    }
     255    return rc;
     256}
  • trunk/src/win32k/dev16/d16strat.c

    r2832 r2836  
    1 /* $Id: d16strat.c,v 1.5 2000-02-20 04:27:22 bird Exp $
     1/* $Id: d16strat.c,v 1.6 2000-02-21 04:45:45 bird Exp $
    22 *
    33 * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr)
     
    145145            {
    146146                ULONG ulLin;
     147                if (fInitTime && TKSSBase16 == 0)
     148                    initGetDosTableData();
    147149                if (DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket),
    148150                                      &ulLin) != NO_ERROR)
     
    153155            case D16_IOCTL_VERIFYPROCTAB:
    154156                if (fInitTime)
     157                {
     158                    if (TKSSBase16 == 0)
     159                        initGetDosTableData();
    155160                    return CallVerifyImportTab32();
     161                }
    156162                break;
    157163        }
  • trunk/src/win32k/dev16/probkrnl.c

    r2832 r2836  
    1 /* $Id: probkrnl.c,v 1.12 2000-02-20 04:27:23 bird Exp $
     1/* $Id: probkrnl.c,v 1.13 2000-02-21 04:45:45 bird Exp $
    22 *
    33 * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
     
    157157*   Internal Functions                                                         *
    158158*******************************************************************************/
     159/* File an output replacements */
    159160static HFILE    fopen(const char * pszFilename, const char * pszIgnored);
    160161static int      fread(void * pvBuffer, USHORT cbBlock, USHORT cBlock,  HFILE hFile);
     
    163164static void     puts(char *psz);
    164165
     166/* C-library replacements. */
    165167static void     kmemcpy(char *psz1, const char *psz2, int cch);
    166168static char *   kstrstr(const char *psz1, const char *psz2);
    167169static int      kstrcmp(const char *psz1, const char *psz2);
    168170static int      kstrncmp(const char *psz1, const char *psz2, int cch);
     171static int      kstrnicmp(const char *psz1, const char *psz2, int cch);
    169172static int      kstrlen(const char *psz);
    170173static int      kargncpy(char *pszTarget, const char *pszArg, unsigned cchMaxlen);
    171174
     175/* Workers */
    172176static int      VerifyPrologs(void);
    173177static int      ProbeSymFile(char *pszFilename);
     
    177181static int      GetKernelOTEs(void);
    178182
     183/* Ouput */
    179184static void     ShowDecNumber(unsigned long ul);
    180185static void     ShowHexNumber(unsigned long ul);
     
    338343
    339344
    340 
    341345/**
    342346 * kstrncmp - String 'n' compare.
     
    360364
    361365
     366#if 0 /* not in use */
     367/**
     368 * kstrnicmp - String 'n' compare, case-insensitive.
     369 * @returns   0 - equal else !0
     370 * @param     p1  String 1
     371 * @param     p2  String 2
     372 * @param     len length
     373 */
     374static int      kstrnicmp(const char *psz1, const char *psz2, int cch)
     375{
     376    register char ch1, ch2;
     377
     378    do
     379    {
     380        ch1 = *psz1++;
     381        if (ch1 >= 'A' && ch1 <= 'Z')
     382            ch1 += 'a' - 'A';           /* to lower case */
     383        ch2 = *psz2++;
     384        if (ch2 >= 'A' && ch2 <= 'Z')
     385            ch2 += 'a' - 'A';           /* to lower case */
     386    } while (--cch > 0 && ch1 == ch2 && ch1 != '\0' && ch2 != '\0');
     387
     388    return ch1 - ch2;
     389}
     390#endif
     391
     392
    362393/**
    363394 * kstrlen - String length.
     
    431462
    432463/*******************************************************************************
    433 *   Implementation Of The Important Function                                   *
     464*   Implementation Of The Important Functions                                  *
    434465*******************************************************************************/
    435466
     
    727758 * @param     filename   Filename of the OS/2 kernel.
    728759 * @result    ulBuild is set.
     760 * @remark    This step will be eliminated by searching thru the DOSGROUP datasegment
     761 *            in the kernel memory. This segment have a string "Internal revision 9.034[smp|uni]"
     762 *            This would be much faster than reading the kernel file. It will also give us a more precise
     763 *            answer to the question! This is currently a TODO issue. !FIXME!
    729764 */
    730765static int ReadOS2Krnl(char * pszFilename)
     
    11171152                    case 'S': /* Symbol file */
    11181153                        i++;
    1119                         i += kargncpy(szUsrSym, &pReqPack->InitArgs[i], sizeof(szUsrSym));
     1154                        if (pReqPack->InitArgs[i] == 'Y' || pReqPack->InitArgs[i] == 'y')
     1155                            i += kargncpy(szUsrSym, &pReqPack->InitArgs[i], sizeof(szUsrSym));
    11201156                        break;
    11211157
Note: See TracChangeset for help on using the changeset viewer.