gforth
[Top][All Lists]
Advanced

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

[gforth] problem with gforth7 and serial access


From: kibler
Subject: [gforth] problem with gforth7 and serial access
Date: Wed, 21 Mar 2012 21:45:14 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120104 Icedove/8.0

Greetings:

This will take a bit to cover, so please read all before responding.
I work with several others and we have been using gforth version 0.6.2,
for many years. We use it to create and develop the myforth 8051 macro
forth compiler and programs for the SiLabs devices. It has worked just
fine for many years and still works even on Debian testing systems - the
latest versions of stable programs.

Over the years we have tried gforth version 7.0 and the serial code that
worked well on 6 fails. Version 7.0 is the current release that most linux
distributions ship. I have recently cloned the gforth-mirror repo and the
gforth version 0.7.9 fails with the serial code.

In searching the web, I see many similar reports over the years about the
serial being broken on version 7, yet I have not found one report that
confirms it works, or any solutions to try to make it work. Everything on
the web suggests it is broken and has been broken in version 7 from the
beginning.

Since I have plenty of experience finding difficult bugs, I have spent the
last few weeks working to resolve the problem. I have traced it down to the
key?-file function, which returns "0" no matter what you do. One of my last
tries, was a combination of breaking and using print statements in the io.c
code where key?_avail is defined. key?-file calls the key?_avail to do a
select call, to check for chars_avail. What I saw confirmed that it returns "0"
always, and in fact appears to not be used at all. I could break the function
and yet keyboard I/O worked, and other items that should have been broken as
well worked. I later found a select.c module that suggests the "select" part
of io.c, calls that module and not the system/stdlib select function.

I have looked at all the documentation for each version, and what little is
provided on the file-io process, says we are doing serial I/O properly, but
the results I see just doesn't agree. I know there is the virtual compiler and
have generated the engine.s which shows calling key?_avail, but key?_avail is
not part of the source for engine.s - what am I missing here? I do "see" on
key?-file, but it doesn't display the key?_avail code that calls the select
command that is suppose to return the chars_avail needed by key?-file
to tell you how many chars are available if any. I clearly am missing some
part of the "how the inner parts work" concepts.

So I have two questions - the first being about the key?-file and how does
one debug something at this level of the coding - half engine, part C, part
forth? It seems I need more facts about how all the little parts of the
engine go together. What are the relations of prim.i to io.c to engine.s?
Where and what documentation should I be following to get all the real facts
about how it goes together?

My second question has to do about gforth itself. It has worked well for
us over the years, but I am a bit concerned that what Debian and other
distributions are shipping is vintage 2007 and not the current 7.9. After
all, Debian testing is suppose to be the most current stuff, yet they are
still shipping 7.0. I can see lots of interest in getting gforth to run on
other architectures - I think 23 so far - and feel that is great. However
I am looking at several options, such as sockets to replace serial, and see
that 7.9 has a much fuller set of support files than 7.0. I was not happy
to see in one of the socket files, a comment saying that this code is un-
tested but should work. Makes we wonder if the code is being tested at all.

My long term concern is providing a version of myforth that needs gforth
to run, yet not having any current or stock gforth in linux distributions
that will work. Right now only the gforth-mirror seems to compile, but I
would not like telling users they need to clone the repo and compile gforth
in order to use myforth.

Can anyone give me some guidance on resolving these concerns?
Bill.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]