Skip to content

Instantly share code, notes, and snippets.

@ViNi-Arco
ViNi-Arco / text.md
Created February 19, 2024 13:05 — forked from merryhime/text.md
Playing with segment registers fs and gs on x64

GSBASE and FSBASE

When you're running out of registers while writing a JIT, you might resort to more unconventional methods for memory access. You might choose to resort to segment registers if you need a fixed register for memory offsets.

Instructions such as:

lea    rax,gs:[rcx+rdx*8]
mov    rax,gs:[rcx+rdx*8]

would then be available for your use.

@ViNi-Arco
ViNi-Arco / gpu_detection.patch
Created December 26, 2023 14:30 — forked from Gravechapa/gpu_detection.patch
Wine gpu detection patch
diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c
index c5e47cb355c..8bc83755746 100644
--- a/dlls/winex11.drv/xrandr.c
+++ b/dlls/winex11.drv/xrandr.c
@@ -367,7 +367,6 @@ static BOOL is_broken_driver(void)
XRRScreenResources *screen_resources;
XRROutputInfo *output_info;
XRRModeInfo *first_mode;
- INT major, event, error;
INT output_idx, i, j;
@ViNi-Arco
ViNi-Arco / build-gcc
Created December 19, 2023 23:29 — forked from bmmalone/build-gcc
Build and Install GCC Suite from Scratch
#! /bin/bash
GCC_VERSION="10.1.0"
WORKDIR="$HOME/gcc/src/"
INSTALLDIR="/$HOME/gcc/install/gcc-${GCC_VERSION}"
set +h
unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE LD_LIBRARY_PATH
@ViNi-Arco
ViNi-Arco / FSR.glsl
Created July 13, 2023 12:06 — forked from agyild/FSR.glsl
AMD FidelityFX Super Resolution v1.0.2 for mpv
// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@ViNi-Arco
ViNi-Arco / UE2_3_4_shader_compilation_on_load
Created June 20, 2023 11:09 — forked from WinterSnowfall/UE2_3_4_shader_compilation_on_load
Unreal Engine 2/3/4 shader compilation on load (not on demand)
#the following settings will alleviate or outright prevent shader stutter
#with the downside of taking up more GPU memory, hence it may not benefit
#GPUs with insufficient VRAM
#for UE2 engine titles edit the main config ini file
#(e.g. Unreal2.ini) to add/change the below lines:
[D3DDrv.D3DRenderDevice]
UsePrecaching=True
AvoidHitches=True
From ea09f193e207732202b59716db8c6c37f1d557a4 Mon Sep 17 00:00:00 2001
From: Andrius Lukosevicius <[email protected]>
Date: Tue, 7 Jun 2022 07:38:04 +0300
Subject: [PATCH] Revert "winex11.drv: Remove unused X11DRV_GET_DRAWABLE
ExtEscape code."
This reverts commit 96b82203f192eade6910f4ac2ecb188e27d22feb.
---
dlls/winex11.drv/init.c | 8 ++++++++
dlls/winex11.drv/x11drv.h | 9 +++++++++
@ViNi-Arco
ViNi-Arco / PKGBUILD
Created May 1, 2023 02:42 — forked from graysky2/PKGBUILD
5.12.9 with clang and thinlto
# Maintainer: Jan Alexander Steffens (heftig) <[email protected]>
pkgbase=linux
pkgver=5.12.9.arch1
pkgrel=1
pkgdesc='Linux'
_srctag=v${pkgver%.*}-${pkgver##*.}
url="https://git.archlinux.org/linux.git/log/?h=$_srctag"
arch=(x86_64)
license=(GPL2)
@ViNi-Arco
ViNi-Arco / C-states.md
Created January 31, 2023 17:13 — forked from wmealing/C-states.md
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered:

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 1aec2a8e66a35..73d75a42781ff 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -38,6 +38,15 @@
unsigned int sysctl_sched_latency = 6000000ULL;
static unsigned int normalized_sysctl_sched_latency = 6000000ULL;
+/*
+ * When tasks asks for yield, alter its vruntime
@ViNi-Arco
ViNi-Arco / fstab-generate-arch.md
Created November 3, 2022 13:07 — forked from Brainiarc7/fstab-generate-arch.md
Generate fstab in Arch Linux

First, install arch-install-scripts:

sudo pacman -S --needed arch-install-scripts

Secondly, mount your partitions in all the internal hard drives.

Thirdly, generate and validate your config by piping it out to stdout: