Skip to content

01Kernel

Ronbin edited this page Dec 6, 2024 · 3 revisions

Compile a 15khz patched kernel

Install kernel source.

apt install linux-source

Install needed packages and dependencies.

apt install build-essential fakeroot atool dwarves
apt build-dep linux

Copy kernel and configuration file to current dir. Then, download kernel patches from D0023R

mkdir kernel && cd kernel
cp /usr/src/linux-source-6.1.tar.xz .
cp /usr/src/linux-config-6.1/config.amd64_none_amd64.xz .
wget "https://raw.githubusercontent.com/D0023R/linux_kernel_15khz/refs/heads/master/linux-6.1/01_linux_15khz.patch"
wget "https://raw.githubusercontent.com/D0023R/linux_kernel_15khz/refs/heads/master/linux-6.1/02_linux_15khz_interlaced_mode_fix.patch"
wget "https://raw.githubusercontent.com/D0023R/linux_kernel_15khz/refs/heads/master/linux-6.1/03_linux_15khz_dcn1_dcn2_interlaced_mode_fix.patch"
wget "https://raw.githubusercontent.com/D0023R/linux_kernel_15khz/refs/heads/master/linux-6.1/04_linux_15khz_dce_interlaced_mode_fix.patch"
wget "https://raw.githubusercontent.com/D0023R/linux_kernel_15khz/refs/heads/master/linux-6.1/05_linux_15khz_amdgpu_pll_fix.patch"
wget "https://raw.githubusercontent.com/D0023R/linux_kernel_15khz/refs/heads/master/linux-6.1/06_linux_switchres_kms_drm_modesetting.patch"

Extract kernel sources and configuration file. Then change dir.

aunpack linux-source-6.1.tar.xz
aunpack config.amd64_none_amd64.xz
cd linux-source-6.1

Apply the patches.

patch -p1 < ../01_linux_15khz.patch
patch -p1 < ../02_linux_15khz_interlaced_mode_fix.patch
patch -p1 < ../03_linux_15khz_dcn1_dcn2_interlaced_mode_fix.patch
patch -p1 < ../04_linux_15khz_dce_interlaced_mode_fix.patch
patch -p1 < ../05_linux_15khz_amdgpu_pll_fix.patch
patch -p1 < ../06_linux_switchres_kms_drm_modesetting.patch

Copy kernel configuration, change a line and compile.

cp ../config.amd64_none_amd64 .config
sed -i 's/CONFIG_DRM_KMS_HELPER=m/CONFIG_DRM_KMS_HELPER=y/g' .config
sed -i 's/CONFIG_LOCALVERSION=""/CONFIG_LOCALVERSION="-15khz"/g' .config
make clean
make -j`nproc` bindeb-pkg 

Install

dpkg -i linux-headers-6.1.106-15khz_6.1.106-15khz-1_amd64.deb
dpkg -i linux-image-6.1.106-15khz_6.1.106-15khz-1_amd64.deb
dpkg -i linux-libc-dev_6.1.106-15khz-1_amd64.deb

Info based on https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-kernel-org-package

And https://wiki.debian.org/BuildADebianKernelPackage

Install my precompiled kernel

Alternativelly you can download and install these packages, patched and compiled from me. I've uploaded them to dropbox

https://www.dropbox.com/sh/d8yf327ja67nx1y/AAAHZPMM3ob5s3Kj6hFVu_axa?dl=0

wget "https://www.dropbox.com/scl/fi/fqby5lffehjgyvaddkq15/linux-image-6.1.106-15khz_6.1.106-15khz-1_amd64.deb?rlkey=nqt1s3w39mnjmpwr47ogs1pht&st=160jgtmr&dl=1" -O linux-image.deb
wget "https://www.dropbox.com/scl/fi/7rn61kk7udc5vshp4sucb/linux-headers-6.1.106-15khz_6.1.106-15khz-1_amd64.deb?rlkey=her0affqssgu9zv72uyb90gks&st=968x5n7w&dl=1" -O linux-headers.deb
wget "https://www.dropbox.com/scl/fi/jz309djc4qd7ym6o3nph9/linux-libc-dev_6.1.106-15khz-1_amd64.deb?rlkey=ksx8xywva9dbk5xs7ozm7b7rx&st=5670bfqg&dl=1" -O linux-libc.deb
dpkg -i linux-image.deb
dpkg -i linux-headers.deb
dpkg -i linux-libc.deb

Modify boot parameters

By default debian and ubuntu installer uses grub so we need to edit /etc/default/grub file.

GRUB_CMDLINE_LINUX_DEFAULT="vga=0x311 video=VGA-1:640x480iec"'

I'm using VGA output. Check all the outputs with

for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done

Run 'update-grub' command and poweroff.

Next time system will boot in 15khz mode, so it must be connected to a tv, not a monitor.

Clone this wiki locally