First, you need to install WSL2 on your machine. It requires Windows 10 1903 or higher.
Open PowerShell as an administrator and type wsl --install Debian
This will enable WSL2 and install Debian - and I recommend going with it. (without Debian option it install Ubuntu).
Then we need to mount the disk in the WSL2. Execute this in Powershell and find your disk name:
GET-CimInstance -query "SELECT * from Win32_DiskDrive"
It should be something like \\.\PHYSICALDRIVEx
And to mount the drive: wsl --mount \\.\PHYSICALDRIVEx --bare
Start WSL2 with either wsl command or by going in the Start menu.
Install required packages: sudo apt install dosfstools
Execute lsblk - look for your mounted drive point. It should in the very end and should be named like this: sdX (X is whatever symbol system has assigned to it)
Step-by-step guide to partition the drive:
$ sudo fdisk /dev/sdX
# Commands in fdisk are symbols, for example `n` creates a new partition.
g # Formats the disk
n # Creating FAT32 parition
# Press Enter for defaults
Partition number (1-128, default 1): # Press enter
First sector (2048-625142414, default 2048): # Press enter
# Here you should set +50M for the size of partition
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-625142414, default 625141759): +50M
n # Creating psxitarch
Partition number (2-128, default 2): # Press enter
First sector (104448-625142414, default 104448): # Press enter
Last sector, +/-sectors or +/-size{K,M,G,T,P} (104448-625142414, default 625141759): # Press enter
x # Enter advanced options
n # Renaming partition
Partition number (1,2, default 2): 2
New name: psxitarch
r # Returning to the menu
w # Write changes to the drive
$ sudo mkfs.vfat -F32 /dev/sdX1
$ sudo mkfs.ext4 /dev/sdX2We created partitions we need.
Mount ext4 with sudo mkdir /mnt/psxitarch and sudo mount psxitarch /mnt/psxitarch.
We’re at the finishing lane, we proceed to extracting of our distro image.
Windows filesystem mount points are in /mnt, and they’re named after disk letters. In order to access the files, cd "/mnt/(your drive letter)/path/to/psxitarch_folder"
And extract! sudo tar -xvJpf psxitarch.tar.xz -C /mnt/psxitarch --numeric-owner
After that, go to PowerShell, wsl --unmount \\.\PHYSICALDRIVEx, then go to Explorer, find FAT32 partition, copy over your bzImage and external initramfs.cpio.gz.
AND YOU’RE ALL SET, CONGRATULATIONS!!!