SFI systems support

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

Xen
Posts: 24
Joined: Wed Aug 11, 2021 9:42 pm

Re: SFI systems support

Post by Xen »

Illen wrote: Sat Nov 27, 2021 12:30 am Also attached an archive with all the dumps.
Interesting info, but need MCFG region, not only table header. On your device it located at address 3EF00000, size 256kb.
Illen
Posts: 49
Joined: Mon Feb 20, 2017 7:12 pm

Re: SFI systems support

Post by Illen »

Xen wrote: Sat Nov 27, 2021 8:40 pm Interesting info, but need MCFG region, not only table header. On your device it located at address 3EF00000, size 256kb.
Ah sorry. How to dump that memory region (any tool for that, or would lspci -xxxx out be fine)?

Edit: I made a dump of whole mmconfig area with memtool.
Attachments
mmconfig.zip
(182.84 KiB) Downloaded 71 times
Last edited by Illen on Mon Nov 29, 2021 12:16 pm, edited 2 times in total.
User avatar
binarymaster
Posts: 481
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: SFI systems support

Post by binarymaster »

Illen wrote: Sun Nov 28, 2021 10:15 pm Ah sorry. How to dump that memory region (any tool for that)?
Everything is a file in Linux, so...

https://superuser.com/a/164968/402784

Something like this should work:

Code: Select all

dd if=/dev/mem of=dump.bin skip=1055916032 bs=1024 count=256 iflag=skip_bytes
Xen
Posts: 24
Joined: Wed Aug 11, 2021 9:42 pm

Re: SFI systems support

Post by Xen »

Illen wrote: Sun Nov 28, 2021 10:15 pm Ah sorry. How to dump that memory region?
How you dump first 1MB? It was physical dump? MCFG dump is fine, but seems strange that there is no realmode interrupt vector table at address 0. SFI tables is ok, but there is also no VGA BIOS and I still unable to find it.
So looking for anyone with Win8 tablet/notebook on CloverTrail platform, who can dump VGA BIOS.
Illen
Posts: 49
Joined: Mon Feb 20, 2017 7:12 pm

Re: SFI systems support

Post by Illen »

Xen wrote: Mon Nov 29, 2021 6:51 pm How you dump first 1MB? It was physical dump?
With dd, I compared the output with memtool and it looks ok.
Xen wrote: Mon Nov 29, 2021 6:51 pm So looking for anyone with Win8 tablet/notebook on CloverTrail platform, who can dump VGA BIOS.
Is there a chance that GMA 3600/3650 Video BIOS could work? It seems to be similar to the Z2760 iGPU, and these Z2760 tablets aren't very common (and most of them appear to be UEFI Class 3, so they might not have Video BIOS at all).
Attachments
memory.7z
(709.78 KiB) Downloaded 67 times
Xen
Posts: 24
Joined: Wed Aug 11, 2021 9:42 pm

Re: SFI systems support

Post by Xen »

Illen wrote: Mon Nov 29, 2021 11:02 pm With dd, I compared the output with memtool and it looks ok.
So seems there is no RM interrupt vector table on your device. Should be not critical if noone use this interrupts. On my device, dd works fine for low memory regions (and interrupts is ok), but unable to dump MCFG table.
Illen wrote: Mon Nov 29, 2021 11:02 pm Is there a chance that GMA 3600/3650 Video BIOS could work?
I hope, I already got one for GMA3600.
Illen wrote: Mon Nov 29, 2021 11:02 pm most of them appear to be UEFI Class 3, so they might not have Video BIOS at all.
Seems so, I check 2 devices, but unable to find VGA BIOS in their UEFI.
Xen
Posts: 24
Joined: Wed Aug 11, 2021 9:42 pm

Re: SFI systems support

Post by Xen »

SFI freeldr is here. This version is working and able to boot kernel (ofc, if you have working one). Limitations: no user input, delay function is hardcoded cycle.

