software:amigalibrarybase
Differences
This shows you the differences between two versions of the page.
— | software:amigalibrarybase [2020/10/14 09:44] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Amiga' | ||
+ | |||
+ | AmigaOS was an operating system that did not support memory protection. All tasks ran in a single (physical) address space. | ||
+ | |||
+ | Of course this is not desirable from a modern OS standpoint. But //how// it was done can serve as an architectural example to hobbyist OS developers, which is why I wrote a quick abstract on it. | ||
+ | |||
+ | ===== Hunk Format ===== | ||
+ | |||
+ | AmigaOS binaries came in a special (non-ELF, non-PE) format that made it possible to split each binary into multiple " | ||
+ | |||
+ | ===== Scatterloader ===== | ||
+ | |||
+ | The scatterloader took the binaries as they came off the disk, and placed each individual hunk into physical memory wherever it fit. Doing this, it also did build a // | ||
+ | |||
+ | ===== Library Base ===== | ||
+ | |||
+ | |||
+ | Each //library// loaded this way had one hunk representing a "jump table" | ||
+ | |||
+ | The compiler knew (from information in the library headers) how each function in the library could be found: Each function had a corresponding, | ||
+ | |||
+ | All that was needed was that pointer to the jump table - this was called the " | ||
+ | |||
+ | ===== OpenLibrary() ===== | ||
+ | |||
+ | The application had to get the Library Base Pointer, and the OS had to load the desired library into memory. Both was done via the '' | ||
+ | |||
+ | The return value of the '' | ||
+ | |||
+ | ===== Exec Base ===== | ||
+ | |||
+ | But to access the '' | ||
+ | |||
+ | Since Exec.library itself could reside at different memory addresses on each start of the OS (think removing or adding RAM between reboots), there had to be some way to access Exec Base. So they chose a fixed address for this Base Pointer, the only fixed address in the whole AmigaOS. | ||
+ | |||
+ | Unfortunately, | ||