4 ms·
Expanding on this a bit. Everything was relative on the Amiga. The only thing absolute was AbsExecBase at 0x4. You get a pointer to this library and then, from
by incepted 11y ago
Expanding on this a bit.
Everything was relative on the Amiga. The only thing absolute was AbsExecBase at 0x4. You get a pointer to this library and then, from there, you can locate more libraries by calling FindLibrary() (or something like that).
AbsExecBase is the ultimate proof of the old adage "Any problem in computer science can be solved with an additional layer of indirection".
- contingencies 11y ago"... except for the problem of too many layers of indirection."
- Flow 11y agoexec.library is a great design. The way programs know nothing except for AbsExecBase, and it points to a table of function pointers of which you have the offsets of. In a sense it was a Component Object Model(COM) like the one in Windows. You call exec->OpenLibrary("name of lib", version_of_lib) and it returns a pointer to a table of function pointers of which you know the offsets of. It could even handle multiple versions of a library in principle. In reality makers of libraries just made sure the function table was the same, and added new stuff at the end. You have to call CloseLibrary(libptr) to release the instance. Pretty similar to Objective-C's and COM's release(). OpenLibrary was allowed to return a different pointer for each call, but the early exec.library did not do this AFAIK. Great design really. And how signals and message system works is just beautiful as well. I really get why Matt Dillon(of FreeBSD and DragonflyBSD) wanted something similar in the BSD kernel. I still have the Amiga Kernel Reference Manual for exec in my shelf.