C# driver development?

You can not make kernel-mode device drivers in C# as the runtime can’t be safely loaded into ring0 and operate as expected. Additionally, C# doesn’t create binaries suitable for loading as device drivers, particularly regarding entry points that drivers need to expose. The dependency on the runtime to jump in and analyze and JIT the … Read more

Editing Functionality of Host Card Emulation in Android

Ok ! So i’ve found a solution to the problem I was having! On the Nexus 7, when the NFC is turned on, it gets its information from a config file in “/etc/” called “libnfc-brcm-20791b05.conf” Inside of this file there is a parameter called “NFA_DM_START_UP_CFG” By default, it looks like this: NFA_DM_START_UP_CFG={42:CB:01:01:A5:01:01:CA:14:00:00:00:00:0E:C0:D4:01:00:0F:00:00:00:00:C0:C6:2D:00:14:0A:B5:03:01:02:FF:80:01:01:C9:03:03:0F:AB:5B:01:00:B2:04:E8:03:00:00:CF:02:02:08:B1:06:00:20:00:00:00:12:C2:02:01:C8} To edit the … Read more

Install Python 3.8 kernel in Google Colaboratory

I have found how to run Python 3.8 notebook on Colab. install Anaconda3 add (fake) google.colab library start jupyterlab access it with ngrok Here’s the code # install Anaconda3 !wget -qO ac.sh https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh !bash ./ac.sh -b # a fake google.colab library !ln -s /usr/local/lib/python3.7/dist-packages/google \ /root/anaconda3/lib/python3.8/site-packages/google # start jupyterlab, which now has Python3 = 3.8 … Read more

How do I programmatically disable hardware prefetching?

You can enable or disable the hardware prefetchers using msr-tools http://www.kernel.org/pub/linux/utils/cpu/msr-tools/. The following enables the hardware prefetcher (by unsetting bit 9): [root@… msr-tools-1.2]# ./wrmsr -p 0 0x1a0 0x60628e2089 [root@… msr-tools-1.2]# ./rdmsr 0x1a0 60628e2089 The following disables the hardware prefetcher (by enabling bit 9): [root@… msr-tools-1.2]# ./wrmsr -p 0 0x1a0 0x60628e2289 [root@… msr-tools-1.2]# ./rdmsr 0x1a0 60628e2289 … Read more

How to add a new device in QEMU source code?

edu in-tree educational PCI device https://github.com/qemu/qemu/blob/v2.7.0/hw/misc/edu.c https://github.com/qemu/qemu/blob/v2.7.0/docs/specs/edu.txt It is very easy to understand and well documented, so I recommend that you study it. It exposes a minimal PCI device, with basic IO, interrupt generation, and DMA. I’ve written a minimal Linux kernel module + userland tests to play with it at: https://github.com/cirosantilli/linux-kernel-module-cheat/blob/6788a577c394a2fc512d8f3df0806d84dc09f355/rootfs_overlay/pci.sh https://github.com/cirosantilli/linux-kernel-module-cheat/blob/6788a577c394a2fc512d8f3df0806d84dc09f355/kernel_module/pci.c Out-of-tree devices … Read more

What are vdso and vsyscall?

The vsyscall and vDSO segments are two mechanisms used to accelerate certain system calls in Linux. For instance, gettimeofday is usually invoked through this mechanism. The first mechanism introduced was vsyscall, which was added as a way to execute specific system calls which do not need any real level of privilege to run in order … Read more