Index: trunk/i386/boot2/graphics.c =================================================================== --- trunk/i386/boot2/graphics.c (revision 2149) +++ trunk/i386/boot2/graphics.c (revision 2150) @@ -44,6 +44,30 @@ #define VIDEO(x) (bootArgs->Video.v_ ## x) //========================================================================== +// getVBEVideoRam + +uint32_t getVBEVideoRam() +{ + VBEInfoBlock vbeInfo; + int err, small; + char *buff = malloc(sizeof(char)*256); + if(!buff) return 0; + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if (err != errSuccess) + return 0; + + if ( strncmp( (char *)vbeInfo.VESASignature, "VESA", 4 ) ) + return 0; + + small = (vbeInfo.TotalMemory < 16); + + return vbeInfo.TotalMemory * 64 * 1024; +} + +//========================================================================== // getVBEInfoString char *getVBEInfoString() Index: trunk/i386/boot2/graphics.h =================================================================== --- trunk/i386/boot2/graphics.h (revision 2149) +++ trunk/i386/boot2/graphics.h (revision 2150) @@ -37,7 +37,7 @@ int loadEmbeddedPngImage(uint8_t *pngData, int pngSize, uint16_t *width, uint16_t *height, uint8_t **imageData); - +uint32_t getVBEVideoRam(); char *getVBEInfoString(); char *getVBEModeInfoString(); void getGraphicModeParams(unsigned long params[]);