[INFO] EDK2 port to Redmi Note 7 to boot Windows

Search This thread

Robotix22

Member
Mar 30, 2022
11
1
Okay now I have another Question I have no Idea how to patch Files like ClockDxe and my Tester fails to patch it too How did you do it?
 
Okay now I have another Question I have no Idea how to patch Files like ClockDxe and my Tester fails to patch it too How did you do it?
You may really need to know a lot of stuff, if you ask how to binary patch an executable then you lack of a lot of knowledge, you may need to find how to reverse engineer binary files resources elsewhere, you may need to ask your questions on different forums not on this thread, you can start joining the Renegade telegram group, there are a lot of people that may point you in the right direction. For me, took a year to patch ClockDxe.efi.....
 

cuongcuto888

New member
Jul 8, 2022
1
0
hi does anyone fix win 10 freezes logo without dots? i use redmi note 7 lavender 2gb ram
boot into uefi and win but freezes at logo
help me :<
i use uefi in this topic because i dont have a linux pc
 
hi does anyone fix win 10 freezes logo without dots? i use redmi note 7 lavender 2gb ram
boot into uefi and win but freezes at logo
help me :<
i use uefi in this topic because i dont have a linux pc
Probably nobody yet, there is an issue with ACPI tables that needs to be fixed, as i do not own a lavender that has issues i am unable to understand what is going on, you may need to get a linux env in order to build your own UEFI and try to fix the ACPI, you can try a docker or a virtual machine under windows, however, there is a lot to do, ACPI tables should be fixed as well for eMMC to work under windows, also UEFI DXE drivers do not work for USB, so there is no USB in Windows, the touch do not work either.
 

sonic011gamer

Member
Mar 28, 2021
12
4
So this is unrelated to this device, but it's related to the pkg:
how did you calculate the right fb address for the header in FramebufferSerialPortLib, I wanna use it for development, and while it works as-is, it's not fitting on my display
 
So this is unrelated to this device, but it's related to the pkg:
how did you calculate the right fb address for the header in FramebufferSerialPortLib, I wanna use it for development, and while it works as-is, it's not fitting on my display
You need to extract uefiplat.cfg from your boot.img which contain all addresses you need, including the Display address as "Display Reserved" then use my tool to calculate the header and footer https://github.com/serdeliuk/edk2-notch-calculator
 
  • Like
Reactions: sonic011gamer

sonic011gamer

Member
Mar 28, 2021
12
4
I actually calculated it by hand in the meanwhile, I didn't think I'd find a right formula on the internet /s
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    So this is unrelated to this device, but it's related to the pkg:
    how did you calculate the right fb address for the header in FramebufferSerialPortLib, I wanna use it for development, and while it works as-is, it's not fitting on my display
    You need to extract uefiplat.cfg from your boot.img which contain all addresses you need, including the Display address as "Display Reserved" then use my tool to calculate the header and footer https://github.com/serdeliuk/edk2-notch-calculator
    1
    You need to extract uefiplat.cfg from your boot.img which contain all addresses you need, including the Display address as "Display Reserved" then use my tool to calculate the header and footer https://github.com/serdeliuk/edk2-notch-calculator
    yes that's the address I needed, as for the Display FB address I know where to get it, thanks
  • 4
    [UPDATE 22 Jan 2022]
    - partial fix for ACPI tables which allow to boot windows
    - added startup.nsh to automatically run in shell

    -----

    Hello,

    I started to port EDK2 to my Lavender, Xiaomi Redmi Note 7 in order to bring Windows to this device.
    So far i was able to fix ClockDxe that makes, for the first time, the eMMC working on a EDK2 port.

    The device is able to boot Windows PE from eMMC
    I am still working to fix USB for boot, mouse and keyboard in the first phase.
    Anyone interested can download my buttons and clocks patches and build his own EDK2 port from my GitHub repo at https://github.com/serdeliuk/edk2-lavender

    Best regards,


    Marc


    eMMC.PE.boot.jpg
    1
    1. Install dependencies

    ```
    # On Ubuntu 18.04
    sudo apt install -y build-essential uuid-dev iasl git nasm python3-distutils gcc-aarch64-linux-gnu abootimg bspatch p7zip-full zip python-pip
    ```
    ```
    # On Debian 11
    sudo apt install -y build-essential uuid-dev iasl git nasm python3-distutils gcc-aarch64-linux-gnu abootimg bspatch p7zip-full zip pip
    ```
    ```
    sudo pip install uefi_firmware
    ```

    2. Clone edk2 and edk2-platforms repositories

    ```
    git clone https://github.com/tianocore/edk2.git --recursive

    git clone https://github.com/tianocore/edk2-platforms.git
    ```
    3. Download Released File and Unzip

    ```
    wget https://github.com/serdeliuk/edk2-lavender/releases/download/2/edk2-lavender.0.0.2.zip

    unzip edk2-lavender.0.0.2.zip
    ```

    4. Edit ` edk2-lavender/RedmiNote7Pkg/RedmiNote7Pkg.dsc`. uncomment the line below that contain RegisterFilterLib

    ```
    [LibraryClasses]
    # RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
    ```

    ```
    [LibraryClasses]
    RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
    ```

    5. Place your `xbl.elf` extracted from a firmware update in xbl folder
    6. Run `bash xbl-extract.sh` inside xbl folder
    7. Run `bash xbl-extract.sh` inside xbl folder
    8. Run ` make -C your_path/edk2-lavender/../edk2/BaseTools/Source/C `
    9. Run ` bash build.sh `
    10. Run ` fastboot flash boot uefi.img `
    1
    Is there way to enable some type of log, or verbose?
    I have doubts that will help as your issue is in windows not in EDK2, but, yes, you can enable debugging in EDK2, for this you will need to enable SerialFrambufferLib

    In edk2-lavender/RedmiNote7Pkg/RedmiNote7Pkg.dsc
    move the # from first line to the next one

    Code:
    #SerialPortLib|RedmiNote7Pkg/Library/FrameBufferSerialPortLib/FrameBufferSerialPortLib.inf
      SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
    This way the serial interface will be switched to screen
    Then fine-tune log level in edk2-lavender/RedmiNote7Pkg/CommonDsc.dsc.inc
    gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000

    The value of above varialbe 0x80000000 show only errors, you can increase the debug level by increasing the number, in the same file above the line are details about what should be added depending on the debug scope.
    i use 0x80000042 in general, meaning
    # DEBUG_ERROR 0x80000000 // Error
    plus
    # DEBUG_INFO 0x00000040 // Verbose
    plus
    # DEBUG_WARN 0x00000002 // Warnings

    Due to huge output you may want to use the delay variable inside the serialframbufferlib to add a delay after each line is printed.

    In edk2-lavender/RedmiNote7Pkg/Library/FrameBufferSerialPortLib/FrameBufferSerialPortLib.c

    // 1000000 = 1s
    // 500000 = 0.5s
    // 100000 = 0.1s
    UINTN delay = 50; // 0.00005s

    delay is set to very low value, try 0.5s (seconds)
    1
    Can you try to install "Device Info HW" and do some screen shots with general, soc, system first part, screen and memory?
    Yes, there is just windows logo
    Screenshots
    1
    I can confirm I have the same specifications as you :)