SlideShare a Scribd company logo
1 of 100
Download to read offline
VESA®
Video Electronics Standards Association
2150NorthFirst Street, Suite 440 Phone: (408) 435-0333
San Jose, CA 95131-2029 FAX: (408) 435-8225
VESA BIOS EXTENSION (VBE)
Core Functions
Standard
Version: 2.0
Document Revision: 1.1
Ratification Date: November 18, 1994
Purpose
Tostandardizeamodular,softwareinterfacetodisplayandaudiodevices. TheVBEinterfaceis
intendedtosimplifyandencouragethedevelopmentofapplicationsthatwishtousegraphics, video, and
audiodeviceswithoutspecificknowledgeoftheinternaloperationoftheevolvingtargethardware.
Summary
TheVBEstandarddefines aset ofextensions totheVGAROMBIOSservices. These functions can
beaccessedunderDOSthroughinterrupt 10h, orbecalleddirectlybyhighperformance32-bit
applicationsandoperatingsystems otherthanDOS.
Theseextensionsalsoprovideahardware-independentmechanismtoobtainvendorinformation, and
serveasanextensiblefoundationforOEMsandVESAtofacilitaterapidsoftwaresupport ofemerging
hardwaretechnologywithoutsacrificingbackwardscompatibility.
VBE Core Standard
Page ii VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
VBECOREFUNCTIONSVERSION2.0 Pageiii
DOCUMENTREVISION1.1
Intellectual Property
Copyright©1993,1995-VideoElectronics Standards Association. Duplicationofthis document
withinVESAmembercompaniesforreviewpurposes is permitted. Thisdocumentmaybe posted
onlineinitsunmodified,read-onlyformatonly.Nocharges,otherthanstandardconnect ordownload
charges,maybeassessedforthis document. Allotherrightsreserved.
Whileeveryprecautionhasbeentakeninthepreparationofthis standard, theVideoElectronics
StandardsAssociationanditscontributorsassumenoresponsibilityforerrors oromissions, andmake
nowarranties,expressedorimplied,offunctionalityorsuitabilityforanypurpose.
Thesamplecodecontainedwithin thisstandardmaybeusedwithout restriction.
Trademarks
Alltrademarksusedinthisdocument arepropertyoftheirrespectiveowners.
• VESA, VBE, VESADDC, VBE/AI, VBE/PM, and VBE/DDCare trademarks ofVideo
ElectronicsStandardsAssociation.
• MS-DOSand Windows are trademarks ofMicrosoft , Inc.
• IBM, VGA, EGA, CGA, andMDAaretrademarks ofInternational Business Machines
• RAMDACis a trademark ofBrooktree Corp.
• HerculesisatrademarkofHercules ComputerTechnology, Inc.
Patents
VESAproposal andstandards documents areadoptedbytheVideoElectronics Standards Association
withoutregardtowhethertheiradoptionmayinvolvepatents onarticles, materials, orprocesses. Such
adoptiondoesnotassumeanyliabilitytoanypatentowner, nordoes it assumeanyobligationwhatever
toparties adoptingtheproposal orstandards document.
Support for this Specification
Clarificationsandapplicationnotestosupportthisstandardwill bepublishedas theneedarises. To
obtainthelateststandardandsupport documentation, contact VESA.
Ifyouhaveaproductwhichincorporates VBE, youshouldaskthecompanythat manufacturedyour
productforassistance. Ifyouareadisplayorcontrollermanufacturer, VESAcanassist youwithany
clarificationyoumayrequire. AllcommentsorreportederrorsshouldbesubmittedinwritingtoVESA
usingoneofthefollowingmechanisms:
World Wide Web: www.vesa.org Mail to:
E-mail: techsupport@vesa.org VideoElectronicsStandardsAssociation
Fax: 408-435-8225 2150NorthFirst Street, Suite 440
Voice: 408-435-0333 SanJose, California95131-2029
Page iv VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
SSC/VBE Workgroup Members
Anyindustrystandardrequiresinput frommanysources. Thepeoplelistedbelowweremembers ofthe
VBEWorkgroupoftheSoftwareStandards Committee(SSC)whichwas responsibleforcombiningall
oftheindustryinputintothisproposal:
CHAIRMAN
Kevin Gillett, S-MOS Systems, Inc.,
past chairman, Rod Dewell , Excalibur Solutions
MEMBERS
David Penley, AT&T Global Information Solutions
Rebecca Nolan, Chips and Technologies, Inc.
Brad Haakenson, Cirrus Logic, Inc.
Joe Rickson, Logitech, Inc.
Aaron Leatherman, LSI Logic Corporation
Jake Richter, Panacea Inc.
Raluca Iovan, Phoenix Technologies Ltd.
Kendall Bennett, SciTech Software
Tom Ryan, SciTech Software
George Bystricky, S-MOS Systems, Inc.
Jason Li, Trident Microsystems, Inc.
Chris Tsang, ULSISystems
GregMoore, VideoElectronics Standards Association
Andy Lambrecht, VLSI Technology, Inc.
Rex Wolfe, Western Digital Imaging
VBECOREFUNCTIONSVERSION2.0 Page v
DOCUMENTREVISION1.1
Table of Contents
INTELLECTUAL PROPERTY .....................................................................................................................................................iii
TRADEMARKS ...................................................................................................................................................................................iii
PATENTS............................................................................................................................................................................................iii
SUPPORT FORTHISSPECIFICATION...................................................................................................................................iii
SSC/VBE WORKGROUPMEMBERS........................................................................................................................................iv
TABLE OFCONTENTS..................................................................................................................................................................v
1.0INTRODUCTION...................................................................................................................................................................... 1
1.1SCOPE OF THE VBESTANDARD...............................................................................................................................................1
1.2 BACKGROUNDER ........................................................................................................................................................................2
2.0 VBE OVERVIEW......................................................................................................................................................................5
2.1 VBE FEATURES...........................................................................................................................................................................5
2.2 VBE AFFECTEDDEVICES..........................................................................................................................................................5
2.3 PROVIDINGVENDORINFORMATION.......................................................................................................................................5
3.0 VBE MODE NUMBERS...........................................................................................................................................................6
4.0 VBE FUNCTIONS...................................................................................................................................................................10
4.1 VBE RETURN STATUS .............................................................................................................................................................10
4.2 PROTECTED MODE CONSIDERATIONS................................................................................................................................11
4.3 FUNCTION 00H - RETURN VBECONTROLLERINFORMATION.........................................................................................12
4.4 FUNCTION 01H - RETURN VBE MODE INFORMATION ......................................................................................................16
4.5 FUNCTION 02H - SET VBE MODE.........................................................................................................................................25
4.6 FUNCTION 03H - RETURN CURRENT VBE MODE...............................................................................................................26
4.7 FUNCTION 04H - SAVE/RESTORESTATE ............................................................................................................................27
4.8 FUNCTION 05H - DISPLAYWINDOW CONTROL.................................................................................................................27
4.9 FUNCTION 06H - SET/GET LOGICALSCANLINE LENGTH ................................................................................................28
4.10 FUNCTION 07H - SET/GET DISPLAYSTART ......................................................................................................................29
4.11 FUNCTION 08H - SET/GET DAC PALETTE FORMAT........................................................................................................30
4.12 FUNCTION 09H - SET/GET PALETTE DATA.......................................................................................................................30
4.13 FUNCTION 0AH - RETURN VBEPROTECTED MODE INTERFACE ..................................................................................31
5.0VBESUPPLEMENTAL SPECIFICATIONS......................................................................................................................34
5.1 PURPOSEOFSUPPLEMENTAL SPECIFICATIONS ................................................................................................................34
5.2 OBTAININGSUPPLEMENTAL VBEFUNCTIONNUMBERS.................................................................................................34
5.3 REQUIREDVBESUPPLEMENTAL SPECIFICATION COMPONENTS..................................................................................35
5.3.1 VBE Supplemental Specification Functions..............................................................................................................35
5.3.2 Return Status....................................................................................................................................................................35
5.3.3 Subfunction 00h - Return VBE Supplemental Specification Information ............................................................35
5.4 SUPPLEMENTAL SPECIFICATION PROTECTED MODE GUIDELINES..............................................................................38
5.5 LOADINGSUPPLEMENTAL DRIVERS ....................................................................................................................................39
5.6 IMPLEMENTATION QUESTIONS ............................................................................................................................................39
Page vi VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
5.7 KNOWN SUPPLEMENTAL SPECIFICATIONS........................................................................................................................40
5.7.1 Function 10h - Power Management Extensions (PM).............................................................................................40
5.7.2 Function 11h - Flat Panel Interface Extensions (FP)..............................................................................................40
5.7.3 Function 12h - Cursor Interface Extensions (CI).....................................................................................................40
5.7.4 Function 13h - Audio Interface Extensions (AI) .......................................................................................................40
5.7.5 Function 14h - OEM Extensions ..................................................................................................................................40
5.7.6 Function 15h - Display Data Channel (DDC) ..........................................................................................................40
5.7.7 Function 16h - Graphics System Configuration (GC).............................................................................................40
APPENDIX1-VBEQUICKREFERENCE................................................................................................................................41
APPENDIX 2 - VBE DATA STRUCTURES..............................................................................................................................47
APPENDIX 3 - VBE SUPPLEMENTAL SPECS. .....................................................................................................................61
APPENDIX4-VBEIMPLEMENTATIONCONSIDERATIONS .........................................................................................63
A4.1 MINIMUM FUNCTIONALITY REQUIREMENTS..................................................................................................................63
A4.1.1 Required VBE Services...............................................................................................................................................63
A4.1.2 Minimum ROM Implementation................................................................................................................................63
A4.1.3 TSR Implementations ..................................................................................................................................................63
A4.2 VGA BIOS IMPLICATIONS....................................................................................................................................................64
A4.3 ROM SPACE LIMITATIONS..................................................................................................................................................65
A4.3.1 Data Storage ................................................................................................................................................................65
A4.3.2 Removal of Unused VGA Fonts .................................................................................................................................65
A4.3.3 Deleting VGA Parameter Tables...............................................................................................................................66
A4.3.4 Increasing ROM Space...............................................................................................................................................66
4.3.5 Support of VGA TTY Functions....................................................................................................................................66
A4.4 IMPLEMENTATION NOTESBY FUNCTION........................................................................................................................67
A4.4.1 General Notes...............................................................................................................................................................67
A4.4.2 Function 00h - Return VBE Controller Information.............................................................................................67
A4.4.3 Function 01h - Return VBE Mode Information......................................................................................................68
A4.4.4 Function 02h - Set VBE Mode...................................................................................................................................68
A4.4.5 Function 03h - Return Current VBE Mode.............................................................................................................69
A4.4.6 Function 05h - Display Window Control................................................................................................................69
A4.4.7 Function 06h - Get/Set Logical Scan Line Length................................................................................................70
A4.4.8 Function 07h - Get/Set Display Start ......................................................................................................................70
A4.4.9 Function 08h - Set/Get DAC Palette Format.........................................................................................................70
A4.4.10 Function 09h - Set/Get Palette Data......................................................................................................................70
A4.4.11 Function 0Ah - Return VBE Function Information..............................................................................................71
A4.5 PLUGANDPLAY ISSUES ........................................................................................................................................................71
A4.6 SUPPORTING MULTIPLE CONTROLLERS..........................................................................................................................71
A4.6.1 Dual-Controller Designs............................................................................................................................................71
A4.6.2 Provision for Multiple Independent Controllers...................................................................................................71
A4.7 DISPLAYREFRESHRATES ANDINTERLACING .................................................................................................................72
A4.8 OEM EXTENSIONSTOVBE ..................................................................................................................................................72
A4.9 CERTIFICATION REQUIREMENTS .......................................................................................................................................73
A4.9.1 VBETest Utility.............................................................................................................................................................73
A4.9.2 Communication with VESA Office............................................................................................................................73
VBECOREFUNCTIONSVERSION2.0 Pagevii
DOCUMENTREVISION1.1
APPENDIX5 - APPLICATIONPROGRAMMING CONSIDERATIONS..........................................................................74
A5.1 APPLICATION DEVELOPER'SSAMPLE SOURCE...............................................................................................................74
C Language Module.................................................................................................................................................................74
Assembly Language Module ...................................................................................................................................................84
A5.2 IMPLEMENTATION NOTESBY FUNCTION........................................................................................................................84
A5.2.1 General Notes...............................................................................................................................................................84
A5.2.2 Function 00h - Return VBE Controller Information.............................................................................................84
A5.2.3 Function 01h - Return VBE Mode Information......................................................................................................85
A5.2.4 Function 02h - Set VBE Mode...................................................................................................................................85
A5.2.5 Function 03h - Return Current VBE Mode.............................................................................................................86
A5.2.6 Function 05h - Display Window Control................................................................................................................86
A5.2.7 Function 06h - Get/Set Logical Scan Line Length................................................................................................86
A5.2.8 Function 07h - Get/Set Display Start ......................................................................................................................87
A5.2.9 Function 08h - Set/Get DAC Palette Format.........................................................................................................87
A5.2.10 Function 09h - Set/Get Palette Data......................................................................................................................87
A5.2.11 Function 0Ah - Return VBE Function Information..............................................................................................88
APPENDIX6-DIFFERENCESBETWEENVBE REVISIONS .............................................................................................89
6.1 VBE 1.0................................................................................................................................................................................89
6.2 VBE 1.1................................................................................................................................................................................89
6.3 VBE 1.2................................................................................................................................................................................89
6.4 VBE 2.0................................................................................................................................................................................89
6.5 VBE 2.0, Rev. 1.1................................................................................................................................................................90
APPENDIX7-RELATEDDOCUMENTS.................................................................................................................................93
Introduction
VBECOREFUNCTIONSVERSION2.0 Page1
DOCUMENTREVISION1.1
1.0 Introduction
This document contains the VESA BIOS Extension (VBE) specification for standard software access to
graphics displaycontrollers which support resolutions, color depths, and frame buffer organizations
beyond the VGA hardware standard. It is intended for use by both applications programmers and
system software developers.
System software developers may use this document to supplement the System and INT 10h ROM
BIOS functions to provide the VBE services. Application developers can use this document as a guide
to programming all VBE compatible devices.
To understand the VBE specification, some knowledge of 80x86 assembly language and the VGA
hardware registers may be required. However, the services described in this specification may be
called fromanyhigh-level programming language that provides a mechanism for generating software
interrupts with the 80x86 registers set to user-specified values.
In this specification, 'VBE' and 'VBE 2.0' are synonymous with 'VBE Core Functions version 2.0'.
1.1 Scope of the VBE Standard
TheprimarypurposeoftheVESAVBE is toprovidestandardsoftwaresupport forthemanyunique
implementationsofSuperVGA(SVGA)graphicscontrollersonthePCplatformthat providefeatures
beyondtheoriginalVGAhardwarestandard. Thisis toprovideafeasiblemechanismbywhich
applicationdeveloperscantakeadvantageofthisnonstandardhardwareingraphics applications.
TheVBEspecificationoffersanextensiblesoftwarefoundationwhichallowsittoevolveasdisplayand
audiodevicesevolveovertime,withoutsacrificingbackwardsoftwarecompatibilitywitholder
implementations. Newapplicationsoftwareshouldbeabletoworkwitholderhardware, and
applicationsoftwarethathasalreadyshippedshouldworkcorrectlyonnewhardwaredevices.
VBEservicesprovidestandardaccess toall resolutions andcolordepths providedonthedisplay
controller,andreporttheavailabilityanddetailsofallsupportedconfigurationstotheapplicationas
necessary.
VBEimplementationsfacilitatethefieldsupportofaudioanddisplayhardwarebyprovidingthe
applicationsoftwarewiththemanufacturer'snameandtheproductidentificationofthedisplay
hardware.
SincegraphicscontrollerservicesonthePCaretypicallyimplementedinROM, theVBEservices are
definedsothattheyshouldbeimplementedwithinthestandardVGAROM. WhenROM
implementations ofVBEarenot possible, orwhenfieldsoftwareupgrades totheonboardROMare
necessary, theVBEimplementationmaybealsoofferedas adevicedriverorDOSTerminateandStay
Resident(TSR)program.
Introduction
Page2 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
ThestandardVBEfunctions maybesupplementedbyOEM's as necessarytosupport customor
proprietaryfunctionsuniquetothemanufacturer. ThismechanismenablestheOEMtoestablish
functions that maybestandardtotheproduct line, orprovideaccess tospecial hardware
enhancements.
AlthoughpreviousVBEstandardsassumedthattheunderlyinggraphicsarchitecturewas aVGA
device,thedisplayservicesdescribedbyVBE2.0canbeimplementedonanyframebufferoriented
graphicsdevice.
ThemajorityofVBEservicesfacilitatethesetupandconfigurationofthehardware,allowing
applicationshighperformance,directaccesstotheconfigureddeviceatruntime. Tofurtherimprovethe
performanceofflatframebufferdisplaydevicesinextendedresolutions, VBE2.0provides new
memorymodelsthatdonotrequirethetraditionalframebuffer"banking"mechanisms.
VBEis expectedtoworkonall 80x86platforms, inreal and protected modes.
Sincesomemoderndisplaydevicesaredesignedwithout anyVGAsupport, twodisplaycontrollers
maybepresentinthesystem. OnedisplaycontrollerwouldbeusedforVGAcompatibility, andthe
otherusedforgraphicextensionstothebasicVGAmodes, resolutions, andframebuffermodels.
Therefore, VBEmust beableoffertheapplicationautomaticaccess totheappropriatedevicebasedon
themodeorresolutionthat is requestedbytheapplication.
CurrentlybeyondthescopeoftheVBEspecificationisthehandlingofhardwareconfigurationand
installationissues. It was originallyconsideredtobecomepart ofVBE2.0, howeverwehavedeferred
theissuestotheGraphicsConfigurationSupplementalSpecification. Inaddition,itisalsopossiblefor
anOEMtodefinetheirownextensionsusingtheOEMSupplementalSpecificationifrequired.
1.2 Backgrounder
TheIBMVGA1
has becomeadefactostandardinthePCgraphics world. Amultitudeofdifferent
VGAofferingsexistinthemarketplace,eachoneprovidingBIOSorregistercompatibilitywiththeIBM
VGA.MoreandmoreoftheseVGAcompatibleproducts implement various supersets oftheVGA
standard.Theseextensionsrangefromhigherresolutionsandmorecolors toimprovedperformanceand
evensomegraphicsprocessingcapabilities.Intensecompetitionhasdramaticallyimprovedthe
price/performanceratio, tothebenefit oftheenduser.
1
IBM and VGA are trademarks of International Business Machines Corporation.
Introduction
VBECOREFUNCTIONSVERSION2.0 Page3
DOCUMENTREVISION1.1
However, several serious problems faceasoftwaredeveloperwhointends totakeadvantageofthese
"SuperVGA"2
environments.Becausethereisnostandardhardwareimplementation, thedeveloperis
facedwithwidelydifferentSuperVGAhardwarearchitecture.Lackingacommonsoftwareinterface,
designingapplicationsfortheseenvironmentsiscostlyandtechnicallydifficult.Exceptforapplications
supportedbyOEM-specificdisplaydrivers, veryfewsoftwarepackages cantakeadvantageofthe
powerandcapabilities ofSuperVGAproducts.
TheVBEstandardwasoriginallyconceivedtoenablethedevelopmentofapplications that wishedto
takeadvantageofdisplayresolutions andcolordepths beyondtheVGAdefinition. Theneedforan
applicationorsoftwarestandardwas recognizedbythedevelopers ofgraphichardwaretoencourage
theuseandacceptanceoftheirrapidlyadvancingproduct families. It becameobvious that themajority
ofsoftwareapplicationdevelopers didnot havetheresources todevelopandsupport customdevice
levelsoftwareforthehundreds ofdisplayboards onthemarket. Thereforetherichnewfeatures of
thesedisplaydeviceswerenotbeingusedoutsideoftherelativelysmall CADmarket, andonlythen
afterconsiderableeffort.
Indeed, theneedforastandardforSVGAdisplayadapters became so important that the VESA
organizationwasformedtoseekout asolution. Theoriginal VBEstandardwas devisedandagreed
uponbyeachoftheactivedisplaycontrollermanufacturers, andhas sincebeenadoptedbyDOS
applicationdeveloperstoenableuseofnon-VGAextendeddisplaymodes.
As timewent alongVBE1.1was createdtoaddmorevideomodes andincreasedlogical line
length/doublebufferingsupport. VBE1.2was createdtoaddmodes andalsoaddedhigh color
RAMDACsupport.
Inthethreeyears sinceVBE1.2was approved we have seen the standard become widelyaccepted
andmanysuccessful programs haveembracedVBE. However, it has becomeobvious that theneed
foramorerobustandextensiblestandardexists. Earlyextensions totheVGAstandardcontinuedusing
alloftheoriginalVGAI/Oportsandframebufferaddresstocommunicatewiththecontroller
hardware. Aswe'veseen,thesupportedresolutions andcolordepths havegrown, intelligent controllers
withBITBLTandLineDrawFunctionshavebecomecommon,andnewflat framebuffermemory
models haveappearedalongwithdisplaycontrollers that arenot basedonVGAinanyway. VBE2.0
andfutureextensionswillsupportnon-VGAbasedcontrollerswithnewfunctionsforreadingand
writingthepaletteandforaccess totheflat framebuffermodels.
2
The term "Super VGA" is used in this document for a graphics display controller implementing any superset of the
standard IBM VGA display adapter.
Introduction
Page4 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
VBE2.0,asdesigned,offerstheextensibilityandtherobustness that was lackingintheprevious
specifications,whileatthesametimeofferingbackwardscompatibility.
Inthefuture,weseetheneedforaddingsupplementalspecificationsforissueslikeMultimedia;
AdvancedGraphicsFunctions;and"PlugandPlay"features.
VBE Overview
VBECOREFUNCTIONSVERSION2.0 Page5
DOCUMENTREVISION1.1
2.0 VBE Overview
ThischapteroutlinesthevariousfeaturesandlimitationsoftheVBEstandard.
2.1 VBE Features
• StandardapplicationinterfacetoGraphicsControllers (SVGADevices).
• Standardmethodofidentifyingproductsandmanufacturers.
• ProvisionforOEMextensionsthroughSub-function14h.
• Simpleprotectedmodeinterface.
• Extensibleinterfacethroughsupplementalspecifications.
2.2 VBE Affected Devices
Allframebuffer-baseddevicesinthePCplatform(withtheexceptionofHercules, Monochrome
(MDA), CGAandEGAdevices)aresuitableforusewithintheVBEstandardtoenable access to the
devicebyVBE-compliantapplications.
2.3 Providing Vendor Information
TheVGAspecificationdoesnotprovideastandardmechanismtodeterminewhat graphicdeviceit is
runningon.OnlybyknowingOEM-specificfeaturescananapplicationdeterminethepresenceofa
particulargraphicscontrollerordisplayboard.Thisofteninvolvesreadingandtestingregisterslocated
atI/OaddressesuniquetoeachOEM. Bynot knowingwhat hardwareanapplicationis runningon,
few, ifany, oftheextendedfeatures ofthis hardwarecan be used.
TheVESABIOSExtensionprovidesseveralfunctionstoreturninformationaboutthegraphics
environment.Thesefunctionsreturnsystemlevelinformationaswellasgraphicsmodespecificdetails.
Function00hreturnsgeneralsystemlevelinformation,includinganOEMidentificationstring.The
functionalsoreturns apointertothesupportedVBEandOEMmodes. Function01h maybe used by
anapplicationtoobtainadditionalinformationabouteachsupportedmode.Function03hreturns the
currentVBEmode.
VBEModeNumbers
Page6 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
3.0 VBE Mode Numbers
StandardVGAmodenumbers are7bits wideandpresentlyrange from00h to 13h. OEMs have
definedextendeddisplaymodes intherange14hto7Fh. Values from80htoFFhcannot beused, since
VGABIOSFunction00h(Set videomode)interprets bit 7as a flagto clear or preserve display
memory.
Duetothelimitationsof7-bit modenumbers, theoptional VBEmodenumbers are14bits wide. To
initializeaVBEmode,themodenumberis passedintheBXregistertoVBEFunction02h(Set VBE
mode).
TheformatofVBEmodenumbersisas follows:
D0-D8 = Modenumber
IfD8==0, this is not a VESAdefined mode
IfD8== 1, this is a VESAdefined mode
D9-D13 = ReservedbyVESAforfutureexpansion(=0)
D14 = Linear/FlatFrameBufferSelect
IfD14 == 0, Use VGA Frame Buffer
IfD14==1, UseLinear/Flat Frame Buffer
D15 = PreserveDisplayMemorySelect
IfD15==0, Clear displaymemory
IfD14==1, Preserve displaymemory
Thus,VBEmodenumbersbeginat100h.Thismodenumberingschemeimplements standard7-bit
modenumbersforOEM-definedmodes. StandardVGAmodes maybeinitializedthrough VBE
Function02h(SetVBEmode)simplybyplacingthemodenumberinBLandclearingtheupperbyte
(BH).7-bitOEM-defineddisplaymodes maybeinitializedinthesameway. Notethat modes mayonly
beset ifthemodeexists in the VideoModeList pointedtobytheVideoModePTRreturnedinFunction
00h. Theexceptiontothis requirement is themodenumber81FFh.
Todate, VESAhas definedonespecial 7-bit mode number, 6Ah, for the 800x600, 16-color, 4-plane
graphics mode. Thecorresponding15-bit modenumberforthis modeis 102h. ThefollowingVBE
modenumbershavebeendefined:
GRAPHICS TEXT
15-bit 7-bit Resolution Colors 15-bit 7-bit Columns Rows
mode mode mode mode
number number number number
100h - 640x400 256 108h - 80 60
101h - 640x480 256 109h - 132 25
102h 6Ah 800x600 16 10Ah - 132 43
103h - 800x600 256 10Bh - 132 50
104h - 1024x768 16 10Ch - 132 60
105h - 1024x768 256
106h - 1280x1024 16
VBEModeNumbers
VBECOREFUNCTIONSVERSION2.0 Page7
DOCUMENTREVISION1.1
107h - 1280x1024 256
VBEModeNumbers
Page8 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
GRAPHICS
15-bit 7-bit Resolution Colors
mode mode
number number
10Dh - 320x200 32K(1:5:5:5:)
10Eh - 320x200 64K(5:6:5)
10Fh - 320x200 16.8M(8:8:8)
110h - 640x480 32K(1:5:5:5:)
111h - 640x480 64K(5:6:5)
112h - 640x480 16.8M(8:8:8)
113h - 800x600 32K(1:5:5:5:)
114h - 800x600 64K(5:6:5)
115h - 800x600 16.8M(8:8:8)
116h - 1024x768 32K(1:5:5:5:)
117h - 1024x768 64K(5:6:5)
118h - 1024x768 16.8M(8:8:8)
119h - 1280x1024 32K(1:5:5:5:)
11Ah - 1280x1024 64K(5:6:5)
11Bh - 1280x1024 16.8M(8:8:8)
81FFh Special Mode(seebelowfordetails)
Note: StartingwithVBEversion2.0,VESAwillnolongerdefinenewVESAmodenumbers andit will
notlongerbemandatorytosupport theseoldmodenumbers. However, it is highlyrecommendedthat
BIOSimplementationscontinuetosupportthesemodenumbersforcompatibilitywitholdersoftware.
VBE2.0-awareapplicationsshouldfollowtheguidelinesinAppendix5-ApplicationProgramming
Considerations -forsettingadesiredmode.
Note: Mode81FFhis aspecial modedesignedtopreservethecurrent memorycontents and give
accesstotheentirevideomemory. Thismodeisespeciallyusefulforsavingtheentirevideomemory
contents beforegoingintoastatethat couldlosethecontents (e.g., set this modetogainaccess toall
videomemorytosaveit beforegoingintoavolatilepowerdownstate). This modeis requiredbecause
theentirevideomemorycontents arenot always accessibleineverymode. It isrecommendedthat this
modebepackedpixel informat, andaModeInfoBlockmust bedefinedforit. However, it shouldnot
appearintheVideoModeList.LookintheModeInfoBlocktodetermineifpagingis requiredandhow
pagingissupportedifitis. Alsonotethattherearenoimpliedresolutionsortimingsassociatedwiththis
mode.
Note: FuturedisplayresolutionswillbedefinedbyVESAdisplayvendors. Thecolordepths will not
bespecifiedandnewmodenumbers will notbeassignedfortheseresolutions. Forexample, ifthe
VESAdisplayvendorsdefine1600x1200asaVESAresolution, applicationdevelopers shouldtarget
theirdisplayresolutionfor1600x1200ratherthanchoosinganarbitraryresolutionlike1550x1190.
TheVBEimplementationshouldbequeriedtogettheavailableresolutions andcolordepths andthe
VBEModeNumbers
VBECOREFUNCTIONSVERSION2.0 Page9
DOCUMENTREVISION1.1
applicationshouldbeflexibleenoughtoworkwiththislist. Appendix5givesadetailedsummaryofthe
wayanapplicationshouldgoaboutselectingandsettingmodes.
VBEFunctions
Page10 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
4.0 VBE Functions
Thischapterdescribesindetaileachofthefunctions definedbytheVBEstandard. VBEfunctions are
calledusingtheINT10hinterrupt vector, passingarguments inthe80X86registers. TheINT10h
interrupthandlerfirstdeterminesifaVBEfunctionhas beenrequested, andifso, processes that
request. Otherwisecontrol is passedtothestandardVGABIOSfor completion.
AllVBEfunctionsarecalledwiththeAHregistersetto4FhtodistinguishthemfromthestandardVGA
BIOSfunctions. TheALregisteris usedtoindicatewhichVBEfunctionis tobeperformed. For
supplementalorextendedfunctionalitytheBLregisterisusedwhenappropriatetoindicateaspecific
sub-function.
Functions00h-0FhhavebeenreservedforStandardVBEfunctionnumbers; Functions 10h-FFh are
reservedforVBESupplementalSpecifications.
InadditiontotheINT10hinterface, aProtectedModeInterfaceis availableand is described below.
4.1 VBE Return Status
TheAXregisterisusedtoindicatethecompletionstatus uponreturnfromVBEfunctions. IfVBE
supportforthespecifiedfunctionisavailable,the4FhvaluepassedintheAHregisteronentryis
returnedintheALregister. IftheVBEfunctioncompletedsuccessfully, 00his returnedintheAH
register. OtherwisetheAHregisteris set toindicatethenatureofthefailure.
VBERETURNSTATUS
AL == 4Fh: Functionissupported
AL != 4Fh: Functionisnotsupported
AH == 00h: Functioncallsuccessful
AH == 01h: Functioncallfailed
AH == 02h: Functionisnotsupportedinthecurrenthardwareconfiguration
AH == 03h: Functioncallinvalidincurrentvideomode
Note: Applicationsshouldtreatanynon-zerovalueintheAHregisterasageneral failureconditionas
laterversionsoftheVBEmaydefineadditional errorcodes.
VBEFunctions
00hReturnVBEControllerInformation
VBECOREFUNCTIONSVERSION2.0 Page11
DOCUMENTREVISION1.1
4.2 Protected Mode Considerations
VBEservices maybecalleddirectlyfrom32-bit protectedmodeonly.
For32-bit protectedmode, 2selector/segment descriptors for 32-bit code and the data segment are
needed.Thesewillbeallocatedandinitializedbythecaller.Thesegmentlimitfieldswillbeset to64k.
TheseselectorsmayeitherbeintheGDTorLDT, but must bevalidwhenevertheVBEis calledin
protectedmode. Thecallermust supplyastacklargeenoughforusebyVBEandbypotential interrupt
handlers.Thecaller'sstackwillbeactiveiforwheninterrupts areenabledintheVBEroutine, sincethe
VBEwillnotswitchstackswheninterruptsareenabled,includingNMIinterrupts. The32-bit VBE
interfacerequires a32-bit stack.
Ifthememorylocationis zero, thenonlyI/Omappedports will beusedsotheapplicationdoes not
needtodoanythingspecial. This shouldbethedefault caseforALLcards that have I/Omapped
registersbecauseit provides thebest performance.
Ifthememorylocationis nonzero(therecanbeonlyone), theapplicationwill needtocreateanew32-
bitselectorwiththebaseaddressthatpointstothe“physical”locationspecifiedwiththespecifiedlimit.
Whentheapplicationneeds tocall the32-bitbankswitchfunction,itmustthenloadtheES selector
withthevalueofthenewselectorthat has beencreated. Thebankswitchingcodecanthen directly
accessitsmemorymappedregisters as absoluteoffsets intotheESselector
(i.e., mov[es:10],eaxtoput avalueintotheregisterat base+10).
It is uptotheapplicationcodetosaveandrestoretheprevious stateofthe ESselector ifthis is
necessary(forexampleinflat model code).
WhentheVBEservices arecalled, thecurrent I/Opermissionbit mapmust allowaccess tothe I/O
ports that theVBEmayneedtoaccess. This can be found in the Sub-Table (Ports and Memory)
returnedbyVBEFunction0Ah.
Tosummarize,itistheresponsibilityofthecallingtoensuretothat it has theappropriateI/Oand
memoryprivileges, andalargeenoughstackandappropriateselectors allocated. It is alsothe
responsibilityofthecallingapplicationtopreserveregistersifnecessary.
Applicationsmustusethesameregisters fortheFunction05handFunction09hprotectedmode
interfacethattheywoulduseinarealmodecall. This includes theAXregister.
Function07hprotectedmodecalls haveadifferent format.
AX = 4F07h
BL = 00h Set DisplayCRTCStart
= 80h SetDisplayCRTCStart duringVertical Retrace
CX = Bits 0-15ofdisplaystart address
DX = Bits 16-31ofdisplaystart address
VBEFunctions
00hReturnVBEControllerInformation
Page12 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
Theprotectedmodeapplicationmust keeptrackofthecolordepthandscanlinelengthtocalculatethe
newstartaddress. Ifavaluethat is out ofrangeis programmed, unpredictableresults will occur.
4.3 Function 00h - Return VBE Controller Information
Thisrequiredfunctionreturnsthecapabilitiesofthedisplaycontroller,therevisionleveloftheVBE
implementation,andvendorspecificinformationtoassistinsupportingalldisplaycontrollersinthefield.
Thepurposeofthisfunctionistoprovideinformationtothecallingprogramaboutthegeneral
capabilitiesoftheinstalledVBEsoftwareandhardware.Thisfunctionfillsaninformationblockstructure
attheaddressspecifiedbythecaller. TheVbeInfoBlockinformationblocksizeis 256bytes forVBE
1.x, and 512 bytes for VBE2.0.
Input: AX = 4F00h ReturnVBEControllerInformation
ES:DI = Pointertobufferinwhichtoplace
VbeInfoBlockstructure
(VbeSignatureshouldbeset to'VBE2'when
functioniscalledtoindicateVBE2.0information
isdesiredandtheinformationblockis 512bytes in
size.)
Output: AX = VBEReturnStatus
Note: Allotherregisters arepreserved.
Theinformationblockhasthefollowingstructure:
VbeInfoBlockstruc
VbeSignature db 'VESA' ;VBESignature
VbeVersion dw 0200h ;VBEVersion
OemStringPtr dd ? ;PointertoOEMString
Capabilities db 4 dup (?) ;Capabilitiesofgraphicscontroller
VideoModePtr dd ? ;PointertoVideoModeList
TotalMemory dw ? ; Numberof64kbmemoryblocks
; Added for VBE 2.0
OemSoftwareRev dw ? ;VBEimplementationSoftwarerevision
OemVendorNamePtr dd ? ;PointertoVendorNameString
OemProductNamePtr dd ? ; PointertoProduct NameString
OemProductRevPtr dd ? ;PointertoProductRevisionString
Reserved db 222 dup (?) ;ReservedforVBEimplementationscratch
; area
OemData db 256 dup (?) ; DataAreaforOEMStrings
VbeInfoBlockends
VBEFunctions
00hReturnVBEControllerInformation
VBECOREFUNCTIONSVERSION2.0 Page13
DOCUMENTREVISION1.1
Note: AlldatainthisstructureissubjecttochangebytheVBEimplementationwhenVBEFunction
00his called. Therefore, it shouldnot beusedbytheapplicationtostoredataofanykind.
DescriptionoftheVbeInfoBlockstructurefields:
The VbeSignaturefieldisfilledwiththeASCIIcharacters'VESA'bytheVBEimplementation.VBE
2.0applicationsshouldpreset this fieldwiththeASCIIcharacters 'VBE2'toindicatetotheVBE
implementationthattheVBE2.0extendedinformationisdesired,andtheVbeInfoBlockis 512bytes in
size. UponreturnfromVBEFunction00h, this fieldshouldalways beset to'VESA'bytheVBE
implementation.
The VbeVersionisaBCDvaluewhichspecifieswhatleveloftheVBEstandardis implementedinthe
software.Thehigherbytespecifiesthemajorversionnumber.Thelowerbytespecifies theminor
versionnumber.
Note: The BCDvalue for VBE2.0 is 0200h and the BCDvalue for VBE1.2 is 0102h. In the past we
havehadsomeapplicationsmisinterpretingtheseBCDvalues. Forexample, BCD0102hwas
interpretedas 1.02, whichis incorrect.
The OemStringPtrisaRealModefarpointertoanullterminatedOEM-definedstring. This stringmay
beusedtoidentifythegraphicscontrollerchiporOEMproduct familyforhardwarespecificdisplay
drivers.Therearenorestrictionsontheformat ofthestring. This pointermaypoint intoeitherROMor
RAM,dependingonthespecificimplementation. VBE2.0BIOSimplementationsmustplacethisstring
intheOemDataareawithintheVbeInfoBlockif'VBE2'is preset intheVbeSignaturefieldonentryto
Function00h. Thismakes it possibletoconvert theRealModeaddress toanoffset withinthe
VbeInfoBlockforProtectedmodeapplications.
Note: ThelengthoftheOEMStringis not defined, but forspaceconsiderations, werecommenda
stringlengthoflessthan256bytes.
The Capabilities fieldindicatesthesupportofspecificfeaturesinthegraphicsenvironment.Thebits
aredefinedasfollows:
D0 = 0 DACisfixedwidth, with6bits perprimarycolor
= 1 DACwidthis switchableto8bits perprimarycolor
D1 = 0 ControllerisVGAcompatible
= 1 ControllerisnotVGAcompatible
D2 = 0 NormalRAMDACoperation
= 1 WhenprogramminglargeblocksofinformationtotheRAMDAC,
usetheblankbitinFunction09h.
D3-31 =Reserved
VBEFunctions
00hReturnVBEControllerInformation
Page14 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
BIOSImplementationNote: TheDACmust always berestoredto 6 bits per primaryas default upon
amodeset. Ifthe DAChas been switched to 8 bits per primary, the mode set must restore the DAC
to6bits perprimarytoensuretheapplicationdeveloperthat he does not have to reset it.
Application Developer's Note: IfaDACis switchable, youcanassume that the DACwill be
restoredto6bits perprimaryupona mode set. For an application to use a DAC, the application
programisresponsibleforsettingtheDACto8bits perprimarymodeusingFunction08h.
VGAcompatibilityisdefinedas supportingall standardIBMVGAmodes, fonts andI/Oports;
however,VGAcompatibilitydoesn't guaranteethat all modes whichcanbeset areVGAcompatible, or
thatthe8x14fontisavailable.
TheneedforD2=1"programtheRAMDACusingtheblankbit inFunction09h"is forolderstyle
RAMDACs,whereprogrammingtheRAMvaluesduringdisplaytimecausesa"snow-like"effect on
thescreen. NewerstyleRAMDACs don't havethis limitationandcaneasilybeprogrammedat any
time,but olderRAMDACs requirethat theybeblankedsoas not todisplaythesnowwhilevalues
changeduringdisplaytime. Thisbitinformsthesoftwarethatitshouldmakethefunctioncallwith
BL=80hratherthanBL=00htoensuretheminimizationofthe"snow-like"effect.
The VideoModePtr points toalist of modenumbers forall displaymodes supported bythe VBE
implementation. Eachmodenumberoccupies oneword(16bits). Thelist ofmodenumbers is
terminatedbya-1(0FFFFh). Themodenumbers inthis list represent all ofthepotentiallysupported
modes bythedisplaycontroller. RefertoChapter3foradescriptionofVESAVBEmode numbers.
VBE2.0BIOSimplementationsmust placethis modelist intheReservedareaoftheVbeInfoBlockor
haveitstaticallystoredwithintheVBEimplementationif'VBE2'ispresetintheVbeSignaturefieldon
entrytoFunction00h.
Note: Itisresponsibilityoftheapplicationtoverifytheactualavailabilityofanymodereturnedbythis
functionthroughtheReturnVBEModeInformation(VBEFunction01h)call.Someofthereturned
modesmaynotbeavailableduetotheactualamountofmemoryphysicallyinstalledonthedisplay
boardorduetothecapabilities oftheattachedmonitor.
Note: IfaVideoModeList is foundtocontainnoentries (starts with0FFFFh), it canbeassumed that
theVBEimplementationisa"stub"implementationwhereonlyFunction00hissupportedfordiagnostic
or"PlugandPlay"reasons. Thesestubimplementations arenot VBE2.0compliant andshouldonlybe
implementedincaseswherenospaceisavailabletoimplementtheentireVBE.
The TotalMemoryfieldindicatesthemaximumamountofmemoryphysicallyinstalledandavailableto
the frame buffer in 64KBunits. (e.g. 256KB= 4, 512KB= 8) Not all video modes can address all
thismemory,seetheModeInfoBlockfordetailedinformationabout theaddressablememoryforagiven
mode.
The OemSoftwareRev fieldisaBCDvaluewhichspecifiestheOEMrevisionlevel oftheVBE
software. Thehigherbytespecifiesthemajorversionnumber.Thelowerbytespecifies theminor
VBEFunctions
00hReturnVBEControllerInformation
VBECOREFUNCTIONSVERSION2.0 Page15
DOCUMENTREVISION1.1
versionnumber. ThisfieldcanbeusedtoidentifytheOEM's VBEsoftwarerelease. This fieldis only
filledinwhen'VBE2'ispresetintheVbeSignaturefieldonentrytoFunction00h.
The OemVendorNamePtrisapointerto anull-terminatedstringcontainingthenameofthevendor
whichproducedthedisplaycontrollerboardproduct. (This stringmaybecontainedinthe
VbeInfoBlockortheVBEimplementation.) Thisfieldisonlyfilledinwhen'VBE2'ispresetinthe
VbeSignaturefieldonentrytoFunction00h. (Note: thelengthofthestrings OemProductRev,
OemProductNameandOemVendorName(includingterminators)summed,mustfitwithina256byte
buffer;thisistoallowforreturnintheOemDatafieldifnecessary.)
The OemProductNamePtrisapointerto anull-terminatedstringcontainingtheproduct nameofthe
displaycontrollerboard. (ThisstringmaybecontainedintheVbeInfoBlockortheVBE
implementation.) Thisfieldisonlyfilledinwhen'VBE2'ispresetintheVbeSignaturefieldonentryto
Function00h. (Note: thelengthofthestrings OemProductRev, OemProductNameand
OemVendorName(includingterminators)summed,mustfitwithina256bytebuffer;thisistoallowfor
returnintheOemDatafieldifnecessary.)
The OemProductRevPtrisapointertoanull-terminatedstringcontainingtherevisionormanufacturing
levelofthedisplaycontrollerboardproduct. (This stringmaybecontainedintheVbeInfoBlockorthe
VBEimplementation.) Thisfieldcanbeusedtodeterminewhichproductionrevisionofthedisplay
controllerboardisinstalled. Thisfieldisonlyfilledinwhen'VBE2'ispresetintheVbeSignaturefieldon
entrytoFunction00h. (Note: thelengthofthestrings OemProductRev, OemProductNameand
OemVendorName(includingterminators)summed,mustfitwithina256bytebuffer;thisistoallowfor
returnintheOemDatafieldifnecessary.)
The ReservedfieldisaspacereservedfordynamicallybuildingtheVideoModeListifnecessaryifthe
VideoModeListisnotstaticallystoredwithintheVBEimplementation. Thisfieldshouldnotbeusedfor
anythingelse,andmaybereassignedinthefuture. Applicationsoftwareshouldnot assumethat
informationinthisfieldisvalid.
The OemDatafieldis a256bytedataareathat is usedtoreturnOEMinformation returned byVBE
Function00hwhen'VBE2'ispresetintheVbeSignaturefield. TheOemVendorNamestring,
OemProductNamestringandOemProductRevstringarecopiedintothis areabytheVBE
implementation. ThisareawillonlybeusedbyVBEimplementations 2.0andabovewhen'VBE2'is
presetintheVbeSignaturefield.
VBEFunctions
00hReturnVBEControllerInformation
Page16 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
4.4 Function 01h - Return VBE Mode Information
ThisrequiredfunctionreturnsextendedinformationaboutaspecificVBEdisplaymodefromthemode
listreturnedbyVBEFunction00h. Thisfunctionfillsthemodeinformationblock,ModeInfoBlock,
structurewithtechnicaldetailsontherequestedmode. TheModeInfoBlockstructureis providedby
theapplicationwithafixedsizeof256bytes.
InformationcanbeobtainedforalllistedmodesintheVideoModeList returnedinFunction00h. Ifthe
requestedmodecannotbeusedorisunavailable, abit will beset intheModeAttributes fieldtoindicate
thatthemodeisnotsupportedinthecurrentconfiguration.
Input: AX = 4F01h ReturnVBEmodeinformation
CX = Modenumber
ES:DI = PointertoModeInfoBlockstructure
Output: AX = VBEReturnStatus
Note: Allotherregisters arepreserved.
Themodeinformationblockhasthefollowingstructure:
ModeInfoBlockstruc
;MandatoryinformationforallVBErevisions
ModeAttributes dw ? ;modeattributes
WinAAttributes db ? ;windowAattributes
WinBAttributes db ? ;windowBattributes
WinGranularity dw ? ;windowgranularity
WinSize dw ? ;windowsize
WinASegment dw ? ;windowAstart segment
WinBSegment dw ? ;windowBstartsegment
WinFuncPtr dd ? ;pointertowindowfunction
BytesPerScanLine dw ? ;bytes perscanline
;MandatoryinformationforVBE1.2andabove
XResolution dw ? ;horizontalresolutioninpixelsorcharacters3
YResolution dw ? ;verticalresolutioninpixelsorcharacters
XCharSize db ? ;charactercellwidthinpixels
YCharSize db ? ;charactercellheightinpixels
NumberOfPlanes db ? ;numberofmemoryplanes
3
Pixels in graphics modes, characters in text modes.
VBEFunctions
03hReturnCurrentVBE Mode
VBECOREFUNCTIONSVERSION2.0 Page17
DOCUMENTREVISION1.1
BitsPerPixel db ? ;bitsperpixel
NumberOfBanks db ? ;numberofbanks
MemoryModel db ? ;memorymodeltype
BankSize db ? ;banksizeinKB
NumberOfImagePages db ? ;numberofimages
Reserved db 1 ;reservedforpagefunction
;DirectColorfields(requiredfordirect/6andYUV/7memorymodels)
RedMaskSize db ? ;sizeofdirect colorredmaskinbits
RedFieldPosition db ? ;bitpositionoflsbofredmask
GreenMaskSize db ? ;sizeofdirectcolorgreenmaskinbits
GreenFieldPosition db ? ;bitpositionoflsbofgreenmask
BlueMaskSize db ? ;sizeofdirectcolorbluemaskinbits
BlueFieldPosition db ? ;bitpositionoflsbofbluemask
RsvdMaskSize db ? ;sizeofdirect colorreservedmaskinbits
RsvdFieldPosition db ? ;bitpositionoflsbofreservedmask
DirectColorModeInfo db ? ;directcolormodeattributes
;MandatoryinformationforVBE2.0andabove
PhysBasePtr dd ? ;physicaladdressforflatmemoryframebuffer
OffScreenMemOffset dd ? ;pointertostart ofoffscreenmemory
OffScreenMemSize dw ? ;amountofoffscreenmemoryin1kunits
Reserved db 206 dup (?) ; remainderofModeInfoBlock
ModeInfoBlock ends
The ModeAttributes fielddescribescertainimportantcharacteristics ofthegraphics mode.
TheModeAttributesfieldisdefinedasfollows:
D0 = Modesupportedbyhardwareconfiguration
0 = Modenot supportedinhardware
1 = Modesupportedinhardware
D1 = 1(Reserved)
D2 = TTYOutput functions supportedbyBIOS
0 = TTYOutput functions not supportedbyBIOS
1 = TTYOutput functions supportedbyBIOS
D3 = Monochrome/colormode(seenotebelow)
0 = Monochromemode
1= Color mode
D4 = Mode type
0 = Textmode
1 = Graphicsmode
D5 = VGAcompatiblemode
0 = Yes
VBEFunctions
00hReturnVBEControllerInformation
Page18 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
1 = No
VBEFunctions
03hReturnCurrentVBE Mode
VBECOREFUNCTIONSVERSION2.0 Page19
DOCUMENTREVISION1.1
D6 = VGAcompatiblewindowedmemorymodeisavailable
0 = Yes
1 = No
D7 = Linearframebuffermodeisavailable
0 = No
1 = Yes
D8-D15 = Reserved
BitD0issettoindicatethatthismodecanbeinitializedinthepresenthardwareconfiguration. This bit is
resettoindicatetheunavailabilityofagraphicsmodeifitrequires acertainmonitortype, morememory
thanisphysicallyinstalled,etc.
BitD1wasusedbyVBE1.0and1.1toindicatethat theoptional informationfollowingthe
BytesPerScanLinefieldwerepresentinthedatastructure. Thisinformationbecamemandatorywith
VBEversion1.2andabove, soD1is nolonger used and should be set to 1. The Direct Color fields
arevalidonlyiftheMemoryModel fieldis set toa6(Direct Color)or 7 (YUV).
BitD2indicateswhetherthevideoBIOShassupport foroutput functions likeTTYoutput, scroll, etc.
inthismode. TTYsupport is recommendedbut not requiredforall extendedtext andgraphicmodes.
Ifbit D2is set to1, thentheINT10hBIOSmust support all ofthestandardoutput functions listed
below.
AllofthefollowingTTYfunctionsmustbesupportedwhenthisbitisset:
01 Set CursorSize
02 SetCursorPosition
06 ScrollTTYwindowuporBlankWindow
07 ScrollTTYwindowdownorBlankWindow
09 Writecharacterandattributeat cursorposition
0A Writecharacteronlyat cursorposition
0E Writecharacter and advance cursor
Bit D3is set toindicatecolormodes, andclearedformonochromemodes.
Bit D4is set toindicategraphics modes, andclearedfortext modes.
Note: Monochromemodes maptheir CRTCaddress at 3B4h. Color modes map their CRTCaddress
at3D4h.Monochromemodeshaveattributesinwhichonlybit 3(video)andbit 4(intensity)ofthe
attributecontrolleroutputaresignificant.Therefore,monochrometextmodeshaveattributesofoff,
video,highintensity,blink,etc.Monochromegraphics modes aretwoplanegraphics modes andhave
attributesofoff,video,highintensity,andblink.Extendedtwocolormodes that havetheirCRTC
address at 3D4h, arecolormodes withonebit perpixel and one plane. The standard VGAmodes, 06h
and11h, wouldbeclassifiedas colormodes, whilethestandardVGAmodes 07h and 0Fh would be
classifiedasmonochromemodes.
VBEFunctions
00hReturnVBEControllerInformation
Page20 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
Bit D5is usedtoindicateifthemodeis compatiblewiththeVGAhardwareregisters andI/Oports. If
this bit is set, thenthemodeis NOTVGAcompatibleandnoassumptions shouldbemadeabout the
availabilityofanyVGAregisters. Ifclear, thenthestandardVGAI/Oports andframebufferaddress
definedinWinASegmentand/orWinBSegmentcanbeassumed.
BitD6isusedtoindicateifthemodeprovides WindowingorBankingoftheframebuffer intothe
framebuffermemoryregionspecifiedbyWinASegmentandWinBSegment. Ifset,thenWindowingof
theframebufferis NOTpossible. Ifclear, thenthedeviceis capableof mappingtheframebufferinto
thesegmentspecifiedinWinASegmentand/orWinBSegment. (Thisbitisusedinconjunctionwithbit
D7,seetablefollowingD7forusage).
BitD7indicatesthepresenceofaLinearFrameBuffermemorymodel. Ifthis bit is set, thedisplay
controllercanbeputintoaflatmemorymodelbysettingthemode(VBEFunction02h)withtheFlat
MemoryModelbitset.(ThisbitisusedinconjunctionwithbitD6, seefollowingtableforusage)
D7 D6
Windowed frame buffer only 0 0
n/a 0 1
Both Windowed and Linear
4 1 0
Linear frame buffer only 1 1
The BytesPerScanLine fieldspecifieshowmanyfullbytesareineachlogicalscanline.Thelogical
scanlinecouldbeequaltoorlargerthanthedisplayedscanline.
The WinAAttributes and WinBAttributes describethecharacteristics oftheCPUwindowingscheme
suchaswhetherthewindowsexistandareread/writeable, as follows:
D0 = Relocatablewindow(s)supported
0 = Singlenon-relocatablewindowonly
1 = Relocatablewindow(s)aresupported
D1 = Windowreadable
0 = Windowis not readable
1 = Windowisreadable
D2 = Windowwriteable
0 = Windowisnotwriteable
1 = Windowiswriteable
D3-D7 = Reserved
4
Use D14 of the Mode Number to select the Linear Buffer on a mode set (Function 02h).
VBEFunctions
03hReturnCurrentVBE Mode
VBECOREFUNCTIONSVERSION2.0 Page21
DOCUMENTREVISION1.1
Evenifwindowingis not supported(bit D0=0forbothWindowAandWindowB), then an
applicationcanassumethatthedisplaymemorybufferresidesatthelocationspecifiedby
WinASegmentand/orWinBSegment.
WinGranularityspecifiesthesmallestboundary, inKB, onwhichthewindowcanbeplacedinthe
framebuffermemory.ThevalueofthisfieldisundefinedifBitD0oftheappropriateWinAttributesfield
is not set.
WinSizespecifiesthesizeofthewindowinKB.
WinASegment and WinBSegmentaddress specifythesegment addresses wherethe windows are
located in the CPUaddress space.
WinFuncPtrspecifiesthesegment:offsetoftheVBEmemorywindowingfunction.Thewindowing
functioncanbeinvokedeitherthroughVBEFunction05h,orbycallingthefunctiondirectly.Adirect
callwillprovidefasteraccesstothehardwarepagingregistersthanusingVBEFunction05h, andis
intendedtobeusedbyhighperformanceapplications.Ifthis fieldis NULL, thenVBEFunction05h
mustbeusedtoset thememorywindowwhenpagingis supported. This direct call methoduses the
sameparametersasVBEFunction05hincludingAXandforVBE2.0implementationswillreturnthe
correct ReturnStatus. VBE1.2implementationsandearlier,didnotrequiretheReturnStatus
informationtobereturned. Formoreinformationonthedirect call method, seethenotes inVBE
Function05handthesamplecodeinAppendix5.
The XResolution and YResolutionspecifythewidthandheightinpixelelementsorcharacters forthis
displaymode.Ingraphicsmodes,thesefieldsindicatethenumberofhorizontalandverticalpixelsthat
maybedisplayed.Intextmodes,thesefieldsindicatethenumberofhorizontal andvertical character
positions. Thenumberofpixelpositionsfortextmodesmaybecalculatedbymultiplyingthereturned
XResolutionandYResolutionvaluesbythecharactercellwidthandheightindicatedintheXCharSize
andYCharSizefieldsdescribedbelow.
The XCharSize and YCharSizespecifythesizeofthecharactercellinpixels. This valueis not zero
based(e.g. XCharSizeforMode3usingthe9point font will haveavalue of9).
The NumberOfPlanes fieldspecifiesthenumberofmemoryplanesavailabletosoftwareinthat mode.
Forstandard16-colorVGAgraphics, this would be set to 4. For standard packed pixel modes, the
fieldwouldbeset to 1. For 256-color non-chain-4 modes, where you need to do bankingto address
allpixels,thisvalueshouldbesettothenumberofbanksrequiredtogettoallthepixels (typicallythis
would be 4 or 8).
The BitsPerPixel fieldspecifiesthetotalnumberofbits allocatedtoonepixel. Forexample, astandard
VGA4Plane16-colorgraphics modewouldhavea4inthis fieldandapacked pixel 256-color
graphicsmodewouldspecify8inthisfield.Thenumberofbits perpixel perplanecannormallybe
derivedbydividingtheBitsPerPixelfieldbytheNumberOfPlanesfield.
VBEFunctions
00hReturnVBEControllerInformation
Page22 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
The MemoryModel fieldspecifiesthegeneraltypeofmemoryorganizationusedinthismode. The
followingmodelshavebeendefined:
00h = Textmode
01h = CGAgraphics
02h = Herculesgraphics
03h = Planar
04h = Packedpixel
05h = Non-chain 4, 256 color
06h = DirectColor
07h = YUV
08h-0Fh = Reserved, to be defined byVESA
10h-FFh = To be defined byOEM
VBEVersion1.1andearlierdefinedDirectColorgraphicsmodes withpixel formats 1:5:5:5, 8:8:8, and
8:8:8:8 as aPackedPixel model with16, 24, and32-bits perpixel, respectively. In VBEVersion 1.2
andlater, theDirect Colormodes usetheDirect Colormemorymodel andusetheMaskSize and
FieldPositionfieldsoftheModeInfoBlocktodescribethepixelformat.BitsPerPixelisalways definedto
bethetotalmemorysizeofthepixel, inbits.
NumberOfBanks.Thisisthenumberofbanksinwhichthescanlines aregrouped. Thequotient from
dividingthescanlinenumberbythenumberofbanksisthebankthatcontains thescanlineandthe
remainderisthescanlinenumberwithinthebank. Forexample, CGAgraphics modes havetwobanks
andHercules graphics modehas fourbanks. Formodes that don't havescanlinebanks (suchas VGA
modes 0Dh-13h), this fieldshouldbeset to 1.
The BankSize fieldspecifies thesizeofabank(groupofscanlines)inunits of1KB. For CGAand
Hercules graphics modes this is 8, as eachbankis 8192bytes inlength. For modes that do not have
scanlinebanks (suchas VGAmodes 0Dh-13h), this fieldshouldbeset to0.
The NumberOfImagePages fieldspecifiesthe"totalnumberminusone(-1)"ofcompletedisplay
imagesthatwillfitintotheframebuffermemory.Theapplicationmayloadmorethanoneimageintothe
framebuffermemoryifthisfieldisnon-zero,andmovethedisplaywindowwithineachofthosepages.
Thisshouldonlybeusedfordeterminingtheadditionaldisplaypageswhichareavailabletothe
application;todeterminetheavailableoffscreenmemory,usetheOffScreenMemOffset and
OffScreenMemSizeinformation.
Note: IftheModeInfoBlockis foranIBMStandardVGAmodeandtheNumberOfImagePages field
containsmorepagesthanwouldbefoundina256KBimplementation, theTTYsupport describedin
theModeAttributes must beaccurate. i.e., iftheTTYfunctions areclaimedtobesupported, theymust
besupportedinallpages,notjustthepagesnormallyfoundinthe256KBimplementation.
VBEFunctions
03hReturnCurrentVBE Mode
VBECOREFUNCTIONSVERSION2.0 Page23
DOCUMENTREVISION1.1
The Reserved fieldhas beendefinedtosupport afutureVBEfeatureandwill always beset toonein
thisversion.
VBEFunctions
00hReturnVBEControllerInformation
Page24 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
The RedMaskSize, GreenMaskSize, BlueMaskSize, and RsvdMaskSize fieldsdefinethesize,in
bits, ofthered, green, andbluecomponents ofadirect colorpixel. Abit maskcan be constructed from
theMaskSizefieldsusingsimpleshiftarithmetic.Forexample,theMaskSizevaluesforaDirect Color
5:6:5modewouldbe5, 6, 5, and0, forthered, green, blue, and reserved fields, respectively. Note that
intheYUVMemoryModel, theredfieldis usedforV, thegreenfieldis usedforY, andthebluefieldis
usedforU. TheMaskSizefields shouldbeset to0inmodes usingamemorymodel that does not have
pixelswithcomponentfields.
The RedFieldPosition, GreenFieldPosition, BlueFieldPosition, andRsvdFieldPositionfields
definethebitpositionwithinthedirectcolorpixelorYUVpixeloftheleastsignificantbitofthe
respectivecolorcomponent.Acolorvaluecanbealignedwithitspixelfieldbyshiftingthevalueleft by
theFieldPosition.Forexample, theFieldPositionvalues foraDirect Color5:6:5modewouldbe11, 5,
0, and0, forthered, green, blue, andreservedfields, respectively. Note that in the YUV
MemoryModel, theredfieldis usedforV, thegreenfieldis usedforY, andthebluefieldis usedfor U.
TheFieldPositionfieldsshouldbesetto0inmodes usingamemorymodel that does not havepixels
withcomponentfields.
The DirectColorModeInfofielddescribesimportant characteristics ofdirect colormodes. Bit D0
specifieswhetherthecolorrampoftheDACis fixedorprogrammable. Ifthecolorrampis fixed, thenit
cannot bechanged. Ifthecolorrampis programmable, it is assumedthat thered, green, and blue
lookuptablescanbeloadedbyusingVBEFunction09h. Bit D1specifies whetherthebits intheRsvd
fieldofthedirect colorpixel canbeusedbytheapplicationorarereserved, andthus unusable.
D0 = Colorrampisfixed/programmable
0 = Colorrampisfixed
1 = Colorrampisprogrammable
D1 = BitsinRsvdfieldareusable/reserved
0 = BitsinRsvdfieldarereserved
1 = BitsinRsvdfieldareusablebytheapplication
The PhysBasePtrisa32-bitphysical address ofthestart offramebuffermemorywhenthecontroller
isinflatframebuffermemorymode.Ifthismodeisnotavailable,thenthisfieldwillbezero.
The OffScreenMemOffset is a32-bit offset fromthestart oftheframebuffermemory. Extraoff-
screenmemorythat is neededbythecontrollermaybelocatedeitherbeforeorafterthis offscreen
memory,besuretocheckOffScreenMemSizetodeterminetheamount ofoff-screenmemorywhichis
availabletotheapplication.
The OffScreenMemSize containstheamountofavailable,contiguousoff-screenmemoryin1kunits,
whichcanbeusedbytheapplication.
VBEFunctions
03hReturnCurrentVBE Mode
VBECOREFUNCTIONSVERSION2.0 Page25
DOCUMENTREVISION1.1
Note: Version1.1andlaterVBEwillzerooutallunusedfieldsintheModeInformationBlock, always
returningexactly256bytes.Thisfacilitatesupwardcompatibilitywithfutureversionsofthestandard,as
anynewlyaddedfieldswillbedesignedsuchthatvaluesofzerowillindicatenominaldefaultsornon-
implementationofoptionalfeatures.(Forexample,afieldcontainingabit-maskofextendedcapabilities
wouldreflecttheabsenceofallsuchcapabilities.)Applications that wishtobebackwards compatibleto
Version1.0VBEshouldpre-initializethe256bytebufferbeforecallingtheReturnVBEMode
Informationfunction.
4.5 Function 02h - Set VBE Mode
ThisrequiredfunctioninitializesthecontrollerandsetsaVBEmode. Theformat ofVESAVBEmode
numbersisdescribedearlierinthis document. Ifthemodecannot beset, theBIOSshouldleavethe
graphicsenvironmentunchangedandreturnafailureerrorcode.
Input: AX = 4F02h Set VBEMode
BX = Desired Mode to set
D0-D8= Modenumber
D9-D13 = Reserved(must be 0)
D14 = 0 Usewindowedframebuffermodel
= 1 Uselinear/flatframebuffermodel
D15 = 0 Cleardisplaymemory
= 1 Don'tcleardisplaymemory
Output: AX = VBEReturnStatus
Note: Allotherregisters arepreserved.
Iftherequestedmodenumberisnotavailable,thenthecallwillfail,returningAH=01htoindicatethe
failuretotheapplication.
IfbitD14isset,themodewill beinitializedforusewithaflat framebuffermodel. Thebaseaddress of
theframebuffercanbedeterminedfromtheextendedmodeinformationreturnedbyVBEFunction
01h. IfD14isset,andalinearframebuffermodelisnotavailablethenthecall will fail.
IfbitD15isnotset,all reportedimagepages, basedonFunction00hreturnedinformation
NumberOfImagePages, will beclearedto00hingraphics mode, and20 07 in text mode. Memory
overandabovethereportedimagepages will not bechanged. Ifbit D15is set, then the contents ofthe
framebufferafterthemodechangeis undefined. Note, the1-bytemodenumbers usedinFunction00h
ofanIBMVGAcompatibleBIOSuseD7tosignifythesamethingas D15does inthis function. If
functioncallD7issetandtheapplicationassumesitissimilartotheIBMcompatiblemodeset using
VBEFunction02h,theimplementationwillfail. VBEawareapplicationsmustusethememoryclearbit
inD15.
VBEFunctions
00hReturnVBEControllerInformation
Page26 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
Note: VBEBIOS2.0implementations shouldalsoupdatetheBIOSDataArea40:87memoryclear
bitsothatVBEFunction03hcanreturnthisflag.VBEBIOS1.2andearlierimplementations ignorethe
memoryclearbit.
Note: Thiscallshouldnotsetmodesnot listedinthelist ofsupportedmodes. Inadditionall modes
(includingIBMstandardVGAmodes),iflistedassupported,must haveModeInfoBlockstructures
associatedwiththem. RequiredModeInfoBlockvalues fortheIBMStandardModes arelistedin
Appendix2.
4.6 Function 03h - Return Current VBE Mode
ThisrequiredfunctionreturnsthecurrentVBEmode. Theformat ofVBEmodenumbers is described
earlierinthisdocument.
Input: AX = 4F03h Returncurrent VBEMode
Output: AX = VBEReturnStatus
BX = CurrentVBEmode
D0-D13 = Modenumber
D14 = 0 Windowedframebuffermodel
= 1 Linear/flatframebuffermodel
D15 = 0 Memoryclearedat last mode set
= 1 Memorynot clearedat last mode set
Note: Allotherregisters arepreserved.
Version 1.x Note: InastandardVGABIOS, Function0Fh(Readcurrent video state) returns the
currentgraphics modeintheALregister. InD7ofAL, it alsoreturns thestatus ofthememoryclearbit
(D7of40:87).Thisbitissetifthemodewassetwithoutclearingmemory. Inthis VBEfunction, the
memoryclearbitwillnotbereturnedinBXsincethepurposeofthefunctionis toreturnthevideomode
only.Ifanapplicationwantstoobtainthememoryclearbit, it shouldcall thestandardVGABIOS
Function0Fh.
Version 2.x Note: Unlikeversion1.xVBEimplementations,thememoryclearflagwillbereturned.
TheapplicationshouldNOTcall thestandardVGABIOSFunction0Fhifthemodewas set withVBE
Function02h.
Note: Themodenumberreturnedmust bethesamemodenumberusedintheVBEFunction02hmode
set.
Note: Thisfunctionis not guaranteedtoreturnanaccuratemodevalueifthemodeset was not done
withVBEFunction02h.
VBEFunctions
07hSet/GetDisplayStart
VBECOREFUNCTIONSVERSION2.0 Page27
DOCUMENTREVISION1.1
4.7 Function 04h - Save/Restore State
Thisrequiredfunctionprovidesacompletemechanismtosaveandrestorethedisplaycontroller
hardwarestate. Thefunctions areasuperset ofthethreesubfunctions underthestandardVGABIOS
Function1Ch(Save/restorestate)whichdoes not guaranteethat theextendedregisters ofthevideo
devicearesavedorrestored. Thecompletehardwarestate(except framebuffermemory)should be
saveable/restorablebysettingtherequestedstates mask(intheCXregister)to000Fh.
Input: AX = 4F04h Save/RestoreState
DL = 00h ReturnSave/RestoreStatebuffersize
= 01h Savestate
= 02h Restorestate
CX = Requestedstates
D0= Save/Restorecontrollerhardwarestate
D1= Save/Restore BIOSdata state
D2= Save/RestoreDACstate
D3= Save/RestoreRegisterstate
ES:BX = Pointertobuffer (ifDL<> 00h)
Output: AX = VBEReturnStatus
BX = Numberof64-byte blocks to hold the state
buffer (ifDL=00h)
Note: Allotherregisters arepreserved.
4.8 Function 05h - Display Window Control
Thisrequiredfunctionsetsorgetsthepositionofthespecifieddisplaywindoworpageintheframe
buffermemorybyadjustingthenecessaryhardwarepagingregisters. Tousethis functionproperly, the
softwareshouldfirstuseVBEFunction01h(ReturnVBEModeinformation)todeterminethesize,
locationandgranularityofthewindows.
Forperformancereasons,itmaybemoreefficienttocallthisfunctiondirectly,withoutincurringtheINT
10hoverhead. VBEFunction01hreturnsthesegment:offsetofthiswindowingfunctionthatmaybe
calleddirectlyforthis reason. Notethat adifferent entrypoint maybereturnedbasedupontheselected
mode. Therefore,itisnecessarytoretrievethissegment:offset specificallyforeachdesiredmode.
Input: AX = 4F05h VBEDisplayWindowControl
BH = 00h Setmemorywindow
= 01h Getmemorywindow
BL = Windownumber
= 00h WindowA
= 01h WindowB
DX = Windownumberinvideomemoryinwindow
granularityunits (SetMemoryWindowonly)
VBEFunctions
00hReturnVBEControllerInformation
Page28 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
Output: AX = VBEReturnStatus
DX = Windownumberinwindowgranularityunits
(GetMemoryWindowonly)
Note: InVBE1.2implementations,thedirectfarcallversionreturnsnoReturnStatusinformationto
theapplication.Also,inthefarcallversion, theAXandDXregisters will bedestroyed. ThereforeifAX
and/orDXmustbepreserved, theapplicationmust dosopriortomakingthefarcall. Theapplication
muststillloadtheinputargumentsinBH,BL,andDX(forSet Window). InVBE2.0implementations,
theBIOSwillreturnthecorrectReturnStatus, andthereforetheapplicationmust assumethat AXand
DXwill bedestroyed.
Application Developer's Note: Thisfunctionisnotintendedforuseinalinearframebuffermode, if
thisfunctionisrequested,thefunctioncallwillfailwiththeVBECompletioncodeAH=03h.
VBEBIOSImplementationNote: Ifthisfunctioniscalledwhileinalinearframebuffermemory
model,thisfunctionmustfailwithcompletioncodeAH=03h.
4.9 Function 06h - Set/Get Logical Scan Line Length
Thisrequiredfunctionsetsorgetsthelengthofalogicalscanline.This allows anapplicationtoset upa
logicaldisplaymemorybufferthatiswiderthanthedisplayedarea.VBEFunction07h(Set/Get Display
Start)thenallowstheapplicationtosetthestartingpositionthat is tobedisplayed.
Input: AX = 4F06h VBESet/GetLogicalScanLineLength
BL = 00h SetScanLineLengthinPixels
= 01h GetScanLineLength
= 02h SetScanLineLengthinBytes
= 03h GetMaximumScanLineLength
CX = IfBL=00h DesiredWidthinPixels
IfBL=02h DesiredWidthinBytes
(IgnoredforGetFunctions
Output: AX = VBEReturnStatus
BX = Bytes PerScan Line
CX = ActualPixelsPerScanLine
(truncatedtonearestcompletepixel)
DX = MaximumNumberofScanLines
Note: Thedesiredwidthinpixels orbytes maynot beachievablebecauseofhardwareconsiderations.
Thenextlargervaluewillbeselectedthatwillaccommodatethedesirednumberofpixels orbytes, and
theactualnumberofpixelswill bereturnedinCX. BXreturns avaluethat whenaddedtoapointerinto
displaymemorywillpointtothenextscanline. Forexample, inVGAmode13hthis wouldbe320, but
inmode12hthis wouldbe80. DXreturns thenumberoflogical scanlines baseduponthenewscan
linelengthandthetotalmemoryinstalledandusableinthisdisplaymode.
VBEFunctions
07hSet/GetDisplayStart
VBECOREFUNCTIONSVERSION2.0 Page29
DOCUMENTREVISION1.1
Note: Thisfunctionis alsovalidinVBEsupportedtext modes. InVBEsupportedtext modes the
applicationshouldconvertthecharacterlinelengthtopixellinelengthbygettingthecurrentcharacter
cellwidththroughtheXCharSizefieldreturnedinModeInfoBlock,multiplyingthattimesthedesired
numberofcharactersperline,andpassingthatvalueintheCXregister. Inaddition,this functionwill
onlyworkifthelinelengthisspecifiedincharactergranularity. i.e.in8dotmodesonlymultiples of8
willwork. Anyvaluewhichisnotincharactergranularitywillresultinafunctioncallfailure.
Note: OnafailuretosetscanlinelengthbysettingaCXvaluetoolarge, thefunctionwill fail witherror
code02h.
Note: ThevaluereturnedwhenBL=03histhelesserofeitherthemaximumlinelengththat the
hardwarecansupport,orthelongestscanlinelengththat wouldsupport thenumberoflines inthe
currentvideomode.
4.10 Function 07h - Set/Get Display Start
Thisrequiredfunctionselectsthepixeltobedisplayedintheupperleft cornerofthedisplay. This
functioncanbeusedtopanandscroll aroundlogical screens that arelargerthanthedisplayedscreen.
Thisfunctioncanalsobeusedtorapidlyswitchbetweentwodifferent displayedscreens fordouble
bufferedanimationeffects.
Input: AX = 4F07h VBESet/Get DisplayStart Control
BH = 00h Reservedandmust be 00h
BL = 00h SetDisplayStart
= 01h GetDisplayStart
= 80h SetDisplayStartduringVertical Retrace
CX = FirstDisplayedPixelInScanLine
(SetDisplayStartonly)
DX = FirstDisplayedScanLine(Set DisplayStart only)
Output: AX = VBEReturnStatus
BH = 00hReservedandwill be0(Get DisplayStart only)
CX = FirstDisplayedPixelInScanLine(Get DisplayStart only)
DX = FirstDisplayedScanLine(Get DisplayStart only)
Note: Thisfunctionisalsovalidintextmodes. Tousethisfunctionintextmode,theapplicationshould
convertthecharactercoordinatestopixelcoordinatesbyusingXCharSizeandYCharSizereturnedin
theModeInfoBlock. IftherequestedDisplayStart coordinates donot allowforafull pageofvideo
memoryorthehardwaredoesnotsupportmemorywrapping, theFunctioncall shouldfail andno
changes shouldbemade. As ageneral case, ifarequestedDisplayStart is not available, fail the
Functioncallandmakenochanges.
Note: CX and DX,forbothinputandoutput values,will bezero-based.
VBEFunctions
0AhReturnVBE Protected Mode Interface
Page30 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
4.11 Function 08h - Set/Get DAC Palette Format
Thisrequiredfunctionmanipulates theoperatingmodeorformat oftheDACpalette. SomeDACs are
configurabletoprovide6bits, 8bits, ormoreofcolordefinitionperred, green, andblueprimary
colors. TheDACpalettewidthis assumedtobereset tothe standard VGAvalue of6 bits per primary
colorduringanymodeset.
Input: AX = 4F08h VBESet/Get PaletteFormat
BL = 00h Set DACPalette Format
= 01h Get DACPaletteFormat
BH = Desiredbits ofcolorperprimary
(Set DACPalette Format only)
Output: AX = VBEReturnStatus
BH = Currentnumberofbits ofcolorperprimary
AnapplicationcandetermineifDACswitchingisavailablebyqueryingBitD0oftheCapabilitiesfield
oftheVbeInfoBlockstructurereturnedbyVBEFunction00h(ReturnControllerInformation). The
applicationcanthenattempttosettheDACpalettewidthtothedesiredvalue. Ifthedisplaycontroller
hardwareisnotcapableofselectingtherequestedpalettewidth, thenthenext lowervaluethat the
hardwareis capableofwill beselected. Theresultingpalettewidthisreturned.
ThisfunctionwillreturnfailurecodeAH=03hifcalledinadirect colororYUVmode.
4.12 Function 09h - Set/Get Palette Data
ThisrequiredfunctionisveryimportantforRAMDAC's whicharelargerthanastandardVGA
RAMDAC. ThestandardINT10hBIOSPalettefunctioncalls assume standard VGAports and VGA
palettewidths. ThisfunctionoffersapaletteinterfacethatisindependentoftheVGAassumptions.
Input: AX = 4F09h VBELoad/UnloadPaletteData
BL = 00h Set PaletteData
= 01h Get PaletteData
= 02h Set SecondaryPalette Data
= 03h Get SecondaryPaletteData
= 80h SetPaletteDataduringVertical Retrace
withBlankBit on
CX = Numberofpaletteregisters to update (to a
maximumof256)
DX = First ofthepaletteregisters toupdate(start)
ES:DI = Tableofpalettevalues (seebelowforformat)
Output: AX = VBEReturnStatus
VBEFunctions
0AhReturn VBE Protected Mode Interface
VBECOREFUNCTIONSVERSION2.0 Page31
DOCUMENTREVISION1.1
Format of Palette Values:Alignment byte, Red byte, Green byte, Blue byte
Note: TheneedforBL=80his forolderstyleRAMDAC's whereprogrammingtheRAMvalues
duringdisplaytimecausesa"snow-like"effect onthescreen. NewerstyleRAMDAC's don't havethis
limitationandcaneasilybeprogrammedat anytime, but olderRAMDAC's requirethat theybe
programmedduringanon-displaytimeonlytostopthesnowlikeeffect seenwhenchangingtheDAC
values. WhenthisisrequestedtheVBEimplementationwillprogramtheDACwithblankingon.
CheckD2oftheCapabilitiesfieldreturnedbyVBEFunction00htodetermineif80hshouldbeused
insteadof00h.
Note: Theneedforthesecondarypaletteis foranticipatedfuturepaletteextensions, ifasecondary
palettedoesnotexistinaimplementationandthesecallsaremade,theVBEimplementationwillreturn
error code 02h.
Note: Whenin6bit mode, theformat ofthe 6 bits is LSB, this is done for speed reasons, as the
applicationcantypicallyshiftthedatafasterthantheBIOScan.
Note: AllapplicationshouldassumetheDACisdefaultedto6bit mode. Theapplicationis responsible
forswitchingtheDACtohighercolormodesusingFunction08h.
Note: QueryVBEFunction08htodeterminetheRAMDACwidthbeforeloadinganewpalette.
4.13 Function 0Ah - Return VBE Protected Mode Interface
Thisrequiredfunctioncall returns apointertoatablethat contains codefora32-bit protectedmode
interfacethat caneitherbecopiedintolocal 32-bit memoryspaceorcan be executed fromROM
providingthecallingapplicationsetsallrequiredselectorsandI/Oaccesscorrectly.Thisfunctionreturns
apointer(inrealmodespace)withoffsets tothecodefragments, andadditionallyreturns anoffset toa
tablewhichcontainsNon-VGAPortandMemorylocations whichanApplicationmayhavetohaveI/O
access to.
Input: AX = 4F0Ah VBE2.0 Protected Mode Interface
BL = 00h Returnprotectedmodetable
Output: AX = Status
ES = Real ModeSegment ofTable
DI = OffsetofTable
CX = LengthofTableincludingprotectedmodecodein bytes
(forcopyingpurposes)
VBEFunctions
0AhReturnVBE Protected Mode Interface
Page32 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
Theformatofthetableisasfollows:
ES:DI+ 00h WordOffset in table ofProtected mode code for
Function5forSet WindowCall
ES:DI+ 02h WordOffset in table ofProtected mode code for
Function7forset DisplayStart
ES:DI+ 04h WordOffset in table ofProtected mode code for
Function9forset PrimaryPalettedata
ES:DI+ 06h Word Offset intableofPorts and MemoryLocations
thattheapplicationmayneedI/Oprivilegefor.
(Optional: ifunsupportedthismustbe0000h)
(SeeSub-tableforformat)
ES:DI + ? VariableremainderofTableincludingCode
Theformat oftheSub-Table(Ports andMemorylocations)
Port, Port, ... , Port, Terminate Port List with FFFF, Memorylocations (4 bytes), Length (2
bytes), TerminateMemoryList withFFFF.
Example 1.ForPort/Indexcombination3DE/FhandMemorylocations DE800-DEA00h(length =
200h)thetablewouldlooklikethis:
DE 03 DF 03 FF FF 00 E8 0D 00 00 02 FF FF
Example 2.Foronlytheports it wouldlooklike:
DE 03 DF 03 FF FF FF FF
Example 3.Foronlythememorylocationsitwouldlooklike
FF FF 00 E8 0D 00 00 02 FF FF
Note:. All protectedmodefunctions shouldendwithanearRET(as opposedtoFARRET)to allow
theapplicationsoftwaretoCALLthecodefromwithintheROM.
Note: ThePort andMemorylocationSub-tabledoes not includetheFrameBufferMemorylocation.
TheFrameBufferMemorylocationiscontainedwithintheModeInfoBlockreturnedbyVBEFunction
01h.
Note: Theprotectedmodecodeis assembled for a 32-bit code segment, when copyingit, the
applicationmust copythecodetoa32-bit code segment.
Note: Itistheresponsibilityoftheapplicationtoensurethat theselectors andsegments areset up
correctly.
VBEFunctions
0AhReturn VBE Protected Mode Interface
VBECOREFUNCTIONSVERSION2.0 Page33
DOCUMENTREVISION1.1
Ifthememorylocationis zero, thenonlyI/Omappedports will beusedsotheapplicationdoes not
needtodoanythingspecial. This shouldbethedefault caseforALLcards that have I/Omapped
registersbecauseit provides thebest performance.
Ifthememorylocationis nonzero(therecanbeonlyone), theapplication will need to create a new32-
bitselectorwiththebaseaddressthatpointstothe“physical”locationspecifiedwiththespecifiedlimit.
Whentheapplicationneedstocallthe32-bit bankswitchfunction, it must thenloadtheESselector
withthevalueofthenewselectorthat has beencreated. Thebankswitchingcodecanthendirectly
accessitsmemorymappedregisters as absoluteoffsets intotheESselector
(i.e., mov[es:10],eaxtoput avalueintotheregisterat base+10).
It is uptotheapplicationcodetosaveandrestoretheprevious stateofthe ESselector ifthis is
necessary(forexampleinflat model code).
Note: Currentlyundefinedregisters maybedestroyedwiththeexceptionofESI, EBP, DSand SS.
Note: Applicationsmustusethesameregisters fortheFunction05handFunction09hprotectedmode
interfacethatitwoulduseinarealmodecall. This includes theAXregister.
Note: Function07hprotectedmodecalls haveadifferent format.
AX = 4F07h
BL = 00h Set DisplayCRTCStart
= 80h SetDisplayCRTCStart duringVertical Retrace
CX = Bits 0-15ofdisplaystart address
DX = Bits 16-31ofdisplaystart address
Theprotectedmodeapplicationmust keeptrackofthecolordepthandscanlinelengthtocalculatethe
newstartaddress. Ifavaluethat is out ofrangeis programmed, unpredictableresults will occur.
Note: RefertoSection4.2forinformationonprotectedmodeconsiderations.
VBESupplementalSpecifications
Page34 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
5.0 VBE Supplemental Specifications
ThischapterdetailsVBESupplementalSpecifications.
5.1 Purpose of Supplemental Specifications
TheVBEwasoriginallydesignedtoprovideadevice-independentinterfacebetweenapplication
softwareandSVGAhardware.Inthelastfewyears, thepersonal computingenvironment has grown
muchmorecomplexandtherehavebeennumerous requests toprovideinterfaces similartotheVBEto
servicethesenewrequirements.TheVBEsupplementalspecificationarchitectureprovides awayto
extendthebasicVBEspecificationwithoutmakingittoounwieldyorhavingtorevisetheVBE
specificationitself.
ThesupplementalspecificationsareimplementedusingVBEfunctionnumbersstartingatAL=10h.This
leavesthefirstsixteenfunctionsavailableforeventualVBEgrowth.Individualcallsforeach
supplementalspecificationaremadethroughasubfunctionnumberviatheBLregister.This
function/subfunctionarchitectureiscompatiblewiththeVBEandprovideseachVBESupplemental
Specificationwith64potentialsubfunctions.Subfunction00hforeachsupplementalspecificationis
reservedfora'ReturnVBESupplementalSpecificationInformation'call. It is basedontheVBE
Function00handreturnsbasicinformationontheVBESupplementalSpecificationimplementation.
5.2 Obtaining Supplemental VBE Function Numbers
VBESupplemental Specifications canonlybecreatedbyVESAcommittees. Onceaneedforanew
softwarespecificationhasbeenidentified,thegroupworkingonit needs tocontact theVESASoftware
StandardsCommittee(SSC)todiscusstherequirements. TheSSCwill assignafunctionnumberand
nametothesupplementalspecification.Thenameassignedtoasupplementalspecificationwillbeinthe
formof'VBE/???'wherethe'???'is atwoorthreeletteracronymforits function. Twoletteracronyms
will bepaddedwithFFhforthethirdletter. Insomecases thecommitteethat is workingonthe
supplementalspecificationmayhaveanothernamethattheywilluseforpromotionalpurposes,however
theVBE/???willcontinuetobethesignature.
TheVBEspecificationwillberevisedperiodicallytoupdatethelistofsupplementalspecifications. To
obtaintheactualspecifications,contacttheVESAoffice.
VBESupplementalSpecifications
VBECOREFUNCTIONSVERSION2.0 Page35
DOCUMENTREVISION1.1
5.3 Required VBE Supplemental Specification Components
5.3.1 VBE Supplemental Specification Functions
AllVBESupplementalSpecificationfunctionsarecalledwiththeAHregistersetto4Fhtoidentifythem
asVBEfunctioncalls. TheALregisterisusedtospecifywhichVESAfunctionthesupplemental
specificationisusing. TheBLregisterwillcontainthesubfunctionnumberforthecallbeingmade,BH
willcontainthesub-subfunctionnumberifnecessary.
e.g.,Input: AX =4FXXh VESASupplementalVBESpecification
('XX'representsthefunctionnumberforthe
supplementalspecification)
BL = ? Subfunction
BH = ? Sub-subfunction
5.3.2 Return Status
AllVBESupplementalSpecificationswillusetheVBECompletioncodesasdocumentedinSection4.1
oftheVBEspecification.
5.3.3 Subfunction 00h - Return VBE Supplemental Specification Information
Thissubfunctionreturnsthecapabilities,revisionlevel,andvendorspecificinformationofthe
supplementalspecification,andisarequiredfunctionforanyVBE2.xSupplementalSpecification.
Thepurposeofthissubfunctionistoprovideinformationtothecallingprogramaboutthegeneral
capabilitiesoftheinstalledVBEsoftwareandhardware. Thissubfunctionfillsaninformationblock
structureattheaddressspecifiedbythecaller. TheSupVBEInfoBlockinformationblocksizeis 256
bytes.
Input: AX =4FXXh ReturnSupplementalVBESpecificationInformation
('XX'representsthefunctionnumberforthe
supplementalspecification)
BL = 00h Subfunction'0'
ES:DI = Pointertobufferinwhichtoplace
SupVBEInfoBlockstructure
Output:AX = VBEReturnStatus
Otherregistersmaybedefinedforinputandoutput basedupontheparticularrequirements of
supplementalspecifications
Whenwritingsupplementalfunctions,explicitlystatewhichregistersarepreservedandwhichare
destroyed. Refrainfrompreservingallregistersasthistendstolimitexpandabilityinthefuture. An
exampleofthenoteis:
VBESupplementalSpecifications
Page36 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
Note: Currentlyundefinedregisters maybedestroyedwiththeexceptionof SI,BP,DS
and SS.
Theinformationblockhasthefollowingstructure:
SupVbeInfoBlockstruc
SupVbeSignature db 'VBE/???' ;SupplementalVBESignature
SupVbeVersion dw ? ;SupplementalVBEVersion
SupVbeSubFunc db 8dup (?) ;Bitfieldofsupportedsubfunctions
OemSoftwareRev dw ? ;OEMSoftwarerevision
OemVendorNamePtr dd ? ;PointertoVendorNameString
OemProductNamePtr dd ? ;PointertoProduct NameString
OemProductRevPtr dd ? ;PointertoProductRevisionString
OemStringPtr dd ? ;PointertoOEMString
Reserved db 221 dup (?) ;Reservedfordescriptionstringsandfuture
;expansion
SupVbeInfoBlockends
Note: AlldatainthisstructureissubjecttochangebytheVBEimplementationwhenanyVBE
Subfunction00hiscalled. Thereforeit shouldnot beusedbytheapplicationtostoredataofanykind.
Descriptionofthe SupVbeInfoBlockstructurefields:
The SupVbeSignaturefieldisfilledwiththeASCIIcharacters 'VBE/'followedbythetwoorthree
letteracronymthatrepresentsthesupplementalspecification.Thisfieldisfilledbythesupplementary
VBEimplementation. Intheeventthattheacronymisonlytwoletters,thethirdlettermustbefilledwith
FFh.
The SupVbeVersionisaBCDvaluewhichspecifieswhatleveloftheVBEsupplementary
specificationisimplementedinthesoftware.Thehigherbytespecifiesthemajorversionnumber.The
lowerbytespecifiestheminorversionnumber.
Note: The BCDvalue for 2.0 is 0200h and the BCDvalue for 1.2 is 0102h. In the past we have had
someapplicationsmisinterpretingtheseBCDvalues. Forexample, BCD0102hwas interpretedas
1.02,whichisincorrect.
The SupVbeSubFuncisabitfieldthatrepresentsthesubfunctionsavailableforthesupplementary
specification.Ifthebitrepresentingaparticularsubfunctionisset,thenthatsubfunctionissupported.
Subfunction'0'isrepresentedbytheLSBofthefirst byteandtheothersubfunctions follow. Onlybits
forsubfunctionsdefinedinthespecificationneedtobeset.
The OemStringPtrisaRealModefarpointertoanull-terminatedOEM-definedstring. This stringmay
usedtoidentifythegraphicscontrollerchiporOEMproductfamilyforhardwarespecificdisplay
VBESupplementalSpecifications
VBECOREFUNCTIONSVERSION2.0 Page37
DOCUMENTREVISION1.1
drivers.Therearenorestrictionsontheformat ofthestring. This pointermaypoint intoeitherROMor
RAM,dependingonthespecificimplementation.
VBESupplementalSpecifications
Page38 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
The OemSoftwareRev fieldisaBCDvaluewhichspecifiestheOEMrevisionlevel ofthe
SupplementalSpecificationsoftware. Thehigherbytespecifiesthemajorversionnumber.Thelower
bytespecifiestheminorversionnumber. This fieldcanbeusedtoidentifytheOEM's VBEsoftware
release.
The OemVendorNamePtrisaRealModefarpointertoanull-terminatedOEM-definedstring
containingthenameofthevendorwhoproducedthedisplaycontrollerboardproduct.
The OemProductNamePtrisaRealModefarpointertoanull-terminatedOEM-definedstring
containingtheproductnameofthedisplaycontrollerboard.
The OemProductRevPtrisaRealModefarpointertoanull-terminatedOEM-definedstring
containingtherevisionormanufacturinglevelofthedisplaycontrollerboardproduct. Thisfieldcanbe
usedtodeterminewhichproductionrevisionofthedisplaycontrollerboardisinstalled.
5.4 Supplemental Specification Protected Mode Guidelines
VBESupplementalSpecificationsmaywishtoincorporate32-bit protectedmodeinterfaces based
uponthe32-bitprotectedmodeinterfaceinVBE2.0. Theguidelines forthis aresimple.
Input: AX =4FXXh SupplementalSpecificationFunctionNumber
BL = XX Return32-bit protectedmodeinterfacetable
Output: AX = Status
ES = Real ModeSegment ofTable
DI = OffsetofTable
CX = LengthofTableincludingprotectedmodecode
(forcopyingpurposes)
Theformatofthetableshouldbeas follows:
ES:DI+ 00h WordOffset in table ofProtected mode code for
firstfunction
ES:DI+(n*2) WordOffset in table ofProtected mode code for
nthfunction
ES:DI+ ? Word Offset intableofPorts and MemoryLocations
thattheapplicationmayneedI/Oprivilegefor
(Optional: ifunsupportedthismustbe0000h)
(SeeSub-tableforformat)
ES:DI + ? VariableremainderofTableincludingCode
VBESupplementalSpecifications
VBECOREFUNCTIONSVERSION2.0 Page39
DOCUMENTREVISION1.1
Theformat oftheSub-Table(Ports andMemorylocations)
Port, Port, ... , Port, Terminate Port List with FFFF, Memorylocations (4 bytes), Length (2
bytes), TerminateMemoryList withFFFF.
Example 1.ForPort/Indexcombination3DE/FhandMemorylocations DE800-DEA00h(length=
200h)thetablewouldlooklikethis:
DE 03 DF 03 FF FF 00 E8 0D 00 00 02 FF FF
Example 2.Foronlytheports it wouldlooklike:
DE 03 DF 03 FF FF FF FF
Example 3.Foronlythememorylocationsitwouldlooklike
FF FF 00 E8 0D 00 00 02 FF FF
Note:. All protectedmodefunctions shouldendwithanearRET(as opposedtoFARRET)to allow
theapplicationsoftwaretoCALLthecodefromwithintheROM.
Note: Theprotectedmodecodeshouldbeassembled for a 32-bit code segment, when copyingit, the
applicationmust copythecodetoa32-bit code segment.
Note: Itistheresponsibilityoftheapplicationtoensurethat theselectors andsegments areset up
correctly.
Note: Currentlyundefinedregisters maybedestroyedwiththeexceptionofESI, EBP, DSand SS.
Indevelopingasupplementalspecification,ensurethatboththeapplicationdeveloperandthe
VBE/XXXimplementorsareawareofwhichportionofthefunctionissupported, i.e., ifafunction
supports bothaGet andaSet function, spell out whichis supported, the Get, the Set or both.
5.5 Loading Supplemental Drivers
VBESupplementalSpecificationscanbeimplementedinROM, TSRprograms oras devicedrivers.
Thespecificrequirementswillvarydependingontheindividualsupplementaryspecification.Ifthereare
anyspecificrequirements,theyshouldbedetailedinthesupplementaryspecification.
5.6 Implementation Questions
Whendevelopinganewsupplementalspecification,implementationquestionswhethertheyarecovered
inthisguidelineornot,shouldbereferredtotheVESASoftwareStandards Committeeforclarification.
ThechairmanoftheSSCcanbecontactedthroughVESAoffice.
VBESupplementalSpecifications
Page40 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
5.7 Known Supplemental Specifications
5.7.1 Function 10h - Power Management Extensions (PM)
Thisoptionalfunctioncontrolsthepowerstateoftheattacheddisplaydeviceormonitor.
RefertotheVBE/PMStandardforspecifics.
5.7.2 Function 11h - Flat Panel Interface Extensions (FP)
Thisproposedoptionalsupplementalspecificationallowsaccesstothespecialfeatures incorporatedin
FlatPanelcontrollers.Thereisnoreferencespecificationat thetimeofthis standard's approval. Contact
theVESAofficeformoreinformation.
5.7.3 Function 12h - Cursor Interface Extensions (CI)
ThisproposedoptionalfunctionprovidesservicesforHardwareCursors andPointingDevices. At this
time,thisisindevelopment. Thereisnoreferencespecificationat thetimeofthis standard's approval,
contacttheVESAofficeformoreinformation.
5.7.4 Function 13h - Audio Interface Extensions (AI)
ThisoptionalfunctionprovidesstandardAudioservices.
RefertotheVBE/AIStandardforspecifics.
5.7.5 Function 14h - OEM Extensions
ThisoptionalsupplementalfunctionprovidesOEM'swithacodedispatchareathat falls underthe
VESA4Fhfunctions. AnOEMmayusethis areaat theirown risk. VESAstates no warranties or
guaranteesaboutthefunctioncallscontainedwithinthisarea.
5.7.6 Function 15h - Display Data Channel (DDC)
Thisoptionalfunctionprovidesamechanismtoextractdatafromattacheddisplaydevices ontheVESA
communicationchannel. RefertotheVBE/DDCStandardforspecifics.
5.7.7 Function 16h - Graphics System Configuration (GC)
Thisproposedsupplementalfunctionprovidesamechanismforsystemlevelservicestoset upMonitor
Timings,LinearFrameBufferaddressesetc.,i.e.systemlevelcallsthatapplicationsshouldnot deal with
. Thereisnoreferencespecificationat thetimeofthis standard's approval. Contact theVESAoffice
formoreinformation.
VBEQuickReference
VBECOREFUNCTIONSVERSION2.0 Page41
DOCUMENTREVISION1.1
Appendix 1 - VBE Quick Reference
Input: AX = 4F00h ReturnVBEControllerInformation
ES:DI = Pointertobufferinwhichtoplace
VbeInfoBlockstructure
(VbeSignatureshouldbeset to'VBE2'when
functioniscalledtoindicateVBE2.0information
isdesiredandtheinformationblockis 512bytes in
size.)
Output:AX = VBEReturnStatus
Note: Allotherregisters arepreserved.
______________________________
Input: AX = 4F01h ReturnVBEmodeinformation
CX = Modenumber
ES:DI = PointertoModeInfoBlockstructure
Output:AX = VBEReturnStatus
Note: Allotherregisters arepreserved.
______________________________
Input: AX = 4F02h Set VBEMode
BX = Desired Mode to set
D0-D8= Modenumber
D9-D13 = Reserved(must be 0)
D14 = 0 Usewindowedframebuffermodel
= 1 Uselinear/flatframebuffermodel
D15 = 0 Cleardisplaymemory
= 1 Don'tcleardisplaymemory
Output:AX = VBEReturnStatus
Note: Allotherregisters arepreserved.
______________________________
VBEQuickReference
Page42 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
Input: AX = 4F03h Returncurrent VBEMode
Output:AX = VBEReturnStatus
BX = CurrentVBEmode
D0-D13 = Modenumber
D14 = 0 Windowedframebuffermodel
= 1 Linear/flatframebuffermodel
D15 = 0 Memoryclearedat last mode set
= 1 Memorynot clearedat last mode set
Note: Allotherregisters arepreserved.
______________________________
Input: AX = 4F04h Save/RestoreState
DL = 00h ReturnSave/RestoreStatebuffersize
= 01h Savestate
= 02h Restorestate
CX = Requestedstates
D0= Save/Restorecontrollerhardwarestate
D1= Save/Restore BIOSdata state
D2= Save/RestoreDACstate
D3= Save/RestoreRegisterstate
ES:BX = Pointertobuffer (ifDL <> 00h)
Output:AX = VBEReturnStatus
BX = Numberof64-byte blocks to hold the state
buffer (ifDL=00h)
Note: Allotherregisters arepreserved.
______________________________
Input: AX = 4F05h VBEDisplayWindowControl
BH = 00h Setmemorywindow
= 01h Getmemorywindow
BL = Windownumber
= 00h WindowA
= 01h WindowB
DX = Windownumberinvideomemoryinwindow
granularityunits (SetMemoryWindowonly)
Output:AX = VBEReturnStatus
DX = Windownumberinwindowgranularityunits
VBEQuickReference
VBECOREFUNCTIONSVERSION2.0 Page43
DOCUMENTREVISION1.1
______________________________
VBEQuickReference
Page44 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
Input: AX = 4F06h VBESet/GetLogicalScanLineLength
BL = 00h SetScanLineLengthinPixels
= 01h GetScanLineLength
= 02h SetScanLineLengthinBytes
= 03h GetMaximumScanLineLength
CX = IfBL=00h DesiredWidthinPixels
IfBL=02h DesiredWidthinBytes
(IgnoredforGetFunctions)
Output:AX = VBEReturnStatus
BX = Bytes PerScan Line
CX = ActualPixels PerScanLine
(truncatedtonearestcompletepixel)
DX = MaximumNumberofScanLines
______________________________
Input: AX = 4F07h VBESet/Get DisplayStart Control
BH = 00h Reservedandmust be 00h
BL = 00h SetDisplayStart
= 01h GetDisplayStart
= 80h SetDisplayStartduringVertical Retrace
CX = FirstDisplayedPixelInScanLine
(SetDisplayStartonly)
DX = FirstDisplayedScanLine(Set DisplayStart only)
Output:AX = VBEReturnStatus
BH = 00hReservedandwill be0(Get DisplayStart only)
CX = FirstDisplayedPixelInScanLine(Get DisplayStart only)
DX = FirstDisplayedScanLine(Get DisplayStart only)
______________________________
Input: AX = 4F08h VBESet/Get PaletteFormat
BL = 00h Set DACPalette Format
= 01h Get DACPaletteFormat
BH = Desiredbits ofcolorperprimary
(Set DACPaletteFormat only)
Output:AX = VBEReturnStatus
BH = Currentnumberofbits ofcolorperprimary
VBEQuickReference
VBECOREFUNCTIONSVERSION2.0 Page45
DOCUMENTREVISION1.1
______________________________
VBEQuickReference
Page46 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
Input: AX = 4F09h VBELoad/UnloadPaletteData
BL = 00h Set PaletteData
= 01h Get PaletteData
= 02h Set SecondaryPalette Data
= 03h Get SecondaryPaletteData
= 80h SetPaletteDataduringVertical Retrace
withBlankBit on
CX = Numberofpaletteregisters toupdate
DX = Firstpaletteregistertoupdate
ES:DI = Tableofpalettevalues (seebelowforformat)
Output:AX = VBEReturnStatus
FormatofPaletteValues: Alignment byte, Redbyte, Greenbyte, Bluebyte
______________________________
Input: AX = 4F0Ah VBE2.0 Protected Mode Interface
BL = 00h Returnprotectedmodetable
Output: AX = Status
ES = Real ModeSegment ofTable
DI = OffsetofTable
CX = LengthofTableincludingprotectedmodecodeinbytes
(forcopyingpurposes)
______________________________
VBEData Structures
VBECOREFUNCTIONSVERSION2.0 Page47
DOCUMENTREVISION1.1
Appendix 2 - VBE Data Structures
VbeInfoBlockstruc
VbeSignature db 'VESA' ;VBESignature
VbeVersion dw 0200h ;VBEVersion
OemStringPtr dd ? ;PointertoOEMString
Capabilities db 4 dup (?) ;Capabilitiesofgraphicscontroller
VideoModePtr dd ? ;PointertoVideoModeList
TotalMemory dw ? ; Numberof64kbmemoryblocks
; Added for VBE 2.0
OemSoftwareRev dw ? ;VBEimplementationSoftwarerevision
OemVendorNamePtr dd ? ;PointertoVendorNameString
OemProductNamePtr dd ? ;PointertoProduct NameString
OemProductRevPtr dd ? ;PointertoProductRevisionString
Reserved db 222 dup (?) ;ReservedforVBEimplementationscratch
; area
OemData db 256 dup (?) ; DataAreaforOEMStrings
VbeInfoBlockends
VBEData Structures
Page48 VBECOREFUNCTIONSVERSION2.0
DOCUMENTREVISION1.1
ModeInfoBlockstruc
;MandatoryinformationforallVBErevisions
ModeAttributes dw ? ;modeattributes
WinAAttributes db ? ;windowAattributes
WinBAttributes db ? ;windowBattributes
WinGranularity dw ? ;windowgranularity
WinSize dw ? ;windowsize
WinASegment dw ? ;windowAstart segment
WinBSegment dw ? ;windowBstartsegment
WinFuncPtr dd ? ;pointertowindowfunction
BytesPerScanLine dw ? ;bytes perscanline
;MandatoryinformationforVBE1.2andabove
XResolution dw ? ;horizontalresolutioninpixelsorcharacters
YResolution dw ? ;verticalresolutioninpixelsorcharacters
XCharSize db ? ;charactercellwidthinpixels
YCharSize db ? ;charactercellheightinpixels
NumberOfPlanes db ? ;numberofmemoryplanes
BitsPerPixel db ? ;bitsperpixel
NumberOfBanks db ? ;numberofbanks
MemoryModel db ? ;memorymodeltype
BankSize db ? ;banksizeinKB
NumberOfImagePages db ? ;numberofimages
Reserved db 1 ;reservedforpagefunction
;DirectColorfields(requiredfordirect/6andYUV/7memorymodels)
RedMaskSize db ? ;sizeofdirect colorredmaskinbits
RedFieldPosition db ? ;bitpositionoflsbofredmask
GreenMaskSize db ? ;sizeofdirectcolorgreenmaskinbits
GreenFieldPosition db ? ;bitpositionoflsbofgreenmask
BlueMaskSize db ? ;sizeofdirectcolorbluemaskinbits
BlueFieldPosition db ? ;bitpositionoflsbofbluemask
RsvdMaskSize db ? ;sizeofdirect colorreservedmaskinbits
RsvdFieldPosition db ? ;bitpositionoflsbofreservedmask
DirectColorModeInfo db ? ;directcolormodeattributes
;MandatoryinformationforVBE2.0andabove
PhysBasePtr dd ? ;physicaladdressforflatmemoryframebuffer
OffScreenMemOffset dd ? ;pointertostart ofoffscreenmemory
OffScreenMemSize dw ? ;amountofoffscreenmemoryin1kunits
Reserved db 206 dup (?) ; remainder of ModeInfoBlock
ModeInfoBlock ends
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20
Vbe20

More Related Content

What's hot

What's hot (7)

Thinkpad x390 Laptops Trần Phát
Thinkpad x390 Laptops Trần PhátThinkpad x390 Laptops Trần Phát
Thinkpad x390 Laptops Trần Phát
 
Resume18
Resume18Resume18
Resume18
 
Hp z book g5
Hp z book g5Hp z book g5
Hp z book g5
 
Supercomputers and Cloud Games
Supercomputers and Cloud GamesSupercomputers and Cloud Games
Supercomputers and Cloud Games
 
Exp w21
Exp w21Exp w21
Exp w21
 
SmartOS
SmartOSSmartOS
SmartOS
 
Unlock Hidden Potential through Big Data and Analytics
Unlock Hidden Potential through Big Data and AnalyticsUnlock Hidden Potential through Big Data and Analytics
Unlock Hidden Potential through Big Data and Analytics
 

Similar to Vbe20

WS-* Specifications Update 2007
WS-* Specifications Update 2007WS-* Specifications Update 2007
WS-* Specifications Update 2007Jorgen Thelin
 
Resin.io contribution to the AGILE-IoT project
Resin.io contribution to the AGILE-IoT projectResin.io contribution to the AGILE-IoT project
Resin.io contribution to the AGILE-IoT projectAGILE IoT
 
네트워크 가상화 보안현황 및 보안연관성
네트워크 가상화 보안현황 및 보안연관성네트워크 가상화 보안현황 및 보안연관성
네트워크 가상화 보안현황 및 보안연관성NAIM Networks, Inc.
 
Java ME Open Source
Java ME Open SourceJava ME Open Source
Java ME Open Sourceguest63b060
 
VxWorks - Holistic Security (Art of Testing)
VxWorks - Holistic Security (Art of  Testing)VxWorks - Holistic Security (Art of  Testing)
VxWorks - Holistic Security (Art of Testing)Aditya K Sood
 
“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIA
“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIA“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIA
“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIAEdge AI and Vision Alliance
 
Kiosk White Paper_Ron_Tony_Loiacono
Kiosk White Paper_Ron_Tony_LoiaconoKiosk White Paper_Ron_Tony_Loiacono
Kiosk White Paper_Ron_Tony_LoiaconoAnthony Loiacono
 
Стас Павлов «Построение безопасной архитектуры IoT решений на примере Azure I...
Стас Павлов «Построение безопасной архитектуры IoT решений на примере Azure I...Стас Павлов «Построение безопасной архитектуры IoT решений на примере Azure I...
Стас Павлов «Построение безопасной архитектуры IoT решений на примере Azure I...MskDotNet Community
 
Porting Android apps to the Series 40 platform
Porting Android apps to the Series 40 platformPorting Android apps to the Series 40 platform
Porting Android apps to the Series 40 platformMicrosoft Mobile Developer
 
Increase Profitability with WAV and Exalt Solutions
Increase Profitability with WAV and Exalt SolutionsIncrease Profitability with WAV and Exalt Solutions
Increase Profitability with WAV and Exalt SolutionsWAV Inc.
 
The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016
The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016
The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016Benjamin Cabé
 
UShareSoft Virtualization & Cloud Factory
UShareSoft Virtualization & Cloud FactoryUShareSoft Virtualization & Cloud Factory
UShareSoft Virtualization & Cloud FactoryUShareSoft
 
Network Equipment Testing White Paper
Network Equipment Testing White PaperNetwork Equipment Testing White Paper
Network Equipment Testing White PaperAtul Nene
 
SOFTORIX Project TitlesList
SOFTORIX Project TitlesListSOFTORIX Project TitlesList
SOFTORIX Project TitlesListguest6071d14
 
The Context Aware Network A Holistic Approach to BYOD
The Context Aware Network A Holistic Approach to BYODThe Context Aware Network A Holistic Approach to BYOD
The Context Aware Network A Holistic Approach to BYODCisco Canada
 

Similar to Vbe20 (20)

WS-* Specifications Update 2007
WS-* Specifications Update 2007WS-* Specifications Update 2007
WS-* Specifications Update 2007
 
Resin.io contribution to the AGILE-IoT project
Resin.io contribution to the AGILE-IoT projectResin.io contribution to the AGILE-IoT project
Resin.io contribution to the AGILE-IoT project
 
네트워크 가상화 보안현황 및 보안연관성
네트워크 가상화 보안현황 및 보안연관성네트워크 가상화 보안현황 및 보안연관성
네트워크 가상화 보안현황 및 보안연관성
 
Azure Sphere
Azure SphereAzure Sphere
Azure Sphere
 
Java ME Open Source
Java ME Open SourceJava ME Open Source
Java ME Open Source
 
VxWorks - Holistic Security (Art of Testing)
VxWorks - Holistic Security (Art of  Testing)VxWorks - Holistic Security (Art of  Testing)
VxWorks - Holistic Security (Art of Testing)
 
Group presentation
Group presentationGroup presentation
Group presentation
 
DRAFT
DRAFTDRAFT
DRAFT
 
“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIA
“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIA“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIA
“Streamlining Development of Edge AI Applications,” a Presentation from NVIDIA
 
DDGen Product Brief
DDGen Product BriefDDGen Product Brief
DDGen Product Brief
 
Applied VoIP Security
Applied VoIP Security Applied VoIP Security
Applied VoIP Security
 
Kiosk White Paper_Ron_Tony_Loiacono
Kiosk White Paper_Ron_Tony_LoiaconoKiosk White Paper_Ron_Tony_Loiacono
Kiosk White Paper_Ron_Tony_Loiacono
 
Стас Павлов «Построение безопасной архитектуры IoT решений на примере Azure I...
Стас Павлов «Построение безопасной архитектуры IoT решений на примере Azure I...Стас Павлов «Построение безопасной архитектуры IoT решений на примере Azure I...
Стас Павлов «Построение безопасной архитектуры IoT решений на примере Azure I...
 
Porting Android apps to the Series 40 platform
Porting Android apps to the Series 40 platformPorting Android apps to the Series 40 platform
Porting Android apps to the Series 40 platform
 
Increase Profitability with WAV and Exalt Solutions
Increase Profitability with WAV and Exalt SolutionsIncrease Profitability with WAV and Exalt Solutions
Increase Profitability with WAV and Exalt Solutions
 
The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016
The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016
The Right Tools for IoT Developers – Dan Gross @ Eclipse IoT Day ThingMonk 2016
 
UShareSoft Virtualization & Cloud Factory
UShareSoft Virtualization & Cloud FactoryUShareSoft Virtualization & Cloud Factory
UShareSoft Virtualization & Cloud Factory
 
Network Equipment Testing White Paper
Network Equipment Testing White PaperNetwork Equipment Testing White Paper
Network Equipment Testing White Paper
 
SOFTORIX Project TitlesList
SOFTORIX Project TitlesListSOFTORIX Project TitlesList
SOFTORIX Project TitlesList
 
The Context Aware Network A Holistic Approach to BYOD
The Context Aware Network A Holistic Approach to BYODThe Context Aware Network A Holistic Approach to BYOD
The Context Aware Network A Holistic Approach to BYOD
 

Recently uploaded

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Recently uploaded (20)

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

Vbe20

  • 1. VESA® Video Electronics Standards Association 2150NorthFirst Street, Suite 440 Phone: (408) 435-0333 San Jose, CA 95131-2029 FAX: (408) 435-8225 VESA BIOS EXTENSION (VBE) Core Functions Standard Version: 2.0 Document Revision: 1.1 Ratification Date: November 18, 1994 Purpose Tostandardizeamodular,softwareinterfacetodisplayandaudiodevices. TheVBEinterfaceis intendedtosimplifyandencouragethedevelopmentofapplicationsthatwishtousegraphics, video, and audiodeviceswithoutspecificknowledgeoftheinternaloperationoftheevolvingtargethardware. Summary TheVBEstandarddefines aset ofextensions totheVGAROMBIOSservices. These functions can beaccessedunderDOSthroughinterrupt 10h, orbecalleddirectlybyhighperformance32-bit applicationsandoperatingsystems otherthanDOS. Theseextensionsalsoprovideahardware-independentmechanismtoobtainvendorinformation, and serveasanextensiblefoundationforOEMsandVESAtofacilitaterapidsoftwaresupport ofemerging hardwaretechnologywithoutsacrificingbackwardscompatibility. VBE Core Standard
  • 3. VBECOREFUNCTIONSVERSION2.0 Pageiii DOCUMENTREVISION1.1 Intellectual Property Copyright©1993,1995-VideoElectronics Standards Association. Duplicationofthis document withinVESAmembercompaniesforreviewpurposes is permitted. Thisdocumentmaybe posted onlineinitsunmodified,read-onlyformatonly.Nocharges,otherthanstandardconnect ordownload charges,maybeassessedforthis document. Allotherrightsreserved. Whileeveryprecautionhasbeentakeninthepreparationofthis standard, theVideoElectronics StandardsAssociationanditscontributorsassumenoresponsibilityforerrors oromissions, andmake nowarranties,expressedorimplied,offunctionalityorsuitabilityforanypurpose. Thesamplecodecontainedwithin thisstandardmaybeusedwithout restriction. Trademarks Alltrademarksusedinthisdocument arepropertyoftheirrespectiveowners. • VESA, VBE, VESADDC, VBE/AI, VBE/PM, and VBE/DDCare trademarks ofVideo ElectronicsStandardsAssociation. • MS-DOSand Windows are trademarks ofMicrosoft , Inc. • IBM, VGA, EGA, CGA, andMDAaretrademarks ofInternational Business Machines • RAMDACis a trademark ofBrooktree Corp. • HerculesisatrademarkofHercules ComputerTechnology, Inc. Patents VESAproposal andstandards documents areadoptedbytheVideoElectronics Standards Association withoutregardtowhethertheiradoptionmayinvolvepatents onarticles, materials, orprocesses. Such adoptiondoesnotassumeanyliabilitytoanypatentowner, nordoes it assumeanyobligationwhatever toparties adoptingtheproposal orstandards document. Support for this Specification Clarificationsandapplicationnotestosupportthisstandardwill bepublishedas theneedarises. To obtainthelateststandardandsupport documentation, contact VESA. Ifyouhaveaproductwhichincorporates VBE, youshouldaskthecompanythat manufacturedyour productforassistance. Ifyouareadisplayorcontrollermanufacturer, VESAcanassist youwithany clarificationyoumayrequire. AllcommentsorreportederrorsshouldbesubmittedinwritingtoVESA usingoneofthefollowingmechanisms: World Wide Web: www.vesa.org Mail to: E-mail: techsupport@vesa.org VideoElectronicsStandardsAssociation Fax: 408-435-8225 2150NorthFirst Street, Suite 440 Voice: 408-435-0333 SanJose, California95131-2029
  • 4. Page iv VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 SSC/VBE Workgroup Members Anyindustrystandardrequiresinput frommanysources. Thepeoplelistedbelowweremembers ofthe VBEWorkgroupoftheSoftwareStandards Committee(SSC)whichwas responsibleforcombiningall oftheindustryinputintothisproposal: CHAIRMAN Kevin Gillett, S-MOS Systems, Inc., past chairman, Rod Dewell , Excalibur Solutions MEMBERS David Penley, AT&T Global Information Solutions Rebecca Nolan, Chips and Technologies, Inc. Brad Haakenson, Cirrus Logic, Inc. Joe Rickson, Logitech, Inc. Aaron Leatherman, LSI Logic Corporation Jake Richter, Panacea Inc. Raluca Iovan, Phoenix Technologies Ltd. Kendall Bennett, SciTech Software Tom Ryan, SciTech Software George Bystricky, S-MOS Systems, Inc. Jason Li, Trident Microsystems, Inc. Chris Tsang, ULSISystems GregMoore, VideoElectronics Standards Association Andy Lambrecht, VLSI Technology, Inc. Rex Wolfe, Western Digital Imaging
  • 5. VBECOREFUNCTIONSVERSION2.0 Page v DOCUMENTREVISION1.1 Table of Contents INTELLECTUAL PROPERTY .....................................................................................................................................................iii TRADEMARKS ...................................................................................................................................................................................iii PATENTS............................................................................................................................................................................................iii SUPPORT FORTHISSPECIFICATION...................................................................................................................................iii SSC/VBE WORKGROUPMEMBERS........................................................................................................................................iv TABLE OFCONTENTS..................................................................................................................................................................v 1.0INTRODUCTION...................................................................................................................................................................... 1 1.1SCOPE OF THE VBESTANDARD...............................................................................................................................................1 1.2 BACKGROUNDER ........................................................................................................................................................................2 2.0 VBE OVERVIEW......................................................................................................................................................................5 2.1 VBE FEATURES...........................................................................................................................................................................5 2.2 VBE AFFECTEDDEVICES..........................................................................................................................................................5 2.3 PROVIDINGVENDORINFORMATION.......................................................................................................................................5 3.0 VBE MODE NUMBERS...........................................................................................................................................................6 4.0 VBE FUNCTIONS...................................................................................................................................................................10 4.1 VBE RETURN STATUS .............................................................................................................................................................10 4.2 PROTECTED MODE CONSIDERATIONS................................................................................................................................11 4.3 FUNCTION 00H - RETURN VBECONTROLLERINFORMATION.........................................................................................12 4.4 FUNCTION 01H - RETURN VBE MODE INFORMATION ......................................................................................................16 4.5 FUNCTION 02H - SET VBE MODE.........................................................................................................................................25 4.6 FUNCTION 03H - RETURN CURRENT VBE MODE...............................................................................................................26 4.7 FUNCTION 04H - SAVE/RESTORESTATE ............................................................................................................................27 4.8 FUNCTION 05H - DISPLAYWINDOW CONTROL.................................................................................................................27 4.9 FUNCTION 06H - SET/GET LOGICALSCANLINE LENGTH ................................................................................................28 4.10 FUNCTION 07H - SET/GET DISPLAYSTART ......................................................................................................................29 4.11 FUNCTION 08H - SET/GET DAC PALETTE FORMAT........................................................................................................30 4.12 FUNCTION 09H - SET/GET PALETTE DATA.......................................................................................................................30 4.13 FUNCTION 0AH - RETURN VBEPROTECTED MODE INTERFACE ..................................................................................31 5.0VBESUPPLEMENTAL SPECIFICATIONS......................................................................................................................34 5.1 PURPOSEOFSUPPLEMENTAL SPECIFICATIONS ................................................................................................................34 5.2 OBTAININGSUPPLEMENTAL VBEFUNCTIONNUMBERS.................................................................................................34 5.3 REQUIREDVBESUPPLEMENTAL SPECIFICATION COMPONENTS..................................................................................35 5.3.1 VBE Supplemental Specification Functions..............................................................................................................35 5.3.2 Return Status....................................................................................................................................................................35 5.3.3 Subfunction 00h - Return VBE Supplemental Specification Information ............................................................35 5.4 SUPPLEMENTAL SPECIFICATION PROTECTED MODE GUIDELINES..............................................................................38 5.5 LOADINGSUPPLEMENTAL DRIVERS ....................................................................................................................................39 5.6 IMPLEMENTATION QUESTIONS ............................................................................................................................................39
  • 6. Page vi VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 5.7 KNOWN SUPPLEMENTAL SPECIFICATIONS........................................................................................................................40 5.7.1 Function 10h - Power Management Extensions (PM).............................................................................................40 5.7.2 Function 11h - Flat Panel Interface Extensions (FP)..............................................................................................40 5.7.3 Function 12h - Cursor Interface Extensions (CI).....................................................................................................40 5.7.4 Function 13h - Audio Interface Extensions (AI) .......................................................................................................40 5.7.5 Function 14h - OEM Extensions ..................................................................................................................................40 5.7.6 Function 15h - Display Data Channel (DDC) ..........................................................................................................40 5.7.7 Function 16h - Graphics System Configuration (GC).............................................................................................40 APPENDIX1-VBEQUICKREFERENCE................................................................................................................................41 APPENDIX 2 - VBE DATA STRUCTURES..............................................................................................................................47 APPENDIX 3 - VBE SUPPLEMENTAL SPECS. .....................................................................................................................61 APPENDIX4-VBEIMPLEMENTATIONCONSIDERATIONS .........................................................................................63 A4.1 MINIMUM FUNCTIONALITY REQUIREMENTS..................................................................................................................63 A4.1.1 Required VBE Services...............................................................................................................................................63 A4.1.2 Minimum ROM Implementation................................................................................................................................63 A4.1.3 TSR Implementations ..................................................................................................................................................63 A4.2 VGA BIOS IMPLICATIONS....................................................................................................................................................64 A4.3 ROM SPACE LIMITATIONS..................................................................................................................................................65 A4.3.1 Data Storage ................................................................................................................................................................65 A4.3.2 Removal of Unused VGA Fonts .................................................................................................................................65 A4.3.3 Deleting VGA Parameter Tables...............................................................................................................................66 A4.3.4 Increasing ROM Space...............................................................................................................................................66 4.3.5 Support of VGA TTY Functions....................................................................................................................................66 A4.4 IMPLEMENTATION NOTESBY FUNCTION........................................................................................................................67 A4.4.1 General Notes...............................................................................................................................................................67 A4.4.2 Function 00h - Return VBE Controller Information.............................................................................................67 A4.4.3 Function 01h - Return VBE Mode Information......................................................................................................68 A4.4.4 Function 02h - Set VBE Mode...................................................................................................................................68 A4.4.5 Function 03h - Return Current VBE Mode.............................................................................................................69 A4.4.6 Function 05h - Display Window Control................................................................................................................69 A4.4.7 Function 06h - Get/Set Logical Scan Line Length................................................................................................70 A4.4.8 Function 07h - Get/Set Display Start ......................................................................................................................70 A4.4.9 Function 08h - Set/Get DAC Palette Format.........................................................................................................70 A4.4.10 Function 09h - Set/Get Palette Data......................................................................................................................70 A4.4.11 Function 0Ah - Return VBE Function Information..............................................................................................71 A4.5 PLUGANDPLAY ISSUES ........................................................................................................................................................71 A4.6 SUPPORTING MULTIPLE CONTROLLERS..........................................................................................................................71 A4.6.1 Dual-Controller Designs............................................................................................................................................71 A4.6.2 Provision for Multiple Independent Controllers...................................................................................................71 A4.7 DISPLAYREFRESHRATES ANDINTERLACING .................................................................................................................72 A4.8 OEM EXTENSIONSTOVBE ..................................................................................................................................................72 A4.9 CERTIFICATION REQUIREMENTS .......................................................................................................................................73 A4.9.1 VBETest Utility.............................................................................................................................................................73 A4.9.2 Communication with VESA Office............................................................................................................................73
  • 7. VBECOREFUNCTIONSVERSION2.0 Pagevii DOCUMENTREVISION1.1 APPENDIX5 - APPLICATIONPROGRAMMING CONSIDERATIONS..........................................................................74 A5.1 APPLICATION DEVELOPER'SSAMPLE SOURCE...............................................................................................................74 C Language Module.................................................................................................................................................................74 Assembly Language Module ...................................................................................................................................................84 A5.2 IMPLEMENTATION NOTESBY FUNCTION........................................................................................................................84 A5.2.1 General Notes...............................................................................................................................................................84 A5.2.2 Function 00h - Return VBE Controller Information.............................................................................................84 A5.2.3 Function 01h - Return VBE Mode Information......................................................................................................85 A5.2.4 Function 02h - Set VBE Mode...................................................................................................................................85 A5.2.5 Function 03h - Return Current VBE Mode.............................................................................................................86 A5.2.6 Function 05h - Display Window Control................................................................................................................86 A5.2.7 Function 06h - Get/Set Logical Scan Line Length................................................................................................86 A5.2.8 Function 07h - Get/Set Display Start ......................................................................................................................87 A5.2.9 Function 08h - Set/Get DAC Palette Format.........................................................................................................87 A5.2.10 Function 09h - Set/Get Palette Data......................................................................................................................87 A5.2.11 Function 0Ah - Return VBE Function Information..............................................................................................88 APPENDIX6-DIFFERENCESBETWEENVBE REVISIONS .............................................................................................89 6.1 VBE 1.0................................................................................................................................................................................89 6.2 VBE 1.1................................................................................................................................................................................89 6.3 VBE 1.2................................................................................................................................................................................89 6.4 VBE 2.0................................................................................................................................................................................89 6.5 VBE 2.0, Rev. 1.1................................................................................................................................................................90 APPENDIX7-RELATEDDOCUMENTS.................................................................................................................................93
  • 8. Introduction VBECOREFUNCTIONSVERSION2.0 Page1 DOCUMENTREVISION1.1 1.0 Introduction This document contains the VESA BIOS Extension (VBE) specification for standard software access to graphics displaycontrollers which support resolutions, color depths, and frame buffer organizations beyond the VGA hardware standard. It is intended for use by both applications programmers and system software developers. System software developers may use this document to supplement the System and INT 10h ROM BIOS functions to provide the VBE services. Application developers can use this document as a guide to programming all VBE compatible devices. To understand the VBE specification, some knowledge of 80x86 assembly language and the VGA hardware registers may be required. However, the services described in this specification may be called fromanyhigh-level programming language that provides a mechanism for generating software interrupts with the 80x86 registers set to user-specified values. In this specification, 'VBE' and 'VBE 2.0' are synonymous with 'VBE Core Functions version 2.0'. 1.1 Scope of the VBE Standard TheprimarypurposeoftheVESAVBE is toprovidestandardsoftwaresupport forthemanyunique implementationsofSuperVGA(SVGA)graphicscontrollersonthePCplatformthat providefeatures beyondtheoriginalVGAhardwarestandard. Thisis toprovideafeasiblemechanismbywhich applicationdeveloperscantakeadvantageofthisnonstandardhardwareingraphics applications. TheVBEspecificationoffersanextensiblesoftwarefoundationwhichallowsittoevolveasdisplayand audiodevicesevolveovertime,withoutsacrificingbackwardsoftwarecompatibilitywitholder implementations. Newapplicationsoftwareshouldbeabletoworkwitholderhardware, and applicationsoftwarethathasalreadyshippedshouldworkcorrectlyonnewhardwaredevices. VBEservicesprovidestandardaccess toall resolutions andcolordepths providedonthedisplay controller,andreporttheavailabilityanddetailsofallsupportedconfigurationstotheapplicationas necessary. VBEimplementationsfacilitatethefieldsupportofaudioanddisplayhardwarebyprovidingthe applicationsoftwarewiththemanufacturer'snameandtheproductidentificationofthedisplay hardware. SincegraphicscontrollerservicesonthePCaretypicallyimplementedinROM, theVBEservices are definedsothattheyshouldbeimplementedwithinthestandardVGAROM. WhenROM implementations ofVBEarenot possible, orwhenfieldsoftwareupgrades totheonboardROMare necessary, theVBEimplementationmaybealsoofferedas adevicedriverorDOSTerminateandStay Resident(TSR)program.
  • 9. Introduction Page2 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 ThestandardVBEfunctions maybesupplementedbyOEM's as necessarytosupport customor proprietaryfunctionsuniquetothemanufacturer. ThismechanismenablestheOEMtoestablish functions that maybestandardtotheproduct line, orprovideaccess tospecial hardware enhancements. AlthoughpreviousVBEstandardsassumedthattheunderlyinggraphicsarchitecturewas aVGA device,thedisplayservicesdescribedbyVBE2.0canbeimplementedonanyframebufferoriented graphicsdevice. ThemajorityofVBEservicesfacilitatethesetupandconfigurationofthehardware,allowing applicationshighperformance,directaccesstotheconfigureddeviceatruntime. Tofurtherimprovethe performanceofflatframebufferdisplaydevicesinextendedresolutions, VBE2.0provides new memorymodelsthatdonotrequirethetraditionalframebuffer"banking"mechanisms. VBEis expectedtoworkonall 80x86platforms, inreal and protected modes. Sincesomemoderndisplaydevicesaredesignedwithout anyVGAsupport, twodisplaycontrollers maybepresentinthesystem. OnedisplaycontrollerwouldbeusedforVGAcompatibility, andthe otherusedforgraphicextensionstothebasicVGAmodes, resolutions, andframebuffermodels. Therefore, VBEmust beableoffertheapplicationautomaticaccess totheappropriatedevicebasedon themodeorresolutionthat is requestedbytheapplication. CurrentlybeyondthescopeoftheVBEspecificationisthehandlingofhardwareconfigurationand installationissues. It was originallyconsideredtobecomepart ofVBE2.0, howeverwehavedeferred theissuestotheGraphicsConfigurationSupplementalSpecification. Inaddition,itisalsopossiblefor anOEMtodefinetheirownextensionsusingtheOEMSupplementalSpecificationifrequired. 1.2 Backgrounder TheIBMVGA1 has becomeadefactostandardinthePCgraphics world. Amultitudeofdifferent VGAofferingsexistinthemarketplace,eachoneprovidingBIOSorregistercompatibilitywiththeIBM VGA.MoreandmoreoftheseVGAcompatibleproducts implement various supersets oftheVGA standard.Theseextensionsrangefromhigherresolutionsandmorecolors toimprovedperformanceand evensomegraphicsprocessingcapabilities.Intensecompetitionhasdramaticallyimprovedthe price/performanceratio, tothebenefit oftheenduser. 1 IBM and VGA are trademarks of International Business Machines Corporation.
  • 10. Introduction VBECOREFUNCTIONSVERSION2.0 Page3 DOCUMENTREVISION1.1 However, several serious problems faceasoftwaredeveloperwhointends totakeadvantageofthese "SuperVGA"2 environments.Becausethereisnostandardhardwareimplementation, thedeveloperis facedwithwidelydifferentSuperVGAhardwarearchitecture.Lackingacommonsoftwareinterface, designingapplicationsfortheseenvironmentsiscostlyandtechnicallydifficult.Exceptforapplications supportedbyOEM-specificdisplaydrivers, veryfewsoftwarepackages cantakeadvantageofthe powerandcapabilities ofSuperVGAproducts. TheVBEstandardwasoriginallyconceivedtoenablethedevelopmentofapplications that wishedto takeadvantageofdisplayresolutions andcolordepths beyondtheVGAdefinition. Theneedforan applicationorsoftwarestandardwas recognizedbythedevelopers ofgraphichardwaretoencourage theuseandacceptanceoftheirrapidlyadvancingproduct families. It becameobvious that themajority ofsoftwareapplicationdevelopers didnot havetheresources todevelopandsupport customdevice levelsoftwareforthehundreds ofdisplayboards onthemarket. Thereforetherichnewfeatures of thesedisplaydeviceswerenotbeingusedoutsideoftherelativelysmall CADmarket, andonlythen afterconsiderableeffort. Indeed, theneedforastandardforSVGAdisplayadapters became so important that the VESA organizationwasformedtoseekout asolution. Theoriginal VBEstandardwas devisedandagreed uponbyeachoftheactivedisplaycontrollermanufacturers, andhas sincebeenadoptedbyDOS applicationdeveloperstoenableuseofnon-VGAextendeddisplaymodes. As timewent alongVBE1.1was createdtoaddmorevideomodes andincreasedlogical line length/doublebufferingsupport. VBE1.2was createdtoaddmodes andalsoaddedhigh color RAMDACsupport. Inthethreeyears sinceVBE1.2was approved we have seen the standard become widelyaccepted andmanysuccessful programs haveembracedVBE. However, it has becomeobvious that theneed foramorerobustandextensiblestandardexists. Earlyextensions totheVGAstandardcontinuedusing alloftheoriginalVGAI/Oportsandframebufferaddresstocommunicatewiththecontroller hardware. Aswe'veseen,thesupportedresolutions andcolordepths havegrown, intelligent controllers withBITBLTandLineDrawFunctionshavebecomecommon,andnewflat framebuffermemory models haveappearedalongwithdisplaycontrollers that arenot basedonVGAinanyway. VBE2.0 andfutureextensionswillsupportnon-VGAbasedcontrollerswithnewfunctionsforreadingand writingthepaletteandforaccess totheflat framebuffermodels. 2 The term "Super VGA" is used in this document for a graphics display controller implementing any superset of the standard IBM VGA display adapter.
  • 11. Introduction Page4 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 VBE2.0,asdesigned,offerstheextensibilityandtherobustness that was lackingintheprevious specifications,whileatthesametimeofferingbackwardscompatibility. Inthefuture,weseetheneedforaddingsupplementalspecificationsforissueslikeMultimedia; AdvancedGraphicsFunctions;and"PlugandPlay"features.
  • 12. VBE Overview VBECOREFUNCTIONSVERSION2.0 Page5 DOCUMENTREVISION1.1 2.0 VBE Overview ThischapteroutlinesthevariousfeaturesandlimitationsoftheVBEstandard. 2.1 VBE Features • StandardapplicationinterfacetoGraphicsControllers (SVGADevices). • Standardmethodofidentifyingproductsandmanufacturers. • ProvisionforOEMextensionsthroughSub-function14h. • Simpleprotectedmodeinterface. • Extensibleinterfacethroughsupplementalspecifications. 2.2 VBE Affected Devices Allframebuffer-baseddevicesinthePCplatform(withtheexceptionofHercules, Monochrome (MDA), CGAandEGAdevices)aresuitableforusewithintheVBEstandardtoenable access to the devicebyVBE-compliantapplications. 2.3 Providing Vendor Information TheVGAspecificationdoesnotprovideastandardmechanismtodeterminewhat graphicdeviceit is runningon.OnlybyknowingOEM-specificfeaturescananapplicationdeterminethepresenceofa particulargraphicscontrollerordisplayboard.Thisofteninvolvesreadingandtestingregisterslocated atI/OaddressesuniquetoeachOEM. Bynot knowingwhat hardwareanapplicationis runningon, few, ifany, oftheextendedfeatures ofthis hardwarecan be used. TheVESABIOSExtensionprovidesseveralfunctionstoreturninformationaboutthegraphics environment.Thesefunctionsreturnsystemlevelinformationaswellasgraphicsmodespecificdetails. Function00hreturnsgeneralsystemlevelinformation,includinganOEMidentificationstring.The functionalsoreturns apointertothesupportedVBEandOEMmodes. Function01h maybe used by anapplicationtoobtainadditionalinformationabouteachsupportedmode.Function03hreturns the currentVBEmode.
  • 13. VBEModeNumbers Page6 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 3.0 VBE Mode Numbers StandardVGAmodenumbers are7bits wideandpresentlyrange from00h to 13h. OEMs have definedextendeddisplaymodes intherange14hto7Fh. Values from80htoFFhcannot beused, since VGABIOSFunction00h(Set videomode)interprets bit 7as a flagto clear or preserve display memory. Duetothelimitationsof7-bit modenumbers, theoptional VBEmodenumbers are14bits wide. To initializeaVBEmode,themodenumberis passedintheBXregistertoVBEFunction02h(Set VBE mode). TheformatofVBEmodenumbersisas follows: D0-D8 = Modenumber IfD8==0, this is not a VESAdefined mode IfD8== 1, this is a VESAdefined mode D9-D13 = ReservedbyVESAforfutureexpansion(=0) D14 = Linear/FlatFrameBufferSelect IfD14 == 0, Use VGA Frame Buffer IfD14==1, UseLinear/Flat Frame Buffer D15 = PreserveDisplayMemorySelect IfD15==0, Clear displaymemory IfD14==1, Preserve displaymemory Thus,VBEmodenumbersbeginat100h.Thismodenumberingschemeimplements standard7-bit modenumbersforOEM-definedmodes. StandardVGAmodes maybeinitializedthrough VBE Function02h(SetVBEmode)simplybyplacingthemodenumberinBLandclearingtheupperbyte (BH).7-bitOEM-defineddisplaymodes maybeinitializedinthesameway. Notethat modes mayonly beset ifthemodeexists in the VideoModeList pointedtobytheVideoModePTRreturnedinFunction 00h. Theexceptiontothis requirement is themodenumber81FFh. Todate, VESAhas definedonespecial 7-bit mode number, 6Ah, for the 800x600, 16-color, 4-plane graphics mode. Thecorresponding15-bit modenumberforthis modeis 102h. ThefollowingVBE modenumbershavebeendefined: GRAPHICS TEXT 15-bit 7-bit Resolution Colors 15-bit 7-bit Columns Rows mode mode mode mode number number number number 100h - 640x400 256 108h - 80 60 101h - 640x480 256 109h - 132 25 102h 6Ah 800x600 16 10Ah - 132 43 103h - 800x600 256 10Bh - 132 50 104h - 1024x768 16 10Ch - 132 60 105h - 1024x768 256 106h - 1280x1024 16
  • 15. VBEModeNumbers Page8 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 GRAPHICS 15-bit 7-bit Resolution Colors mode mode number number 10Dh - 320x200 32K(1:5:5:5:) 10Eh - 320x200 64K(5:6:5) 10Fh - 320x200 16.8M(8:8:8) 110h - 640x480 32K(1:5:5:5:) 111h - 640x480 64K(5:6:5) 112h - 640x480 16.8M(8:8:8) 113h - 800x600 32K(1:5:5:5:) 114h - 800x600 64K(5:6:5) 115h - 800x600 16.8M(8:8:8) 116h - 1024x768 32K(1:5:5:5:) 117h - 1024x768 64K(5:6:5) 118h - 1024x768 16.8M(8:8:8) 119h - 1280x1024 32K(1:5:5:5:) 11Ah - 1280x1024 64K(5:6:5) 11Bh - 1280x1024 16.8M(8:8:8) 81FFh Special Mode(seebelowfordetails) Note: StartingwithVBEversion2.0,VESAwillnolongerdefinenewVESAmodenumbers andit will notlongerbemandatorytosupport theseoldmodenumbers. However, it is highlyrecommendedthat BIOSimplementationscontinuetosupportthesemodenumbersforcompatibilitywitholdersoftware. VBE2.0-awareapplicationsshouldfollowtheguidelinesinAppendix5-ApplicationProgramming Considerations -forsettingadesiredmode. Note: Mode81FFhis aspecial modedesignedtopreservethecurrent memorycontents and give accesstotheentirevideomemory. Thismodeisespeciallyusefulforsavingtheentirevideomemory contents beforegoingintoastatethat couldlosethecontents (e.g., set this modetogainaccess toall videomemorytosaveit beforegoingintoavolatilepowerdownstate). This modeis requiredbecause theentirevideomemorycontents arenot always accessibleineverymode. It isrecommendedthat this modebepackedpixel informat, andaModeInfoBlockmust bedefinedforit. However, it shouldnot appearintheVideoModeList.LookintheModeInfoBlocktodetermineifpagingis requiredandhow pagingissupportedifitis. Alsonotethattherearenoimpliedresolutionsortimingsassociatedwiththis mode. Note: FuturedisplayresolutionswillbedefinedbyVESAdisplayvendors. Thecolordepths will not bespecifiedandnewmodenumbers will notbeassignedfortheseresolutions. Forexample, ifthe VESAdisplayvendorsdefine1600x1200asaVESAresolution, applicationdevelopers shouldtarget theirdisplayresolutionfor1600x1200ratherthanchoosinganarbitraryresolutionlike1550x1190. TheVBEimplementationshouldbequeriedtogettheavailableresolutions andcolordepths andthe
  • 17. VBEFunctions Page10 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 4.0 VBE Functions Thischapterdescribesindetaileachofthefunctions definedbytheVBEstandard. VBEfunctions are calledusingtheINT10hinterrupt vector, passingarguments inthe80X86registers. TheINT10h interrupthandlerfirstdeterminesifaVBEfunctionhas beenrequested, andifso, processes that request. Otherwisecontrol is passedtothestandardVGABIOSfor completion. AllVBEfunctionsarecalledwiththeAHregistersetto4FhtodistinguishthemfromthestandardVGA BIOSfunctions. TheALregisteris usedtoindicatewhichVBEfunctionis tobeperformed. For supplementalorextendedfunctionalitytheBLregisterisusedwhenappropriatetoindicateaspecific sub-function. Functions00h-0FhhavebeenreservedforStandardVBEfunctionnumbers; Functions 10h-FFh are reservedforVBESupplementalSpecifications. InadditiontotheINT10hinterface, aProtectedModeInterfaceis availableand is described below. 4.1 VBE Return Status TheAXregisterisusedtoindicatethecompletionstatus uponreturnfromVBEfunctions. IfVBE supportforthespecifiedfunctionisavailable,the4FhvaluepassedintheAHregisteronentryis returnedintheALregister. IftheVBEfunctioncompletedsuccessfully, 00his returnedintheAH register. OtherwisetheAHregisteris set toindicatethenatureofthefailure. VBERETURNSTATUS AL == 4Fh: Functionissupported AL != 4Fh: Functionisnotsupported AH == 00h: Functioncallsuccessful AH == 01h: Functioncallfailed AH == 02h: Functionisnotsupportedinthecurrenthardwareconfiguration AH == 03h: Functioncallinvalidincurrentvideomode Note: Applicationsshouldtreatanynon-zerovalueintheAHregisterasageneral failureconditionas laterversionsoftheVBEmaydefineadditional errorcodes.
  • 18. VBEFunctions 00hReturnVBEControllerInformation VBECOREFUNCTIONSVERSION2.0 Page11 DOCUMENTREVISION1.1 4.2 Protected Mode Considerations VBEservices maybecalleddirectlyfrom32-bit protectedmodeonly. For32-bit protectedmode, 2selector/segment descriptors for 32-bit code and the data segment are needed.Thesewillbeallocatedandinitializedbythecaller.Thesegmentlimitfieldswillbeset to64k. TheseselectorsmayeitherbeintheGDTorLDT, but must bevalidwhenevertheVBEis calledin protectedmode. Thecallermust supplyastacklargeenoughforusebyVBEandbypotential interrupt handlers.Thecaller'sstackwillbeactiveiforwheninterrupts areenabledintheVBEroutine, sincethe VBEwillnotswitchstackswheninterruptsareenabled,includingNMIinterrupts. The32-bit VBE interfacerequires a32-bit stack. Ifthememorylocationis zero, thenonlyI/Omappedports will beusedsotheapplicationdoes not needtodoanythingspecial. This shouldbethedefault caseforALLcards that have I/Omapped registersbecauseit provides thebest performance. Ifthememorylocationis nonzero(therecanbeonlyone), theapplicationwill needtocreateanew32- bitselectorwiththebaseaddressthatpointstothe“physical”locationspecifiedwiththespecifiedlimit. Whentheapplicationneeds tocall the32-bitbankswitchfunction,itmustthenloadtheES selector withthevalueofthenewselectorthat has beencreated. Thebankswitchingcodecanthen directly accessitsmemorymappedregisters as absoluteoffsets intotheESselector (i.e., mov[es:10],eaxtoput avalueintotheregisterat base+10). It is uptotheapplicationcodetosaveandrestoretheprevious stateofthe ESselector ifthis is necessary(forexampleinflat model code). WhentheVBEservices arecalled, thecurrent I/Opermissionbit mapmust allowaccess tothe I/O ports that theVBEmayneedtoaccess. This can be found in the Sub-Table (Ports and Memory) returnedbyVBEFunction0Ah. Tosummarize,itistheresponsibilityofthecallingtoensuretothat it has theappropriateI/Oand memoryprivileges, andalargeenoughstackandappropriateselectors allocated. It is alsothe responsibilityofthecallingapplicationtopreserveregistersifnecessary. Applicationsmustusethesameregisters fortheFunction05handFunction09hprotectedmode interfacethattheywoulduseinarealmodecall. This includes theAXregister. Function07hprotectedmodecalls haveadifferent format. AX = 4F07h BL = 00h Set DisplayCRTCStart = 80h SetDisplayCRTCStart duringVertical Retrace CX = Bits 0-15ofdisplaystart address DX = Bits 16-31ofdisplaystart address
  • 19. VBEFunctions 00hReturnVBEControllerInformation Page12 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 Theprotectedmodeapplicationmust keeptrackofthecolordepthandscanlinelengthtocalculatethe newstartaddress. Ifavaluethat is out ofrangeis programmed, unpredictableresults will occur. 4.3 Function 00h - Return VBE Controller Information Thisrequiredfunctionreturnsthecapabilitiesofthedisplaycontroller,therevisionleveloftheVBE implementation,andvendorspecificinformationtoassistinsupportingalldisplaycontrollersinthefield. Thepurposeofthisfunctionistoprovideinformationtothecallingprogramaboutthegeneral capabilitiesoftheinstalledVBEsoftwareandhardware.Thisfunctionfillsaninformationblockstructure attheaddressspecifiedbythecaller. TheVbeInfoBlockinformationblocksizeis 256bytes forVBE 1.x, and 512 bytes for VBE2.0. Input: AX = 4F00h ReturnVBEControllerInformation ES:DI = Pointertobufferinwhichtoplace VbeInfoBlockstructure (VbeSignatureshouldbeset to'VBE2'when functioniscalledtoindicateVBE2.0information isdesiredandtheinformationblockis 512bytes in size.) Output: AX = VBEReturnStatus Note: Allotherregisters arepreserved. Theinformationblockhasthefollowingstructure: VbeInfoBlockstruc VbeSignature db 'VESA' ;VBESignature VbeVersion dw 0200h ;VBEVersion OemStringPtr dd ? ;PointertoOEMString Capabilities db 4 dup (?) ;Capabilitiesofgraphicscontroller VideoModePtr dd ? ;PointertoVideoModeList TotalMemory dw ? ; Numberof64kbmemoryblocks ; Added for VBE 2.0 OemSoftwareRev dw ? ;VBEimplementationSoftwarerevision OemVendorNamePtr dd ? ;PointertoVendorNameString OemProductNamePtr dd ? ; PointertoProduct NameString OemProductRevPtr dd ? ;PointertoProductRevisionString Reserved db 222 dup (?) ;ReservedforVBEimplementationscratch ; area OemData db 256 dup (?) ; DataAreaforOEMStrings VbeInfoBlockends
  • 20. VBEFunctions 00hReturnVBEControllerInformation VBECOREFUNCTIONSVERSION2.0 Page13 DOCUMENTREVISION1.1 Note: AlldatainthisstructureissubjecttochangebytheVBEimplementationwhenVBEFunction 00his called. Therefore, it shouldnot beusedbytheapplicationtostoredataofanykind. DescriptionoftheVbeInfoBlockstructurefields: The VbeSignaturefieldisfilledwiththeASCIIcharacters'VESA'bytheVBEimplementation.VBE 2.0applicationsshouldpreset this fieldwiththeASCIIcharacters 'VBE2'toindicatetotheVBE implementationthattheVBE2.0extendedinformationisdesired,andtheVbeInfoBlockis 512bytes in size. UponreturnfromVBEFunction00h, this fieldshouldalways beset to'VESA'bytheVBE implementation. The VbeVersionisaBCDvaluewhichspecifieswhatleveloftheVBEstandardis implementedinthe software.Thehigherbytespecifiesthemajorversionnumber.Thelowerbytespecifies theminor versionnumber. Note: The BCDvalue for VBE2.0 is 0200h and the BCDvalue for VBE1.2 is 0102h. In the past we havehadsomeapplicationsmisinterpretingtheseBCDvalues. Forexample, BCD0102hwas interpretedas 1.02, whichis incorrect. The OemStringPtrisaRealModefarpointertoanullterminatedOEM-definedstring. This stringmay beusedtoidentifythegraphicscontrollerchiporOEMproduct familyforhardwarespecificdisplay drivers.Therearenorestrictionsontheformat ofthestring. This pointermaypoint intoeitherROMor RAM,dependingonthespecificimplementation. VBE2.0BIOSimplementationsmustplacethisstring intheOemDataareawithintheVbeInfoBlockif'VBE2'is preset intheVbeSignaturefieldonentryto Function00h. Thismakes it possibletoconvert theRealModeaddress toanoffset withinthe VbeInfoBlockforProtectedmodeapplications. Note: ThelengthoftheOEMStringis not defined, but forspaceconsiderations, werecommenda stringlengthoflessthan256bytes. The Capabilities fieldindicatesthesupportofspecificfeaturesinthegraphicsenvironment.Thebits aredefinedasfollows: D0 = 0 DACisfixedwidth, with6bits perprimarycolor = 1 DACwidthis switchableto8bits perprimarycolor D1 = 0 ControllerisVGAcompatible = 1 ControllerisnotVGAcompatible D2 = 0 NormalRAMDACoperation = 1 WhenprogramminglargeblocksofinformationtotheRAMDAC, usetheblankbitinFunction09h. D3-31 =Reserved
  • 21. VBEFunctions 00hReturnVBEControllerInformation Page14 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 BIOSImplementationNote: TheDACmust always berestoredto 6 bits per primaryas default upon amodeset. Ifthe DAChas been switched to 8 bits per primary, the mode set must restore the DAC to6bits perprimarytoensuretheapplicationdeveloperthat he does not have to reset it. Application Developer's Note: IfaDACis switchable, youcanassume that the DACwill be restoredto6bits perprimaryupona mode set. For an application to use a DAC, the application programisresponsibleforsettingtheDACto8bits perprimarymodeusingFunction08h. VGAcompatibilityisdefinedas supportingall standardIBMVGAmodes, fonts andI/Oports; however,VGAcompatibilitydoesn't guaranteethat all modes whichcanbeset areVGAcompatible, or thatthe8x14fontisavailable. TheneedforD2=1"programtheRAMDACusingtheblankbit inFunction09h"is forolderstyle RAMDACs,whereprogrammingtheRAMvaluesduringdisplaytimecausesa"snow-like"effect on thescreen. NewerstyleRAMDACs don't havethis limitationandcaneasilybeprogrammedat any time,but olderRAMDACs requirethat theybeblankedsoas not todisplaythesnowwhilevalues changeduringdisplaytime. Thisbitinformsthesoftwarethatitshouldmakethefunctioncallwith BL=80hratherthanBL=00htoensuretheminimizationofthe"snow-like"effect. The VideoModePtr points toalist of modenumbers forall displaymodes supported bythe VBE implementation. Eachmodenumberoccupies oneword(16bits). Thelist ofmodenumbers is terminatedbya-1(0FFFFh). Themodenumbers inthis list represent all ofthepotentiallysupported modes bythedisplaycontroller. RefertoChapter3foradescriptionofVESAVBEmode numbers. VBE2.0BIOSimplementationsmust placethis modelist intheReservedareaoftheVbeInfoBlockor haveitstaticallystoredwithintheVBEimplementationif'VBE2'ispresetintheVbeSignaturefieldon entrytoFunction00h. Note: Itisresponsibilityoftheapplicationtoverifytheactualavailabilityofanymodereturnedbythis functionthroughtheReturnVBEModeInformation(VBEFunction01h)call.Someofthereturned modesmaynotbeavailableduetotheactualamountofmemoryphysicallyinstalledonthedisplay boardorduetothecapabilities oftheattachedmonitor. Note: IfaVideoModeList is foundtocontainnoentries (starts with0FFFFh), it canbeassumed that theVBEimplementationisa"stub"implementationwhereonlyFunction00hissupportedfordiagnostic or"PlugandPlay"reasons. Thesestubimplementations arenot VBE2.0compliant andshouldonlybe implementedincaseswherenospaceisavailabletoimplementtheentireVBE. The TotalMemoryfieldindicatesthemaximumamountofmemoryphysicallyinstalledandavailableto the frame buffer in 64KBunits. (e.g. 256KB= 4, 512KB= 8) Not all video modes can address all thismemory,seetheModeInfoBlockfordetailedinformationabout theaddressablememoryforagiven mode. The OemSoftwareRev fieldisaBCDvaluewhichspecifiestheOEMrevisionlevel oftheVBE software. Thehigherbytespecifiesthemajorversionnumber.Thelowerbytespecifies theminor
  • 22. VBEFunctions 00hReturnVBEControllerInformation VBECOREFUNCTIONSVERSION2.0 Page15 DOCUMENTREVISION1.1 versionnumber. ThisfieldcanbeusedtoidentifytheOEM's VBEsoftwarerelease. This fieldis only filledinwhen'VBE2'ispresetintheVbeSignaturefieldonentrytoFunction00h. The OemVendorNamePtrisapointerto anull-terminatedstringcontainingthenameofthevendor whichproducedthedisplaycontrollerboardproduct. (This stringmaybecontainedinthe VbeInfoBlockortheVBEimplementation.) Thisfieldisonlyfilledinwhen'VBE2'ispresetinthe VbeSignaturefieldonentrytoFunction00h. (Note: thelengthofthestrings OemProductRev, OemProductNameandOemVendorName(includingterminators)summed,mustfitwithina256byte buffer;thisistoallowforreturnintheOemDatafieldifnecessary.) The OemProductNamePtrisapointerto anull-terminatedstringcontainingtheproduct nameofthe displaycontrollerboard. (ThisstringmaybecontainedintheVbeInfoBlockortheVBE implementation.) Thisfieldisonlyfilledinwhen'VBE2'ispresetintheVbeSignaturefieldonentryto Function00h. (Note: thelengthofthestrings OemProductRev, OemProductNameand OemVendorName(includingterminators)summed,mustfitwithina256bytebuffer;thisistoallowfor returnintheOemDatafieldifnecessary.) The OemProductRevPtrisapointertoanull-terminatedstringcontainingtherevisionormanufacturing levelofthedisplaycontrollerboardproduct. (This stringmaybecontainedintheVbeInfoBlockorthe VBEimplementation.) Thisfieldcanbeusedtodeterminewhichproductionrevisionofthedisplay controllerboardisinstalled. Thisfieldisonlyfilledinwhen'VBE2'ispresetintheVbeSignaturefieldon entrytoFunction00h. (Note: thelengthofthestrings OemProductRev, OemProductNameand OemVendorName(includingterminators)summed,mustfitwithina256bytebuffer;thisistoallowfor returnintheOemDatafieldifnecessary.) The ReservedfieldisaspacereservedfordynamicallybuildingtheVideoModeListifnecessaryifthe VideoModeListisnotstaticallystoredwithintheVBEimplementation. Thisfieldshouldnotbeusedfor anythingelse,andmaybereassignedinthefuture. Applicationsoftwareshouldnot assumethat informationinthisfieldisvalid. The OemDatafieldis a256bytedataareathat is usedtoreturnOEMinformation returned byVBE Function00hwhen'VBE2'ispresetintheVbeSignaturefield. TheOemVendorNamestring, OemProductNamestringandOemProductRevstringarecopiedintothis areabytheVBE implementation. ThisareawillonlybeusedbyVBEimplementations 2.0andabovewhen'VBE2'is presetintheVbeSignaturefield.
  • 23. VBEFunctions 00hReturnVBEControllerInformation Page16 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 4.4 Function 01h - Return VBE Mode Information ThisrequiredfunctionreturnsextendedinformationaboutaspecificVBEdisplaymodefromthemode listreturnedbyVBEFunction00h. Thisfunctionfillsthemodeinformationblock,ModeInfoBlock, structurewithtechnicaldetailsontherequestedmode. TheModeInfoBlockstructureis providedby theapplicationwithafixedsizeof256bytes. InformationcanbeobtainedforalllistedmodesintheVideoModeList returnedinFunction00h. Ifthe requestedmodecannotbeusedorisunavailable, abit will beset intheModeAttributes fieldtoindicate thatthemodeisnotsupportedinthecurrentconfiguration. Input: AX = 4F01h ReturnVBEmodeinformation CX = Modenumber ES:DI = PointertoModeInfoBlockstructure Output: AX = VBEReturnStatus Note: Allotherregisters arepreserved. Themodeinformationblockhasthefollowingstructure: ModeInfoBlockstruc ;MandatoryinformationforallVBErevisions ModeAttributes dw ? ;modeattributes WinAAttributes db ? ;windowAattributes WinBAttributes db ? ;windowBattributes WinGranularity dw ? ;windowgranularity WinSize dw ? ;windowsize WinASegment dw ? ;windowAstart segment WinBSegment dw ? ;windowBstartsegment WinFuncPtr dd ? ;pointertowindowfunction BytesPerScanLine dw ? ;bytes perscanline ;MandatoryinformationforVBE1.2andabove XResolution dw ? ;horizontalresolutioninpixelsorcharacters3 YResolution dw ? ;verticalresolutioninpixelsorcharacters XCharSize db ? ;charactercellwidthinpixels YCharSize db ? ;charactercellheightinpixels NumberOfPlanes db ? ;numberofmemoryplanes 3 Pixels in graphics modes, characters in text modes.
  • 24. VBEFunctions 03hReturnCurrentVBE Mode VBECOREFUNCTIONSVERSION2.0 Page17 DOCUMENTREVISION1.1 BitsPerPixel db ? ;bitsperpixel NumberOfBanks db ? ;numberofbanks MemoryModel db ? ;memorymodeltype BankSize db ? ;banksizeinKB NumberOfImagePages db ? ;numberofimages Reserved db 1 ;reservedforpagefunction ;DirectColorfields(requiredfordirect/6andYUV/7memorymodels) RedMaskSize db ? ;sizeofdirect colorredmaskinbits RedFieldPosition db ? ;bitpositionoflsbofredmask GreenMaskSize db ? ;sizeofdirectcolorgreenmaskinbits GreenFieldPosition db ? ;bitpositionoflsbofgreenmask BlueMaskSize db ? ;sizeofdirectcolorbluemaskinbits BlueFieldPosition db ? ;bitpositionoflsbofbluemask RsvdMaskSize db ? ;sizeofdirect colorreservedmaskinbits RsvdFieldPosition db ? ;bitpositionoflsbofreservedmask DirectColorModeInfo db ? ;directcolormodeattributes ;MandatoryinformationforVBE2.0andabove PhysBasePtr dd ? ;physicaladdressforflatmemoryframebuffer OffScreenMemOffset dd ? ;pointertostart ofoffscreenmemory OffScreenMemSize dw ? ;amountofoffscreenmemoryin1kunits Reserved db 206 dup (?) ; remainderofModeInfoBlock ModeInfoBlock ends The ModeAttributes fielddescribescertainimportantcharacteristics ofthegraphics mode. TheModeAttributesfieldisdefinedasfollows: D0 = Modesupportedbyhardwareconfiguration 0 = Modenot supportedinhardware 1 = Modesupportedinhardware D1 = 1(Reserved) D2 = TTYOutput functions supportedbyBIOS 0 = TTYOutput functions not supportedbyBIOS 1 = TTYOutput functions supportedbyBIOS D3 = Monochrome/colormode(seenotebelow) 0 = Monochromemode 1= Color mode D4 = Mode type 0 = Textmode 1 = Graphicsmode D5 = VGAcompatiblemode 0 = Yes
  • 26. VBEFunctions 03hReturnCurrentVBE Mode VBECOREFUNCTIONSVERSION2.0 Page19 DOCUMENTREVISION1.1 D6 = VGAcompatiblewindowedmemorymodeisavailable 0 = Yes 1 = No D7 = Linearframebuffermodeisavailable 0 = No 1 = Yes D8-D15 = Reserved BitD0issettoindicatethatthismodecanbeinitializedinthepresenthardwareconfiguration. This bit is resettoindicatetheunavailabilityofagraphicsmodeifitrequires acertainmonitortype, morememory thanisphysicallyinstalled,etc. BitD1wasusedbyVBE1.0and1.1toindicatethat theoptional informationfollowingthe BytesPerScanLinefieldwerepresentinthedatastructure. Thisinformationbecamemandatorywith VBEversion1.2andabove, soD1is nolonger used and should be set to 1. The Direct Color fields arevalidonlyiftheMemoryModel fieldis set toa6(Direct Color)or 7 (YUV). BitD2indicateswhetherthevideoBIOShassupport foroutput functions likeTTYoutput, scroll, etc. inthismode. TTYsupport is recommendedbut not requiredforall extendedtext andgraphicmodes. Ifbit D2is set to1, thentheINT10hBIOSmust support all ofthestandardoutput functions listed below. AllofthefollowingTTYfunctionsmustbesupportedwhenthisbitisset: 01 Set CursorSize 02 SetCursorPosition 06 ScrollTTYwindowuporBlankWindow 07 ScrollTTYwindowdownorBlankWindow 09 Writecharacterandattributeat cursorposition 0A Writecharacteronlyat cursorposition 0E Writecharacter and advance cursor Bit D3is set toindicatecolormodes, andclearedformonochromemodes. Bit D4is set toindicategraphics modes, andclearedfortext modes. Note: Monochromemodes maptheir CRTCaddress at 3B4h. Color modes map their CRTCaddress at3D4h.Monochromemodeshaveattributesinwhichonlybit 3(video)andbit 4(intensity)ofthe attributecontrolleroutputaresignificant.Therefore,monochrometextmodeshaveattributesofoff, video,highintensity,blink,etc.Monochromegraphics modes aretwoplanegraphics modes andhave attributesofoff,video,highintensity,andblink.Extendedtwocolormodes that havetheirCRTC address at 3D4h, arecolormodes withonebit perpixel and one plane. The standard VGAmodes, 06h and11h, wouldbeclassifiedas colormodes, whilethestandardVGAmodes 07h and 0Fh would be classifiedasmonochromemodes.
  • 27. VBEFunctions 00hReturnVBEControllerInformation Page20 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 Bit D5is usedtoindicateifthemodeis compatiblewiththeVGAhardwareregisters andI/Oports. If this bit is set, thenthemodeis NOTVGAcompatibleandnoassumptions shouldbemadeabout the availabilityofanyVGAregisters. Ifclear, thenthestandardVGAI/Oports andframebufferaddress definedinWinASegmentand/orWinBSegmentcanbeassumed. BitD6isusedtoindicateifthemodeprovides WindowingorBankingoftheframebuffer intothe framebuffermemoryregionspecifiedbyWinASegmentandWinBSegment. Ifset,thenWindowingof theframebufferis NOTpossible. Ifclear, thenthedeviceis capableof mappingtheframebufferinto thesegmentspecifiedinWinASegmentand/orWinBSegment. (Thisbitisusedinconjunctionwithbit D7,seetablefollowingD7forusage). BitD7indicatesthepresenceofaLinearFrameBuffermemorymodel. Ifthis bit is set, thedisplay controllercanbeputintoaflatmemorymodelbysettingthemode(VBEFunction02h)withtheFlat MemoryModelbitset.(ThisbitisusedinconjunctionwithbitD6, seefollowingtableforusage) D7 D6 Windowed frame buffer only 0 0 n/a 0 1 Both Windowed and Linear 4 1 0 Linear frame buffer only 1 1 The BytesPerScanLine fieldspecifieshowmanyfullbytesareineachlogicalscanline.Thelogical scanlinecouldbeequaltoorlargerthanthedisplayedscanline. The WinAAttributes and WinBAttributes describethecharacteristics oftheCPUwindowingscheme suchaswhetherthewindowsexistandareread/writeable, as follows: D0 = Relocatablewindow(s)supported 0 = Singlenon-relocatablewindowonly 1 = Relocatablewindow(s)aresupported D1 = Windowreadable 0 = Windowis not readable 1 = Windowisreadable D2 = Windowwriteable 0 = Windowisnotwriteable 1 = Windowiswriteable D3-D7 = Reserved 4 Use D14 of the Mode Number to select the Linear Buffer on a mode set (Function 02h).
  • 28. VBEFunctions 03hReturnCurrentVBE Mode VBECOREFUNCTIONSVERSION2.0 Page21 DOCUMENTREVISION1.1 Evenifwindowingis not supported(bit D0=0forbothWindowAandWindowB), then an applicationcanassumethatthedisplaymemorybufferresidesatthelocationspecifiedby WinASegmentand/orWinBSegment. WinGranularityspecifiesthesmallestboundary, inKB, onwhichthewindowcanbeplacedinthe framebuffermemory.ThevalueofthisfieldisundefinedifBitD0oftheappropriateWinAttributesfield is not set. WinSizespecifiesthesizeofthewindowinKB. WinASegment and WinBSegmentaddress specifythesegment addresses wherethe windows are located in the CPUaddress space. WinFuncPtrspecifiesthesegment:offsetoftheVBEmemorywindowingfunction.Thewindowing functioncanbeinvokedeitherthroughVBEFunction05h,orbycallingthefunctiondirectly.Adirect callwillprovidefasteraccesstothehardwarepagingregistersthanusingVBEFunction05h, andis intendedtobeusedbyhighperformanceapplications.Ifthis fieldis NULL, thenVBEFunction05h mustbeusedtoset thememorywindowwhenpagingis supported. This direct call methoduses the sameparametersasVBEFunction05hincludingAXandforVBE2.0implementationswillreturnthe correct ReturnStatus. VBE1.2implementationsandearlier,didnotrequiretheReturnStatus informationtobereturned. Formoreinformationonthedirect call method, seethenotes inVBE Function05handthesamplecodeinAppendix5. The XResolution and YResolutionspecifythewidthandheightinpixelelementsorcharacters forthis displaymode.Ingraphicsmodes,thesefieldsindicatethenumberofhorizontalandverticalpixelsthat maybedisplayed.Intextmodes,thesefieldsindicatethenumberofhorizontal andvertical character positions. Thenumberofpixelpositionsfortextmodesmaybecalculatedbymultiplyingthereturned XResolutionandYResolutionvaluesbythecharactercellwidthandheightindicatedintheXCharSize andYCharSizefieldsdescribedbelow. The XCharSize and YCharSizespecifythesizeofthecharactercellinpixels. This valueis not zero based(e.g. XCharSizeforMode3usingthe9point font will haveavalue of9). The NumberOfPlanes fieldspecifiesthenumberofmemoryplanesavailabletosoftwareinthat mode. Forstandard16-colorVGAgraphics, this would be set to 4. For standard packed pixel modes, the fieldwouldbeset to 1. For 256-color non-chain-4 modes, where you need to do bankingto address allpixels,thisvalueshouldbesettothenumberofbanksrequiredtogettoallthepixels (typicallythis would be 4 or 8). The BitsPerPixel fieldspecifiesthetotalnumberofbits allocatedtoonepixel. Forexample, astandard VGA4Plane16-colorgraphics modewouldhavea4inthis fieldandapacked pixel 256-color graphicsmodewouldspecify8inthisfield.Thenumberofbits perpixel perplanecannormallybe derivedbydividingtheBitsPerPixelfieldbytheNumberOfPlanesfield.
  • 29. VBEFunctions 00hReturnVBEControllerInformation Page22 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 The MemoryModel fieldspecifiesthegeneraltypeofmemoryorganizationusedinthismode. The followingmodelshavebeendefined: 00h = Textmode 01h = CGAgraphics 02h = Herculesgraphics 03h = Planar 04h = Packedpixel 05h = Non-chain 4, 256 color 06h = DirectColor 07h = YUV 08h-0Fh = Reserved, to be defined byVESA 10h-FFh = To be defined byOEM VBEVersion1.1andearlierdefinedDirectColorgraphicsmodes withpixel formats 1:5:5:5, 8:8:8, and 8:8:8:8 as aPackedPixel model with16, 24, and32-bits perpixel, respectively. In VBEVersion 1.2 andlater, theDirect Colormodes usetheDirect Colormemorymodel andusetheMaskSize and FieldPositionfieldsoftheModeInfoBlocktodescribethepixelformat.BitsPerPixelisalways definedto bethetotalmemorysizeofthepixel, inbits. NumberOfBanks.Thisisthenumberofbanksinwhichthescanlines aregrouped. Thequotient from dividingthescanlinenumberbythenumberofbanksisthebankthatcontains thescanlineandthe remainderisthescanlinenumberwithinthebank. Forexample, CGAgraphics modes havetwobanks andHercules graphics modehas fourbanks. Formodes that don't havescanlinebanks (suchas VGA modes 0Dh-13h), this fieldshouldbeset to 1. The BankSize fieldspecifies thesizeofabank(groupofscanlines)inunits of1KB. For CGAand Hercules graphics modes this is 8, as eachbankis 8192bytes inlength. For modes that do not have scanlinebanks (suchas VGAmodes 0Dh-13h), this fieldshouldbeset to0. The NumberOfImagePages fieldspecifiesthe"totalnumberminusone(-1)"ofcompletedisplay imagesthatwillfitintotheframebuffermemory.Theapplicationmayloadmorethanoneimageintothe framebuffermemoryifthisfieldisnon-zero,andmovethedisplaywindowwithineachofthosepages. Thisshouldonlybeusedfordeterminingtheadditionaldisplaypageswhichareavailabletothe application;todeterminetheavailableoffscreenmemory,usetheOffScreenMemOffset and OffScreenMemSizeinformation. Note: IftheModeInfoBlockis foranIBMStandardVGAmodeandtheNumberOfImagePages field containsmorepagesthanwouldbefoundina256KBimplementation, theTTYsupport describedin theModeAttributes must beaccurate. i.e., iftheTTYfunctions areclaimedtobesupported, theymust besupportedinallpages,notjustthepagesnormallyfoundinthe256KBimplementation.
  • 30. VBEFunctions 03hReturnCurrentVBE Mode VBECOREFUNCTIONSVERSION2.0 Page23 DOCUMENTREVISION1.1 The Reserved fieldhas beendefinedtosupport afutureVBEfeatureandwill always beset toonein thisversion.
  • 31. VBEFunctions 00hReturnVBEControllerInformation Page24 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 The RedMaskSize, GreenMaskSize, BlueMaskSize, and RsvdMaskSize fieldsdefinethesize,in bits, ofthered, green, andbluecomponents ofadirect colorpixel. Abit maskcan be constructed from theMaskSizefieldsusingsimpleshiftarithmetic.Forexample,theMaskSizevaluesforaDirect Color 5:6:5modewouldbe5, 6, 5, and0, forthered, green, blue, and reserved fields, respectively. Note that intheYUVMemoryModel, theredfieldis usedforV, thegreenfieldis usedforY, andthebluefieldis usedforU. TheMaskSizefields shouldbeset to0inmodes usingamemorymodel that does not have pixelswithcomponentfields. The RedFieldPosition, GreenFieldPosition, BlueFieldPosition, andRsvdFieldPositionfields definethebitpositionwithinthedirectcolorpixelorYUVpixeloftheleastsignificantbitofthe respectivecolorcomponent.Acolorvaluecanbealignedwithitspixelfieldbyshiftingthevalueleft by theFieldPosition.Forexample, theFieldPositionvalues foraDirect Color5:6:5modewouldbe11, 5, 0, and0, forthered, green, blue, andreservedfields, respectively. Note that in the YUV MemoryModel, theredfieldis usedforV, thegreenfieldis usedforY, andthebluefieldis usedfor U. TheFieldPositionfieldsshouldbesetto0inmodes usingamemorymodel that does not havepixels withcomponentfields. The DirectColorModeInfofielddescribesimportant characteristics ofdirect colormodes. Bit D0 specifieswhetherthecolorrampoftheDACis fixedorprogrammable. Ifthecolorrampis fixed, thenit cannot bechanged. Ifthecolorrampis programmable, it is assumedthat thered, green, and blue lookuptablescanbeloadedbyusingVBEFunction09h. Bit D1specifies whetherthebits intheRsvd fieldofthedirect colorpixel canbeusedbytheapplicationorarereserved, andthus unusable. D0 = Colorrampisfixed/programmable 0 = Colorrampisfixed 1 = Colorrampisprogrammable D1 = BitsinRsvdfieldareusable/reserved 0 = BitsinRsvdfieldarereserved 1 = BitsinRsvdfieldareusablebytheapplication The PhysBasePtrisa32-bitphysical address ofthestart offramebuffermemorywhenthecontroller isinflatframebuffermemorymode.Ifthismodeisnotavailable,thenthisfieldwillbezero. The OffScreenMemOffset is a32-bit offset fromthestart oftheframebuffermemory. Extraoff- screenmemorythat is neededbythecontrollermaybelocatedeitherbeforeorafterthis offscreen memory,besuretocheckOffScreenMemSizetodeterminetheamount ofoff-screenmemorywhichis availabletotheapplication. The OffScreenMemSize containstheamountofavailable,contiguousoff-screenmemoryin1kunits, whichcanbeusedbytheapplication.
  • 32. VBEFunctions 03hReturnCurrentVBE Mode VBECOREFUNCTIONSVERSION2.0 Page25 DOCUMENTREVISION1.1 Note: Version1.1andlaterVBEwillzerooutallunusedfieldsintheModeInformationBlock, always returningexactly256bytes.Thisfacilitatesupwardcompatibilitywithfutureversionsofthestandard,as anynewlyaddedfieldswillbedesignedsuchthatvaluesofzerowillindicatenominaldefaultsornon- implementationofoptionalfeatures.(Forexample,afieldcontainingabit-maskofextendedcapabilities wouldreflecttheabsenceofallsuchcapabilities.)Applications that wishtobebackwards compatibleto Version1.0VBEshouldpre-initializethe256bytebufferbeforecallingtheReturnVBEMode Informationfunction. 4.5 Function 02h - Set VBE Mode ThisrequiredfunctioninitializesthecontrollerandsetsaVBEmode. Theformat ofVESAVBEmode numbersisdescribedearlierinthis document. Ifthemodecannot beset, theBIOSshouldleavethe graphicsenvironmentunchangedandreturnafailureerrorcode. Input: AX = 4F02h Set VBEMode BX = Desired Mode to set D0-D8= Modenumber D9-D13 = Reserved(must be 0) D14 = 0 Usewindowedframebuffermodel = 1 Uselinear/flatframebuffermodel D15 = 0 Cleardisplaymemory = 1 Don'tcleardisplaymemory Output: AX = VBEReturnStatus Note: Allotherregisters arepreserved. Iftherequestedmodenumberisnotavailable,thenthecallwillfail,returningAH=01htoindicatethe failuretotheapplication. IfbitD14isset,themodewill beinitializedforusewithaflat framebuffermodel. Thebaseaddress of theframebuffercanbedeterminedfromtheextendedmodeinformationreturnedbyVBEFunction 01h. IfD14isset,andalinearframebuffermodelisnotavailablethenthecall will fail. IfbitD15isnotset,all reportedimagepages, basedonFunction00hreturnedinformation NumberOfImagePages, will beclearedto00hingraphics mode, and20 07 in text mode. Memory overandabovethereportedimagepages will not bechanged. Ifbit D15is set, then the contents ofthe framebufferafterthemodechangeis undefined. Note, the1-bytemodenumbers usedinFunction00h ofanIBMVGAcompatibleBIOSuseD7tosignifythesamethingas D15does inthis function. If functioncallD7issetandtheapplicationassumesitissimilartotheIBMcompatiblemodeset using VBEFunction02h,theimplementationwillfail. VBEawareapplicationsmustusethememoryclearbit inD15.
  • 33. VBEFunctions 00hReturnVBEControllerInformation Page26 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 Note: VBEBIOS2.0implementations shouldalsoupdatetheBIOSDataArea40:87memoryclear bitsothatVBEFunction03hcanreturnthisflag.VBEBIOS1.2andearlierimplementations ignorethe memoryclearbit. Note: Thiscallshouldnotsetmodesnot listedinthelist ofsupportedmodes. Inadditionall modes (includingIBMstandardVGAmodes),iflistedassupported,must haveModeInfoBlockstructures associatedwiththem. RequiredModeInfoBlockvalues fortheIBMStandardModes arelistedin Appendix2. 4.6 Function 03h - Return Current VBE Mode ThisrequiredfunctionreturnsthecurrentVBEmode. Theformat ofVBEmodenumbers is described earlierinthisdocument. Input: AX = 4F03h Returncurrent VBEMode Output: AX = VBEReturnStatus BX = CurrentVBEmode D0-D13 = Modenumber D14 = 0 Windowedframebuffermodel = 1 Linear/flatframebuffermodel D15 = 0 Memoryclearedat last mode set = 1 Memorynot clearedat last mode set Note: Allotherregisters arepreserved. Version 1.x Note: InastandardVGABIOS, Function0Fh(Readcurrent video state) returns the currentgraphics modeintheALregister. InD7ofAL, it alsoreturns thestatus ofthememoryclearbit (D7of40:87).Thisbitissetifthemodewassetwithoutclearingmemory. Inthis VBEfunction, the memoryclearbitwillnotbereturnedinBXsincethepurposeofthefunctionis toreturnthevideomode only.Ifanapplicationwantstoobtainthememoryclearbit, it shouldcall thestandardVGABIOS Function0Fh. Version 2.x Note: Unlikeversion1.xVBEimplementations,thememoryclearflagwillbereturned. TheapplicationshouldNOTcall thestandardVGABIOSFunction0Fhifthemodewas set withVBE Function02h. Note: Themodenumberreturnedmust bethesamemodenumberusedintheVBEFunction02hmode set. Note: Thisfunctionis not guaranteedtoreturnanaccuratemodevalueifthemodeset was not done withVBEFunction02h.
  • 34. VBEFunctions 07hSet/GetDisplayStart VBECOREFUNCTIONSVERSION2.0 Page27 DOCUMENTREVISION1.1 4.7 Function 04h - Save/Restore State Thisrequiredfunctionprovidesacompletemechanismtosaveandrestorethedisplaycontroller hardwarestate. Thefunctions areasuperset ofthethreesubfunctions underthestandardVGABIOS Function1Ch(Save/restorestate)whichdoes not guaranteethat theextendedregisters ofthevideo devicearesavedorrestored. Thecompletehardwarestate(except framebuffermemory)should be saveable/restorablebysettingtherequestedstates mask(intheCXregister)to000Fh. Input: AX = 4F04h Save/RestoreState DL = 00h ReturnSave/RestoreStatebuffersize = 01h Savestate = 02h Restorestate CX = Requestedstates D0= Save/Restorecontrollerhardwarestate D1= Save/Restore BIOSdata state D2= Save/RestoreDACstate D3= Save/RestoreRegisterstate ES:BX = Pointertobuffer (ifDL<> 00h) Output: AX = VBEReturnStatus BX = Numberof64-byte blocks to hold the state buffer (ifDL=00h) Note: Allotherregisters arepreserved. 4.8 Function 05h - Display Window Control Thisrequiredfunctionsetsorgetsthepositionofthespecifieddisplaywindoworpageintheframe buffermemorybyadjustingthenecessaryhardwarepagingregisters. Tousethis functionproperly, the softwareshouldfirstuseVBEFunction01h(ReturnVBEModeinformation)todeterminethesize, locationandgranularityofthewindows. Forperformancereasons,itmaybemoreefficienttocallthisfunctiondirectly,withoutincurringtheINT 10hoverhead. VBEFunction01hreturnsthesegment:offsetofthiswindowingfunctionthatmaybe calleddirectlyforthis reason. Notethat adifferent entrypoint maybereturnedbasedupontheselected mode. Therefore,itisnecessarytoretrievethissegment:offset specificallyforeachdesiredmode. Input: AX = 4F05h VBEDisplayWindowControl BH = 00h Setmemorywindow = 01h Getmemorywindow BL = Windownumber = 00h WindowA = 01h WindowB DX = Windownumberinvideomemoryinwindow granularityunits (SetMemoryWindowonly)
  • 35. VBEFunctions 00hReturnVBEControllerInformation Page28 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 Output: AX = VBEReturnStatus DX = Windownumberinwindowgranularityunits (GetMemoryWindowonly) Note: InVBE1.2implementations,thedirectfarcallversionreturnsnoReturnStatusinformationto theapplication.Also,inthefarcallversion, theAXandDXregisters will bedestroyed. ThereforeifAX and/orDXmustbepreserved, theapplicationmust dosopriortomakingthefarcall. Theapplication muststillloadtheinputargumentsinBH,BL,andDX(forSet Window). InVBE2.0implementations, theBIOSwillreturnthecorrectReturnStatus, andthereforetheapplicationmust assumethat AXand DXwill bedestroyed. Application Developer's Note: Thisfunctionisnotintendedforuseinalinearframebuffermode, if thisfunctionisrequested,thefunctioncallwillfailwiththeVBECompletioncodeAH=03h. VBEBIOSImplementationNote: Ifthisfunctioniscalledwhileinalinearframebuffermemory model,thisfunctionmustfailwithcompletioncodeAH=03h. 4.9 Function 06h - Set/Get Logical Scan Line Length Thisrequiredfunctionsetsorgetsthelengthofalogicalscanline.This allows anapplicationtoset upa logicaldisplaymemorybufferthatiswiderthanthedisplayedarea.VBEFunction07h(Set/Get Display Start)thenallowstheapplicationtosetthestartingpositionthat is tobedisplayed. Input: AX = 4F06h VBESet/GetLogicalScanLineLength BL = 00h SetScanLineLengthinPixels = 01h GetScanLineLength = 02h SetScanLineLengthinBytes = 03h GetMaximumScanLineLength CX = IfBL=00h DesiredWidthinPixels IfBL=02h DesiredWidthinBytes (IgnoredforGetFunctions Output: AX = VBEReturnStatus BX = Bytes PerScan Line CX = ActualPixelsPerScanLine (truncatedtonearestcompletepixel) DX = MaximumNumberofScanLines Note: Thedesiredwidthinpixels orbytes maynot beachievablebecauseofhardwareconsiderations. Thenextlargervaluewillbeselectedthatwillaccommodatethedesirednumberofpixels orbytes, and theactualnumberofpixelswill bereturnedinCX. BXreturns avaluethat whenaddedtoapointerinto displaymemorywillpointtothenextscanline. Forexample, inVGAmode13hthis wouldbe320, but inmode12hthis wouldbe80. DXreturns thenumberoflogical scanlines baseduponthenewscan linelengthandthetotalmemoryinstalledandusableinthisdisplaymode.
  • 36. VBEFunctions 07hSet/GetDisplayStart VBECOREFUNCTIONSVERSION2.0 Page29 DOCUMENTREVISION1.1 Note: Thisfunctionis alsovalidinVBEsupportedtext modes. InVBEsupportedtext modes the applicationshouldconvertthecharacterlinelengthtopixellinelengthbygettingthecurrentcharacter cellwidththroughtheXCharSizefieldreturnedinModeInfoBlock,multiplyingthattimesthedesired numberofcharactersperline,andpassingthatvalueintheCXregister. Inaddition,this functionwill onlyworkifthelinelengthisspecifiedincharactergranularity. i.e.in8dotmodesonlymultiples of8 willwork. Anyvaluewhichisnotincharactergranularitywillresultinafunctioncallfailure. Note: OnafailuretosetscanlinelengthbysettingaCXvaluetoolarge, thefunctionwill fail witherror code02h. Note: ThevaluereturnedwhenBL=03histhelesserofeitherthemaximumlinelengththat the hardwarecansupport,orthelongestscanlinelengththat wouldsupport thenumberoflines inthe currentvideomode. 4.10 Function 07h - Set/Get Display Start Thisrequiredfunctionselectsthepixeltobedisplayedintheupperleft cornerofthedisplay. This functioncanbeusedtopanandscroll aroundlogical screens that arelargerthanthedisplayedscreen. Thisfunctioncanalsobeusedtorapidlyswitchbetweentwodifferent displayedscreens fordouble bufferedanimationeffects. Input: AX = 4F07h VBESet/Get DisplayStart Control BH = 00h Reservedandmust be 00h BL = 00h SetDisplayStart = 01h GetDisplayStart = 80h SetDisplayStartduringVertical Retrace CX = FirstDisplayedPixelInScanLine (SetDisplayStartonly) DX = FirstDisplayedScanLine(Set DisplayStart only) Output: AX = VBEReturnStatus BH = 00hReservedandwill be0(Get DisplayStart only) CX = FirstDisplayedPixelInScanLine(Get DisplayStart only) DX = FirstDisplayedScanLine(Get DisplayStart only) Note: Thisfunctionisalsovalidintextmodes. Tousethisfunctionintextmode,theapplicationshould convertthecharactercoordinatestopixelcoordinatesbyusingXCharSizeandYCharSizereturnedin theModeInfoBlock. IftherequestedDisplayStart coordinates donot allowforafull pageofvideo memoryorthehardwaredoesnotsupportmemorywrapping, theFunctioncall shouldfail andno changes shouldbemade. As ageneral case, ifarequestedDisplayStart is not available, fail the Functioncallandmakenochanges. Note: CX and DX,forbothinputandoutput values,will bezero-based.
  • 37. VBEFunctions 0AhReturnVBE Protected Mode Interface Page30 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 4.11 Function 08h - Set/Get DAC Palette Format Thisrequiredfunctionmanipulates theoperatingmodeorformat oftheDACpalette. SomeDACs are configurabletoprovide6bits, 8bits, ormoreofcolordefinitionperred, green, andblueprimary colors. TheDACpalettewidthis assumedtobereset tothe standard VGAvalue of6 bits per primary colorduringanymodeset. Input: AX = 4F08h VBESet/Get PaletteFormat BL = 00h Set DACPalette Format = 01h Get DACPaletteFormat BH = Desiredbits ofcolorperprimary (Set DACPalette Format only) Output: AX = VBEReturnStatus BH = Currentnumberofbits ofcolorperprimary AnapplicationcandetermineifDACswitchingisavailablebyqueryingBitD0oftheCapabilitiesfield oftheVbeInfoBlockstructurereturnedbyVBEFunction00h(ReturnControllerInformation). The applicationcanthenattempttosettheDACpalettewidthtothedesiredvalue. Ifthedisplaycontroller hardwareisnotcapableofselectingtherequestedpalettewidth, thenthenext lowervaluethat the hardwareis capableofwill beselected. Theresultingpalettewidthisreturned. ThisfunctionwillreturnfailurecodeAH=03hifcalledinadirect colororYUVmode. 4.12 Function 09h - Set/Get Palette Data ThisrequiredfunctionisveryimportantforRAMDAC's whicharelargerthanastandardVGA RAMDAC. ThestandardINT10hBIOSPalettefunctioncalls assume standard VGAports and VGA palettewidths. ThisfunctionoffersapaletteinterfacethatisindependentoftheVGAassumptions. Input: AX = 4F09h VBELoad/UnloadPaletteData BL = 00h Set PaletteData = 01h Get PaletteData = 02h Set SecondaryPalette Data = 03h Get SecondaryPaletteData = 80h SetPaletteDataduringVertical Retrace withBlankBit on CX = Numberofpaletteregisters to update (to a maximumof256) DX = First ofthepaletteregisters toupdate(start) ES:DI = Tableofpalettevalues (seebelowforformat) Output: AX = VBEReturnStatus
  • 38. VBEFunctions 0AhReturn VBE Protected Mode Interface VBECOREFUNCTIONSVERSION2.0 Page31 DOCUMENTREVISION1.1 Format of Palette Values:Alignment byte, Red byte, Green byte, Blue byte Note: TheneedforBL=80his forolderstyleRAMDAC's whereprogrammingtheRAMvalues duringdisplaytimecausesa"snow-like"effect onthescreen. NewerstyleRAMDAC's don't havethis limitationandcaneasilybeprogrammedat anytime, but olderRAMDAC's requirethat theybe programmedduringanon-displaytimeonlytostopthesnowlikeeffect seenwhenchangingtheDAC values. WhenthisisrequestedtheVBEimplementationwillprogramtheDACwithblankingon. CheckD2oftheCapabilitiesfieldreturnedbyVBEFunction00htodetermineif80hshouldbeused insteadof00h. Note: Theneedforthesecondarypaletteis foranticipatedfuturepaletteextensions, ifasecondary palettedoesnotexistinaimplementationandthesecallsaremade,theVBEimplementationwillreturn error code 02h. Note: Whenin6bit mode, theformat ofthe 6 bits is LSB, this is done for speed reasons, as the applicationcantypicallyshiftthedatafasterthantheBIOScan. Note: AllapplicationshouldassumetheDACisdefaultedto6bit mode. Theapplicationis responsible forswitchingtheDACtohighercolormodesusingFunction08h. Note: QueryVBEFunction08htodeterminetheRAMDACwidthbeforeloadinganewpalette. 4.13 Function 0Ah - Return VBE Protected Mode Interface Thisrequiredfunctioncall returns apointertoatablethat contains codefora32-bit protectedmode interfacethat caneitherbecopiedintolocal 32-bit memoryspaceorcan be executed fromROM providingthecallingapplicationsetsallrequiredselectorsandI/Oaccesscorrectly.Thisfunctionreturns apointer(inrealmodespace)withoffsets tothecodefragments, andadditionallyreturns anoffset toa tablewhichcontainsNon-VGAPortandMemorylocations whichanApplicationmayhavetohaveI/O access to. Input: AX = 4F0Ah VBE2.0 Protected Mode Interface BL = 00h Returnprotectedmodetable Output: AX = Status ES = Real ModeSegment ofTable DI = OffsetofTable CX = LengthofTableincludingprotectedmodecodein bytes (forcopyingpurposes)
  • 39. VBEFunctions 0AhReturnVBE Protected Mode Interface Page32 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 Theformatofthetableisasfollows: ES:DI+ 00h WordOffset in table ofProtected mode code for Function5forSet WindowCall ES:DI+ 02h WordOffset in table ofProtected mode code for Function7forset DisplayStart ES:DI+ 04h WordOffset in table ofProtected mode code for Function9forset PrimaryPalettedata ES:DI+ 06h Word Offset intableofPorts and MemoryLocations thattheapplicationmayneedI/Oprivilegefor. (Optional: ifunsupportedthismustbe0000h) (SeeSub-tableforformat) ES:DI + ? VariableremainderofTableincludingCode Theformat oftheSub-Table(Ports andMemorylocations) Port, Port, ... , Port, Terminate Port List with FFFF, Memorylocations (4 bytes), Length (2 bytes), TerminateMemoryList withFFFF. Example 1.ForPort/Indexcombination3DE/FhandMemorylocations DE800-DEA00h(length = 200h)thetablewouldlooklikethis: DE 03 DF 03 FF FF 00 E8 0D 00 00 02 FF FF Example 2.Foronlytheports it wouldlooklike: DE 03 DF 03 FF FF FF FF Example 3.Foronlythememorylocationsitwouldlooklike FF FF 00 E8 0D 00 00 02 FF FF Note:. All protectedmodefunctions shouldendwithanearRET(as opposedtoFARRET)to allow theapplicationsoftwaretoCALLthecodefromwithintheROM. Note: ThePort andMemorylocationSub-tabledoes not includetheFrameBufferMemorylocation. TheFrameBufferMemorylocationiscontainedwithintheModeInfoBlockreturnedbyVBEFunction 01h. Note: Theprotectedmodecodeis assembled for a 32-bit code segment, when copyingit, the applicationmust copythecodetoa32-bit code segment. Note: Itistheresponsibilityoftheapplicationtoensurethat theselectors andsegments areset up correctly.
  • 40. VBEFunctions 0AhReturn VBE Protected Mode Interface VBECOREFUNCTIONSVERSION2.0 Page33 DOCUMENTREVISION1.1 Ifthememorylocationis zero, thenonlyI/Omappedports will beusedsotheapplicationdoes not needtodoanythingspecial. This shouldbethedefault caseforALLcards that have I/Omapped registersbecauseit provides thebest performance. Ifthememorylocationis nonzero(therecanbeonlyone), theapplication will need to create a new32- bitselectorwiththebaseaddressthatpointstothe“physical”locationspecifiedwiththespecifiedlimit. Whentheapplicationneedstocallthe32-bit bankswitchfunction, it must thenloadtheESselector withthevalueofthenewselectorthat has beencreated. Thebankswitchingcodecanthendirectly accessitsmemorymappedregisters as absoluteoffsets intotheESselector (i.e., mov[es:10],eaxtoput avalueintotheregisterat base+10). It is uptotheapplicationcodetosaveandrestoretheprevious stateofthe ESselector ifthis is necessary(forexampleinflat model code). Note: Currentlyundefinedregisters maybedestroyedwiththeexceptionofESI, EBP, DSand SS. Note: Applicationsmustusethesameregisters fortheFunction05handFunction09hprotectedmode interfacethatitwoulduseinarealmodecall. This includes theAXregister. Note: Function07hprotectedmodecalls haveadifferent format. AX = 4F07h BL = 00h Set DisplayCRTCStart = 80h SetDisplayCRTCStart duringVertical Retrace CX = Bits 0-15ofdisplaystart address DX = Bits 16-31ofdisplaystart address Theprotectedmodeapplicationmust keeptrackofthecolordepthandscanlinelengthtocalculatethe newstartaddress. Ifavaluethat is out ofrangeis programmed, unpredictableresults will occur. Note: RefertoSection4.2forinformationonprotectedmodeconsiderations.
  • 41. VBESupplementalSpecifications Page34 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 5.0 VBE Supplemental Specifications ThischapterdetailsVBESupplementalSpecifications. 5.1 Purpose of Supplemental Specifications TheVBEwasoriginallydesignedtoprovideadevice-independentinterfacebetweenapplication softwareandSVGAhardware.Inthelastfewyears, thepersonal computingenvironment has grown muchmorecomplexandtherehavebeennumerous requests toprovideinterfaces similartotheVBEto servicethesenewrequirements.TheVBEsupplementalspecificationarchitectureprovides awayto extendthebasicVBEspecificationwithoutmakingittoounwieldyorhavingtorevisetheVBE specificationitself. ThesupplementalspecificationsareimplementedusingVBEfunctionnumbersstartingatAL=10h.This leavesthefirstsixteenfunctionsavailableforeventualVBEgrowth.Individualcallsforeach supplementalspecificationaremadethroughasubfunctionnumberviatheBLregister.This function/subfunctionarchitectureiscompatiblewiththeVBEandprovideseachVBESupplemental Specificationwith64potentialsubfunctions.Subfunction00hforeachsupplementalspecificationis reservedfora'ReturnVBESupplementalSpecificationInformation'call. It is basedontheVBE Function00handreturnsbasicinformationontheVBESupplementalSpecificationimplementation. 5.2 Obtaining Supplemental VBE Function Numbers VBESupplemental Specifications canonlybecreatedbyVESAcommittees. Onceaneedforanew softwarespecificationhasbeenidentified,thegroupworkingonit needs tocontact theVESASoftware StandardsCommittee(SSC)todiscusstherequirements. TheSSCwill assignafunctionnumberand nametothesupplementalspecification.Thenameassignedtoasupplementalspecificationwillbeinthe formof'VBE/???'wherethe'???'is atwoorthreeletteracronymforits function. Twoletteracronyms will bepaddedwithFFhforthethirdletter. Insomecases thecommitteethat is workingonthe supplementalspecificationmayhaveanothernamethattheywilluseforpromotionalpurposes,however theVBE/???willcontinuetobethesignature. TheVBEspecificationwillberevisedperiodicallytoupdatethelistofsupplementalspecifications. To obtaintheactualspecifications,contacttheVESAoffice.
  • 42. VBESupplementalSpecifications VBECOREFUNCTIONSVERSION2.0 Page35 DOCUMENTREVISION1.1 5.3 Required VBE Supplemental Specification Components 5.3.1 VBE Supplemental Specification Functions AllVBESupplementalSpecificationfunctionsarecalledwiththeAHregistersetto4Fhtoidentifythem asVBEfunctioncalls. TheALregisterisusedtospecifywhichVESAfunctionthesupplemental specificationisusing. TheBLregisterwillcontainthesubfunctionnumberforthecallbeingmade,BH willcontainthesub-subfunctionnumberifnecessary. e.g.,Input: AX =4FXXh VESASupplementalVBESpecification ('XX'representsthefunctionnumberforthe supplementalspecification) BL = ? Subfunction BH = ? Sub-subfunction 5.3.2 Return Status AllVBESupplementalSpecificationswillusetheVBECompletioncodesasdocumentedinSection4.1 oftheVBEspecification. 5.3.3 Subfunction 00h - Return VBE Supplemental Specification Information Thissubfunctionreturnsthecapabilities,revisionlevel,andvendorspecificinformationofthe supplementalspecification,andisarequiredfunctionforanyVBE2.xSupplementalSpecification. Thepurposeofthissubfunctionistoprovideinformationtothecallingprogramaboutthegeneral capabilitiesoftheinstalledVBEsoftwareandhardware. Thissubfunctionfillsaninformationblock structureattheaddressspecifiedbythecaller. TheSupVBEInfoBlockinformationblocksizeis 256 bytes. Input: AX =4FXXh ReturnSupplementalVBESpecificationInformation ('XX'representsthefunctionnumberforthe supplementalspecification) BL = 00h Subfunction'0' ES:DI = Pointertobufferinwhichtoplace SupVBEInfoBlockstructure Output:AX = VBEReturnStatus Otherregistersmaybedefinedforinputandoutput basedupontheparticularrequirements of supplementalspecifications Whenwritingsupplementalfunctions,explicitlystatewhichregistersarepreservedandwhichare destroyed. Refrainfrompreservingallregistersasthistendstolimitexpandabilityinthefuture. An exampleofthenoteis:
  • 43. VBESupplementalSpecifications Page36 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 Note: Currentlyundefinedregisters maybedestroyedwiththeexceptionof SI,BP,DS and SS. Theinformationblockhasthefollowingstructure: SupVbeInfoBlockstruc SupVbeSignature db 'VBE/???' ;SupplementalVBESignature SupVbeVersion dw ? ;SupplementalVBEVersion SupVbeSubFunc db 8dup (?) ;Bitfieldofsupportedsubfunctions OemSoftwareRev dw ? ;OEMSoftwarerevision OemVendorNamePtr dd ? ;PointertoVendorNameString OemProductNamePtr dd ? ;PointertoProduct NameString OemProductRevPtr dd ? ;PointertoProductRevisionString OemStringPtr dd ? ;PointertoOEMString Reserved db 221 dup (?) ;Reservedfordescriptionstringsandfuture ;expansion SupVbeInfoBlockends Note: AlldatainthisstructureissubjecttochangebytheVBEimplementationwhenanyVBE Subfunction00hiscalled. Thereforeit shouldnot beusedbytheapplicationtostoredataofanykind. Descriptionofthe SupVbeInfoBlockstructurefields: The SupVbeSignaturefieldisfilledwiththeASCIIcharacters 'VBE/'followedbythetwoorthree letteracronymthatrepresentsthesupplementalspecification.Thisfieldisfilledbythesupplementary VBEimplementation. Intheeventthattheacronymisonlytwoletters,thethirdlettermustbefilledwith FFh. The SupVbeVersionisaBCDvaluewhichspecifieswhatleveloftheVBEsupplementary specificationisimplementedinthesoftware.Thehigherbytespecifiesthemajorversionnumber.The lowerbytespecifiestheminorversionnumber. Note: The BCDvalue for 2.0 is 0200h and the BCDvalue for 1.2 is 0102h. In the past we have had someapplicationsmisinterpretingtheseBCDvalues. Forexample, BCD0102hwas interpretedas 1.02,whichisincorrect. The SupVbeSubFuncisabitfieldthatrepresentsthesubfunctionsavailableforthesupplementary specification.Ifthebitrepresentingaparticularsubfunctionisset,thenthatsubfunctionissupported. Subfunction'0'isrepresentedbytheLSBofthefirst byteandtheothersubfunctions follow. Onlybits forsubfunctionsdefinedinthespecificationneedtobeset. The OemStringPtrisaRealModefarpointertoanull-terminatedOEM-definedstring. This stringmay usedtoidentifythegraphicscontrollerchiporOEMproductfamilyforhardwarespecificdisplay
  • 45. VBESupplementalSpecifications Page38 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 The OemSoftwareRev fieldisaBCDvaluewhichspecifiestheOEMrevisionlevel ofthe SupplementalSpecificationsoftware. Thehigherbytespecifiesthemajorversionnumber.Thelower bytespecifiestheminorversionnumber. This fieldcanbeusedtoidentifytheOEM's VBEsoftware release. The OemVendorNamePtrisaRealModefarpointertoanull-terminatedOEM-definedstring containingthenameofthevendorwhoproducedthedisplaycontrollerboardproduct. The OemProductNamePtrisaRealModefarpointertoanull-terminatedOEM-definedstring containingtheproductnameofthedisplaycontrollerboard. The OemProductRevPtrisaRealModefarpointertoanull-terminatedOEM-definedstring containingtherevisionormanufacturinglevelofthedisplaycontrollerboardproduct. Thisfieldcanbe usedtodeterminewhichproductionrevisionofthedisplaycontrollerboardisinstalled. 5.4 Supplemental Specification Protected Mode Guidelines VBESupplementalSpecificationsmaywishtoincorporate32-bit protectedmodeinterfaces based uponthe32-bitprotectedmodeinterfaceinVBE2.0. Theguidelines forthis aresimple. Input: AX =4FXXh SupplementalSpecificationFunctionNumber BL = XX Return32-bit protectedmodeinterfacetable Output: AX = Status ES = Real ModeSegment ofTable DI = OffsetofTable CX = LengthofTableincludingprotectedmodecode (forcopyingpurposes) Theformatofthetableshouldbeas follows: ES:DI+ 00h WordOffset in table ofProtected mode code for firstfunction ES:DI+(n*2) WordOffset in table ofProtected mode code for nthfunction ES:DI+ ? Word Offset intableofPorts and MemoryLocations thattheapplicationmayneedI/Oprivilegefor (Optional: ifunsupportedthismustbe0000h) (SeeSub-tableforformat) ES:DI + ? VariableremainderofTableincludingCode
  • 46. VBESupplementalSpecifications VBECOREFUNCTIONSVERSION2.0 Page39 DOCUMENTREVISION1.1 Theformat oftheSub-Table(Ports andMemorylocations) Port, Port, ... , Port, Terminate Port List with FFFF, Memorylocations (4 bytes), Length (2 bytes), TerminateMemoryList withFFFF. Example 1.ForPort/Indexcombination3DE/FhandMemorylocations DE800-DEA00h(length= 200h)thetablewouldlooklikethis: DE 03 DF 03 FF FF 00 E8 0D 00 00 02 FF FF Example 2.Foronlytheports it wouldlooklike: DE 03 DF 03 FF FF FF FF Example 3.Foronlythememorylocationsitwouldlooklike FF FF 00 E8 0D 00 00 02 FF FF Note:. All protectedmodefunctions shouldendwithanearRET(as opposedtoFARRET)to allow theapplicationsoftwaretoCALLthecodefromwithintheROM. Note: Theprotectedmodecodeshouldbeassembled for a 32-bit code segment, when copyingit, the applicationmust copythecodetoa32-bit code segment. Note: Itistheresponsibilityoftheapplicationtoensurethat theselectors andsegments areset up correctly. Note: Currentlyundefinedregisters maybedestroyedwiththeexceptionofESI, EBP, DSand SS. Indevelopingasupplementalspecification,ensurethatboththeapplicationdeveloperandthe VBE/XXXimplementorsareawareofwhichportionofthefunctionissupported, i.e., ifafunction supports bothaGet andaSet function, spell out whichis supported, the Get, the Set or both. 5.5 Loading Supplemental Drivers VBESupplementalSpecificationscanbeimplementedinROM, TSRprograms oras devicedrivers. Thespecificrequirementswillvarydependingontheindividualsupplementaryspecification.Ifthereare anyspecificrequirements,theyshouldbedetailedinthesupplementaryspecification. 5.6 Implementation Questions Whendevelopinganewsupplementalspecification,implementationquestionswhethertheyarecovered inthisguidelineornot,shouldbereferredtotheVESASoftwareStandards Committeeforclarification. ThechairmanoftheSSCcanbecontactedthroughVESAoffice.
  • 47. VBESupplementalSpecifications Page40 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 5.7 Known Supplemental Specifications 5.7.1 Function 10h - Power Management Extensions (PM) Thisoptionalfunctioncontrolsthepowerstateoftheattacheddisplaydeviceormonitor. RefertotheVBE/PMStandardforspecifics. 5.7.2 Function 11h - Flat Panel Interface Extensions (FP) Thisproposedoptionalsupplementalspecificationallowsaccesstothespecialfeatures incorporatedin FlatPanelcontrollers.Thereisnoreferencespecificationat thetimeofthis standard's approval. Contact theVESAofficeformoreinformation. 5.7.3 Function 12h - Cursor Interface Extensions (CI) ThisproposedoptionalfunctionprovidesservicesforHardwareCursors andPointingDevices. At this time,thisisindevelopment. Thereisnoreferencespecificationat thetimeofthis standard's approval, contacttheVESAofficeformoreinformation. 5.7.4 Function 13h - Audio Interface Extensions (AI) ThisoptionalfunctionprovidesstandardAudioservices. RefertotheVBE/AIStandardforspecifics. 5.7.5 Function 14h - OEM Extensions ThisoptionalsupplementalfunctionprovidesOEM'swithacodedispatchareathat falls underthe VESA4Fhfunctions. AnOEMmayusethis areaat theirown risk. VESAstates no warranties or guaranteesaboutthefunctioncallscontainedwithinthisarea. 5.7.6 Function 15h - Display Data Channel (DDC) Thisoptionalfunctionprovidesamechanismtoextractdatafromattacheddisplaydevices ontheVESA communicationchannel. RefertotheVBE/DDCStandardforspecifics. 5.7.7 Function 16h - Graphics System Configuration (GC) Thisproposedsupplementalfunctionprovidesamechanismforsystemlevelservicestoset upMonitor Timings,LinearFrameBufferaddressesetc.,i.e.systemlevelcallsthatapplicationsshouldnot deal with . Thereisnoreferencespecificationat thetimeofthis standard's approval. Contact theVESAoffice formoreinformation.
  • 48. VBEQuickReference VBECOREFUNCTIONSVERSION2.0 Page41 DOCUMENTREVISION1.1 Appendix 1 - VBE Quick Reference Input: AX = 4F00h ReturnVBEControllerInformation ES:DI = Pointertobufferinwhichtoplace VbeInfoBlockstructure (VbeSignatureshouldbeset to'VBE2'when functioniscalledtoindicateVBE2.0information isdesiredandtheinformationblockis 512bytes in size.) Output:AX = VBEReturnStatus Note: Allotherregisters arepreserved. ______________________________ Input: AX = 4F01h ReturnVBEmodeinformation CX = Modenumber ES:DI = PointertoModeInfoBlockstructure Output:AX = VBEReturnStatus Note: Allotherregisters arepreserved. ______________________________ Input: AX = 4F02h Set VBEMode BX = Desired Mode to set D0-D8= Modenumber D9-D13 = Reserved(must be 0) D14 = 0 Usewindowedframebuffermodel = 1 Uselinear/flatframebuffermodel D15 = 0 Cleardisplaymemory = 1 Don'tcleardisplaymemory Output:AX = VBEReturnStatus Note: Allotherregisters arepreserved. ______________________________
  • 49. VBEQuickReference Page42 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 Input: AX = 4F03h Returncurrent VBEMode Output:AX = VBEReturnStatus BX = CurrentVBEmode D0-D13 = Modenumber D14 = 0 Windowedframebuffermodel = 1 Linear/flatframebuffermodel D15 = 0 Memoryclearedat last mode set = 1 Memorynot clearedat last mode set Note: Allotherregisters arepreserved. ______________________________ Input: AX = 4F04h Save/RestoreState DL = 00h ReturnSave/RestoreStatebuffersize = 01h Savestate = 02h Restorestate CX = Requestedstates D0= Save/Restorecontrollerhardwarestate D1= Save/Restore BIOSdata state D2= Save/RestoreDACstate D3= Save/RestoreRegisterstate ES:BX = Pointertobuffer (ifDL <> 00h) Output:AX = VBEReturnStatus BX = Numberof64-byte blocks to hold the state buffer (ifDL=00h) Note: Allotherregisters arepreserved. ______________________________ Input: AX = 4F05h VBEDisplayWindowControl BH = 00h Setmemorywindow = 01h Getmemorywindow BL = Windownumber = 00h WindowA = 01h WindowB DX = Windownumberinvideomemoryinwindow granularityunits (SetMemoryWindowonly) Output:AX = VBEReturnStatus DX = Windownumberinwindowgranularityunits
  • 51. VBEQuickReference Page44 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 Input: AX = 4F06h VBESet/GetLogicalScanLineLength BL = 00h SetScanLineLengthinPixels = 01h GetScanLineLength = 02h SetScanLineLengthinBytes = 03h GetMaximumScanLineLength CX = IfBL=00h DesiredWidthinPixels IfBL=02h DesiredWidthinBytes (IgnoredforGetFunctions) Output:AX = VBEReturnStatus BX = Bytes PerScan Line CX = ActualPixels PerScanLine (truncatedtonearestcompletepixel) DX = MaximumNumberofScanLines ______________________________ Input: AX = 4F07h VBESet/Get DisplayStart Control BH = 00h Reservedandmust be 00h BL = 00h SetDisplayStart = 01h GetDisplayStart = 80h SetDisplayStartduringVertical Retrace CX = FirstDisplayedPixelInScanLine (SetDisplayStartonly) DX = FirstDisplayedScanLine(Set DisplayStart only) Output:AX = VBEReturnStatus BH = 00hReservedandwill be0(Get DisplayStart only) CX = FirstDisplayedPixelInScanLine(Get DisplayStart only) DX = FirstDisplayedScanLine(Get DisplayStart only) ______________________________ Input: AX = 4F08h VBESet/Get PaletteFormat BL = 00h Set DACPalette Format = 01h Get DACPaletteFormat BH = Desiredbits ofcolorperprimary (Set DACPaletteFormat only) Output:AX = VBEReturnStatus BH = Currentnumberofbits ofcolorperprimary
  • 53. VBEQuickReference Page46 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 Input: AX = 4F09h VBELoad/UnloadPaletteData BL = 00h Set PaletteData = 01h Get PaletteData = 02h Set SecondaryPalette Data = 03h Get SecondaryPaletteData = 80h SetPaletteDataduringVertical Retrace withBlankBit on CX = Numberofpaletteregisters toupdate DX = Firstpaletteregistertoupdate ES:DI = Tableofpalettevalues (seebelowforformat) Output:AX = VBEReturnStatus FormatofPaletteValues: Alignment byte, Redbyte, Greenbyte, Bluebyte ______________________________ Input: AX = 4F0Ah VBE2.0 Protected Mode Interface BL = 00h Returnprotectedmodetable Output: AX = Status ES = Real ModeSegment ofTable DI = OffsetofTable CX = LengthofTableincludingprotectedmodecodeinbytes (forcopyingpurposes) ______________________________
  • 54. VBEData Structures VBECOREFUNCTIONSVERSION2.0 Page47 DOCUMENTREVISION1.1 Appendix 2 - VBE Data Structures VbeInfoBlockstruc VbeSignature db 'VESA' ;VBESignature VbeVersion dw 0200h ;VBEVersion OemStringPtr dd ? ;PointertoOEMString Capabilities db 4 dup (?) ;Capabilitiesofgraphicscontroller VideoModePtr dd ? ;PointertoVideoModeList TotalMemory dw ? ; Numberof64kbmemoryblocks ; Added for VBE 2.0 OemSoftwareRev dw ? ;VBEimplementationSoftwarerevision OemVendorNamePtr dd ? ;PointertoVendorNameString OemProductNamePtr dd ? ;PointertoProduct NameString OemProductRevPtr dd ? ;PointertoProductRevisionString Reserved db 222 dup (?) ;ReservedforVBEimplementationscratch ; area OemData db 256 dup (?) ; DataAreaforOEMStrings VbeInfoBlockends
  • 55. VBEData Structures Page48 VBECOREFUNCTIONSVERSION2.0 DOCUMENTREVISION1.1 ModeInfoBlockstruc ;MandatoryinformationforallVBErevisions ModeAttributes dw ? ;modeattributes WinAAttributes db ? ;windowAattributes WinBAttributes db ? ;windowBattributes WinGranularity dw ? ;windowgranularity WinSize dw ? ;windowsize WinASegment dw ? ;windowAstart segment WinBSegment dw ? ;windowBstartsegment WinFuncPtr dd ? ;pointertowindowfunction BytesPerScanLine dw ? ;bytes perscanline ;MandatoryinformationforVBE1.2andabove XResolution dw ? ;horizontalresolutioninpixelsorcharacters YResolution dw ? ;verticalresolutioninpixelsorcharacters XCharSize db ? ;charactercellwidthinpixels YCharSize db ? ;charactercellheightinpixels NumberOfPlanes db ? ;numberofmemoryplanes BitsPerPixel db ? ;bitsperpixel NumberOfBanks db ? ;numberofbanks MemoryModel db ? ;memorymodeltype BankSize db ? ;banksizeinKB NumberOfImagePages db ? ;numberofimages Reserved db 1 ;reservedforpagefunction ;DirectColorfields(requiredfordirect/6andYUV/7memorymodels) RedMaskSize db ? ;sizeofdirect colorredmaskinbits RedFieldPosition db ? ;bitpositionoflsbofredmask GreenMaskSize db ? ;sizeofdirectcolorgreenmaskinbits GreenFieldPosition db ? ;bitpositionoflsbofgreenmask BlueMaskSize db ? ;sizeofdirectcolorbluemaskinbits BlueFieldPosition db ? ;bitpositionoflsbofbluemask RsvdMaskSize db ? ;sizeofdirect colorreservedmaskinbits RsvdFieldPosition db ? ;bitpositionoflsbofreservedmask DirectColorModeInfo db ? ;directcolormodeattributes ;MandatoryinformationforVBE2.0andabove PhysBasePtr dd ? ;physicaladdressforflatmemoryframebuffer OffScreenMemOffset dd ? ;pointertostart ofoffscreenmemory OffScreenMemSize dw ? ;amountofoffscreenmemoryin1kunits Reserved db 206 dup (?) ; remainder of ModeInfoBlock ModeInfoBlock ends