CSCE 121 Chapter 25

From Notes
Jump to navigation Jump to search

« previous | Wednesday, December 1, 2010 | next »


Embedded Systems Programming

Remember: not all computers are desktops and laptops

Airplane controls, engine processors

Differences with Personal Computers

  • Predictability
  • Memory management
  • Direct hardware access
  • Limited resources
Hard real-time
Response must occur before deadline
Soft real-time
Preferred response before deadline, but not required


Bases

C++ Operations execute in a constant, measurable amount of time...

with the exception of:

  • new
  • throw

BIG NO-NOs IN REAL-TIME APPLICATIONS

(In 5 years, throw will have been solved)


Ideals

Keep the highest level of abstraction, but learn your way around the hardware.

Life without new

Pre-allocation: set aside a fixed amount of memory for global objects at startup time

Templates work very well for embedded systems:

  • No overhead for inline operations
  • No memory used for unused operations


Dealing with Failures

  • Self-check the software: know when the hardware is misbehaving
  • Have backups for processes that might misbehave


Bit Manipulations

... :(


Standards: Banishing Compexity

Use conventions for:

  • variable names
  • indentation
  • comments
  • specifying certain features of a language