Resources for learning C, Unix, Linux and embedded systems [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I want to learn C , UNIX and LINUX, and more about embedded systems. Very much interested in them. Are there any online courses or websites which can guide me. And please suggest books to read in learning them.
Thanks for your time.
Ya please lets your answers and comments come in , they are invaluable to me..!!

The C Programming Language by K & R
Advanced UNIX Programming
UNIX Network Programming
Structure and Interpretation of Computer Programs Videos (done in LISP, but invaluable programming course)
Understanding the Linux Kernel (a little out of date but good info, don't take as gospel)
Linux Device Drivers 3rd Edition (pretty out of date but good info, same as above)
Writing Linux Device Drivers (pretty up to date but not as detailed as before)
The UNIX Time-Sharing System, this is essentially the original UNIX paper, it may help to understand where all this came from, don't have to understand every detail of this old paper but I think it gives some good background

I'd highly recommend "UNIX for dummies" as a starting point on Unix/Linux.

There are many amazing resources online. My favorite is from MIT.
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/
Free courses. They can be pretty in depth, and cover many more subjects than just computer science and mathematics.

Few resources that helped me for C:
The C Programming Language Book by K & R
highercomputingforeveryone.com helped me out initially
Stanford's Programming Paradigm Videos
Good Luck!

A quick way to learn a bit about all of the above is to buy an MSP430-based development board from Texas Instruments, install mspgcc (the open-source compiler for the MSP430) on a Linux machine, and write a basic C program that blinks an LED on the development board.

Other than the resources suggested above, you need to understand why you need these languages. Programming language or an OS alone will only take you as far -- for e.g. if you are programming on embedded platforms usually memory is not in abundance. So you need to code for memory optimization. If you are working on real time, you would need to understand interrupt handling well etc. I'd suggest definitely spend time on the architecture (ARM Cortex-M1 etc) for which you are planning to code. Always helps.
For more quirks look into http://en.wikibooks.org/wiki/Embedded_Systems/C_Programming
Orielly's Programming Embedded Systems in C and C++ is a good place to start once you have the basics of C/C++ clear.

Related

What topics (basics or foundations or fundamentals or what) to learn/study before studying K&R's "The C Programming Language"? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I don't know programming, I don't know any programming language (only some HTML if it can be called programming language). I only studied Petzold's "CODE" so far just to learn basics.
I decided to learn basics and (at least) some C first (even if some suggest JS, Python or other languages first).
To learn C, people often suggest studying K&R's book "The C Programming Language" after learning basics of programming. (Even in the book they say that the book is not for beginners)
People often sat "it's important to learn basics/fundamental/foundations first" and stress about basics and foundations without telling what they are.
Basics basics basics. . . foundations foundations foundations. . . what topics, concepts, etc. do the basics (or foundations or fundamemtals or what they call it) involve?
NOTE: I don't ask for book or course recommendation, but I ask for what topics/concepts to learn to get a foundation.
Hell, raw theory is boring and that's not what programming is!
I'm not expecting anyone who's learning to program to study raw and crude theory first. The best way you can learn is by trail-and-return-non-zero, trail-and-SIGSEGV, and some day, trail-and-return-zero.
Anyway, if you already have some knowledge of algebra, electronics, or even some computer science, that'll definitely help you, But, if you don't know something like that, don't learn it just for the sake of preparation.
It's pretty debatable whether HTML is a programming language, but anyway, you'll enter in another world/dimension/universe/existence by learning C.
The C language is, IMHO, a very neat language. May it not be as flexible (and thus, dirty) as C++, but it's neat and elegant. It's simple. Once you know C, and can read/write it fluently, you could even (more or less) understand parts of the Linux kernel for example.
You mentioned both Javascript and Python. I wouldn't go with Javascript unless you're of those impure people who want to learn programming just for a job, and not for entertainment/fun, which is the real magic and beatifulness behind it! Python would be something I would recommend, but you already know C is somewhat harder, and you want to go that way, so go that way!
I'm not sure how much to recommend to you K&R. It was never updated after ANSI C (a standard from 1988-90!). That makes it pretty outdated (the latest C standard is from 2011, and the previous one was from 1999 (without C99 you'll experiment hell sooner or later)). Many (and I mean too much) people has though of The C Programming Language as "being the authoritative reference for C", because it was (in part) written by Dennis MacAlistair Ritchie (1941-2011), or in other words, the Messiah and Creator of C, who came to save us from Fortran.
Although some other answer may better answer you which books may be recommended (I can't, because I wasn't taught by books, but by Google), I hope this answer will give some light on what you should do. Happy programming :)!
I don't think very much is required to start reading K&R for comprehension. Although it is not written for novices, it is not novice-unfriendly. It does cover the very basic concepts of variables, functions, if-else statements, memory addresses, etc. with due diligence. It can stand alone as a programming tutorial. I think the main obstacles to newcomers would be programming terminology and a basic grasp of how to express a task as a series of logical steps in an algorithm (i.e., in code).
In my own opinion, C is an excellent choice for first programming language, and K&R is an excellent choice for learning C. I read K&R at a time when I had already studied C in college, but I remember wishing that it had been the first C programming book I had ever read. It presents the C language and its standard library very succinctly and in a way that is consistent with its design philosophy (makes sense, since it's written by the creators of C). This is not something you will get from reading books with titles such as "C for Engineers", which guide you through just enough of the language to succeed in a specific line of work. K&R presents C as a language -- it shows you the whole toolbox.
Is K&R the ideal book specifically for beginners? Probably not. Do I recommend it? Yes. It's written as an introduction to C, not to programming in general. But the gap isn't so wide that it is insurmountable. It is not necessary to be familiar with any of the past languages mentioned in the introduction (to this day I've never written a line of Fortran or Pascal in my life), nor is it necessary to know any particulars about machine language.
C itself is a relatively minimal programming language which maps closely to the primitives of procedural programming (variables, control statements like while and if/else, functions) and computer architecture (pointers, arrays, strong typing, memory allocation). Learning C will force you to become familiar with these concepts, which make up the technology underlying other languages like Java, Python, JavaScript, and so on. Consequently you will end up with a deeper understanding of software in general, and it will make you well-prepared to pick up those languages down the line if you choose.
I definitely recommend you the following book: Learn C The Hard Way.
Zed Shaw, the author of this book, is a person who totally understands the difference between a beginner programmer (someone who understands the fundamentals) and a total beginner (someone like you). You can read more about his ideas about this here.
The book is almost entirely available online and a physical copy will be published soon.
Maybe after reading this book you should read the K&R's one.
Note: The name of the book does not mean that the book is hard by the way.

linux kernel step by step [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
i know c language.my goal is to read linux kernel.so what languages should i learn(write books too) before start reading kernel and is there any book to help reading linux kernel
This book is a little outdated, but Understanding The Linux Kernel is an amazing reference. It will also give you a crash course in i386 features that make a lot of the kernel facilities possible (such as the MMU and how interrupts work. With operating systems, it's sometimes hard to understand where the hardware ends and the OS begins), and reference a lot of the critical source directly.
Also, look into the LWN Kernel article index for more up-to-date references.
One good way to start is come up with a really simple feature that you'd like to add to the kernel and start hacking away at it. (Something I did in college was count how many times each process got preempted and export that value via the /proc file system. Taught me a lot about scheduling, /proc, the process structure, and many other facilities). Also a recommendation, do this in a VM unless you plan to reboot every fifteen minutes.
For ad hoc questions, searching Google works, or asking questions on IRC. (Respectfully, of course.)
The Linux kernel is over 11.5 million lines long! It takes years to be a good programmer and you have to be one if you want to hack the Linux kernel. Taking your age and experience into account, you will most probably fail if you make that your first C project. I recommend getting your hands wet on some other cool stuffs using C. For Example, port the codes in the GreyHat Python book (debuggers, hooking, fuzzing and e.t.c) to C and add interesting features to them. If you are really into OS development, I recommend reading good books on Assembly and writing your own little real time OS. I've seen a real time OS written by a 13 year old kid so it's possible. Good luck!
Not so long ago there was a Linux kernel workshop at Hackerspace Brussels. You can take a look at the links on the event page https://hackerspace.be/LinuxKernelWorkshop
I raised this question myself years ago. I've then got stuck into lines of Linux kernel source code to figure out how it works. Till now my understanding on Linux kernel is still a mix. I think the best way to understand a program is write it by yourself. To build an OS, I think this is the minimum:
computer hardware & architecture
assembler & compiler
assembly
C language
There are lots of books out there that could help you read Linux kernel piece by piece. You still have a lot of time to rewrite it yourself.

LInux vs BSD for kernel development [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I recently updated my rusty C skills, and I've been trying to find a project to try them out on, so I picked kernel development (after all, C is a systems language). So, I was wondering which would be easier to start out with, Linux or one of the BSDs? Linux has a larger userbase (so I would probably have more support), but it also has a humongous codebase (9 million lines last time I checked), would the BSDs be easier to start out with because they combine the userbase and kernel into one large codebase? Also, is it best to just start reading the kernel source code? And, are they trying to implement new features aside from SMP and new drivers?
Unfortunately, I can only speak of Linux kernel hacking for myself. Currently I'm in an internship where I am working on a kernel, and I never did this before. But I was able to learn a lot of stuff in a quite short time, due to several reasons (again, I want to point out that I don't know how much of this is covered withint he BSD community):
Tutorials. The Linux Community is quite big and therefore you will find a lot of beginners information on kernel hacking. I feel like the standard to begin with was this guide. If you read it you will see, that even kernel hacking starts with hello world ;)
Linux Cross Reference. A great tool. It covers the complete Vanilla source code and shows you where each function/struct/define/whatever was defined and implemented, so no long searching for some stuff
The modular build of linux (I assume the same goes for BSD) Clearly you won't be able to look through 9 mio lines of code. But you can start easy with a little loadable kernel module and then go deeper. Maybe look at other modules first, hack them, and finally dig into the directly compiled stuff
The sheer community size. Not only kernel mailing lists, but also a huge number of forums or Q&A sites like this one where you can be sure to get help if you don't know what to do ;)
Just my 2 cents ;)
I am using and developing for Linux for many years, but am lacking any real experience with BSD to recommend either way.
You sound lacking experience for kernel hacking. Just reading kernel source might be insightful, but won't really teach you much. There is a lot going on in Linux kernel besides drivers. For example, latest 2.6.38 was focused on desktop responsiveness. DRM stack is ever changing and could use more man power.
I'd suggest start easy, small fixes for beta drivers, etc.

What open source C projects are worth studying for learning good design? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
What small open source projects in C are interesting for learning good design?
The project should be:
Not too large (like the linux kernel)
Well documented
Perhaps still under active development
I've just started learning C, and while the language itself is not too difficult, i'm struggling how to design larger applications, so i thought checking out other open source projects would be a good starting point.
Thanks!
Redis (nosql db) is:
under active development
a manageable size
portable and robust
has no external dependancies
very well written, understandable code
In my opinion, good examples of moderately sized projects written in C are:
GNU Scientific Library (besides the source code, don't miss their design document)
Kazlib
Git
Posix threads are a perfect example of good C design
I like gnucash: http://www.gnucash.org/
No too large like Linux kernel, but still big I think.
You can start learning from small and well structured applications like http://abygaelle.guillaume-fr.net/trac/gemmes
It all depends what kind of projects you are interested in. And what aspect of it (specific algorithms, UI, networking, etc, etc...)
Head over to freshmeat, sourceforge or ohloh and browse the projects for your area of interest.
Alternatively if you want to look at projects that were chosen for a particular reason google summer of code might be interesting for you - even though these rarely include full projects.
EDIT:
Also alternatively, you might take something like linux kernel, but instead of trying to understand everything try to
get the big picture
then concentrate on one tiny piece of it and inspect how the code changed over time (and for what reasons - it should be quite well documented)

C Problems and Solutions [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a series of C problems (with solutions) that I can use to build my C skills. I already understand the basics of the language, the syntax, and the semantics. I am looking for a series of problems that will help me hone my skills, not a set of simple questions that you'd see in an introductory programming class.
You might try solving some of the problems on Project Euler. The first few are pretty simple, but they get very challenging very quickly. I think it's a lot of fun trying to come up with the shortest code or highly optimized code to compute the results (though, I generally use C++ or Python, not C).
One advantage the Project Euler problems have is that they aren't just language-centric; they're problems that really make you think hard about how to develop an elegant solution to difficult problems.
And don't forget code-golf.
You probably want to respond only to challenges (questions) that have at least 10 upvotes.
Here is a list of sites with online judges (and similar) which contains a large variety of problems:
(The sites are sorted in lexicographical order)
ACM Live Archive, problems from past ACM/ICPC regionals and World Finals.
Arbiter, online judge at Sharif University in Iran.
FZU Online Judge
Google Code Jam
Harbin Online Judge
Hangzhou Dianzi University (HDU) Online Judge
Hunan University ACM/ICPC Online Judge
IPSC (Internet Problem Solving Contest)
KSRU Online Judge
10.Jilin Online Judge
11.Lviv Online Judge
12.Moscow Online Judge
13.National Taiwan University Online Judge
14.Online Problems Solving System (OPSS)
15.Peking University Online Judge
16.Programming Challenges
17.Project Euler
18.Saratov Online Judge
19.Sphere Online Judge
20.TJU Online Judge
21.TopCoder
22.Ural Online Judge
23.USACO Training Program Gateway
24.UVa Online Judge
25.Wuhan University Online Judge
26.ZJU Online Judge
27.Z-Trening
Build libraries that implement sophisticated data structures, like binary trees, dictionaries, and such.
Write a compiler. It doesn't need to be complex or even complete: you can make up a simple language (a subset of lisp?) and then write a lexer for it. Make sure you start by laying down the formal grammar. You will touch memory management, pointer arithmetics and other neat C stuff.
I learnt a great deal about automata and compiler-design by writing a simple YAML parser in C++.
Try out Dennis Ritchie's book on C programming language. The book has quite good problems and also reading it is a joy :)
For more challenging problems you can go to Bitwise Programming contest
Ruby Quiz has 156 problems with solutions. But in Ruby, not C. See the ruby-lang mailing list for more after James stopped being Ruby quiz master.
Knuth's repository of bitwise stuff might help in the noble pursuit :)
http://www-cs-faculty.stanford.edu/~knuth/fasc1a.ps.gz
Practice code Katas, language does not matter that much. Trying to solve Katas you allready did with another language is usually quite efficient to learn a new language.
You could always visit Freshmeat, find a few projects that interest you and look at their bug tracker. Grab the code and try to fix a few of the problems.
This helps open source while also helping you to get used to jumping in to someone else's code with debugging goggles on.

Resources