Skip to content

Instantly share code, notes, and snippets.

View franzflasch's full-sized avatar

franzflasch

View GitHub Profile
@franzflasch
franzflasch / Makefile
Created January 10, 2022 12:06 — forked from 38/Makefile
A Minimal LLVM JIT example for LLVM-5
jit-toy: jit-toy.cpp
clang++ -g -o $@ $^ $(shell /usr/lib/llvm-5.0/bin/llvm-config --cxxflags --ldflags --system-libs --libs core)
@franzflasch
franzflasch / drm-prime-dumb-kms.c
Created May 20, 2021 20:43 — forked from Miouyouyou/drm-prime-dumb-kms.c
Simple example showing how to use DRM to : allocate a Dumb buffer on the GPU, use it as a framebuffer, use this CRTC on the currently connected screen (expecting 1 connected screen), export the buffer, reimport it implicitly with mmap and write in it.
// This will works on Embedded GPU that implements .gem_prime_mmap like Rockchip ones.
// This will fail on most DRM drivers for GPU with dedicated memory as they tend to NOT implement .gem_prime_mmap.
#include <stdio.h>
#include <libdrm/drm.h>
#include <stdint.h>
#include <sys/mman.h>
#include <string.h>
@franzflasch
franzflasch / qemu-networking.md
Created November 26, 2019 12:38 — forked from extremecoders-re/qemu-networking.md
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@franzflasch
franzflasch / coding-style.md
Last active September 20, 2022 16:02
coding style

Formats the source file to the gnu coding style, with no curly braces intendation and line length of 100

indent <source-file> -o <output-file> -gnu -bli0 -l100

clang-format with Microsoft style is nice

clang-format -style=Microsoft -i read_serial_raw.c
@franzflasch
franzflasch / opensource-fpga.md
Last active December 20, 2018 10:59
opensource fpga development
@franzflasch
franzflasch / byobu-cheat-sheet.md
Last active March 13, 2020 21:24
byobu cheat sheet

Create new named session:

byobu -S <session-name>

List windows of named session

byobu -S <session-name> ls

1. Prepare prerequisites:

apt-get install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev libpython-dev python-pip python-capstone virtualenv

2. Build qemu-riscv:

cd ..
git clone https://github.com/riscv/riscv-qemu.git
cd riscv-qemu
@franzflasch
franzflasch / qemu-cortex-m-stm32.md
Last active August 15, 2018 08:39
qemu-cortex-m-stm32

Howto qemu cortex-m (stm32)

Install prerequisites for qemu, some of them are:

apt-get install build-essential libglib2.0-dev zlib1g-dev libpixman-1-dev
apt-get install libsdl2*

Get qemu for cortex-m microcontrollers

goip dynamic dns:

prepare curl:

opkg install curl  
opkg install ca-certificates  
opkg install ca-bundle  

goip script:

@franzflasch
franzflasch / qemu-arm-with-busybox-linux-and-shared-folder.md
Last active May 7, 2024 14:26
Howto qemu-arm with busybox linux and shared folder

Install dependencies

apt-get install gcc-arm-linux-gnueabihf qemu

Prepare work directory

mkdir qemu-arm-sandbox && cd qemu-arm-sandbox