Skip to content

Instantly share code, notes, and snippets.

View imbushuo's full-sized avatar
👋
Yahallo

Ben (Bingxing) Wang imbushuo

👋
Yahallo
View GitHub Profile
Machine Build Time Notes
ThinkStation P620 (3945WX) 3m9.333s My desktop workstation
Standard_D8s_v3 14m54.310s My cloud workstation (build in local SSD)
MacBook Pro 2020 (Core i9 Power connected) 18m28.65s My work laptop 1
ThinkPad Z13 (Power unplugged) 9m58.835s Limited CPU performance
ThinkPad Z13 (Power connected) 5m25.508s Full CPU performance
@imbushuo
imbushuo / simplevm.c
Last active April 8, 2024 07:06
Demonstrates Hypervisor.Framework usage in Apple Silicon
// simplevm.c: demonstrates Hypervisor.Framework usage in Apple Silicon
// Based on the work by @zhuowei
// @imbushuo - Nov 2020
// To build:
// Prepare the entitlement with BOTH com.apple.security.hypervisor and com.apple.vm.networking WHEN SIP IS OFF
// Prepare the entitlement com.apple.security.hypervisor and NO com.apple.vm.networking WHEN SIP IS ON
// ^ Per @never_released, tested on 11.0.1, idk why
// clang -o simplevm -O2 -framework Hypervisor -mmacosx-version-min=11.0 simplevm.c
// codesign --entitlements simplevm.entitlements --force -s - simplevm
@imbushuo
imbushuo / HalInterrupt.md
Last active November 17, 2020 10:13
Third party Windows interrupt controller support if you are brave enough

Extracted from Windows public symbol, with a bit guessing. Function prototypes are not fully understood yet.

You still need your own way to hook your things into HAL.dll, as interrupt controller extension is never exposed.

typedef struct _SOC_INITIALIZATION_HEADER {
    ULONG TableVersion;
    ULONG TableSize;
} SOC_INITIALIZATION_HEADER, *PSOC_INITIALIZATION_HEADER;
tinymembench v0.4.9 (simple benchmark for memory throughput and latency)
==========================================================================
== Memory bandwidth tests ==
== ==
== Note 1: 1MB = 1000000 bytes ==
== Note 2: Results for 'copy' tests show how many bytes can be ==
== copied per second (adding together read and writen ==
== bytes would have provided twice higher numbers) ==
== Note 3: 2-pass copy means that we are using a small temporary buffer ==
imbushuo@hvminlinux:~/Sources/tinymembench$ lscpu
Architecture: aarch64
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 1
Core(s) per socket: 8
Socket(s): 1
Vendor ID: Qualcomm
Model: 14
tinymembench v0.4.9 (simple benchmark for memory throughput and latency)
==========================================================================
== Memory bandwidth tests ==
== ==
== Note 1: 1MB = 1000000 bytes ==
== Note 2: Results for 'copy' tests show how many bytes can be ==
== copied per second (adding together read and writen ==
== bytes would have provided twice higher numbers) ==
== Note 3: 2-pass copy means that we are using a small temporary buffer ==
@imbushuo
imbushuo / arm64-config
Created February 24, 2020 07:45
WSL2 modified arm64 kernel config
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 4.19.84 Kernel Configuration
#
#
# Compiler: gcc (Debian 8.3.0-6) 8.3.0
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=80300
@imbushuo
imbushuo / bootlog.log
Created February 24, 2020 01:07
Debian 10 Hyper-V arm64 VM boot log
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x51df804e]
[ 0.000000] Linux version 4.19.84-microsoft-standard+ (imbushuo@BEN-SURFACEPROX) (gcc version 8.3.0 (Debian 8.3.0-6)) #2 SMP Sun Feb 23 18:32:21 EST 2020
[ 0.000000] earlycon: pl11 at MMIO 0x00000000effec000 (options '')
[ 0.000000] bootconsole [pl11] enabled
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: EFI v2.70 by EDK II
[ 0.000000] efi: ACPI=0x3fffa000 ACPI 2.0=0x3fffa014 SMBIOS=0x3ffd3000 SMBIOS 3.0=0x3ffd1000 MEMATTR=0x3f022018 RNG=0x3ffd7e18
[ 0.000000] efi: seeding entropy pool
[ 0.000000] ACPI: Early table checksum verification disabled
[ 0.000000] ACPI: RSDP 0x000000003FFFA014 000024 (v02 VRTUAL)
@imbushuo
imbushuo / PPTT.dsl
Created December 8, 2019 22:15
Lenovo C630 WOS (Snapdragon 850) ACPI PPTT Table
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20190703 (32-bit version)
* Copyright (c) 2000 - 2019 Intel Corporation
*
* Disassembly of ./PPTT.aml, Sun Dec 8 17:13:58 2019
*
* ACPI Data Table [PPTT]
*
* Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
@imbushuo
imbushuo / Vibrator.cs
Last active November 2, 2019 10:57
Turn your Apple Magic Trackpad 2 into a vibrator
using HidSharp;
using System.Linq;
namespace ForceTouchTrigger
{
class Program
{
static void Main(string[] args)
{
// Force Touch Device: USB\VID_05AC&PID_0265&MI_02