mbexec is my tool to run raw multiboot files via kexec api. Unfortunally, native linux kexec tool is able to run only ELF files, and cant run raw files like freeldr.
Usage:
mbexec main_module cmdline module1_file module1_cmd ...
command lines must be specified, at least any string.
Example:
mbexec freeldr.sys "bootpath=xxx" VgaBiosGMA600.bin VgaBios

bootpath can be sdhci(x)emmc(x)mmcp(x)partition(x) or sdhci(x)sd(x)partition(x). If bootpath is incorrect or not specified you will see list of all avaliable paths.

Vga bios is not necessary if it is present on device or was loaded before. VGA BIOS should be passed as module with "VgaBios" cmd.
If you just dump VGA BIOS from UEFI device, it probably will not work on SFI systems without 2 patches: need to disable int15 calls, and fix delay function (avoid using of legacy timer).

I will post sources later, after I finish remain things and decide how to post it.
Attachments
sfi_freeldr.zip
(386.76 KiB) Downloaded 69 times
Illen
Posts: 49
Joined: Mon Feb 20, 2017 7:12 pm

Re: SFI systems support

Post by Illen »

Xen wrote: Wed Dec 01, 2021 6:27 pm SFI freeldr is here. This version is working and able to boot kernel (ofc, if you have working one). Limitations: no user input, delay function is hardcoded cycle.
Thanks. I tested it briefly on my device with following results:

mbexec freeldr.sys "bootpath=sdhci(1)sd(0)partition(1)" - stuck on android screen.
mbexec freeldr.sys "bootpath=sdhci(1)sd(0)partition(1)" VgaBiosGMA600.bin VgaBios - screen turns black (with backlight).
mbexec freeldr.sys "bootpath=sdhci(1)sd(0)partition(1)" VgaBiosGMA3600.bin VgaBios - blinking rainbow artifacts (like on attached photo).
IMG_20211201_202802.jpg
IMG_20211201_202802.jpg (113.77 KiB) Viewed 5213 times
In any case the device would reboot after some time (90 seconds or so). I will do more testing later.
Xen
Posts: 24
Joined: Wed Aug 11, 2021 9:42 pm

Re: SFI systems support

Post by Xen »

Thanks for testing.
Illen wrote: Wed Dec 01, 2021 10:08 pm sdhci(1)
Argument is PCI index of the SD controller, =bus*256+dev*8+func or index of its MCFG table. For your device it should be 8, 32, 33.
If freeldr.ini is located it should be loaded and may affect on screen.
Illen wrote: Wed Dec 01, 2021 10:08 pm In any case the device would reboot after some time (90 seconds or so). I will do more testing later.
Seems there is a watchdog timer. To prevent reboot it must be disabled or periodically reseted.
Illen wrote: Wed Dec 01, 2021 10:08 pm blinking rainbow artifacts
GMA 3650 Similar to the GMA 3600, but this version is clocked at 640 MHz.
Probably there is a problem - it produces video output at wrong frequency and display cannot receive it correctly. So there is 2 ways to fix it - find another BIOS, exactly matching to your device, or fix existing by adjusting clock configuration.
Illen
Posts: 49
Joined: Mon Feb 20, 2017 7:12 pm

Re: SFI systems support

Post by Illen »

Xen wrote: Wed Dec 01, 2021 11:48 pm Argument is PCI index of the SD controller, =bus*256+dev*8+func or index of its MCFG table. For your device it should be 8, 32, 33.
If freeldr.ini is located it should be loaded and may affect on screen.
Ah, so the SD card would be on sdhci(32) then. Sadly passing this bootpath didn't change the screen output.
Xen wrote: Wed Dec 01, 2021 11:48 pm
GMA 3650 Similar to the GMA 3600, but this version is clocked at 640 MHz.
Probably there is a problem - it produces video output at wrong frequency and display cannot receive it correctly. So there is 2 ways to fix it - find another BIOS, exactly matching to your device, or fix existing by adjusting clock configuration.
Is your Video BIOS from a GMA 3650 or 3600? As far as I know GMA 3600 runs at 400 MHz which would be the same frequency as the GMA on my device. The problem might be also that, unlike CloverTrail which uses SGX545, CloverTrail+ uses SGX544MP2 which is from the newer PowerVR 5XT serie. Sadly there are no CloverTrail+ based PC/UEFI platforms apparently.
Xen
Posts: 24
Joined: Wed Aug 11, 2021 9:42 pm

