[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] SLB implementation



Peter Persson <pep.fishmoose@gmail.com> worte:

> So the prototype for slb_init() is actually slb_init(BASEPAGE* base)?

No.

Header for a "shared library"
-------------------------------cut-------------------------------
XREF slb_init
XREF slb_exit
XREF slb_open
XREF slb_close
XREF slb_fn0
XDEF __text

TEXT

__text:
DC.L    $70004afc       ; Magic value
DC.L    name            ; Pointer to name of library
DC.L    1               ; Version number
DC.L    0               ; Flags, at present 0L
DC.L    slb_init        ; Is called after loading
DC.L    slb_exit        ; Is called before exit/removal
DC.L    slb_open        ; Is called at opening
DC.L    slb_close       ; Is called at closing
DC.L    0               ; Pointer to procedure name (optional)
DC.L    0,0,0,0,0,0,0,0 ; Unused, always NULL
DC.L    0               ; Number of functions (none!)

name:   DC.B    'TEST.SLB',0
-------------------------------cut-------------------------------

-------------------------------cut-------------------------------
extern char __text[];

int32_t cdecl slb_init( void )
{
    int8_t *path,*name;

    path = __text-128;
    .
    .
    .
}
-------------------------------cut-------------------------------

Of course work this only if the basepage is in front of the header.

> I get the basepage in slb_open(), but the command line doesn't contain
> anything useful (i.e. no path to the library).

Maybe I'm blind, but I can not see in FreeMiNT 
slb.c:load_and_init_slb that the path is copie to the command line. 
This should be add.

Gerhard