News for hackers. Stuff that matters.
Re:The Amiga Demoscene Mixtape Vol. 1 [video] by incepted on Saturday January 16, 2016 @12:51AM (#10914419)
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".

Re:The Amiga Demoscene Mixtape Vol. 1 [video] by Flow on Saturday January 16, 2016 @12:27PM (#10915920)
exec.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.

Re:The Amiga Demoscene Mixtape Vol. 1 [video] by contingencies on Saturday January 16, 2016 @01:21AM (#10914502)
"... except for the problem of too many layers of indirection."