VBE enabling
Posted: Sat Jul 31, 2010 1:57 pm
I am following the official VBE 3.0 specs to enable the protected mode entry point that I need to get VBE going. I made sure to download an lgpl'd VGABIOS and fix my bochsrc, but when I scan my 32Kb copied BIOS image, I cannot find the PMID signature... So when I make sure that everything I'm doing looks correct, I get to thinking maybe the VBE specs are outdated or incorrect. Maybe. I'm just wondering is the BIOS image always at 0xC0000 like the specs say? And is it safe to assume the BIOS image is 32Kb, like the specs say?
What I did was copy the 32Kb at 0xC0000 to 0x10E000, which is a 9 page area in my kernel dedicated to holding the copied BIOS and enabling VBE. The copy worked. I used my simple _mem_cpy function and checked and double checked that it was working properly. It is. The problem is not the copy. I can see the problem being one of three things:
- The location of the original BIOS in RAM is incorrect (0xC0000)
- The size of the original BIOS in RAM is incorrect (0x8000)
- The scan isn't working properly.
However, I really don't think it's the latter because it's a very simple function that I've recoded a number of ways to test for different bugs and it's had the same outcome of "PMID NOT FOUND" every time. Here is the code:
Anyway, here's an image verifying that the memory copy is working and that the signature is not being found:
The "No" on one line followed by "Yes" on the next are the results of calling the _dbg_yes and _dbg_no routines and since "No" is there, the signature wasn't found.
Help appreciated,
Brodeur235
What I did was copy the 32Kb at 0xC0000 to 0x10E000, which is a 9 page area in my kernel dedicated to holding the copied BIOS and enabling VBE. The copy worked. I used my simple _mem_cpy function and checked and double checked that it was working properly. It is. The problem is not the copy. I can see the problem being one of three things:
- The location of the original BIOS in RAM is incorrect (0xC0000)
- The size of the original BIOS in RAM is incorrect (0x8000)
- The scan isn't working properly.
However, I really don't think it's the latter because it's a very simple function that I've recoded a number of ways to test for different bugs and it's had the same outcome of "PMID NOT FOUND" every time. Here is the code:
Code: Select all
global _setup_vbe
_setup_vbe:
; setup stack frame
push ebp
mov ebp,esp
pushad
; Following Exact VBE 3.0 Specs
; =============================
; Step 1.) Allocate a protected mode buffer large enough to hold
; the entire BIOS image (32Kb normally).
; Done in the paging module.
; Step 2.) Copy the BIOS image from the 0xC000 physical memory
; region to the protected mode buffer.
push DWORD 0x00008000 ; 32 kb = 0x8000 bytes
push DWORD 0x000C0000
push DWORD 0x0010E000
call _mem_copy
add esp,DWORD 0x0C
; Step 3.) Scan the BIOS image for the PMInfoBlock structure
; and check that the checksum for the block is 0.
mov ecx,DWORD 0x10E000
add ecx,DWORD 0x8000
sub ecx,DWORD 0x04
mov eax,DWORD 0x10E000
.next_check:
; check if counter reached limit
cmp eax,ecx
jz .not_found
; check for signature
cmp DWORD [ds:eax],0x504D4944 ; "PMID"
jz .found
; increment counter and loop back around
inc eax
jmp .next_check
.not_found:
call _dbg_no
.found:
call _dbg_yes
; jump to end (over code)
jmp .done
; data
.data:
.PMInfoBlock dd 0x00000000
; end
.done:
; clean up stack frame
popad
mov esp,ebp
pop ebp
ret
The "No" on one line followed by "Yes" on the next are the results of calling the _dbg_yes and _dbg_no routines and since "No" is there, the signature wasn't found.
Help appreciated,
Brodeur235