Register to reply

Learning Systems Programming in C

by Mathematicize
Tags: c programming, ide, programming, systems, unix
Share this thread:
Mathematicize
#1
Feb24-12, 12:49 AM
P: 11
Hey everyone,

I am currently in a C and UNIX Systems Programming course, and my professor is not the best to say the least. Does anybody have recommendations on how to learn Systems Programming on your own? Such as, any interesting projects I could do in my spare time with online resources? Or just any general tips? I am kind of a scatter-brained person, great at math and high-level OOP (java and C#). Also, could anybody recommend me a great IDE with a debugger. I have tried XCode for C, but compared to netbeans and visual studio for java and C#, it does not compare in my opinion.

Thanks!
Phys.Org News Partner Science news on Phys.org
Flapping baby birds give clues to origin of flight
Prions can trigger 'stuck' wine fermentations, researchers find
Socially-assistive robots help kids with autism learn by providing personalized prompts
rcgldr
#2
Feb24-12, 01:58 AM
HW Helper
P: 7,126
I'm not sure what your course involves. Since the unix system is already up and running, it would seem that systems programming would involve something like writing a device driver. Usually a debugging kernel is used for this type of work, does the course include access to a debugging kernel?
MarcoD
#3
Feb24-12, 08:39 AM
P: 98
Personally, programming a microcontroller these days is a lot of fun. There are tons of nice free tools out there, and you get some kind of feeling how it is to write an OS from scratch.

Having said that, writing an OS is something for experts, and -these days- a very complex thing you buy. But if you feel like tinkering, you could start a project like that. A led christmas display or something like that is a nice place to start.

rcgldr
#4
Feb24-12, 10:19 AM
HW Helper
P: 7,126
Learning Systems Programming in C

Quote Quote by MarcoD View Post
Personally, programming a microcontroller these days is a lot of fun. There are tons of nice free tools out there, and you get some kind of feeling how it is to write an OS from scratch.

Having said that, writing an OS is something for experts, and -these days- a very complex thing you buy.
A minimal pre-emptive multi-tasking OS doesn't involve a lot of code, perhaps 300 to 500 lines of code depending on how much you put into it. Each task has it's own stack area, so context switching is mostly about saving everything you need to resume a task on it's own stack, then switching stacks, and restoring to continue with another task.

Using a rule that only one task can pend on any specific event makes things a bit easier and quicker since you can include the address of the task control block in the event structure (or zero if no task is pending on an event). (For one task or interrupt to signal multiple tasks at once, multiple events would be required, but that's not a large overhead, and keeps the OS code simple.)

How interrupts are handled can be a bit tricky, since if an interrupt signals a higher priority pending task, you'll need to move some of the context saved by the interrupt process to the current task's stack, before going to a dispatcher to switch context to the higher priority task. Nested interrupts add another layer of complexity, since any level interrupt could signal a task, but the dispatcher isn't called until the lowest current level interrupt is being exited (and only called if a task switch is to be done).
nsaspook
#5
Feb24-12, 11:39 AM
P: 642
Quote Quote by Mathematicize View Post
Hey everyone,

I am currently in a C and UNIX Systems Programming course, and my professor is not the best to say the least. Does anybody have recommendations on how to learn Systems Programming on your own? Such as, any interesting projects I could do in my spare time with online resources? Or just any general tips? I am kind of a scatter-brained person, great at math and high-level OOP (java and C#). Also, could anybody recommend me a great IDE with a debugger. I have tried XCode for C, but compared to netbeans and visual studio for java and C#, it does not compare in my opinion.

Thanks!
I would get be a simple pic32 controller board with MPLABX.
http://www.microchip.com/pagehandler...family/mplabx/
http://www.microchip.com/stellent/id...cName=en545713

That's the basic hardware and IDE platform needed to start.
Rogerio
#6
Feb26-12, 12:01 PM
P: 403
Start by reading the book "UNIX Programming", by Kernighan & Ritchie.
Adyssa
#7
Feb27-12, 02:16 AM
P: 188
I did an OS class last year and we made a shell that could execute programs and handle pipes and redirects. It was a really short program, much shorter than I imagined, but the code was tricky. We used this book, and I found it very helpful, but it focuses more on OS theory and not that much on actual programming:

http://www.amazon.com/Modern-Operati...0330536&sr=8-1


Register to reply

Related Discussions
Learning c#, .NET programming Programming & Computer Science 5
Learning a Programming Language Academic Guidance 15
Learning parallel programming... Programming & Computer Science 2
THAN programming - puzzle - learning aid Programming & Computer Science 7
Programming-based learning General Math 2