View Single Post
Old 10 March 2011, 03:12   #6
Vairn
The Grim-Button
 
Vairn's Avatar
 
Join Date: Jan 2008
Location: Melbourne Australia
Age: 43
Posts: 414
heh, sorry.

See the first line, where it loads 4, into a6 move.l 4.w,a6

4 is the library base offset for the Exec library
so to call functions from the exec library, you need to know there LVO (Library Vector offset) basically where they are in the library vector table.

This link would explain it better then I, ever could.
http://gega.homelinux.net/AmigaDevDo...17.html#17-5-1

Quote:
Libraries and devices
The main modularisation technique in AmigaOS is based on dynamically-loaded shared libraries, either stored as a file on disk with a ".library" filename extension, or stored in the Kickstart ROM. All library functions are accessed via an indirect jump table, which is a negative offset to the library base pointer. That way, every library function can be patched or hooked at run-time, even if the library is stored in ROM.
The most important library in AmigaOS is exec.library (Exec), which can be considered a microkernel, as well as a library. It acts as a scheduler for tasks running on the system, providing pre-emptive multitasking with prioritised round-robin scheduling. Exec also provides access to other libraries and high-level inter-process communication via message passing. (Other microkernels have had performance problems because of the need to copy messages between address spaces. Since the Amiga has only one address space, Exec message passing is quite efficient.) The only fixed memory address in the Amiga software (address 4) is a pointer to exec.library, which can then be used to access other libraries. Exec was designed and implemented by Carl Sassenrath.
Unlike traditional operating systems, the exec kernel does not run "privileged". Contemporary operating systems for the 68000 such as Atari TOS and SunOS used trap instructions for invoking kernel functions. This made the kernel functions run in the 68000's supervisor mode, while user software ran in the unprivileged user mode. Mac OS on the 68000 even used supervisor mode for everything, kernel and application code alike. By contrast, exec function calls are made with the library jump table, and the kernel code normally executes in user mode. Whenever supervisor mode is needed, either by the kernel or user programs, the library functions Supervisor() or SuperState() are used.
Device drivers are also libraries, but they implement a standardised interface. Applications do not usually call devices directly as libraries, but use the exec.library I/O functions to indirectly access them. Like libraries, devices are either files on disk (with the ".device" extension), or stored in the Kickstart ROM.

Last edited by Vairn; 10 March 2011 at 03:18.
Vairn is offline  
 
Page generated in 0.08204 seconds with 11 queries