Skip to content

Instantly share code, notes, and snippets.

View dramforever's full-sized avatar
🖤
dramming

dram dramforever

🖤
dramming
  • Scarlet Devil Mansion, Gensokyo
View GitHub Profile
#0 0x00007fb858e9cf3c in __pthread_kill_implementation () from /nix/store/g2jzxk3s7cnkhh8yq55l4fbvf639zy37-glibc-2.40-66/lib/libc.so.6
#1 0x00007fb858e4190e in raise () from /nix/store/g2jzxk3s7cnkhh8yq55l4fbvf639zy37-glibc-2.40-66/lib/libc.so.6
#2 0x00007fb85d6366f3 in KCrash::defaultCrashHandler(int) () from /nix/store/4knd9p4dr453bwb44g4glknskilg208j-kcrash-6.16.0/lib/libKF6Crash.so.6
#3 <signal handler called>
#4 0x00007fb83e076950 in iris_set_damage_region () from /nix/store/ig8h5hjy3s9lfhi75zc64acmyzr8zzyd-mesa-25.1.6/lib/libgallium-25.1.6.so
#5 0x00007fb83cd27fcf in dri_st_framebuffer_validate () from /nix/store/ig8h5hjy3s9lfhi75zc64acmyzr8zzyd-mesa-25.1.6/lib/libgallium-25.1.6.so
#6 0x00007fb83cddc48c in st_framebuffer_validate () from /nix/store/ig8h5hjy3s9lfhi75zc64acmyzr8zzyd-mesa-25.1.6/lib/libgallium-25.1.6.so
#7 0x00007fb83cddd061 in st_api_make_current () from /nix/store/ig8h5hjy3s9lfhi75zc64acmyzr8zzyd-mesa-25.1.6/lib/libgallium-25.1.6.so
#8 0x00007fb83cd27a84 in dri_make_current () f
use core::{
fmt,
ops::{Range, RangeInclusive},
};
/// A non-empty range of `usize` values
///
/// Like [`RangeInclusive`], `Region` can repesent any `usize` range, even those
/// that contain `usize::MAX`.
#[derive(Clone, Copy, PartialEq, Eq)]
\ https://www.cs.utexas.edu/users/EWD/transcriptions/EWD00xx/EWD28.html
: indvar create 0 , ['] @ ,
does> dup cell+ @ execute ;
: :=
>body
dup -rot ! \ Store value
cell+ ['] @ swap ! ; \ Make literal indvar
#include <stdio.h>
#include <stdlib.h>
#define DECL_STATE \
[[maybe_unused]] const struct word *const *ip, \
[[maybe_unused]] size_t *sp, \
[[maybe_unused]] const struct word *const **rsp
#define STATE ip, sp, rsp
struct word {
@dramforever
dramforever / _info.md
Last active July 18, 2025 17:09
How much RISC-V instruction space do we have left?
// QEMU emulator version 7.2.0
// qemu-system-riscv64 -M virt,aia=aplic-imsic,aia-guests=2,aclint=true,dumpdtb=dtb.dtb -smp 2
#include <dt-bindings/interrupt-controller/irq.h>
/dts-v1/;
/ {
compatible = "riscv-virtio";
model = "riscv-virtio,qemu";
@dramforever
dramforever / drawfb.c
Created February 15, 2023 07:15
Playing around with /dev/fb0
#define _GNU_SOURCE
#include <fcntl.h>
#include <linux/fb.h>
#include <stddef.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
int main() {
&gpio {
pinctrl-names = "default";
pinctrl-0 = <&gpiojtag_pins>;
gpiojtag_pins: gpiojtag-0 {
input-pins {
pinmux =
<GPIOMUX(1, GPO_LOW, GPO_DISABLE, GPI_CPU_JTAG_TCK)>,
<GPIOMUX(2, GPO_LOW, GPO_DISABLE, GPI_CPU_JTAG_TDI)>,
<GPIOMUX(3, GPO_LOW, GPO_DISABLE, GPI_CPU_JTAG_TMS)>;
@dramforever
dramforever / clkgen.txt
Last active July 13, 2022 18:30
(Partially) undocumented JH7100 registers found in headers
Register: clk_cpundbus_root_ctrl_REG_ADDR
Address: CLKGEN_BASE_ADDR + 0x0
31 24 16 8 0
| | | | |
[------<>------------------------]
'-------------------------- [25:24] (rw) clk_cpundbus_root_src
Register: clk_dla_root_ctrl_REG_ADDR
@dramforever
dramforever / Makefile
Last active March 3, 2022 09:06
Stack trace
CFLAGS += -fno-omit-frame-pointer -funwind-tables
LDFLAGS += -lunwind
.PHONY: all
all: stack-trace
.PHONY: clean
clean:
rm stack-trace