Thread: Cygwin and coLinux

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446

    Cygwin and coLinux

    What exactly is cygwin? I read it being referenced as a compiler and as an emulator... It becomes confusing.

    Specifically, compiling my source code under cygwin allows me to test my source code for compatibility? Or I'm better off with coLinux?

    And as for coLinux? Isn't this a much better choice since apparently it runs Linux natively on windows?

    What is the use most people find in Cygwin?
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    What exactly is cygwin? I read it being referenced as a compiler and as an emulator... It becomes confusing.
    cygwin is an implementation of bash that runs under Windows. It's an emulator, because it emulates bash under linux really well. It includes a compiler (gcc) and other tools (gdb, grep, ls) that are found on most Linux systems. You can run processes in the background with &.

    I've never heard of coLinux.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    Or just read the respective web-sites.
    # Cygwin is a Linux-like environment for Windows. It consists of two parts: A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
    # A collection of tools, which provide Linux look and feel.
    > Isn't this a much better choice since apparently it runs Linux natively on windows?
    That depends on how easy it is for coLinux to mount windows partitions.
    You can freely access any part of the file system from within cygwin.

    Since it seems pretty easy to have both at the same time, why not try both?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I've read the website description and even installed cygwin before asking. However, I'm having trouble understanding the use of cygwin. It emulates Linux, however it seems to not provide portability between any major distro. Applications need to be compiled under cygwin in order to work from either any Linux or windows source files.

    So, I wonder why it is so popular. What daily use people have for it?

    coLinux is still on a somewhat early stage of development. However it seems to already provide stable images of Debian and Gentoo. It runs linux natively in a vm-like fashion. However, the point is, from what I gather, to provide a platform to run any linux distro natively through images.
    Last edited by Mario F.; 07-02-2006 at 11:59 AM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    People who don't want to go have culture shock by going immediately from the friendly windows GUI to linux, or the task of partitioning your hard drive and making your system able to dual boot, find a use for stuff like cygwin. It's like linux training wheels.

    GCC also doesn't run under windows at all, so you need the shell. MingW is supposed to be a windows port, and it is, but if you don't have an IDE you need to get the shell then, too.

  6. #6
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by Mario F.
    So, I wonder why it is so popular. What daily use people have for it?
    I work on the operations side in a brokerage firm in New York. That is to say... not the programming side. Besides me, there is a 40 year old who had been a programmer for so 20 years and is doing this temporarily. He turned me onto Cygwin.

    Where does it have it's use? On the operations side, where most people have very little computer experience, all of the computers have Windows installed. That's it. Since it's on the companies system, we can't partition the drive and install Linux for our use, so we need a quick and easy way to get the advantages of Unix tools without having Unix. That's why we use Cygwin.
    Last edited by SlyMaelstrom; 07-03-2006 at 11:47 AM. Reason: Yes, this did say petition the drive
    Sent from my iPadŽ

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    > What daily use people have for it?
    Mostly, I use bash because it just wipes the floor with cmd.exe
    And I get lots of other familiar unix tools (grep, sed, perl etc etc) which make life so much more comfortable on the command line.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Yup. I have it fully running now. Having some fun with it actually. Thanks for the heads-up, you all.

    Also decided to dual-boot my SuSE 8.0 Professional copy. Just looking for software to read my Linux partition from windows. Linux already provides read-write access to NTFS.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Cygwin is not an emulator. It does not emulate anything and thus cannot run programs written for Linux or BSD or whatever.

    Cygwin is at its core a library. It's a library providing a POSIX API, implemented on top of the Win32 API. API here meaning not only functions, but also a lot of behaviour and file system layout, especially device files and their behaviour. What Cygwin doesn't provide is Linux system calls - it's not an emulator.

    Thus, you can take programs written for a POSIX environment (such as bash, gcc, gawk and many others) and compile them using the Cygwin library instead of whatever implements the whole POSIX API on other platforms (largely glibc under Linux). The resulting program is a real Win32 executable that depends on cygwin1.dll to run. Among other things, this means you can launch it from cmd.exe, from explorer, from whatever you want. The programs are perfectly well-behaved Win32 citizens - except that they experience a slightly different view of the filesystem.

    The complete Cygwin package consists of an installer, the core Cygwin library, and a host of packages pre-compiled for Cygwin.


    MinGW is something different. MinGW actually changes the source code of the programs it provides to make them compile with the Win32 API instead of the POSIX API. As such, the MinGW programs are far fewer (just what is necessary to get a typical *nix programming environment to run: gcc, ld, make, bash (because make uses it), a few programs commonly used in scripting such as sed and awk, ...), however they are slightly faster, as they don't go through the additional indirection of the Cygwin library.


    So to directly address some misinformation on this thread:
    1) cygwin is not an implementation of bash. Bash compiles under the Cygwin environment and then runs there; Cygwin probably had to make only minimal code changes to make it so.
    2) cygwin is not an emulator. It's a library.
    3) You don't need any POSIX shell (sh, ash, bash, zsh, ksh, ...) to run MinGW on Windows, even if you don't have a GUI (typically Dev-C++ or Code::Blocks). cmd.exe, i.e. the native Windows shell, will do. Barely

    In conclusion, the only programs really adapted for Cygwin were those in the toolchain: autoconf (needs a Win32 configuration), gcc (not that much, though) and ld (needs to be able to output PE files.)
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed