High level hardware access

Alcimar Barbosa Soares alcimar@ufu.br
Mon, 22 May 2000 18:08:28 -0300


Dear friends

Since you've been so kind helping us with static linking in UNIX (among
many other things), we decided to abuse a bit more of your expertise...

As we described before, we are working on the development of a control
system for upper limb prostheses.
We are developing most of the base programs in Clean... However, in
order to access hardware (such as parallel and serial ports) we had to
write some low level functions (inline assembler)... and (amazingly :)
)  it is working... But writing low level functions make our system very
dependent on the hardware. In other words, whenever we change our
hardware we have to re-write the software... not a very clever
approach...
Hence, we are trying to access those ports as files, just like UNIX
does...... our initial high level program - treating ports as files
(LINUX):

module tes
import stdEnv

start w
# (ok, file, w) = sfopen  "/dev/ttyS0"  FReadText  w    //accessing COM1
(mouse)
   (contents, file) = Rd file 0 []

Rd file i ac
# ok = sfend file
|  ok = Rd file i ac
|  i == 4 = (ac, file)
# (ok, c, file) = sfreadc file
= Rd file (i=1) [c:ac]

AND... guess what? IT doesn't work....

Whenever we try to run, the answer is:

    "sFOpen: seek to end of file failed"

As I said above, we have already done it in low level.... But we would
like to treat ports like files... a much more cute approach... Is that
possible? If so what should we do?

And finally ... ( you thought that was all??? ... NOP) ... Does anyone
have an idea of where we can find a documentation about the "clm command
line flags" FOR LINUX????

Thanks for your help,

Alcimar

----------------------------
Alcimar B. Soares
Ph.D Engenharia Biomédica
Dep. de Eng. Elétrica - UFU
alcimar@ufu.br
Fone/Fax: 0 xx 34 236 5099
____________________________