Skip to content

tghedaoo/Embedded-Software-Study

Repository files navigation

Embedded Systems Software / Firmware Study Material

Embedded Systems

  1. Endianess
  2. Socket Programming
  3. Bit Manipulation
  4. Operating Systems
  5. Peripherals
  6. Boot Sequence
  7. System Design

Data Structures & Algorithms

  1. Arrays
  2. Linked List
  3. Search Algos
  4. Queue
  5. Stack
  6. Tree
  7. String mainpulation

C++ programming

Encapsulation, Inheritance, Polymorphism, Abstraction.

  • Inheritance - Base & Derived Class, Indirect Inheritance, Abstract Class, Dynamic Polymorphism. (TODO - Friend class, multiple inheritance, Diamond problem)
  • Dynamic Polymorphism - Runtime polymorphism. See Inheritance and Keywords doc.
  • Static Polymorphism (TODO - Templates and Overloading - Operator, Function.)
  • Move and Copy Semantics
  • RAII
  • Smart pointer
  • V-Table
  • keywords: static, volatile, const, virtual (TODO - virtual class, constexpr, noexcept)
  • Design Patterns: Factory, Visitor.
  • STL - string, vector, stack, map, unordered_map, set, unordered_set.

C programming

Advanced Leetcode Questions

  1. LRU Cache (C++)
    https://leetcode.com/problems/lru-cache/description/
    My Code LRU Cache needs a hash map mapping the nodes of a Doubly Linked List. The DLL tracks the least recently used key.
    When a new key or a recently used key comes in, the DLL updates in such a way that the key in question ends up at the head.
    Naturally the tail node becomes the least recently used one. This is removed whenever the list reaches capacity.
    Note: To avoid time exceed issue, remove extra functions from the class and hard code the ops.

Code Review Practices.

Code review practices: https://www.youtube.com/watch?v=3pth05Rgr8U

LLDB Debugger.

LLDB debugging for Mac M1: https://www.youtube.com/watch?v=v_C1cvo1biI (Allow access to see code breakpoints.)
General command flow: Add a breakpoint at main or any line number of your choice.

lldb 'your_exec_file'
b main
run
gui

Use command "help" to see all commands.
In gui, it's easy to visually see the current variables and states. Useful for investigating seg faults.
'n' to go next line.
's' to step in.

ISO 26262.

Issues with C

  1. Unspecified behaviour (sequence of evaluation)
  2. Undefined behaviour (overflow/ underflow issues)
  3. Implementation defined (memory allocation in case of zero space request)

MISRA C rules to avoid issues with it