Dell bios, how to decompose / mod.

Discussion in 'BIOS Mods' started by wolf69, Nov 21, 2009.

  1. Enchanter

    Enchanter MDL Novice

    Oct 30, 2009
    7
    0
    0
    I can't understand why?! :confused:

    By default Windows detects ICH7-M controller as "Intel(R) 82801GBM/GHM (ICH7-M Family) Serial ATA Storage Controller - 27C4". Earlier i was thinking that the reason of this is "IDE emulation" in BIOS properties. In my imagination after enabling AHCI mode for internal disk and switching it, Windows detects internal HDD as "Intel(R) 82801GBM/GHM (ICH7-M Family) Serial ATA Storage Controller - 27C5", and requests (or F6 install) the Intel Rapid Storage Technology drivers...
    But now i'm puzzled... :g:

    Any ideas?


    Is it banal empty? Or it's unusable right now?
    There is mechanical differences in SATA and eSATA connectors... How you planing to make this?
     
  2. Apokrif

    Apokrif MDL Addicted

    Dec 7, 2008
    542
    35
    30
    gabiz_ro,
    I.e. you were not able to find ICH7 initialization code in some BIOS module and replace it with the one you need, right?
    I think, I asked you very same question few times already, but you always do something different...
     
  3. gabiz_ro

    gabiz_ro MDL Member

    Feb 2, 2010
    173
    12
    10
    Hello Apokrif
    I was not able to find right initialization sequence for ICH7.
    Sorry if you think I ignored you,I did not such thing.
    I have tried to swap few modules from Dell BIOS,even was easy (just replace module,remake CRC and flash,I was using external flasher to aviod some problems with recovery)
    In all cases I wasn't able to boot from internal HDD after switching to AHCI.

    Since switching to AHCI make unavailable optical unit and since ICH7-M is SATA I generation I have abandoned this and I have focus on SATA II express-card.

    Like I said earlier, I think on others boards BIOS configure ICH7-M for AHCI or RAID mode,depending of motherboard chipset.Then is user choice through setup menu to choose desired mode,that reflect in value of offset 90 but if BIOS is just nothing and doesn't declare memory space and doesn't enable memory space then do required steps (reset ports,spin-up drives,detect disks,enable AHCI) in the end you'll have an ICH7 configured in legacy mode and forced to switch to AHCI mode but loosing access to attached HDD.BIOS know how INT13 was mapped but when required to read data an boot earlier INT13 was not available anymore.
    Also in my case,power on without HDD next second insert hdd bay,but BIOS already searched for HDD and not found as result no power for HDD,no spinning,nothing.

    At this moment I'm happy owner of Inspiron 9400 with two WD Scorpio Black WD32000BEKT in RAID 0 (I did a mistake on notebookforum,is 320G HDD not 500,not enough money)
    I'm able to boot from RAID 0 (with a little trick,and with grub4dos to remap disks)
     
  4. Enchanter

    Enchanter MDL Novice

    Oct 30, 2009
    7
    0
    0
  5. Enchanter

    Enchanter MDL Novice

    Oct 30, 2009
    7
    0
    0
    Hello, Apokrif! Are you started this thread? (link:forum.ixbt.com/topic.cgi?id=11:34739) If you understand russian - it's very good news for me, cause i'm really needs your consultation. Contact me please.
     
  6. Apokrif

    Apokrif MDL Addicted

    Dec 7, 2008
    542
    35
    30
    gabiz_ro,
    Did get any bricks after BIOS module replacements?
    I assume, you didn’t replace menu module.
    If it’s so, even if you put a module capable of switching ICH7 into AHCI, you still need to change BIOS setting somehow to make it work (i.e. to perform switch)
    Have you tried Dell DCCU to set options unavailable in menu?

    If it worked this way, than it should work same way for Linux/windows, but it doesn’t…

    I.e. nothing needs to be done to handle int13h properly?

    I’m sure Linux kernel patch expects to boot device right after switching ICH7 to AHCI.
    IMO, it does have some additional code to work around properly.
    Windows doesn’t have it - resulting in BSOD.


    Could you clarify it - does DSDT method works for Linux with or without kernel patch?
     
  7. MarketingGuru

    MarketingGuru MDL Novice

    Apr 10, 2011
    6
    0
    0
    i am going to test this
     
  8. aascut

    aascut MDL Junior Member

    Feb 10, 2011
    53
    15
    0
    #512 aascut, Apr 18, 2011
    Last edited by a moderator: Apr 20, 2017
    Hi!
    I tried to disassemble file d510A04.rom with IDA Pro. But i got strange results from the very beginning.
    Code:
    f000:FFF0 ; ---------------------------------------------------------------------------
    f000:FFF0                 jmp     loc_4030
    f000:FFF0 ; ---------------------------------------------------------------------------
    ....
    
    f000:4030 ; ---------------------------------------------------------------------------
    f000:4030
    f000:4030 loc_4030:                               ; CODE XREF: f000:FFF0j
    f000:4030                 jmp     loc_40E8
    f000:4030 ; ---------------------------------------------------------------------------
    ....
    f000:40E8 ; ---------------------------------------------------------------------------
    f000:40E8
    f000:40E8 loc_40E8:                               ; CODE XREF: f000:loc_4030j
    f000:40E8                 cli
    f000:40E9                 cld
    f000:40EA                 wbinvd
    f000:40EC                 mov     ax, cs
    f000:40EE                 mov     ss, ax
    f000:40F0                 assume ss:f000
    f000:40F0                 xor     esp, esp
    f000:40F3                 shl     edx, 10h
    f000:40F7                 mov     sp, 40FDh
    f000:40FA                 jmp     rec_ReG_PCI_to_PCI
    ....
    f000:DA03 ; ---------------------------------------------------------------------------
    f000:DA03
    f000:DA03 rec_ReG_PCI_to_PCI:                     ; CODE XREF: f000:40FAj
    f000:DA03                 mov     dx, 0CF8h;        read port 
    f000:DA06                 mov     eax, 8000F01Ch; dev. 30 func. 0 PCI_to_PCI brige, reg. offset 1C 
    f000:DA0C                 out     dx, eax;              read reg.
    f000:DA0E                 mov     dl, 0FCh ;
    f000:DA10                 mov     ax, 0E0F0h
    f000:DA13                 out     dx, ax; write to register address base and adress limits
    f000:DA14                 mov     dx, 0CF8h
    f000:DA17                 mov     eax, 8000F004h ; PCICMD reg.
    f000:DA1D                 out     dx, eax
    f000:DA1F                 mov     dl, 0FCh 
    f000:DA21                 mov     al, 1
    f000:DA23                 out     dx, al; set bit 0 = 1,  i/o space eneble
    f000:DA24                mov     eax, 4179653Eh ; what is it? 
    f000:DA2A                out     0E8h, eax; what is a i/o port? 
    f000:DA2D                 jmp     sp
    
    I tried to find what is the port #0E8h in google, but finded only "EMS port address 0E8H- 0EFH" for some old motherbord. Who knows, what does this mean? o_O
     
  9. aascut

    aascut MDL Junior Member

    Feb 10, 2011
    53
    15
    0
    Reply to myself:
    Maybe it's a special Dell's debug port (0E8h), since it only entered the intermediate values ​​of eax.
     
  10. Apokrif

    Apokrif MDL Addicted

    Dec 7, 2008
    542
    35
    30
    I came to same conclusion early. :)
    It’s most likely PCI card with 4 x 8 segment display.
    Not sure is it can display all ascii characters.
    4179653Eh should show “Aye>”
    If you Google for PCI POST Motherboard Diagnostic Test Card, you can find it pictures.
     
  11. aascut

    aascut MDL Junior Member

    Feb 10, 2011
    53
    15
    0
    #515 aascut, Apr 29, 2011
    Last edited by a moderator: Apr 20, 2017
    Hi great GURU!
    Thank you that strengthened me in this opinion!
    Code:
    piece of code D810_A05.rom
    47D0 ; ---------------------------------------------------------------------------
    F000:47D0
    F000:47D0 control_to_Dells:                       ; CODE XREF: F000:4297j
    F000:47D0                 out     0E8h, eax       ; "Shdn";"pre ";"boot";"PmAB"
    F000:47D3                 retn                    ; to f000:429A
    F000:47D3 ; ---------------------------------------------------------------------------
    
    everything happens in a cycle, after each round to port code output
    
    PS: Apokrif thanks for your great decompress utility !
    To all
    I am not a programmer and my knowledge of English and especially in the asm are very weak but I decided to study the bios to simultaneously examine both.
    At this moment my work stoped at this fragment:
    Code:
     fragment_of_D810_A05.rom
    ....
    F000:48E0 byte_F48E0      db 4Fh, 0, 90h, 48h, 2 dup(0FFh) ; DATA XREF: F000:P_MOD_Enabler
    F000:48E6 byte_F48E6      db 6 dup(0)                                ; DATA XREF: F000:4E40r
    F000:48EC                       db 0, 4, 4 dup(0)
    ...
    F000:4E39 ; ---------------------------------------------------------------------------
    F000:4E39
    F000:4E39 P_MOD_Enable:                           ; CODE XREF: F000:429FJ
    F000:4E39                 db      66h             ; Load Global Descriptor Table Register
    F000:4E39                 lgdt    fword ptr cs:byte_F48E0
    F000:4E40                 db      66h
    F000:4E40                 lidt    fword ptr cs:byte_F48E6 ; Load Interrupt Descriptor Table Register
    F000:4E47                 mov     eax, cr0        ; eax=60000010
    F000:4E4A                 or      al, 1           ; Logical Inclusive OR
    F000:4E4C                 mov     cr0, eax        ; cr0=60000011, proc.protect mod enable
    F000:4E4F                 jmp     far ptr 8:4E54h ; Jump
    F000:4E4F ; ---------------------------------------------------------------------------
    ...
    
    I did not understand how to use GDT /IDT and how calculate new segment address. What is a value of GDTR and IDTR? Need help, explain to the easier, who knows, please.

    The Knowledge nut is very very hard
    to crack but still....
    we aren't accustomed to retreat

    :eek:
     
  12. Apokrif

    Apokrif MDL Addicted

    Dec 7, 2008
    542
    35
    30
    Google is you friend.
    There is no point is writing few pages you can find in easily.
    It want be easy to swallow (i.e. to understand), quite a lot prerequisites there :rolleyes:

    I didn’t write decompress utility.
    The code was in the BIOS already, so I rewrote it in C# only ;)
     
  13. aascut

    aascut MDL Junior Member

    Feb 10, 2011
    53
    15
    0
    #517 aascut, May 3, 2011
    Last edited by a moderator: Apr 20, 2017
    Enlightenment came pretty quickly for me.
    But number of questions is growing exponentially! :(.

    Code:
     
    fragment code D810_A05.rom
    F000:74D5 What is the D0:F1??!! there isn't device 0 function 1
    F000:74D5 in intel915 chipset?
    F000:74D5                 mov     dx, 0CF8h
    F000:74D8                 mov     eax, 80000138h  ; dev.0 func.1 ??
    F000:74DE                 out     dx, eax         ; read
    F000:74E0                 mov     dl, 0FCh ; '¹'
    F000:74E2                 mov     ax, 1000h
    F000:74E5                 out     dx, ax          ; write reg with value 1000h
    F000:74E5                                         ; or 0001000000000000b
    F000:74E6                 mov     dx, 1066h
    F000:74E9                 mov     ax, 1
    F000:74EC                 out     dx, ax ; write 0000000000000001b into port 1066h??
    F000:74ED
    F000:74ED locret_F74ED:                           ; CODE XREF: F000:7484j
    F000:74ED                 retn                    ; cs:ip=F000:42A2
    F000:74ED ; ---------------------------------------------------------------------------
    
     
  14. Apokrif

    Apokrif MDL Addicted

    Dec 7, 2008
    542
    35
    30
    #518 Apokrif, May 7, 2011
    Last edited by a moderator: Apr 20, 2017
    I do know only basic asm. When it comes to chipsets, I download Intel docs and read thoroughly... very time consuming :(
     
  15. aascut

    aascut MDL Junior Member

    Feb 10, 2011
    53
    15
    0
    #519 aascut, May 10, 2011
    Last edited: May 10, 2011
    I found a description of
    in chipset
    . Maybe when Dell's programmers adapted the code under new chip "Intel 915", this piece did not remove or they forget about it.
     
  16. Apokrif

    Apokrif MDL Addicted

    Dec 7, 2008
    542
    35
    30
    It might. BIOS modules are shared between different Dell systems.