Jump to content
43oh

What's the big idea with Linux?


Recommended Posts

I'm guessing this is a question I can't answer because I haven't met a need for linux yet, but why is linux so great? Anyone who's anyone in the embedded world uses it, and I'd love to learn, but I've never yet found a limitation with a Windows set up that would require the use of another OS.

 

So, why should I be learning linux?

 

I'm not saying there's no need for it, just I'd like to know why all the gods of C* use it, and therefore I'll have reason to learn it.

 

*tbh, anyone who can write code is a god of C to me, so if you fit the description and use linux - tell me why :)

Link to post
Share on other sites
I'm guessing this is a question I can't answer because I haven't met a need for linux yet, but why is linux so great? Anyone who's anyone in the embedded world uses it, and I'd love to learn, but I've never yet found a limitation with a Windows set up that would require the use of another OS.

 

So, why should I be learning linux?

Because it is there on the majority of (at least a certain class of) embedded devices and systems. If you scale up from micros to bigger SOCs (which you probably will, eventually), the encounter will be unavoidable. Best get ahead of it.

 

II'm not saying there's no need for it, just I'd like to know why all the gods of C* use it, and therefore I'll have reason to learn it.

For me it's about as natural as (I'm guessing) Windows is to you. After the obligatory 8bit home computers and DOS I started using Linux. From my POV the question really is, why would anyone not use Linux? :D. Kidding, though. It's probably (likely) still quite a horrible (desktop) experience if you expect things to Just Work (disclaimer: I'm saying this with a little over 15 years of systems operations under my belt; I do know my way around), but at the same time this statement is quite biased: I have reasonably concrete ideas of how my (desktop) systems should look, smell and behave. This apparently contradicts about 110% of the current mainstream trends, so I tend to be grumpy about it (and at the same time I am shamelessly enjoying the exact same look and feel of my desktop for the last ~10 years).

 

It completely doesn't matter on what system you learn. ISO C is ISO C on Windows, on Linux, and everywhere else. POSIX is the same everywhere. Platform-specific things exist everywhere, so there's no escape anyway. Trying to write truly portable code will greatly extend your swearing vocabulary.

 

Start with Cygwin. It will give you most everything you would have on Linux for the getting familiar/doing programming aspect, without having to leave the comfort of the environment you got used to.

 

Let it be on record that by replying to this, I am in no way, shape or form to be considered an "expert in C".

Link to post
Share on other sites
...why is linux so great? Anyone who's anyone in the embedded world uses it...

I think the answer is easy. Linux is Unix-like and everybody knows that Unix is the mother of all systems :) (Unix predates Windows and so does C.) Linux is stable and affordable compared to other systems.

That said, do yourself a favor and get a real Unix system, like Mac OS X :D

Link to post
Share on other sites

Linux is a free version of Unix..... Gods of C love it, because C was created first under the Unix operating system. Windows has always moved more and more to be Unix like but has always lack in being as programer friendly as Linux is.

 

Yes you can do 99% of everything under Windows as Unix, but some things Unix just does better or Unix makes it easier to do.

 

You may never need to use Linix/Unix for what you want done, not sure I would be running Linux on the MSP430. But I do code in C with my MSP430.

 

Linux is more a community operating system, unlike Windows which is controlled by Microsoft.

 

Under Linux you can tweak it, even create your our version of it. For those like me who like using a Unix type OS, gives us the best of both worlds. Windowing system and Unix together.

 

Because linux is free, it gives people more freedom to improve or try new ideas. That is why you see so many flavors of Unix, Red Hat(Fedora), Ubuntu (Mint which I run as branch of Ubuntu).

 

Oh and did I say it's free, with Ton's of Great Free software....

 

 

If you want to be a computer programming God, then at some point Linux/Unix is a must to learn. LOL!

Link to post
Share on other sites

Remember that there's a lot of emotion bound up in this topic.

 

If someone insists that you do something a specific way then you might start resenting that person. If a company insists that you code on a specific platform then you might start resenting them.

 

It's all about freedom of choice and whether you can retain yours while doing something you love.

 

Some people like coding in a walled garden but no windows, some like coding in the great outdoors where things seem wild and crazy and some just like to code behind the safety of big windows.

 

Don't let anyone decide for you. Pick whatever OS makes you feel free then run with it.

Link to post
Share on other sites
Remember that there's a lot of emotion bound up in this topic.

 

Indeed. These sort of topics usually end up nasty (elsewhere :)). This in turn makes it sort of hard to gather advice or others' POV even if you sincerely honest to god want only this.

 

There is no One True Way, and we all differ in what we consider a comfortable and/or productive environment.

 

That's about as far as anyone can get you without you getting your feet wet :D.

Link to post
Share on other sites

Perhaps my question wasn't a good one (probably because I don't understand the question I'm asking). I was thinking more from an embedded perspective than a desktop one. It just seems linux is the natural next thing to do, though maybe I'm trying to run before I can walk here. It's just that I see linux everywhere interesting, and I don't really grasp any of it.

 

