1<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> 2<html> 3<head> 4 5<title>OpenML ABI/DDI (DRAFT July 19, 2001)</title> 6 7<meta name="description" content="OpenML ABI/DDI standards"> 8<meta name="keywords" content="OpenML, OpenGL, ABI, Linux"> 9<meta name="owner" content="Jon Leech"> 10 11<center> 12<h2> OpenML® Application Binary Interface (ABI) and Device Driver 13 Interface (DDI) Standards </h2> 14 15<p>Version 0.2<br> 16 July 19, 2001<br> 17 Editor: Jon Leech, SGI 18</center> 19 20<p><hr></p> 21 22<h2> Index </h2> 23 24 <ul> 25 <li><a href="#1">1. Overview and Goals </a> 26 <li><a href="#2">2. OpenML Component APIs and Versions</a> 27 <li><a href="#3">3. Calling Conventions</a> 28 <li><a href="#4">4. Libraries</a> 29 <li><a href="#5">5. Header Files</a> 30 <li><a href="#6">6. Extension Mechanism and Extension Headers</a> 31 <li><a href="#7">7. Device Driver Interfaces</a> 32 <li><a href="#app">Appendix: Open Issues</a> 33 <li><a href="#log">Change Log</a> 34 </ul> 35 36<a name="1"> 37<h2> 1. Overview and Goals </h2> 38 39<p> 1.1. This document is intended to solve three related problems. 40 First, defining the ABIs and runtime environment for applications 41 using OpenML. This will enable applications using the OpenML APIs 42 for rendering to run on a variety of underlying implementations 43 transparently. 44 45<p> Second, defining the Software Development Kit (SDK) (for developing 46 apps using OpenGL. This includes header file locations, conventions 47 for use of extensions, etc. 48 49<p> Finally, defining the Device Driver Interface (DDI) for appropriate 50 portions of OpenML. 51 52<p> These standards target multiple platforms. For Linux and Microsoft 53 Windows, where multiple vendors will supply OpenML implementations, 54 the standards are <b>proscriptive</b>; all conformant OpenML 55 implementations must satisfy the ABI, SDK, and DDI requirements. For 56 other platforms (at this time, vendor-specific Unix platforms such 57 as IRIX or Solaris), only some parts of the standards are required, 58 while others are <b>recommended</b>, for maximal portability between 59 platforms. 60 61<p> It may eventually be appropriate to share these standards with 62 broader standards bodies such as the 63 <a href="http://www.freestandards.org">Free Standards Group</a> on 64 Linux. 65 66<p> 1.2. There are many open issues in the initial draft; this is 67 intended for discussion and extensive modification. Open issues are 68 summarized in the <a href="#app">appendix</a>. Some decisions are 69 largely arbitrary (filenames and file locations, for example), and 70 in those cases we have been guided by existing practice where 71 possible. 72 73<p> 1.3. This document is intended to become part of the OpenML 74 Specification on its approval, and is a joint work of the 75 <a href="http://www.khronos.org">Khronos SIG</a>.</p> 76 77<a name="2"> 78<h2> 2. OpenML Component APIs and Versions </h2> 79 80<h3> 2.1. Component APIs </h3> 81 82<p> OpenML requires implementations of several separate APIs: <b>ML</b>, 83 <b>MLdc</b>, and <b>OpenGL</b>. For the most part, the ABIs, SDKs, 84 and DDIs required for each of these APIs are not related, and are 85 described separately. Interactions are documented where needed. 86 87<h3> 2.2. ML </h3> 88 89<p> ML is the <i>Media Library</i> component of OpenML. It is a 90 low-level API for accessing video and audio hardware. 91 92<h3> 2.3. MLdc </h3> 93 94<p> MLdc is the <i>Display Control</i> component of OpenML. It manages 95 multiple video <i>channels</i>, including aspects such as video 96 formats, timing, gamma tables, etc. 97 98<h3> 2.4. OpenGL </h3> 99 100<p> OpenGL is the <i>Graphics</i> component of OpenML. It is a low-level 101 API for performing 3D rendering. OpenGL is standardized separately 102 from OpenML by the <a href="http://www.opengl.org/">OpenGL 103 Architecture Review Board</a>; OpenML simply requires a specific 104 version of OpenGL with a small number of added API extensions for 105 managing video data. 106 107<p> Because OpenGL is a pre-existing API with shipping implementations, 108 this document mostly refers to other standards (such as the <a 109 href="http://oss.sgi.com/projects/ogl-sample/ABI/">OpenGL ABI for 110 Linux</a>) when defining OpenGL-specific standards.</p> 111 112<h3> 2.5. Versions </h3> 113 114<p> This document defines ABIs and DDIs for the OpenML 1.0 APIs. </p> 115 116<a name="3"> 117<h2> 3. Calling Conventions </h2> 118 119<h3> 3.1. ML Calling Conventions </h3> 120 121<p> <b>OPEN</b> - need to define ML datatype required sizes, Windows / Linux 122 / etc. conventions. 123 124<h3> 3.2. MLdc Calling Conventions </h3> 125 126<p> <b>OPEN</b> - need to define MLdc datatype required sizes, Windows / 127 Linux / etc. conventions. 128 129<h3> 3.3. OpenGL Calling Conventions </h3> 130 131<p> 3.3.1. <b>Linux</b> - the OpenGL implementation must follow the 132 calling and datatype conventions defined by the <a 133 href="http://oss.sgi.com/projects/ogl-sample/ABI/">OpenGL ABI for 134 Linux</a>. 135 136<p> 3.3.2. <b>Windows</b> - the OpenGL implementation must follow the 137 calling and datatype conventions established <i>de facto</i> by 138 Microsoft's <tt>OPENGL32.DLL</tt> and header files. 139 140<p> 3.3.3. <b>Other Platforms</b> - calling conventions are 141 platform-dependent. Datatype conventions are platform dependent so 142 long as they satisfy the minimum size requirements of the OpenGL 143 Specification. 144 145<p> <b>Issues:</b> Do we need to address C++ linking issues? Need more 146 detail on calling conventions for Linux?</p> 147 148<a name="4"> 149<h2> 4. Libraries </h2> 150 151<h3> 4.1. ML Library </h3> 152 153<p> There is a single user-level ML link library. It includes ML entry 154 points, and in general makes use of underlying hardware drivers for 155 hardware device access. Hardware drivers may be incorporated into 156 the link library, but in general they are loaded by the link library 157 at runtime, and accessed through a <a href="#DDIsection">Device 158 Driver Interface</a> defined below. 159 160<p> 4.1.1 <b>Linux</b> - the link library has two names: that used on 161 the ld command line, and the <tt>DT_SONAME</tt> within that library 162 (specified by the <i>-soname</i> switch when linking the library), 163 defining where it's looked up at runtime. Both forms must exist so 164 that both linking and running will operate properly. 165 166<p> The <tt>DT_SONAME</tt> includes the ML major version number, and is 167 <tt>libML.so.1</tt>. The <i>link library name</i> is 168 <tt>libML.so</tt>. <tt>libML.so</tt> must be implemented as a 169 symbolic link to <tt>libML.so.1</tt>. This allows future major 170 revisions of ML to be implemented transparently to applications by 171 simply changing the link; new applications will link with the new 172 runtime library, while old, compiled applications will continue to 173 use the old runtime. 174 175<p> <b>Issues:</b> do we need static link libraries? 176 177<p> Both ML libraries must be located in <tt>/usr/lib</tt>. 178 179<p> 4.1.2. <b>Windows</b> - the link library is named <tt>ML32.DLL</tt>. 180 It must be located in <tt>\System\???</tt> 181 182<p> <b>Issues:</b> What the heck are the Windows system library 183 conventions, anyway? And will we run into the horrid Windows XP 184 "driver signing" mess by mandating the library live in 185 <tt>\System</tt>? 186 187<p> 4.1.3. <b>Other Platforms</b> - the base name of the library should 188 be <tt>libML</tt>, so that crossplatform Unix build systems can 189 always use "-lML" on their link lines. The ML major version number 190 (1) should be incorporated into the link library name in appropriate 191 fashion. The library should be shared, and should use whatever the 192 platform's library versioning mechanism is to cause compiled 193 applications to resolve to resolve to the correct version of 194 <tt>libML</tt> (e.g. the one they were linked against), even if a 195 newer major version has become the default. 196 197<p> The ML library is typically located in <tt>/usr/lib</tt>, although 198 platform conventions may override this. The important point is that 199 there be a single, standard location for the link library on that 200 platform. 201 202<h3> 4.2. MLdc Library </h3> 203 204<p> There is a single user-level MLdc link library. It includes MLdc 205 entry points, and in general makes use of underlying hardware 206 drivers for hardware device access. Hardware drivers may be 207 incorporated into the link library, but in general they are loaded 208 by the link library or the window system at runtime, and accessed 209 through a <a href="#DDIsection">Device Driver Interface</a> defined 210 below. 211 212<p> 4.2.1 <b>Linux</b> - the link library has two names: that used on 213 the ld command line, and the <tt>DT_SONAME</tt> within that library 214 (specified by the <i>-soname</i> switch when linking the library), 215 defining where it's looked up at runtime. Both forms must exist so 216 that both linking and running will operate properly. 217 218<p> The <tt>DT_SONAME</tt> includes the MLdc major version number, and 219 is <tt>libMLdc.so.1</tt>. The <i>link library name</i> is 220 <tt>libMLdc.so</tt>. <tt>libMLdc.so</tt> must be implemented as a 221 symbolic link to <tt>libMLdc.so.1</tt>. This allows future major 222 revisions of MLdc to be implemented transparently to applications by 223 simply changing the link; new applications will link with the new 224 runtime library, while old, compiled applications will continue to 225 use the old runtime. 226 227<p> <b>Issues:</b> do we need static link libraries? 228 229<p> Both MLdc libraries must be located in <tt>/usr/lib</tt>. 230 231<p> 4.2.2. <b>Windows</b> - the link library is named 232 <tt>MLDC32.DLL</tt>. It must be located in <tt>\System\???</tt> 233 234<p> <b>Issues:</b> As for <tt>ML32.DLL</tt> - decide where 235 the library lives. 236 "driver signing" mess by mandating the library live in 237 <tt>\System</tt>? 238 239<p> 4.2.3. <b>Other Platforms</b> - the base name of the library should 240 be <tt>libMLdc</tt>, so that crossplatform Unix build systems can 241 always use "-lMLdc" on their link lines. The MLdc major version 242 number (1) should be incorporated into the link library name in 243 appropriate fashion. The library should be shared, and should use 244 whatever the platform's library versioning mechanism is to cause 245 compiled applications to resolve to resolve to the correct version 246 of <tt>libMLdc</tt> (e.g. the one they were linked against), even if 247 a newer major version has become the default. 248 249<p> The MLdc library is typically located in <tt>/usr/lib</tt>, although 250 platform conventions may override this. The important point is that 251 there be a single, standard location for the link library on that 252 platform. 253 254<h3> 4.3. OpenGL Library </h3> 255 256<p> There is a single user-level OpenGL link library. It includes OpenGL 257 entry points, and in general makes use of underlying hardware 258 drivers for hardware device access. Hardware drivers may be 259 incorporated into the link library, but in general they are loaded 260 by the link library or the window system at runtime, and accessed 261 through a <a href="#DDIsection">Device Driver Interface</a> defined 262 below. 263 264<p> 4.3.1 <b>Linux</b> - the OpenGL library naming, location, and 265 versioning conventions are as defined by the <a 266 href="http://oss.sgi.com/projects/ogl-sample/ABI/">OpenGL ABI for 267 Linux</a>. 268 269<p> 4.3.2. <b>Windows</b> - the OpenGL library is shipped by Microsoft 270 in <tt>\System\OPENGL32.DLL</tt>. 271 272<p> 4.3.3. <b>Other Platforms</b> - follow existing conventions on those 273 platforms (typically the OpenGL library is linked via "-lGL"). New 274 platforms without existing conventions should follow the Linux 275 conventions insofar as possible. 276 277<h3> 4.4. Additional Issues </h3> 278 279<p> <ul> 280 <li> C++ runtime issues on Linux? 281 <li> Entry points guaranteed in each library. 282 <li> Thread safety. 283 <li> Transitive linking of required libraries. 284 </ul> 285 286<a name="5"> 287<h2> 5. Header Files </h2> 288 289<h3> 5.1. ML Header Files </h3> 290 291<p> 5.1.1. The following header files are required for ML: 292 293 <ul> 294 <li> <b>TBD</b> 295 </ul> 296 297<p> Language bindings supported - <b>TBD</b> (C and C++?) 298 299<p> Header locations - <b>TBD</b> (presumably /usr/include/ML on 300 Linux/Unix) 301 302<p> Header contents - <b>TBD</b> (ML 1.0) 303 304<h3> 5.2. MLdc Header Files</h3> 305 306<p> 5.2.1. The following header files are required for MLdc: 307 308 <ul> 309 <li> <b>TBD</b> 310 </ul> 311 312<p> Language bindings supported - <b>TBD</b> (C and C++?) 313 314<p> Header locations - <b>TBD</b> (/usr/include/ML? check w/Cary) 315 316<p> Header contents - <b>TBD</b> (MLdc 1.0) 317 318<h3> 5.3. OpenGL Header Files </h3> 319 320<p> 5.3.1 <b>Linux</b> - the OpenGL header file requirements are as 321 defined by the <a 322 href="http://oss.sgi.com/projects/ogl-sample/ABI/">OpenGL ABI for 323 Linux</a>. In addition, <tt>glext.h</tt> and <tt>glxext.h</tt> must 324 define interfaces for the OpenGL and GLX extensions, respectively, 325 required by OpenML 1.0. 326 327<p> 5.3.2. <b>Windows</b> - the following header files 328 are required: 329 330 <ul> 331 <li> <tt><GL/gl.h></tt> - OpenGL 332 <li> <tt><GL/wgl.h></tt> - WGL 333 <li> <tt><GL/glu.h></tt> - GLU 334 <li> <tt><GL/glext.h></tt> - OpenGL Extensions 335 <li> <tt><GL/wglext.h></tt> - WGL Extensions 336 </ul> 337 338<p> gl.h, glu.h, and wgl.h are typically supplied by Microsoft, 339 while <tt>glext.h</tt> and <tt>wglext.h</tt> should be obtained from 340 the OpenGL extension registry. <tt>glext.h</tt> and 341 <tt>wglext.h</tt> must define interfaces for the OpenGL and WGL 342 extensions, respectively, required by OpenML 1.0. 343 344<p> Header locations - <b>TBD</b> (check existing practice for 345 MS-supplied headers; define a location for others). 346 347<p> 5.3.3. <b>Other Platforms</b> - follow existing conventions on those 348 platforms (typically header files are placed in 349 <tt>/usr/include/GL</tt>). However, all implementations must provide 350 <tt>glext.h</tt> and, for implementations on the X Window System and 351 GLX, <tt>glxext.h</tt>, and all OpenML 1.0 extensions must be 352 defined in those headers. 353 354<p> New platforms without existing conventions should follow the Linux 355 conventions insofar as possible. 356 357<h3> 5.4. General Issues </h3> 358 359<p> Required header files must not pull in internal headers or headers 360 from other packages where that would cause unexpected namespace 361 pollution. They must be protected against multiple inclusion and 362 should not themselves include any headers that are not so protected. 363 364<p> Vendor-specific shortcuts, such as macros for higher performance GL 365 entry points, are intrinsically unportable. These should <b>not</b> 366 be present in any required header files, but instead in a 367 vendor-specific header file that requires explicit effort by 368 developers to access, such as defining a vendor-specific 369 preprocessor symbol or including a vendor-specific header file.</p> 370 371<!-- <font face="Arial" size="2">yadda yadda</font> --> 372 373<a name="6"> 374<h2> 6. Extension Mechanism and Extension Headers </h2> 375 376<h3> 6.1. General Requirements </h3> 377 378<p> The ML, MLdc, and OpenGL APIs may be extended by individual vendors 379 or groups of vendors to provide functionality specific to some 380 implementations. Such extensions take the form of new entry points 381 and/or new parameters to existing functions. 382 383<p> In general each API will be exposed to applications as a single link 384 library, with the library dispatching functions to hardware-specific 385 drivers as appropriate. If vendors providing extensions each 386 provided a modified link library, binary applications could not 387 reliably be moved from system to system, because incompatible 388 interfaces would be provided depending on the source of the library. 389 390<p> To deal with this, each API provides an <i>extension mechanism</i> 391 which lets applications obtain new entry points (pointers to 392 functions within driver modules) dynamically at runtime. 393 394<p> Similarly, if each vendor provided modified header files adding 395 their extensions, it would be difficult to build applications 396 consistently in different environments. To deal with this, each API 397 defines the structure of a <i>extension header</i> which defines 398 interfaces for all known extensions and can be maintained at a 399 central source. 400 401<h3> 6.2. ML Extensions </h3> 402 403<p> 6.2.1. The ML extension mechanism and extension headers 404 are not defined yet; this will be done for OpenML 1.1. 405 406<h3> 6.3. MLdc Extensions </h3> 407 408<p> 6.3.1. <i>Need to insert MLdc extension mechanism</i>. 409 410<h3> 6.4. OpenGL Extensions </h3> 411 412<p> 6.4.1. <b>Linux</b> - The OpenGL ABI for Linux defines the required 413 extension functionality, including the <b>glXGetProcAddressARB</b> 414 function (provided by the <tt>GLX_ARB_get_proc_address</tt> 415 extension) used to query extension interfaces. The <tt>glext.h</tt> 416 and <tt>glxext.h</tt> headers from the OpenGL extension registry 417 define interfaces to known OpenGL and GLX extensions. 418 419<p> 6.4.2. <b>Windows</b> - WGL provides the <b>wglGetProcAddress</b> 420 function used to query extension interfaces (unlike the GLX 421 equivalent, returned function pointers are <i>context dependent</i>; 422 portable code must be aware of this difference). <tt>glext.h</tt> 423 (identical to the Linux version) and <tt>wglext.h</tt> headers from 424 the OpenGL extension registry define interfaces to known OpenGL and 425 WGL extensions. 426 427<p> 6.4.3. <b>Other Platforms</b> - Unix platforms should follow the 428 Linux conventions, providing the <tt>GLX_ARB_get_proc_address</tt> 429 extension as well as <tt>glext.h</tt> and <tt>glxext.h</tt>. Other 430 platforms should define an extension with similar functionality and 431 provide <tt>glext.h</tt>; a companion extension header for window 432 system interface extensions may also need to be provided. </p> 433 434<a name="7"> 435<h2> 7. Device Driver Interfaces </h2> 436 437<p> <b>TBD</b> - waiting on dmSDK DDI. 438 439 440<p><hr></p> 441 442<a name="app"> 443<h2> Appendix: Open Issues </h2> 444 445<p> <b>TBD</b> 446 447<!-- <p><a name="issue2.1"> 448 <b>Section 2.1</b>: 449 Define GL datatypes for other supported Linux architectures - Alpha, 450 PowerPC, MIPS, etc. (in general these will be identical to the IA32 451 types). Note: we may want to suggest <tt>GLlong</tt> and 452 <tt>GLulong</tt> as 64-bit datatypes for future OpenGL revisions. 453--> 454 455 456<a name="log"> 457<h2> Change Log </h2> 458 459<ul> 460<li> 2001/07/19 - Added extension mechanism section. 461<li> 2001/04/17 - Initial version. 462</ul> 463 464</body> 465</html> 466