C Tutorial

C Tutorial information abounds on the web - the information provided here is geared towards users who program deeply embedded systems.  While C programming is almost obsolete for applications programming apart from deeply embedded systems, it is still popluar in both deeply embedded systems and operating systems because of its ability to represent hardware and operating system constructs well.

 

C is a feature lean procedural  language which makes it easy to learn and to use.  It does not have embedded concurrency.

C also exhibits the following more specific characteristics:

  • no nested function definitions (unlike Pascal)
  • variables may be hidden in nested blocks with allocation from the stack
  • weak typing which allows users to easily transform data in embedded systems or operating systems
  • low-level access to memory using pointers
  • function and data pointers to support polymorphism at run time 
  • pointer arithmetic with array access as pointer arithmetic
  • conditional compilation and file inclusion
  • complex functionality such as structures and unions
  • easily added libraries to encapsulate complex features like math libraries
  • few keywords
  • lots of bit operators for low level control

 

It also has the following limitations: 

  • No garbage collection - users manage memory directly
  • No array assignments or complex structure assignment (other than with a pointer)
  • No array operations
  • No array checking
  • No exception handling as part of the language
  • No packaging aka Ada, limited static packaging in files
  • No object oriented notions
  • No standard GUI libraries or graphics libraries.
  • No concurrency in the language.

 

As a result of it's strong capabilities for embedded systems and its limitations, users have tried to add better capabilities to the language to deal with these limitations and simplify C tutorial information and enhance ease of use.

 

RoweBots has overcome the limitations of C and provided great C tutorial information by doing the following:

  • Adding an open source and commercial Linux and POSIX compatible RTOS to the environment.  This provides the following features.
    • Memory management overcoming garbage collection and memory issues.
    • Exception handling for the operating systems
    • pthread libraries to deal with concurrency
    • Add on graphics
    • A standard I/O model which encapsulates all device I/O in a standard way
  • A focus on deeply embedded applications that do not require complex object orientation.
  • A focus on deeply embedded applications that do not require large array manipulation.

As a result, the combined environment provides a clean and simple environment with simple C tutorials for deeply embedded systems.