Re: SFI systems support

Post by Xen »

Illen wrote: Fri Dec 03, 2021 3:21 am Is your Video BIOS from a GMA 3650 or 3600?
Its from cedarwiev platform device (and gma600 from oaktrail), not sure which one exactly.
I fount where timing settings is located: GMA600: 0x1984; GMA3600: 0x1BB6

Structure:
uint32_t refclk, vco_max, vco_min;
uint8_t m1_max, m1_min, m2_max, m2_min, p1_max, p1_min;

For GMA600 there is 3 sets, but last seems unused, GMA3600 - 5 sets. Only one set is used (BIOS select it by device detection), so you need to determine which one is your and try to fix it.
Almost same parameters is used in psb_intel_find_best_PLL function of linux drivers (google it).
Xen
Posts: 24
Joined: Wed Aug 11, 2021 9:42 pm

Re: SFI systems support

Post by Xen »

SFI freeldr is complete and im ready to post sources, but any suggestion how to do it? I have a gitlab account, but idk if there is any actual ROS repo exists on gitlab? Should I clone full repo or just post modified files or something else?
RawExec (ex mbexec) is here: https://gitlab.com/XenRE/rawexec
User avatar
binarymaster
Posts: 481
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: SFI systems support

Post by binarymaster »

Xen wrote: Wed Dec 15, 2021 11:34 am SFI freeldr is complete and im ready to post sources, but any suggestion how to do it? I have a gitlab account, but idk if there is any actual ROS repo exists on gitlab? Should I clone full repo or just post modified files or something else?
RawExec (ex mbexec) is here: https://gitlab.com/XenRE/rawexec
GitHub is our primary development platform, all development and testing goes there. It would be better if you sign up there, so you can just fork the main repository, and then create SFI branch in your fork.

Here is a guide article on our wiki: https://reactos.org/wiki/Commiting_Changes

If you don't want to register on GitHub, you can probably perform full repository import into GitLab, and then create your branch there. But this will make it more complicated for developers to review and for testers to test (since our workflow is tied to GitHub).

As a secondary platform, we have our self-hosted git repository server, but it's just a read-only mirror, we don't use it to push commits.
Xen
Posts: 24
Joined: Wed Aug 11, 2021 9:42 pm

Re: SFI systems support

Post by Xen »

Sources is here: https://gitlab.com/XenRE/sfi-freeldr
I decide to pack all new/modified files to archive, you can extract it over existing ReactOS sources and build. Sources is updated to lastest version from github.
Common changes: fixes in fs.c (described above), new CallFar16 realmode function, new bootpath command line argument.
Warning: I set [set(SARCH "sfi"] in base\sdk\cmake\config.cmake so SFI build will be default. Set it back to "pc" before merging with main repository.
User avatar
binarymaster
Posts: 481
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: SFI systems support

Post by binarymaster »

Illen wrote: Fri Dec 03, 2021 3:21 am Is your Video BIOS from a GMA 3650 or 3600? As far as I know GMA 3600 runs at 400 MHz which would be the same frequency as the GMA on my device. The problem might be also that, unlike CloverTrail which uses SGX545, CloverTrail+ uses SGX544MP2 which is from the newer PowerVR 5XT serie. Sadly there are no CloverTrail+ based PC/UEFI platforms apparently.
Xen wrote: Sat Dec 04, 2021 5:07 pm For GMA600 there is 3 sets, but last seems unused, GMA3600 - 5 sets. Only one set is used (BIOS select it by device detection), so you need to determine which one is your and try to fix it.
Almost same parameters is used in psb_intel_find_best_PLL function of linux drivers (google it).
Guys check this one out:
- https://www.phoronix.com/scan.php?page= ... rVR-Vulkan

Maybe it could help here as well.
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests