Skip to content

Core Software Fundamentals

DJShepherd edited this page Dec 10, 2023 · 8 revisions

C/C++ Translation to Machine Code

CPU fundamentals

System/OS fundamentals

Memory Paging

Assembly

  • Basic understanding of assembly design
    • Calling conventions (stack owner, argument passing)
    • Prolog, epilog (stack manipulation, return address)
    • Local variables/stack access
    • Registers/flags
    • Standard/common control flows
    • Common optimization techniques
      • Control flow optimizations
      • Integer bit tricks/data manipulation optimizations
    • Execution context switching
      • Thread switching
      • Interrupt processing
  • RISC vs CISC architectures
  • RISCV - Used in a lot of custom/proprietary controllers/sub systems
  • ARM - Used for a lot of public/consumer IoT products
  • X86/64 - Home/business computers
  • Instruction pipelines

Interrupts

Inter Process Communication (IPC) designs

Secure System Software Layers

  • What they do/contain, how they provide security, etc

Security Modules

Hypervisor

  • Multi OS system
    • For consumer/IoT devices, it isolates a vulnerable user OS from a trusted, higher privileged system OS
    • In a cloud environment, it isolates separate customer’s OS’ from each other
  • Hypervisor - Geeks for Geeks
    • Type 1 HV: bare metal. Better VM isolation but less support for peripherals, cross VM communication, etc.
    • Type 2 HV: Container inside a host OS. Better support for host to container communication, peripherals, etc. But not as good isolation and more risk of container breakout to host.

Kernel

OS/User Mode

Containers

  • A container is a method used for cloud application deployment that isn’t as secure/isolated as compared to using a VM.
  • A container application runs as a normal application within a host OS alongside other deployed container applications. Container applications are configured with a set of versioned support libraries that make it run in a constantly defined environment, regardless of the host OS.
  • Popular modern host OS’ have containerization support that help with security and isolation, such as a sandbox environment (isolated view of files, system resources, etc) and fine-grained permissions (accessible socket ports, files, system resources, etc).
  • Because it runs in the context of a shared host OS, any vulnerable or malicious container application can put the system at risk of compromising the host and all other containers, resources, etc. If the host OS provides containerization features, this would require using an exploit to break out of the container sandbox to gain system level access (“container/sandbox escape”).
  • Security can be comparable to a Type 2 hypervisor where the hypervisor runs in the host OS. The main difference is that containers will interact with the host OS kernel while applications in a VM will interact with the hosted VM kernel. Container Escape is comparable to VM Escape.

System Boot, Drivers

Registers

Driver Development

Bootstrapping

I/O, Direct Memory Access (DMA)

Common Bus Protocols

  • Basic familiarity
  • UART
  • I2C
  • JTAG
  • SPI

Common Driver Stacks

  • Basic familiarity
  • USB
  • Network
  • Bluetooth
Clone this wiki locally