Jump to content











Photo
- - - - -

another BIOS without AHCI switch

ahci bios bootmgr grub4dos

  • Please log in to reply
No replies to this topic

#1 mcluskyism

mcluskyism
  • Members
  • 1 posts
  •  
    Italy

Posted 04 June 2023 - 10:21 PM

Hi all, here is my first post.
Searching the forum, my problem looks like https://reboot.pro/i...&hl=+bios +ahci
I too have a BIOS with no AHCI option, and after many more attempts, I'm trying to work around it like this:

  • USB floppy drive, I already own it and tested working
  • FreeDOS plus an XMS driver (XMGR by Jack R. Ellis)
  • CWSDPMI to enter protected mode
  • (maybe borrowed from ex buildbot.flashrom.org) a setpci.exe to carry my ICH7-M chipset from IDE (8086:27c4) to AHCI (8086:27c5) - during a Debian boot sequence, with a well populated initramfs, just write setpci -s 0:1f.2 90.b=40 at the end of a grub2 stanza
  • and this is where in DOS the internal SSD vanishes due to not implementing ports, this is where I would need an "AHCI driver" for DOS hard disk or something similar and before it is loaded winload.exe and the CriticalDeviceDatabase
  • (borrowed from https://reboot.pro/i...hl=+patch +ahci ) if i could access the internal SSD i could then use my self-compiled grub4dos to chainload Windows 7 bootmgr which resides into the vanished disk, first MBR partition

I have discussed all of the above here as well ( https://superuser.co...-not-in-windows ) ( https://www.bttr-sof...?id=7412#p20313 ) but feel free to ask, if something is not clear.
I am open to advice and suggestions, if there are other avenues to explore, something that for example includes a hacked bootmgr.

My best and thanks for attention



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 June 2023 - 08:07 AM

I am not sure to understand the "final" goal.

 

Is it just to run a given OS on that PC in AHCI mode ?

 

If I get this right, your PC is a (old Sony) laptop that has a "normal" BIOS but that for *some reason* has not a AHCI/SATA mode option in the BIOS.

 

What problems (if any) do you have in running it in IDE mode?

 

:duff:

Wonko 



#3 mcluskyism

mcluskyism
  • Members
  • 1 posts
  •  
    Italy

Posted 05 June 2023 - 01:49 PM

Good morning Wonko, it is an honor to speak with you smile.png

Yes, I would like to force a Windows 7 to see an SSD in AHCI mode from the start of the boot sequence.

And yes, you're right, my old (but bought NOS) netbook has a "normal" (dumbed) BIOS without a AHCI/SATA mode option, and I don't have enough courage and skill to attempt a modding and a reflash.

Why would I want to use it in AHCI?

For example, because my SSD brand has an application to update its firmware, which however only works in Windows - no party for Linux and apples or oranges also.

And because this modern bad habit annoys me a lot, for which one buys a device or an OS but then can use it only for what the manufacturer has decided can be done (I won't mention names to avoid complaints).

For now I've tried grub4dos, but if you can think of anything else, please feel free.

My best



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 June 2023 - 03:44 PM

I understand, but I don't know if it is worth the time/hassle, if it works normally in IDE emulation mode.

 

Expecially on an oldish motherboard you don't have that many real world advantages in operating in SATA when compared to IDE compatibility mode, NCQ is nice but overall not so relevant and you don't need hot swapping for an internal device, the difference in speed for data transfers may be noticeable, but hardly so on older motherboards.

 

Modding the BIOS would be the "natural" solution, provided that you can find someone with the right experience/knowledge, the exact make/model would be important to know as many manufacturers do not actually modify the BIOS code, they simply hide the choice and there are "unblocked" BIOSes for many models.

 

I don't know if the DOS (or in the case of the WIndows 7 the BOOTMGR which actually has initial code in real mode that is not too different from DOS) gets the info about the controller mode, i.e.if it somewhere that grub4dos cannot reach or cannot change or if it is in a modifiable on-the-fly sort of table, this may depend on the speciic BIOS/machine :unsure:.

 

The grub4dos AHCI patch by schtrom AFAICU provides access as SATA/AHCI to grub4dos but this faster access is (and should be) only temporary and the channel needs to be closed (uninit) before continuing booting the OS, so it is not useful for what you want to do.

 

What you want/need is something capable of altering the DSDT at boot, grub4dos can do that, example:

https://github.com/M...AD/ACPI-Patcher

but what needs to be changed is to be seen, there is some related info on Macintosh related forums such as insanelyMac or tonymacx86 , though cannot say if "portable" to your PC.

 

Here:

 

https://www.techinfe...t&comment=29656

 

(though used for other scopes) there is a reference to an old tool capable of modifying the DSDT from DOS, that may be useful though the issue remains about "what" to write.

 

Are you sure that your SSD firmware upgrade tool does not work in IDE compatibility mode? 

 

Does that BIOS provide no choice or it does provide IDE and RAID? (I remember there were some HP and possibly also Asus laptops that needed to be  setup in RAID (0) mode).

 

:duff:
Wonko

 

 

 

 



#5 mcluskyism

mcluskyism
  • Members
  • 1 posts
  •  
    Italy

Posted 05 June 2023 - 07:11 PM

Hi, I start from the end:

Are you sure that your SSD firmware upgrade tool does not work in IDE compatibility mode?

 

I haven't tried it, but if I stay at the manufacturer's site ... https://www.kingston...ical/ssdmanager

 

To use Kingston® SSD Manager, you must have:

  • One or more Kingston® SSDs (doh!)
  • AHCI mode set in BIOS (f*ck!!!)
  • Administrator privileges in Windows® (Oh my! Linux Root is not enough???)

 

Does that BIOS provide no choice or it does provide IDE and RAID?

 

 

nah, no choice, no RAID or nothing.

 

But the links you copied to me look interesting (thanks!) so I try to take some time to delve into the DSDT topic.
I know for sure that in the community of apple eaters someone tried to translate the equivalent of the command setpci -s 0:1f.2 90.b=40 into DSDT as well as trying to patch the MBR code and also modify the grub legacy stage1, and I've also read several ViDock / eGPU related forums.
Whether I'll be able to figure anything out remains to be seen biggrin.png
Anyway, thanks again for the tips, my best


#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 June 2023 - 02:54 PM

I had another look around and found a couple interesting links:

 

https://dreamlayers....-on-ich7-m.html

 

in the comments there is a reference to an old post via Wayback Machine:

 

https://web.archive....478-ich7-m.html

 

(I presume by the same nando4 which is also a member on reboot.pro)

 

that points out how it would be possible to use the good ol' (and (in)famous) "XP Kansas City Shuffle" (or "Fake Signature Method"):

 

https://web.archive....showtopic=21242

 

http://reboot.pro/in...?showtopic=6672

 

But I cannot remember if the same approach did work for Windows 7 or however something similar has been done. :dubbio:

 

:duff:

Wonko 



#7 mcluskyism

mcluskyism
  • Members
  • 1 posts
  •  
    Italy

Posted 06 June 2023 - 06:57 PM

Hi, you've caught the mother of all threads, and if you read the comments, you will find a couple of a certain Federico ... that's me, in the real world wink.png

https://dreamlayers....-on-ich7-m.html

 

exactly what inspired me the solution that works in Debian, and which I then re-proposed, with a few personal additions and some operational details, on superuser.com

After that, following the other link on the Wayback Machine, I also tried to interpret the batches that were posted by nando4 by reading and re-reading the Intel® I/O Controller Hub 7 (ICH7) Family Datasheet in parallel ( https://www.intel.co...-datasheet.html ).

With partial success: using schtrom's grub4dos also as a diagnostic support, adding other setpci strings in Datasheet order (as I understand it a little bit so far), I went from not having any AHCI chipset recognized to having the chipset identified, but no port implemented.

But then I stopped due to ignorance, unfortunately I have no experience as a software writer, just a lot of passion.

I post the last sequence on my Google Drive https://docs.google....dit?usp=sharing (values from 10.W to 24.L I extracted with lspci from my Debian running in ACHI).

As an example of what I don't understand, page 526 describes the GHC—Global ICH7 Control Register, which should have an Address Offset equal to ABAR + 04h–07h ... and how do I translate it into setpci???

In the end, ATM, circa

"XP Kansas City Shuffle" (or "Fake Signature Method")

 

I could try to explore it, but in the posts you linked to me you're right, there is no explicit mention of tests conducted from Vista onwards, and unfortunately as we know from Vista onwards the Winzozz boot system changed from Dawn to Dusk (yes, I am citing The Smashing Pumpkins tongue.png ).

Still my best



#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 07 June 2023 - 11:48 AM

Yes, the whole stuff was intended for a different scenario, booting (indirectly) from something that had no "real mode" support (or had it with much slower transfer speeds) but that once the Windows drivers kicked in had proper support (or a faster transfer speed).

 

Typically that was used on motherboards that only offered 1.1 speeds in BIOS but actually had 2.0 ports or that had USB ports but not bootability for them in BIOS.

 

That made more sense in XP times, as later motherboards had "proper" USB support in BIOS and it had anyway a practical application only or some particular motherboard/on peculiar systems with limited BIOS.

 

The idea was to start booting from a mem mapped reduced system up to the point where the "protected mode" part of the OS kicked in, at which moment the disk/device from which the OS was initially booted would disappear but - through a "clever" modification of the MBR code so that it had the same checksum as another (till then unseen) device - the "real" device would be used instead.

 

Since the USB 1.1 was extremely slow, the "chainboot" image needed to be as small as possible, so the kicker image contained only the bare-bare minimum needed files, in your case it could also be a "full install" image (of course made on the smallest possible volume for the image) so you wouldn't have the issue of finding which files are actually needed.

 

What I don't know is whether anyone tested this approach with Vista or 7 with success or failure, XP had two mechanisms to verify that the device was the "right" one, the MBR disk signature (easily duplicable in an image) and the MBR checksum (worked around by the modifiers calculated by the program by s4e), but it is entirely possible that Vista or 7 introduced some other checks.

 

In the original thread on 911cd Dietmar does make a reference to Windows 7, but I cannot remember/cannot find any more exact report (if any ever existed).

 

:duff:

Wonko



#9 mcluskyism

mcluskyism
  • Members
  • 1 posts
  •  
    Italy

Posted 07 June 2023 - 04:44 PM

OK, thanks for the exchange, the suggestions and the information, there is always more to learn cool.png

At this point, if it's not a problem, I'd still leave this thread open, in the hope that some PCI configuration space expert (perhaps nando4?) will try to consider the foolish idea of writing "by hand" the bareminimum of registers necessary to enable SATA and AHCI and implement the port to which the vanishing SSD is connected, starting from a real (Free)DOS environment and with setpci.exe

Compared to the sequences recalled in the link on the Wayback Machine (again by nando4), with some personal modification sewn to measure on my netbook, as mentioned I arrived at a certain point, hoping I hadn't completely got the suit's size wrong biggrin.png

But I don't know how to go further, I really lack the basics to translate for example the famous GHC Address Offset equal to ABAR + 04h-07h ...

where in the blessed PCI configuration space are one supposed to write this?

And how do one consider the sum of 04h-07h???

During my study process, to help myself, I've prepared a spreadsheet that I share on my Google Drive to anyone who can be useful, that translates hexadecimal values into binary while paying attention to the difference in endianness between the outputs of setpci and lspci.

 

https://docs.google....dit?usp=sharing

 

Inside the spreadsheet, there are also comparison formulas that I use to highlight the differences in lspci output taken in both DOS stuck in IDE and Debian running in AHCI.

 

Thanks again for everything, my best







Also tagged with one or more of these keywords: ahci, bios, bootmgr, grub4dos

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users