VirtualBox

Changeset 31434 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Aug 6, 2010 10:56:38 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64500
Message:

vgaInfoText: dump more, check more, still stuff left to be done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r31195 r31434  
    18151815    s1 = s->vram_ptr + (s->start_addr * 4);
    18161816#else /* VBOX */
    1817     s1 = s->CTX_SUFF(vram_ptr) + (s->start_addr * 8);
     1817    s1 = s->CTX_SUFF(vram_ptr) + (s->start_addr * 8); /** @todo r=bird: Add comment why we do *8 instead of *4, it's not so obvious... */
    18181818#endif /* VBOX */
    18191819
     
    46294629static DECLCALLBACK(void) vgaInfoText(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
    46304630{
    4631     PVGASTATE   pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
    4632     uint8_t     *src;
    4633     unsigned    row, col;
    4634     unsigned    num_rows = 25, num_cols = 80;
    4635 
    4636     /* Pure paranoia... */
    4637     Assert(num_rows * num_cols * 8 <= pThis->vram_size);
    4638 
    4639     src = pThis->vram_ptrR3;
    4640     if (src)
    4641     {
    4642         for (col = 0; col < num_cols; ++col)
    4643             pHlp->pfnPrintf(pHlp, "-");
    4644         pHlp->pfnPrintf(pHlp, "\n");
    4645         for (row = 0; row < num_rows; ++row)
     4631    PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
     4632    if (!(pThis->gr[6] & 1))
     4633    {
     4634        uint8_t *pbSrc = pThis->vram_ptrR3;
     4635        if (pbSrc)
    46464636        {
    4647             for (col = 0; col < num_cols; ++col)
     4637            /*
     4638             * Figure out the display size and where the text is.
     4639             *
     4640             * Note! We're cutting quite a few corners here and this code could
     4641             *       do with some brushing up.  Dumping from the start of the
     4642             *       frame buffer is done intentionally so that we're more
     4643             *       likely to obtain the full scrollback of a linux panic.
     4644             */
     4645            uint32_t cbLine;
     4646            uint32_t offStart;
     4647            uint32_t uLineCompareIgn;
     4648            vga_get_offsets(pThis, &cbLine, &offStart, &uLineCompareIgn);
     4649
     4650            uint32_t cRows = offStart / cbLine + 25;
     4651            uint32_t cCols = cbLine / 8;
     4652            if (cRows * cCols * 8 <= pThis->vram_size)
    46484653            {
    4649                 if (RT_C_IS_PRINT(*src))
    4650                     pHlp->pfnPrintf(pHlp, "%c", *src);
    4651                 else
    4652                     pHlp->pfnPrintf(pHlp, ".");
    4653                 src += 8;   /* chars are spaced 8 bytes apart */
     4654                /*
     4655                 * Do the dumping.
     4656                 */
     4657                uint32_t row, col;
     4658                for (col = 0; col < cCols; ++col)
     4659                    pHlp->pfnPrintf(pHlp, "-");
     4660                pHlp->pfnPrintf(pHlp, "\n");
     4661                for (row = 0; row < cRows; ++row)
     4662                {
     4663                    if (offStart != 0 && pbSrc == pThis->vram_ptrR3 + offStart)
     4664                        for (col = 0; col < cCols; ++col)
     4665                            pHlp->pfnPrintf(pHlp, "-");
     4666                    for (col = 0; col < cCols; ++col)
     4667                    {
     4668                        if (RT_C_IS_PRINT(*pbSrc))
     4669                            pHlp->pfnPrintf(pHlp, "%c", *pbSrc);
     4670                        else
     4671                            pHlp->pfnPrintf(pHlp, ".");
     4672                        pbSrc += 8;   /* chars are spaced 8 bytes apart */
     4673                    }
     4674                    pbSrc += cbLine & 7;
     4675                    pHlp->pfnPrintf(pHlp, "\n");
     4676                }
     4677                for (col = 0; col < cCols; ++col)
     4678                    pHlp->pfnPrintf(pHlp, "-");
     4679                pHlp->pfnPrintf(pHlp, "\n");
    46544680            }
    4655             pHlp->pfnPrintf(pHlp, "\n");
    4656         }
    4657         for (col = 0; col < num_cols; ++col)
    4658             pHlp->pfnPrintf(pHlp, "-");
    4659         pHlp->pfnPrintf(pHlp, "\n");
     4681            else
     4682                pHlp->pfnPrintf(pHlp, "Outside VRAM! (%ux%u)\n", cRows, cCols);
     4683        }
     4684        else
     4685            pHlp->pfnPrintf(pHlp, "VGA memory not available!\n");
    46604686    }
    46614687    else
    4662     {
    4663         pHlp->pfnPrintf(pHlp, "VGA memory not available!\n");
    4664     }
     4688        pHlp->pfnPrintf(pHlp, "Not in text mode!\n");
    46654689}
    46664690
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette