Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!ox.com!math.fu-berlin.de!uniol!sol.north.de!skuld!core!peic From: peic@core.north.de (Peter Eichler) Newsgroups: comp.sys.amiga.programmer Subject: Re: Getting Kickstart version Message-ID: <194f341d.ARN0105@core.north.de> Date: 16 Jun 91 11:18:05 GMT References: <3646@sirius.ucs.adelaide.edu.au> Reply-To: peic@core.north.de (Peter Eichler) Followup-To: comp.sys.amiga.programmer Organization: Private UUCP-Site Lines: 46 In article <3646@sirius.ucs.adelaide.edu.au>, Jonathan Potter writes: >How do I find out what version of Kickstart is running, in an OS friendly way? ^^^^^^^^^^^ >Under 1.3, location $fc000c contains it, but this doesn't work under 2.0. ^^^^^^^^^^^^^^^^ This is *definitely* NOT OS friendly, if you look at a particular address to get a version number!!! Remember: Only $00000004, which contains the pointer to SysBase is a fix address; all other locations may vary in future versions! So please: NEVER NEVER peek into RAM or ROM (the old Basic times are over now), otherwise your application won't run (or even worse: it will crash) on different OS versions. The easiest (and IMHO one of the "cleanest") methods is simply to look at the version of ExecBase: #include #include #include #include /* or "functions.h" for Aztec */ struct Library *ExecBase; UWORD Version, Revision; ExecBase = OpenLibrary("exec.library", 0); if(ExecBase) { Version = ExecBase->lib_Version; Revision = ExecBase->lib_Revision; printf("Version: %ud; Revision: %ud\n", Version, Revision); CloseLibrary(ExecBase); } else printf("Couldn't open ExecBase!!!\n"); >Please mail replies if you can help. Thanks. >Jon Hope, that will help you... Peter Q:What's the problem of being drunk? A:Ask a glass of water. (Hitchhiker) ------------------------------------------------------------------------------ SNAIL:Peter Eichler \ Hegelstrasse 3 \ 2800 Bremen 1 \ Germany Amiga 3000 EMAIL:peic@core.north.de OR peic@skuld.north.de: VOICE:(+)49 421 530642