| Recommended by Wim's BIOS... |
|
Moderator: Moderators
A866 mov ecx,0x3a ; MSR 0x3A
A86C rdmsr ; read
A86E bt eax,0x0 ; don't try to change it if it is already locked
A873 jc 0xa88d ; skip MSR 0x3A logic
A875 push ax
A876 mov ax,0x195 ; NVRAM setting to check
A879 call 0xf000:0x4120 ; check NVRAM stored setting
A87E pop ax
A87F jz 0xa886 ; If VMX disabled, skip ** replace with 2 NOPs (0x90) **
A881 bts eax,0x2 ; Enable VMX
A886 bts eax,0x0 ; Lock MSR 0x3A
A88B wrmsr ; write=BCPNVS PnP NVRAM Storage=
NVRAM Total Size: 0x2000
NVRAM Max. Config Space: 0x1FFF
NVRAM Base Address: 0xFFF80000
ESCD Total Size: 0x2000
ESCD Segment Address: 0x8000
NVRAM Leading Control Area: 0x00000000
NVRAM Leading Data Area: 0x0000I would like to experiment a bit myself with that BIOS issues. Would you please be so kind as to tell me how you managed the BIOS trace you reported? A short sequence of the steps and tools required would really be appreciated. Thanks in advance
IntuitiveNipple wrote:I'm writing a kernel module to change the setting in NVRAM.
It is based on the PnP BIOS code with some NVRAM-layout specific additions.
$ ndisasm -a -p intel -b 16 input.bin > output.dasm0000A855 0FA2 cpuid
0000A857 25FF0F and ax,0xfff
0000A85A 3DE106 cmp ax,0x6e1
0000A85D 722E jc 0xa88d
0000A85F 660FBAE105 bt ecx,0x5
0000A864 7327 jnc 0xa88d
0000A866 66B93A000000 mov ecx,0x3a ; MSR VMX control
0000A86C 0F32 rdmsr
0000A86E 660FBAE000 bt eax,0x0
0000A873 7218 jc 0xa88d
0000A875 50 push ax
0000A876 B89501 mov ax,0x0195
0000A879 9A204100F0 call 0xf000:0x4120
0000A87E 58 pop ax
0000A87F 7405 jz 0xa886 ; ZF set == VMX disabled
0000A881 660FBAE802 bts eax,0x2 ; Enable VMX
0000A886 660FBAE800 bts eax,0x0 ; Lock MSR until power cycle
0000A88B 0F30 wrmsr
$ sudo su
$ modprobe nvram
$ hexdump -C /dev/nvram
$ vmx-enable -e
VMX-enable version 0.1 © 2007 TJ http://intuitivenipple.net
Licensed on the terms of GPL version 3
Enables VMX (for supported BIOS's only).
Enabling VMX
114 bytes read
CMOS VMX flag: 0 (disabled)
CMOS Checksum (calculated): 0x06C6
CMOS Checksum (stored): 0x06C6
**Simulation only**
Doing VMX enable with mask 0x40
Byte 3 (before updating flag): 0x87
Change mask 0x40
Byte 3 ( after updating flag): 0xC7
CMOS VMX flag: 1 (enabled)
Checksum (calculated): 0x0706
Finished
There is a tool out there, called symcmos from Phoenix Ltd, e.g. here:
http://www.filewatcher.com/b/ftp/ftp.su ... y.0.0.html
I own a SZ1XP (architecture is very similar to other VAIOs based on Intel Core Duo (2)) and used it to enable the VT feature by means of a dos bootdisk and dumping my original cmos settings:
symcmos -v2 -lcmos.sav
editing register 399 from [0000] to [0001] and loaded the modified settings back:
symcmos -v2 -ucmos.sav
Now the catch: this register is possibly only valid for my model and the latest available Bios (R0092N0) for it - so it's still somewhat risky to find the correct register by trial/error. Also there are a lot of them... but it's doable. I only found one show-killer - a single register will pop up a red line and asks something like: "Do you really want to enable Service/Rescue Mode? (y/n)" --> don't get tempted, it's a trick (or an old leftover or something else): if you press 'y', anything which prints more than a few lines out will freeze the system - even the bios menu itself. If something goes terribly wrong (like this show-killer)- you need to either run the tool again with parameter -d (clear cmos) or if you can't do this anymore, disassemble the laptop and disconnect the cmos battery.
By the way, I also tried the other way and used this Phoenix Bios Editor Pro tool (V2.1) - just do a search on the intel.com download center for "phoenix" and get BiosEdit2100.zip - they intented it for logo change, but it's the real deal to even build bios images. I am sure, it would work great, if Sony isn't so much "stay customized with every piece of OEM product you've bought in": A modified bios (where e.g. the VT feature is enabled) is generated without errors or warnings, BUT it will destroy any ACPI related functionality and do other nasty things, if really flashed. This means: WinXP will not boot anymore (BSOD) and Linux will work only when pnpbios and acpi is disabled. Without WinXP you can't flash a good bios back - so you are basically lost: no DOS tools or Phoenix CRISIS recovery disk will save you: Sony made sure of it (bios image and flash procedure is customized and there is no DOS version available).
Needless to say that you void your warranty and will possibly turn your laptop into a brick if you follow any of my instructions - for me it worked out fine and if I've found the info I just posted it would have saved me a lot of time and stress
Cheers,
Bernhard
-------
> I assume the process is change a register, boot the
> test app, see if the VT bit is set. If not, run the
> cmos change app restore the register, change the next
> register. Repeat.
You could do it that way (change only registers which are set to [0000] and leave all other alone) one by one and spend a lot of hours or you could just set the first half of all zeroed registers to one, check if the VT bit is set, if no: restore your original cmos and try the other half - if yes: only change half of the registers to one within the found set, check again and repeat (binary search principle).
But I would try register 399 (on line 210 of the generated cmos file) first - maybe you're lucky!
> I am afraid I might brick this FZ190. Of course I
> guess worst case with method one I could just pull
> the CMOS battery, right? Is there any chance of
> bricking using method one?
Not that I could think of. If I'd design the bios, I would not ultimately trust the settings read from cmos (there could be corruption or a changed layout after a bios update where the checksum is still valid for invalid data) and thus would not trigger any functionality which permanently bricks the boot process.
Good luck and let me know about the outcome, if you try it!
-------
'Restore Defaults' will change all settings back. Like I said, there is only one range (or even only one register) which could cause real troubles - maybe (after I played a little bit more around) unrelated to the register which causes the red lined question during boot up to turn on 'Service/Repair/Debug mode': So I highly recommend to get rid of boot/bios passwords and fingerprint protection (if your notebook has one) - so that you can at least boot into DOS and clear the CMOS without the need to open the laptop and remove the battery (which, by the way, works great too).
Sorry, no performance tests - currently not even a VMware installation and I wouldn't expect any or much gains there: a guest has already run only within a margin of 5-10% slower than on real hardware before VT was there.
Although I update the CMOS checksum in registers 0x2E-0x2F
* Checksums over the NVRAM contents are managed by this driver. In case of a
* bad checksum, reads and writes return -EIO. The checksum can be initialized
* to a sane state either by ioctl(NVRAM_INIT) (clear whole NVRAM) or
* ioctl(NVRAM_SETCKS) (doesn't change contents, just makes checksum valid
* again; use with care!)
ROMEXEC1.rom.dasm-394-00000541 B08D mov al,0x8d
ROMEXEC1.rom.dasm-395-00000543 E670 out 0x70,al
ROMEXEC1.rom.dasm-396-00000545 E471 in al,0x71
ROMEXEC1.rom.dasm-397-00000547 2480 and al,0x80
ROMEXEC1.rom.dasm-398-00000549 B48D mov ah,0x8d
ROMEXEC1.rom.dasm-399-0000054B 86C4 xchg al,ah
ROMEXEC1.rom.dasm-400-0000054D E670 out 0x70,al
ROMEXEC1.rom.dasm-401-0000054F 86C4 xchg al,ah
ROMEXEC1.rom.dasm:402:00000551 E671 out 0x71,al ; CMOS write
ROMEXEC1.rom.dasm-403-00000553 BA7210 mov dx,0x1072
ROMEXEC1.rom.dasm-404-00000556 ED in ax,dx
ROMEXEC1.rom.dasm-405-00000557 2500FC and ax,0xfc00
ROMEXEC1.rom.dasm-406-0000055A 0DFF03 or ax,0x3ff
ROMEXEC1.rom.dasm-407-0000055D EF out dx,ax
seg004:0E6E updateCRC proc far ; CODE XREF: sub_4462+B2
seg004:0E6E ; sub_45A6+EA ...
seg004:0E6E
seg004:0E6E ptrPDM = dword ptr -0Ah
seg004:0E6E
seg004:0E6E enter 0Ah, 0
seg004:0E72 push 0Ah
seg004:0E74 push 4E56h
seg004:0E77 push 0Ch
seg004:0E79 mov ax, word ptr addrPDM
seg004:0E7C mov dx, word ptr addrPDM+2
seg004:0E80 mov word ptr [bp+ptrPDM+2], dx
seg004:0E83 mov word ptr [bp+ptrPDM], ax
seg004:0E86 call [bp+ptrPDM]
seg004:0E89 add sp, 6
seg004:0E8C or ax, ax
seg004:0E8E jz short exit
seg004:0E90 push ax ; char
seg004:0E91 push seg seg004
seg004:0E94 push offset errorUpdatingCRC ; "Error %X updating NVRAM CRC\n"
seg004:0E97 nop
seg004:0E98 push cs
seg004:0E99 call near ptr printError
seg004:0E9C
seg004:0E9C exit: ; CODE XREF: updateCRC+20
seg004:0E9C leave
seg004:0E9D retf
seg004:0E9D updateCRC endp
seg004:0BBE getDispatchManager proc far ; CODE XREF: _main+22
seg004:0BBE
seg004:0BBE value = word ptr -8
seg004:0BBE address = dword ptr -4
seg004:0BBE
seg004:0BBE enter 0Ch, 0
seg004:0BC2 mov [bp+address], 0F0000000h ; Scan in steps of 0x0010 from here
seg004:0BCA mov [bp+value], 0FFF0h ; End Of Table marker?
seg004:0BCF jmp short isValidModuleEntry
seg004:0BD1 ; ---------------------------------------------------------------------------
seg004:0BD1
seg004:0BD1 isModulePDM: ; CODE XREF: getDispatchManager+61
seg004:0BD1 push 4 ; size_t
seg004:0BD3 push seg seg004 ; string2
seg004:0BD6 push offset signaturePDM ; "$PDM"
seg004:0BD9 push word ptr [bp+address+2] ; MSW
seg004:0BDC push ax ; string1
seg004:0BDD call _strncmp
seg004:0BE2 add sp, 0Ah
seg004:0BE5 or ax, ax ; Is it Phoenix Dispatch Manager?
seg004:0BE7 jnz short next
seg004:0BE9 mov ax, word ptr [bp+address] ; LSW
seg004:0BEC mov dx, word ptr [bp+address+2] ; MSW
seg004:0BEF mov bx, ax
seg004:0BF1 mov es, dx
seg004:0BF3 mov cl, es:[bx+5] ; count
seg004:0BF7 sub ch, ch
seg004:0BF9 push cx ; count
seg004:0BFA push dx ; PDM table entry
seg004:0BFB push ax
seg004:0BFC nop
seg004:0BFD push cs
seg004:0BFE call near ptr calcModuleTableEntryChecksum
seg004:0C01 add sp, 6
seg004:0C04 or al, al ; table entry checksum 0?
seg004:0C06 jnz short next
seg004:0C08 les bx, [bp+address]
seg004:0C0B mov ecx, es:[bx+7] ; address of Phoenix Dispatch Manager
seg004:0C10 mov addrPDM, ecx
seg004:0C15
seg004:0C15 next: ; CODE XREF: getDispatchManager+29
seg004:0C15 ; getDispatchManager+48
seg004:0C15 add word ptr [bp+address], 10h
seg004:0C19
seg004:0C19 isValidModuleEntry: ; CODE XREF: getDispatchManager+11
seg004:0C19 mov ax, word ptr [bp+address]
seg004:0C1C cmp [bp+value], ax ; end of table?
seg004:0C1F ja short isModulePDM
seg004:0C21 leave
seg004:0C22 retf
seg004:0C22 getDispatchManager endp
jmp far ptr 6CE8h:0E6FE4313hI think we could help each other on this, and record our progress here for others to share. What do you think?
Return to In-depth High-tech BIOS section
Users browsing this forum: No registered users and 0 guests