flat assembler
Message board for the users of flat assembler.

Index > Main > INT 13 handler?

Author
Thread Post new topic Reply to topic
gabiz_ro



Joined: 20 Feb 2010
Posts: 66
gabiz_ro 09 Mar 2010, 04:14
After a patch to chipset registers (made by loading a PCI option rom) I've managed to switch controller from legacy IDE to SATA AHCI.
This option is missing in bios so I need this trick to enable ahci.
Problem is after POST bios still report my disk as is was detected as result I'm unable to boot from hdd.
Booting some linux from external drive seems to be ok,disk is in AHCI mode can be detected and accessed.
Now I think I need to call INT13 handler to update my disk info in fixed disk parameters table or update what bios think and see about my disk.
I search a lot about this but can't find some real solutions.
Can somebody help me or tell me how to do this ?
Post 09 Mar 2010, 04:14
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 09 Mar 2010, 04:52
Maybe the provided Int13 handler cannot handle SATA AHCI mode at all?

Perhaps you could defer the controller configuration to a later time like those cracks for Windows 7 to make the computer look like OEM?

Another approach would be to replace the Int13 handler and setup the controller at the boot loader stage (this was done in old computers not supporting LBA, for instance, I think one was called "On Track" or so). The problem here is that you'll need to write the handler unless you're extremely lucky of finding one (perhaps you may attempt to switch modes and see if the BIOS's handler magically works here).

BTW, What are the tangible advantages of AHCI? Will your hardware really take advantage of AHCI instead of merely support the interface?
Post 09 Mar 2010, 04:52
View user's profile Send private message Reply with quote
gabiz_ro



Joined: 20 Feb 2010
Posts: 66
gabiz_ro 09 Mar 2010, 05:54
Thanks for responses.
First time I try a grub patch but all I get was geometry error.That patch works for others brands with same chipset but not for Dell.
With mi pci option rom is like those who crack win7,they load slic and certs I rewrite chipset registers.
But this enclosed Dells,even if my option rom is fine,tried also isa option rom,bios won't load in normal way,only if I replace pxe lan boot and choose network boot will load.
As for advantages I think they are and in near future I planned to upgrade to SSD and in that case AHCI is must.
Post 09 Mar 2010, 05:54
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 09 Mar 2010, 06:11
Quote:

With mi pci option rom is like those who crack win7,they load slic and certs I rewrite chipset registers.

But in the case of those cracks it is done after boot, but in the very earlier stages of Windows start up sequence. Here, your BIOS would already detected the disk and even read and executed the boot loader without problems. However, it is possible that the stage is either too earlier or to late for this... On Linux the story could probably be different, as the kernel is loaded to memory completely and also the initrd. Just before passing control to the kernel changing to AHCI might work.
Post 09 Mar 2010, 06:11
View user's profile Send private message Reply with quote
gabiz_ro



Joined: 20 Feb 2010
Posts: 66
gabiz_ro 09 Mar 2010, 14:01
Most of cracks using option rom is between POST and booting,as far as I know,just recent I saw something included in bootloader himself.
There are few option rom for raid (useless for me) and found two option rom with AHCI bios,one from Intel,one from Phoenix.I inserted my patch into them but still not working,
Intel PCI option rom - error
Phoenix ISA option rom -error
Both complaining about controller.
I think is need for controller initialization bypass then maybe will work.
Post 09 Mar 2010, 14:01
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 09 Mar 2010, 15:39
gabiz_ro wrote:
I think is need for controller initialization bypass then maybe will work.
Only if you've done proper initialization yourself.

OS (not only boot loader) that you're trying to boot uses int 13 to access HDDs and doesn't support AHCI?
Post 09 Mar 2010, 15:39
View user's profile Send private message Reply with quote
gabiz_ro



Joined: 20 Feb 2010
Posts: 66
gabiz_ro 09 Mar 2010, 18:05
Sorry for wrong expression.
I want to say is need for bios or controller steps which redetect my fixed disk.
As I read on few places fixed disk parameter table area can be updated.But this code is way to far for me,since few days ago I take contact with asm.
Post 09 Mar 2010, 18:05
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 09 Mar 2010, 20:31
gabiz_ro,

If the OS that you're trying to boot supports AHCI, why do you need to implement int 13 AHCI support during the boot stage? After it OS will use it's own SATA drivers and ignore your int 13 anyway.

If it doesn't, well, which feature that is not available in legacy mode do you need? NCQ? Hot plug? Port multiplier?
Post 09 Mar 2010, 20:31
View user's profile Send private message Reply with quote
gabiz_ro



Joined: 20 Feb 2010
Posts: 66
gabiz_ro 09 Mar 2010, 21:27
Sseems I can't explain right in english.
Let's try other ways.
-power up computer.
-bios initialization
-bios detect hardware,including disk parameters etc
-option rom is executed (controller is switched to AHCI)
Now: -bios don't know that and assume disk is in same configuration
-bios seek for boot devices but can't get access to disk where he was detected.

Then if booting Freedos by example,from usb, I get error messages like "Error reading partition table on disk"
Bios report my disk as it was detected (something like is not refreshing this info)
Ex:
Some programs like sdisk eddinfo extdisk report me model and some info about my disk parameters but this is happening even if I remove disk from notebook,so bios once disk was detected save thin details and never update this.
But if I run AHCCMDT test program from ata-atapi.com he can find and test my disk and all is ok from that side,and from linux (booted from usb too) all is ok.

My problem is not with operating sistem is in bios stage,bios can't load bootloader from disk.
Bios try to boot from inexistent disk
Maybe is not implemented in bios that switch of access from I/O ports in legacy to memory space in AHCI.
Post 09 Mar 2010, 21:27
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 09 Mar 2010, 23:07
gabiz_ro,

I understand what you're trying to do but don't understand why. Do you think transfer rate will reach the sky in FreeDOS when you switch to AHCI? ATA HAS (IDE) and AHCI are just different standards to talk to SATA controller, which runs natively anyway (and BM IDE interface provides access to AHCI registers). NCQ may be an issue, but hot-plug… do FreeDOS support it?

In short: will you accept the burden of writing complete driver which implements int 13 functions using AHCI?
Post 09 Mar 2010, 23:07
View user's profile Send private message Reply with quote
gabiz_ro



Joined: 20 Feb 2010
Posts: 66
gabiz_ro 09 Mar 2010, 23:27
Why you insist so much on FreeDos?
I'm not planning to use it. I use it for the moment when I cant boot from internal hdd and for the moment and during testing FreeDos and linux are alternatives.
Since I'm planning to upgrade to ssd I want to take full advantage.
Don't know about your opinion but mine is AHCI is better than emulated IDE.
Post 09 Mar 2010, 23:27
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 09 Mar 2010, 23:31
baldr, I think the Int13 support is just for the very early stage of operating system loading (the boot loader for instance). If he switch to AHCI too early he may probably need to have a custom Int13 handler as the BIOS's one will probably can't work and the boot loader or early OS loading stages will need it.

My suggestion was not to use a ROM patch approach, instead make something like some Win7 cracks do (not all are based on patching the BIOS or having an expansion ROM, some are really loaded in some Windows loading stage). If this fails then yes, probably writing an Int13 handler and also filling some tables will be required..
Post 09 Mar 2010, 23:31
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 10 Mar 2010, 00:12
LocoDelAssembly,

Yes, something (usually BIOS or RAID option ROM) should be able to fulfill int 13 requests from BIOS/OS loader to boot properly. Writing complete driver that will be thrown out after OS initialization looks like overkill for me.

__________
gabiz_ro,

I've mentioned FreeDOS as an example of OS without AHCI support. Linux seems to support AHCI. AHCI mode initialization seems to be more complex than MAP setting, and if BIOS doesn't contain code that talks to SATA using AHCI, somebody should write it beforehand. Would you? Remember, that code will be unused after AHCI-ready OS loads.
Post 10 Mar 2010, 00:12
View user's profile Send private message Reply with quote
gabiz_ro



Joined: 20 Feb 2010
Posts: 66
gabiz_ro 10 Mar 2010, 00:57
One of this could be the problem:
-bios don't know to talk to sata using ahci or
-once disk detected bios will keep that info and not search for any changes.
I'll try to disassembly few AHCI bios option rom what I found to remove part of controller initialization and uso only AHCI bios.
Post 10 Mar 2010, 00:57
View user's profile Send private message Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 295
Alphonso 10 Mar 2010, 02:56
Loco has made some very good points.

I went through this same thing with my notebook except I wanted IDE and the notebook offered only AHCI. To have done it through the boot loader would have meant having to write a new int 13h handler Sad
In the end all it needed was a bit to be changed in the BIOS to switch from AHCI to IDE. Very Happy
Perhaps you to have this option hidden away. Less options for users, less chance of something being set wrong and costing support time I suppose.
Post 10 Mar 2010, 02:56
View user's profile Send private message Reply with quote
gabiz_ro



Joined: 20 Feb 2010
Posts: 66
gabiz_ro 10 Mar 2010, 14:10
Yes Alphonso,in many cases is right. But my bios even is a Phoenix one based is Dell proprietary bios one and until recent there was no way to extract some modules or to do other things.And bios settings I suppose is stored in kbc EMC5004 because after bios update setting are still the same,here is stored and password to.Even if bios chip is flashed by external programmer this password and settings will remain unchanged.
I did one test on my laptop and one acer and using mhdd as test program
both powered without disks on acer after inserting on the fly disk i can get mhdd to detect disk but on my Dell if I try that disk isn not even powered no spinning no activities,nothing.
Post 10 Mar 2010, 14:10
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.