Skip to content

Instantly share code, notes, and snippets.

View retrage's full-sized avatar
💭
🦄

Akira Moroo retrage

💭
🦄
View GitHub Profile
@retrage
retrage / openocd-usb-sipeed-visionfive2.cfg
Last active March 1, 2024 11:22
OpenOCD config for VisionFive 2 with Sipeed RV-Debugger-Plus
# REF: https://github.com/orangecms/RV-Debugger-BL702/blob/nezha/tools/openocd/openocd-usb-sipeed.cfg
# REF: https://github.com/strangerover2002/visionfive2-/blob/main/u74.cfg
# SiPEED USB-JTAG/TTL based on FT2232D
adapter driver ftdi
ftdi vid_pid 0x0403 0x6010
# http://blog.sipeed.com/p/727.html
ftdi channel 0
reset_config trst_only
transport select jtag
adapter speed 1000
@retrage
retrage / apfs_efi_jumpstart_dump.c
Last active September 18, 2021 08:27
Apple File System (APFS) EFI Jumpstart EFI Driver Extraction Application
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#define BLOCK_SIZE (512)
@retrage
retrage / pcb800099-bin-mod.md
Created May 2, 2020 01:03
PCB800099 Resolution Modification

PCB800099 Resolution Modification

1 describes how to modify PCB800099 firmware to change resolution (from 1400x1050 to 480x1280). The source code can be found 2. The data to be modified is structures PanelType 3. Here is the definition.

@retrage
retrage / nabla-lkl-hello.log
Created January 20, 2020 11:11
Hello from Linux(lkl/musl) on Solo5(spt) on Docker(runnc)
$ docker run -i --runtime=runnc retrage/nabla-lkl-hello:latest /hello.
nabla
nabla-run arg [/opt/runnc/bin/nabla-run --x-exec-heap --mem=512 --block:rootfs=/
var/run/docker/runtime-runnc/moby/aa6f5263a2bd839b2fdc1cb0b4bb66d5c120e3aa4f5cd6
f76318788e8fde102e/rootfs.iso /var/lib/docker/overlay2/b9f7d682cd11b25c81edbb6c2
c1d7c6768a769f3c29db709b70a05f7191716d1/merged/hello.nabla {"env":"PATH=/usr/loc
al/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","env":"HOSTNAME=aa6f5263a2
bd","cmdline":"/var/lib/docker/overlay2/b9f7d682cd11b25c81edbb6c2c1d7c6768a769f3
c29db709b70a05f7191716d1/merged/hello.nabla","net":{"if":"ukvmif0","cloner":"Tru
e","type":"inet","method":"static","addr":"172.17.0.2","mask":"16","gw":"172.17.
@retrage
retrage / printhex.c
Created December 21, 2019 04:03
BitVisor loadvmm.efi printhex
static void
printhex (EFI_SYSTEM_TABLE *systab, uint64_t val, int width)
{
CHAR16 msg[2];
if (width > 1 || val >= 0x10)
printhex (systab, val >> 4, width - 1);
msg[0] = L"0123456789ABCDEF"[val & 0xF];
msg[1] = L'\0';
systab->ConOut->OutputString (systab->ConOut, msg);
@retrage
retrage / lkl-build.md
Created October 24, 2019 08:38
lkl build time comparison

GNU ld:

$ /usr/bin/time make -C tools/lkl -j$(nproc) CC=clang
721.32user 36.81system 1:53.14elapsed 670%CPU (0avgtext+0avgdata 238908maxresident)k
272inputs+6619824outputs (0major+13666771minor)pagefaults 0swaps

LLVM lld:

@retrage
retrage / main.c
Created September 14, 2019 04:22
te-gen
/* SPDX-License-Identifier: MIT */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/mman.h>
@retrage
retrage / 0001-Avoid-gcc-warning-error.patch
Created July 10, 2019 03:51
Workaround for solo5 rumprun build with gcc >= 7
diff --git a/build-rr.sh b/build-rr.sh
index 2a8e4e1..ecd0646 100755
--- a/build-rr.sh
+++ b/build-rr.sh
@@ -389,6 +389,14 @@ buildrump ()
#
[ `${CC} -dumpversion | cut -f1 -d.` -ge 7 ] \
&& extracflags="$extracflags -F CPPFLAGS=-Wimplicit-fallthrough=0"
+ [ `${CC} -dumpversion | cut -f1 -d.` -ge 7 ] \
+ && extracflags="$extracflags -F CPPFLAGS=-Wno-maybe-uninitialized"
diff --git a/Vlv2TbltDevicePkg/PlatformPkg.fdf b/Vlv2TbltDevicePkg/PlatformPkg.fdf
index cb5b6b7..6c34a99 100644
--- a/Vlv2TbltDevicePkg/PlatformPkg.fdf
+++ b/Vlv2TbltDevicePkg/PlatformPkg.fdf
@@ -366,6 +366,7 @@ READ_LOCK_CAP = TRUE
READ_LOCK_STATUS = TRUE
FvNameGuid = B73FE497-B92E-416e-8326-45AD0D270091
+INF StmPlatformSamplePkg/MsegSmramPei/MsegSmramPei.inf
From f5a7768da347fed4acbe389ec01817f6a6b7ee2a Mon Sep 17 00:00:00 2001
From: Akira Moroo <retrage01@gmail.com>
Date: Mon, 20 May 2019 13:13:27 +0900
Subject: [PATCH 1/4] Add gitignore for src/tools
Signed-off-by: Akira Moroo <retrage01@gmail.com>
---
.gitignore | 3 +++
src/tools/.gitignore | 12 ++++++++++++
src/tools/awk/.gitignore | 3 +++