Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: Snapshot 5....
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 4036 of 4053
Post > Topic >>

Re: Snapshot 5.37 of xina

by Albert van der Horst <albert@[EMAIL PROTECTED] > May 5, 2008 at 10:32 PM

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




 6 Posts in Topic:
Snapshot 5.37 of xina
Albert van der Horst <  2008-05-04 10:37:23 
Re: Snapshot 5.37 of xina
Robert Spykerman <robe  2008-05-04 11:53:06 
Re: Snapshot 5.37 of xina
Robert Spykerman <robe  2008-05-04 21:00:15 
Re: Snapshot 5.37 of xina
Robert Spykerman <robe  2008-05-05 03:06:34 
Re: Snapshot 5.37 of xina
Albert van der Horst <  2008-05-05 22:32:51 
Re: Snapshot 5.37 of xina
Bruce McFarling <agila  2008-05-05 06:20:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 2:07:41 CDT 2008.