Skip to content

Instantly share code, notes, and snippets.

Go Arm or go home.

Andrei Warkentin andreiw

Go Arm or go home.
View GitHub Profile
pkgin -y install xorg
pkgin -y install hal
pkgin -y install fam
pkgin -y install mpv compton midori firefox mozilla-rootcerts-openssl
pkgin -y install wpa_gui sysupgrade deluge slim slim-themes uget thunderbird
pkgin -y install xfce4 xfce4-extras
cp /usr/pkg/share/examples/rc.d/hal /etc/rc.d
cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d
cp /usr/pkg/share/examples/rc.d/famd /etc/rc.d
andreiw / _dma-for-every-acpi-dev.diff
Last active Jul 25, 2020
5.5 patch to support _DMA restrictions/translations for ACPI objects, to properly support xHCI with a 4GB Pi via ACPI
View _dma-for-every-acpi-dev.diff
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 33f71983e..f7f7114c4 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -1076,12 +1076,13 @@ void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size)
size = 1ULL << 32;
- if (dev_is_pci(dev)) {
- ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size);
andreiw / main.c
Created Jul 21, 2019 — forked from mrandri19/main.c
main.c: Modern text rendering with Linux: Part 1
View main.c
#include <stdio.h>
#include <freetype2/ft2build.h>
#include FT_FREETYPE_H
int main() {
FT_Library ft;
FT_Error err = FT_Init_FreeType(&ft);
if (err != 0) {
printf("Failed to initialize FreeType\n");
andreiw /
Last active Dec 22, 2016
Pythonista extension to import URL as Python script
import appex
import clipboard
import urllib3
import os
def main():
if not appex.is_running_extension():
print('This script is intended to be run from the sharing extension.')
andreiw / cgate.c
Created Feb 8, 2016
x64 override idt handlers in existing system (useful for UEFI)
View cgate.c
void c_gate_entry(uint64_t *regs)
uint64_t gate = regs[15];
unsigned ix = 0;
uint64_t pc;
uint64_t sp;
uint64_t cr2;
warn("Gate = 0x%lx", gate);
andreiw / walker.c
Last active Dec 22, 2016
x64 identity-mapped page table walker - useful for detecting non-identity-mapped bits
View walker.c
uint64_t i4;
uint64_t *l4pt;