I'm sure I'll get into it more when I have to - if I want to do the cool stuff I see others doing that is. :D

Link to post
Share on other sites

I think the attraction of Linux is the fact that you can do anything that you want with it.

 

I think the problem of Linux is that you can do anything that you want with it.

 

Some people want/require/need more structure than Linux naturally provides. Others thrive on that freedom.

 

Let's face it. Managing a Linux box can be a lot of work. There are a lot of things to be aware of and unfortunately you have to learn many of them in the school of hard knocks.

 

I've been using Linux since 1995 so I've got a lot of figurative bruises from it. I've also got a lot of successes with it.

 

In the end, I use whatever OS will allow me to be successful at my job with the least amount of frustration.

 

Presently, I have a copy of CCS Microcontroller so I gladly use Windows7 to write my code. If I didn't have CCS then I would be using mspgcc on whatever platform made sense.

 

Whatever you choose, select the environment that allows you to forget what OS you're using and that allows you to focus on being successful at whatever you attempt to create.

Link to post
Share on other sites
I was thinking more from an embedded perspective than a desktop one.

That is a (tiny) bit simpler matter. For starters, just get a good command of the shell, the toolchain and the API (which is mostly POSIX). For this, Cygwin is perfectly fine. Peruse then manual pages (man man).

 

Also peruse online manual pages, and manual pages for OpenBSD, FreeBSD and NetBSD. The reason for this is that Linux man pages are generally somewhere between "incomplete crap", "inaccurate crap" and "lying crap"; the BSDs tend to do much better. Since all of them are Unix-lookalikes and all of them implement POSIX (with varying degree of success, but mostly there), there is a great deal of similarity, and you can re-use one another's API documentation to a considerable degree.

 

You may also want to have a peek at SUSv4 (reading these manuals takes a bit of getting used to). You however need to observe the cases where facilities and functions documented in the above places differ a tiny bit from system to system (the deviations from the standard tend to be documented well, at least) -- told ya portability will take you to new heights of swearing.

 

This is pretty overwhelming, so you probably want some book or online course material, but I can't be of help with these. The late W. Richard Stevens's Advanced Programming in the UNIX Environment used to be a gold standard, though by now probably newer ones just as good exist (it's not beginners material though).

 

Write small and stupid programs that do small and stupid things. Write a bit of a network client, a bit of a network server. Take special care of getting familiar with inter-process communication techniques (IPC), concurrency techniques and issues, event-driven programming techniques (poll, select, epoll, ...).

 

So far this is about 2 years' worth of things to do :), but don't get scared, there are plenty small successes all along the way (yeah, frustration too).

 

For the fun part, get yourself a Linksys WRT54GL (I suppose they are cheap by now) router (or anything else OpenWrt supports). The WRT54GL is a well-known, understood and documented (if you gather the stuff) piece of hardware, for which OpenWrt gives you a nice development environment (don't know if this one will work on Cygwin, though, but I see no particular reason why it shouldn't). Hack the hardware a bit (I think finding at least one I2C or SPI bus is no problem, but there are definitely a couple of GPIOs on the board), and write software for it using the OpenWrt toolchain. There probably isn't a simpler and cheaper way to taste the thing. Substitute the WRT54GL for something else, as appropriate -- I have stopped closely following these things a bit back. The OpenWrt TOH (and the Old TOH too, probably) is a good start.

 

Good luck -- you are looking at one hell of a journey :).

Link to post
Share on other sites

There is an old saying: "Those who don't understand UNIX are condemned to reinvent it, poorly."

 

If you want to know "why unix?" there is one book you *must* read: _The Design of the UNIX Operating System_ by Maurice J. Bach

 

http://www.amazon.com/dp/0132017997

 

The wonderful thing about Unix is that a fully functional (if not necessarily useable) system can be implemented in roughly 10,000 lines of code. The best example here is Minix, described in _Operating Systems: Design and Implementation_ by Andrew S. Tanenbaum

 

http://www.amazon.com/dp/0131429388

 

Linux evolved as a result of Linus Torvalds' desire to re-work the original Minix (version 1) from an educational tool into a usable system.

 

The current version of Minix (Minix 3) splits the difference between an educational tool and something usable, resulting in n increase in kernel size from 10,000 lines of code to roughly 30,000 lines of code.

Link to post
Share on other sites

Many thanks all - I know it's a difficult (and emotive :shock: ) subject, but I appreciate y'all trying to help me, even if it's like teaching a goldfish to shuffle a deck of cards :D

 

I'm going to go the linksys router route, I think setting a target project will help clarify my aims, and make the learning linux a secondary aim (which is the only way I learn anything!).

 

So, the target is to have a linksys router controlling a LED matrix, displaying the most recent tweets from my favourite people. Bearing in mind I've been into microcontrollers for about 2 months, I think it's a suitably challenging project. Of course I'll work a 430 chip in there somewhere too :)

 

Thanks again everyone,

 

Guy

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...