Skip to content

Instantly share code, notes, and snippets.

@soleen
soleen / qemu_run.sh
Created January 20, 2022 03:28
page table check panic
#!/bin/bash
set -e
PARAM="root=/dev/sda console=ttyS0 page_table_check=on"
qemu-system-x86_64 -smp 1 -m 1G -enable-kvm -cpu host \
-net user,host=10.0.2.10,hostfwd=tcp::10022-:22 \
-net nic,model=virtio-net-pci \
-kernel arch/x86/boot/bzImage -nographic \
-device virtio-scsi-pci,id=scsi \
@soleen
soleen / config
Created January 20, 2022 03:25
page table check panic
drive.web-frontend_20220112.01_p1
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.16.0 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 11.2.0-12) 11.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
@soleen
soleen / repro.c
Created January 20, 2022 03:22
page table check panic repro
#define _GNU_SOURCE
#include <fcntl.h>
#include <sched.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <sys/mman.h>
@soleen
soleen / init.sh
Created November 4, 2021 16:22 — forked from m13253/init.sh
Minimal working initramfs for BusyBox, with login
#!/bin/busybox sh
# 1) Download a prebuilt BusyBox binary here:
# https://busybox.net/downloads/binaries/
#
# 2) Prepare your kernel
# cp /boot/vmlinuz vmlinuz
#
# 3) Copy the files
# install -Dm0755 busybox-x86_64 initramfs/bin/busybox
@soleen
soleen / gist:564e4d516c25b0cb099c9bc026c87963
Created December 2, 2018 20:46 — forked from chrisdone/gist:02e165a0004be33734ac2334f215380e
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel