Posts

Showing posts from 2019

Device Memory, MMIO and SSE instruction set

Introduction - This blogpost is going to summarized my recent research and idea between PCI Device, MMIO, SSE instruction set. Recently, I have a research topic that require to access and copy the device memory (BAR memory). For my previous knowledge , BAR memory is actually as same as the physical memory, but somehow it is mapped to the devices. However, I changed my thought after I met a problem when coping device memory by kernel optimized memcpy. I used memcpy for memory-mapped space, it all return 0xFF, however, it works great I copy it by normal pointer, it stimulate me to dig inside, what's happening. PCI Device A device that meet PCI specification, in PCI device spec, there's one great point that enable you could easier communicate with the device, it called Mapped Memory I/O, MMIO.  PCI device has it's own device memory and register inside the hardware, for the register is always responsible for communication from external device , like the device driv

Android Kernel Development - Kernel compilation and Hello World

Image
Introduction Due to the lack of the material that clearly kick off the  android kernel development , hopefully it will gives the clearer  guide to develop your own android driver and debugging it. p.s. Due to the version differential, this article  is not ensure all of the Android Version , SDK version,  source  code , and   Emulator is compatible , however,  the door of   research is always opened,   just   feel   free   to contact me  and play together :P All the materials   are also  saved   in   the VM  ,   you can just directly leverage  the  existing VM Image for  development or  alternatively, as a research and studying, follow the following guide  to create your own workplace.  Android kernel didn't have dynamically insmod like the other linux, so this tutorial is trying to build a new Android Kernel and make test our kernel driver as well. Material Ubuntu 18.04.2 LTS  Android studio Android ndk-r10 Android SDK Goldfish v3.10 VMWare 15   

Say Hello to UEFI World.

Image
Introduction To be short... This article is going to try how could we let our EFI file get loaded under Windows 10 with disabled secure boot. Content 0. Install a VM as UEFI base VM. 1. Turn off your secure boot as following: Figure[1] 2. Mounting your GPT partition to the system by mount <drive_name> /s, so EFI partition that is visible to us. Figure[2] 3. We could place our .EFI driver / application here now (these action could be implemented programmatically, simply file coping after mounting, here is showing the concept.) 4. Configure the boot setting by SetFirmwareEnvironment API which is exported by Windows.  a) The pararmeter and GUID will be specified by UEFI spec, depend on your UEFI version.  b) For example, we need to change the BOOT#### or DRIVER#### Variable, the parameter is EFI_LOAD_OPTION as following definition: Figure[3] 5. The path of the OPTION will set as followed Figure[4] 6.  After reboot, the drive