![]() | |||
AROS Application Development ManualWarning This document is not finished! It is highly likely that many parts are out-of-date, contain incorrect information or are simply missing altogether. If you want to help rectify this, please contact us. Appendix: Library OverviewFIXME: This should be autogenerated from autodocs? Appendix: GlossaryCurrent Directory
The directory, which all file-system actions are relative to, as long as no absolute path`s are used. Every `process structure stores its current directory in the field pr_CurrentDir. Appendix: Differences compared to AmigaOSPointer/Integer conversionsIf you need a variable which can store a pointers as an integer, don't use ULONG but IPTR. AROS guarantees that LONG is 32bit on all systems, while IPTR is always large enough to contain a pointer. Most notable things which are affected by this: TagItem`s (the `ti_Data field is now an IPTR instead of ULONG), BOOPSI classes (eg. the return value of DoMethod()), ReadArgs(), VPrintf(), VFPrintf() and more. 64 bit variablesThe type of 64 bit variables is QUAD (unsigned: UQUAD). This is for example returned by the function SMult64() of utility.library. To access the high- and loworder 32bit values of the 64bit variable, use LOW32OF64() and HIGH32OF64() which are defined in AROS/include/aros/64bit.h. Cloning RastPortsAROS uses an external driver to access the graphics hardware. Since the nature of this driver is unknown to AROS, it is no longer valid to clone a RastPort by simply copying it. To be compatible, there are two new functions (in AROS) or macros (on Amiga): CreateRastPort(), CloneRastPort() and FreeRastPort(). You must call CloneRastPort() to create a copy or CreateRastPort() for an empty RastPort and FreeRastPort() after you've done your work with it. This approach produces equivalent code on the Amiga but on AROS it can slow things down a bit. If you must preserve the original state of the RastPort, it's more safe to create a clone, work on it and then dispose of it again. It can also be faster if you would have to make a lot of changes to the RastPort to create two clones and set them to the two states you need. But your code should not depend on certain gains or losses of speed due to cloned RastPorts since the behaviour of the underlying graphics system is undefined. Tag valuesThe original AmigaOS doesn't use the tags below USER_TAG (have a look a at utility/tagitem.h if you don't belive me) which means, you shouldn't use tags at or near USER_TAG because then they might interfere with the OS's own tags. To solve this, AROS does use the tags below USER_TAG and the various implementators need not fear that their tags may overlap with the ones from the system. The file AROS/include/utility/tagitem.h now contains the basic offsets for the various parts of the OS. In the future, it might be possible for users to allocate ranges of tags for specific uses. DoMethod() or the stack is all wrongThere are CPUs around which don't care that the rest of the world have stacks which grow from large to small adresses. HPPA is an example for this. While it might look neat to the engineers who did it, it breaks our code. Another thing which breaks the code are small data types (eg. WORD, UBYTE, etc), because most systems put only integers or longs and pointers on the stack. So if some Msg structure expects WORD (see intuition/gadgetclass.h), this fails on every system but the Amiga. Then there are rumours about CPUs which use 32bit numbers and 64bit pointers or the other way round. On these CPUs, SetAttrs() and all other function which pass TagLists over the stack will fail. To overcome this, we introduce this rule: If you want to pass a structure with `DoMethod()` and `DoMethodA()` or similar functions, you must prepend `STACK` to each type, like this: `WORD` becomes `STACKWORD`, `ULONG` becomes `STACKULONG`, etc. To solve special problems on certain CPUs, we try to get a compiler which gets it right or, if that is impossible, we write a small preprocessor which replaces the dubious code by calls to the array versions. Include filesDue to some weird reason the include files for workbench.library are called clib/wb_protos.h, defines/wb.h, inline/wb.h, wb_pragmas.h and proto/wb.h in AmigaOS. AROS decided to replace "wb" by the library's name "workbench". We provide wrapper includes for consitency to (old) AmigaOS programs, but recommend using the new names clib/workbench_protos.h, defines/workbench.h, inline/workbench.h, workbench_pragmas.h and proto/workbench.h instead. Registers and CPUsAROS has put some effort in defining a way to write code which is hardware independant. To achieve this, a couple of macros have been definied.
|
Copyright © 1995-2008, The AROS Development Team. All rights reserved. Amiga® is a trademark of Amiga Inc. All other trademarks belong to their respective owners. |