To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1301
1300  |  1302
Subject: 
solaris + legOS
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 27 Jul 2000 18:40:24 GMT
Viewed: 
1522 times
  
Hello,

I'm trying to get legOS to work on solaris. I'm having troubles.

I've got the cross compiler installed. I'm having the same problem
everyone else who's tried it on Solaris: legOS/util/dll-src/loader.c
gives problems me an error with the FASYNC on line 293.k (Well, it was
also complainning about getopt_long which isn't POSIX compilant,
but i fixed that in my source).

I've been searching for a long while now different documenation about
io in Sun, and there just doesn't seem to be a similar flag/command
as doing fcntl(rcxFD(), F_SETFL, FASYNC).  It *seems* like using
SREAMS programming is automatically supposed to be asynchronous.

Both fnctl and ioctl can do fcntl(rcxFD(), F_SETFL, O_NONBLOCK);.
But that doesn't seem to help.

Furthermore, when i was trying to get it to work (with
the FASYNC line commented out), i modified the
fcntl(rcxFD(),F_SETOWN,getpid()) so that it checked if there was
errors in it.
      if (fcntl(rcxFD(),F_SETOWN,getpid()) < 0) {
perror("fcntl: F_SETOWN getpid()");
exit(1);
      }
This gave me the following error:
      fcntl: F_SETOWN getpid(): Invalid argument

I'm not sure how to check which argument may be wrong.

Other problems I had:
firmdl3 would not download the legOS.srec. After emailling
Kekoa Proudfoot, I got it to work by modifing the rcx_comm.c file,
static int nbread(...) function. I put 'timeout *=2;' right
before it enters the while loop (line 88). That fixed it.
(The old 1.x version of firmdl also worked (without changes))

Because I can get the 'dll' program to compile (without the FASYNC
stuff), and because it seems like solaris is supposed to do ASYNC
automatically, i was wondering if perhaps the 'dll' program, or the
RCX was timming out early. After all, when running the dll stuff
without the FASYNC, I _DO_ see the IR LCD icon going on and off a few
times. This is why i think it may be timing out.

Any ideas on the ASYNC stuff?
Any ideas on how to change the timeouts?
Where is documenation regarding LNP?
How can I check to make sure both the RCX and 'dll' program are using
the proper addresses? How can i enable debugging output for the RCX
LNP stuff... what functions are called in the RCX to handle the
LNP stuff?

I'm starting to get very frustrated with the 'dll' program.

(the following stuff about Makefiles, i'd already emailled
Luis Villa about, although I hadn't noticed any changes in CVS)

The Makefiles are evil. They dont work with Solaris, because solaris
doesn't have /bin/sh being an alias for bash. This causes all the
'exit -1' to give premature errors. Reading the GNU Make manual, it
should be 'exit 2'. Return code 2 is the value returned by make when
it finds errors. (sh says '-1: bad number').

In the legOS/Makefile, legOS/util/Makefile and legOS/lib/Makefile,
there are recursive calls to make doing:
    make -C dir_name
This is the incorrect way to recursively call make. It should be
    $(MAKE) $(MFLAGS) -C dir_name
$(MAKE) is the save executable make file that it was called with,
$(MFLAGS) passes on any command line parameters.
(Hmm.. IIRC, there was one weird instance in legOS/util/dll-src/Makefile
which calls make depend in the same directory. That seems weird to
me. That should also be fixed)

In the legOS/Makefile, there are some 'export NODEPS=yes ; ... '
commands. /bin/sh doesn't allow you to define a variable and export
it in the same command. These should be modified to
'NODEPS=yes ; export NODEPS ; ...'
To be honest, I dont' actually recall these variables being used
anywhere anymore.. anyone know?
The other thing you could do is when calling make again, do:
    $(MAKE) $(MFLAGS) NODEPS=yes -C sub_dir

Last thing, in the Makefile.common has a nice "script" to
figure out the LEGOS_ROOT directory by this command:
  export LEGOS_ROOT=$(shell pwd | sed -e "s/\(.*\)\(LegOS\).*/\1\2/i")/

The export here works because it is not a command passed to the shell,
but rather a command which `make` inteprets.

The problem is that `sed`  in solaris doesn't have the nice 'i' flag
to the substitue flag. It causes sed to think the command is garbled.
A solution is to define a variable called $(SED_SFLAG), and set it
to equal "i" when it is a system which needs the case-insensitive
mode (ie. DOS). Lastly, b/c we do case-sensitive, we need to change
the capital letter 'L' to 'l'. So the command would look like:

SED_SFLAG=
#if case-insensitve needed
SED_SFLAG=i
#endif
export LEGOS_ROOT=$(shell pwd | sed -e "s/\(.*\)\(legOS\).*/\1\2/$(SED_SFLAG)")/

Thanks for any help!

Ryan

--
Ryan VanderBijl                        http://www.calvin.edu/~rvbijl39

(Frodo:) "I don't want to answer a string of questions while I am
eating. I want to think!" "Good heavens!" said Pippin. "At breakfast?"



Message has 1 Reply:
  Re: solaris + legOS
 
(...) You do have FASYNC on Solaris, it's in <sys/file.h>. But this won't help much, as it is only there for socket IO. The same problem is with F_SETOWN, it is only defined for sockets, therefore you get the EINVAL. (...) No, we won't get SIGIO (...) (24 years ago, 27-Jul-00, to lugnet.robotics.rcx.legos)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR