In article
<f7cdd896-37ca-43d3-8658-8edc90fa73a0@[EMAIL PROTECTED]
>,
Robert Spykerman <robert.spykerman@[EMAIL PROTECTED]
> wrote:
>On May 5, 2:00 pm, Robert Spykerman <robert.spyker...@[EMAIL PROTECTED]
>
>wrote:
><SNIP>
>
>> The test suite has uncovered at least one problem with CREATE-FILE.
>> (Wow, that test suite is pretty rigorous).
>>
>> I will be checking this out. No doubt this is related to syscalls. Oh
>> what fun :)
>
>Yep, syscalls. What fun.
>
>OSX does not have creat anymore. So I've added functionality via the
>open syscall. This appears to work now. Will test more.
>
>Also, the open syscall behaves slightly differently on OSX cmp linux.
>For example, if you try and open a non-existent file on linux you get
>a negative return (error). On osx, you get a 2 returned in EAX when
>you open a non-existent file or if you try and open a directory. I
>assume it means stderr. Any file that exists appears to get a fid >=
>4.
>
>Now of course, one could add some extra cheat logic to cope for the
>difference, like I did for the fork syscall. This however means less
>genericity in the syscall words, as each substantially different
>syscall will have to have a word of its own.
Where we aim for is a Forth OPEN-FILE that is consistent across
systems. So the OPEN-FILE in the generic system selects between
an OSX and a linux (and a Windows, and an MSDOS) implementation.
This is no different from the situation with REPOSITION-FILE.
>Alternatively have a jumptable in just one word ie XOS which will
>dispatch the syscall to its appropriate patch within just to mantain
>lina compatibility (ie so the forth.lab syscalls don't break).
That is a kind of compatibility I don't seek. The library should
make available words that are functionally the same across
systems. If the implementation is different then the library
caters for that.
For example:
The windows SAVE-SYSTEM has an index line
( SAVE-SYSTEM ) CF: ?WI
The regular linux SAVE-SYSTEM has an index line
( SAVE-SYSTEM ) CF: ?LI ?32
The 64 bit linux SAVE-SYSTEM has an index line
( SAVE-SYSTEM ) CF: ?LI ?64
The OSX SAVE-SYSTEM will get an index line
( SAVE-SYSTEM ) CF: ?OX
If there is an underlying open system call, instead of creat,
fine. Certainly the windows SAVE-SYSTEM uses totally different
underlying calls.
If a facility merely requires 32 bits it looks like
( CRC ) CF: ?32
If there are facilities portable across Unices I will introduce
?X for that.
The -c screen (3) takes care of compilation. It is the same across
all ciforth's, and uses SAVE-SYSTEM.
<SNIP>
>
>I'll stick at this for a while, but I'll aim to link to c down the
>line. From what I know the big *nix forths, gforth, iForth (I think -
>have't got a copy yet) and VFX link to c libs.
There is a place for a different approach.
>
>Robert Spykerman
--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@[EMAIL PROTECTED]
&=n http://home.hccnet.nl/a.w.m.van.der.horst


|