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

Re: [MiNT] SLB implementation



4 jan 2011 kl. 18.56 skrev Gerhard Stoll:

> int32_t cdecl slb_init( void )
> {
>    int8_t *path,*name;
> 
>    path = __text-128;

I guess that's __text - 256 (sizeof(BASEPAGE) returns 256).

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

It is in my library (I link with VLINK, the linker in the VBCC package, since this allows linking without the a.out header stuff).

> 
>> 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.

I just checked this with MagicMac OSX, but the behavior is actually identical to that of freemint. Maybe it's different in MagiC 6 on the Atari, I don't know.

I get the basepage of the library itself by checking the location of the header and subtracting sizeof(BASEPAGE). I can see that this is the correct address, because if I do Cconws(bp->p_env) I can see the first environment string. If I do Cconws(bp->p_cmdlin) I get nothing. Same thing with Cconws(&p->p_cmdlin[1]).

So the freemint kernel behavior is a least the same as MagicMac in this case, unless I've completely misunderstood the subject.

My workaround for this is to search the SLBPATH, SYSDIR, \GEMSYS\MAGIC\XTENSION,  and some other places... naturally it would be nice if the kernel could provide some useful info, but then again it seems MagiCMac doesn't do it either, so why bother :)

-- PeP