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 / 2650
2649  |  2651
Subject: 
Linux, Cygwin, DJGPP: what is it all about?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 17 Jun 2002 20:07:24 GMT
Viewed: 
2131 times
  
Ok, lets try to fiddle some things out. There seems to be a confusion about
the software needed for running legOS and why. And there seems to be some
confusion about what cygwin and DJGPP are.

legOS runs user programs written in C and compiled to the machine language
of the Brick. The brick has a Hitachi processor, so the C code has to be
compiled to Hitachi machine code.
legOS itself has to be compiled to the Hitachi machine code, too. So even if
we provide a downloadable legOS image in the distribution, everyone wanting
to write a user program must have a C compiler that can translate to
Hitachi machine code.

The only free compiler I know of is the H8 GNU C crosscompiler. And this
compiler is Unix software. You _must_ have a unix system to run it. If you
are running Linux, you are lucky because the GNU compiler runs on native
Linux.

You don't have Linux? Bad. But not too bad. There is cygwin. Cygwin can be
seen as a layer between DOS (yes, you Windows users: you are running DOS
under your windows system, even if you never saw it in action).
If for example the GNU C compiler opens a file, it calls the needed Linux
system routines. Cygwin sits between and translates this calls to DOS
system calls. The GNU compiler never knows that it does not run on Unix and
the DOS system does not know that it is called by a software not aware of
its existance.
But nothing comes free. DOS and Unix have some incompatibilities. The
seperator for subdirectories are different, Unix has no drive names but
only a file system tree and so on. The Windows user has to learn some nasty
things: How to fiddle with the command line. How to use cryptic command
line switches. How to run some weired programs like make. And many things
more.

Now to DJGPP. DJGPP is a port of the GNU C compiler to DOS. Where is the
difference between this and the cygwin / H8-GNU C compiler? DJGPP will
compile a C program to an exe file that could be run on DOS. Thats all. You
can't tell DJGPP to make Hitachi code. And you can't run the GNU H8
compiler on the DJGPP system because the whole DJGPP system is a DOS
system. There are bash, make and all things a GNU C compiler wants to see.
But all these programs have been changed in a way that they can run on DOS.
They don't know about unix. Cygwin and DJGPP may be similar in the actual
handling. GNU-C needs a fair amount of support programs both systems must
include. But cygwin runs Unix programs and DJGPP runs DOS programs. With
cygwin you can use a Linux progam to get Hitachi machine code. With DJGPP
this Linux program won't work at all.

- legOS runs user Hitachi machine language programs
- you need the H8 crosscompiler to compile these programs
- this crosscompiler only exists for the Unix system
- so you have to run cygwin to run the compiler to compile your program

If you don't want to do that, the only chance is not to use legOS.

What could we do for the new Windows user? Not much, I fear. We could try to
make a better documentation for Windows. We could even try to make an
installation cookbook. But you _must_ have some knowledge of "make" to
compile a user program. You _must_ learn the unix way to do your work. Even
if you use a good editor to resemble an IDE, you first must set up some
batch files and in the end you first have to know what has to be done on
the command line level and then resemble it for your editor.

Or, better, buy a cheap harddisk, install a Linux system on it and run your
legOS development system under Linux. You will see that it is _much_
faster, because the cygwin translation layer has vanished and you have all
needed unix tools at hand.

Regards,

Michael



Message has 1 Reply:
  Re: Linux, Cygwin, DJGPP: what is it all about?
 
Michael, I agree with you up to ... (...) if (...) wanting (...) here. (...) And I quote from the section "A stark moral choice" in the document The GNU Project ((URL) I looked for a way that a programmer could do something for the good. I asked (...) (22 years ago, 18-Jun-02, to lugnet.robotics.rcx.legos)

4 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