Skip to content

Instantly share code, notes, and snippets.

View gautammenghani's full-sized avatar

Gautam Menghani gautammenghani

View GitHub Profile
@gautammenghani
gautammenghani / pgbench_steps.md
Last active March 12, 2024 11:55
steps to run phoronix pgbench

NOTE: Run all below steps as root

  1. Get phoronix test suite
# git clone https://github.com/phoronix-test-suite/phoronix-test-suite.git
  1. Install dependencies
# dnf install -y libicu libicu-devel pkgconf-pkg-config php-cli php-xml php-json unzip

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@gautammenghani
gautammenghani / usb.md
Created September 29, 2022 09:28
pass thru usb drive

IMAGE="/home/gautam/fun/linux/programming/image" qemu-system-x86_64
-m 4G
-smp 2
-kernel /opt/linux/arch/x86/boot/bzImage
-append "console=ttyS0 root=/dev/sda earlyprintk=serial net.ifnames=0 kasan.fault=report"
-drive file=$IMAGE/buster.img,format=raw
-net user,hostfwd=tcp::10021-:22 -net nic
-enable-kvm
-usb -device qemu-xhci,id=xhci -device usb-host,hostdevice=/dev/bus/usb/001/003 -nographic -pidfile vm.pid 2>&1 | tee vm.log

@gautammenghani
gautammenghani / gist:af55cfd40c3020defef9da65f53747fe
Last active April 23, 2022 17:19
kernel_learning_resources

oops.c

#include <linux/kernel.h> #include <linux/module.h>

MODULE_LICENSE("GPL"); static int test_panic_init(void) { printk(KERN_INFO"%s: In init\n", func); panic("Hello Kernel I am causing the panic\n"); return 0;

@gautammenghani
gautammenghani / kernel_dev_process.md
Last active January 9, 2022 09:10
The kernel development process to submit patches
  1. Clone the stable kernel git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

  2. Create a new branch and make changes in that branch. Commit your changes.

  3. Create a config file for your distro, and then compile and install your kernel to make sure everything works.

  4. To submit your changes, you need to make a patch out of your commit. Each subsystem of the kernel has its own maintainer(s). To find out the maintainer for your subsystem, you can use the 'get_maintainer.pl' script bundled with the kernel.

  5. To get your patch ready, use the following command. After a patch is generated, you need to add details to it explaining why changes are required. git format-patch -1 --to= --to= --cc= --cc=