flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > DOS > How to temporary modify BIOS

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 226
Location: film "CandyMan" directed through Bernard Rose
How to temporary modify BIOS

Code:

; Example how to temporary modify video BIOS and enable high resolution modes on my NVIDIA GeForce 9600 GSO 512

                org     100h

Start:          cli
                call    ChipsetOpen
                mov     ax,0xC000
                mov     fs,ax
                mov     word [fs:4695h],0xC3F8  ;clc / ret - all modes as valid for this monitor
                call    ChipsetClose
                sti
                ret

ChipsetOpen:    mov     ecx,0xC0010010
                rdmsr
                mov     [xC0010010+0],eax
                mov     [xC0010010+4],edx
                or      eax,80000h
                wrmsr
                mov     ecx,268h
                rdmsr
                mov     [xC000+0],eax
                mov     [xC000+4],edx
                inc     ecx
                rdmsr
                mov     [xC800+0],eax
                mov     [xC800+4],edx
                inc     ecx
                rdmsr
                mov     [xD000+0],eax
                mov     [xD000+4],edx
                inc     ecx
                rdmsr
                mov     [xD800+0],eax
                mov     [xD800+4],edx
                inc     ecx
                rdmsr
                mov     [xE000+0],eax
                mov     [xE000+4],edx
                inc     ecx
                rdmsr
                mov     [xE800+0],eax
                mov     [xE800+4],edx
                inc     ecx
                rdmsr
                mov     [xF000+0],eax
                mov     [xF000+4],edx
                inc     ecx
                rdmsr
                mov     [xF800+0],eax
                mov     [xF800+4],edx

                mov     ecx,268h
                mov     eax,18181818h
                mov     edx,eax
                wrmsr                   ; C000-C7FF
                inc     ecx
                wrmsr                   ; C800-CFFF
                inc     ecx
                wrmsr                   ; D000-D7FF
                inc     ecx
                wrmsr                   ; D800-DFFF
                inc     ecx
                wrmsr                   ; E000-E7FF
                inc     ecx
                wrmsr                   ; E800-EFFF
                inc     ecx
                wrmsr                   ; F000-F7FF
                inc     ecx
                wrmsr                   ; F800-FFFF
                ret

ChipsetClose:   mov     ecx,268h
                mov     eax,[xC000+0]
                mov     edx,[xC000+4]
                wrmsr
                inc     ecx
                mov     eax,[xC800+0]
                mov     edx,[xC800+4]
                wrmsr
                inc     ecx
                mov     eax,[xD000+0]
                mov     edx,[xD000+4]
                wrmsr
                inc     ecx
                mov     eax,[xD800+0]
                mov     edx,[xD800+4]
                wrmsr
                inc     ecx
                mov     eax,[xE000+0]
                mov     edx,[xE000+4]
                wrmsr
                inc     ecx
                mov     eax,[xE800+0]
                mov     edx,[xE800+4]
                wrmsr
                inc     ecx
                mov     eax,[xF000+0]
                mov     edx,[xF000+4]
                wrmsr
                inc     ecx
                mov     eax,[xF800+0]
                mov     edx,[xF800+4]
                wrmsr
                mov     ecx,0xC0010010
                mov     eax,[xC0010010+0]
                mov     edx,[xC0010010+4]
                wrmsr
                ret

xC000           dd      ?,?
xC800           dd      ?,?
xD000           dd      ?,?
xD800           dd      ?,?
xE000           dd      ?,?
xE800           dd      ?,?
xF000           dd      ?,?
xF800           dd      ?,?
xC0010010       dd      ?,?



_________________
smaller is better
Post 11 Nov 2015, 18:24
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.