Learning Systems Programming in C

  • Thread starter Thread starter Mathematicize
  • Start date Start date
  • Tags Tags
    Programming Systems
Click For Summary

Discussion Overview

The discussion revolves around learning Systems Programming in C, particularly in the context of a course on C and UNIX Systems Programming. Participants share resources, project ideas, and personal experiences related to self-learning and practical applications in systems programming.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant seeks recommendations for self-learning Systems Programming, including project ideas and IDE suggestions, expressing frustration with their professor.
  • Another participant suggests that systems programming might involve writing a device driver and questions whether the course includes access to a debugging kernel.
  • Several participants propose programming microcontrollers as a fun and educational project, noting the availability of free tools and the experience of writing an OS from scratch.
  • One participant describes the complexity of writing a minimal pre-emptive multi-tasking OS, discussing context switching and interrupt handling in detail.
  • A suggestion is made to use a PIC32 controller board with MPLABX as a practical platform for learning.
  • Reading "UNIX Programming" by Kernighan & Ritchie is recommended as a foundational resource.
  • A participant shares their experience from an OS class where they created a shell, noting the challenges of the programming involved and recommending a book focused on OS theory.

Areas of Agreement / Disagreement

Participants generally agree on the value of practical projects and resources for learning Systems Programming, but there are multiple competing views on the best approaches and tools to use. The discussion remains unresolved regarding the best IDE and specific project recommendations.

Contextual Notes

Some participants express uncertainty about the course content and its alignment with practical applications. There are also varying opinions on the complexity of projects and the resources that would be most beneficial for self-learning.

Who May Find This Useful

This discussion may be useful for students and self-learners interested in Systems Programming, particularly those looking for project ideas, resources, and insights from others' experiences in the field.

Mathematicize
Messages
11
Reaction score
0
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!
 
Technology news on Phys.org
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?
 
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.
 
MarcoD said:
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).
 
Last edited:
Mathematicize said:
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/en-us/family/mplabx/
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2615&dDocName=en545713

That's the basic hardware and IDE platform needed to start.
 
Start by reading the book "UNIX Programming", by Kernighan & Ritchie.
 
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:

https://www.amazon.com/dp/0136006639/?tag=pfamazon01-20
 

Similar threads

Replies
86
Views
3K
  • · Replies 25 ·
Replies
25
Views
1K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
3
Views
4K
Replies
6
Views
3K
  • · Replies 86 ·
3
Replies
86
Views
13K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K