Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I've been facing difficulty while determing the OEM string for my grpahics card. I've read the Vesa 2.0 specification which clearly states that the pointer to the OEM string is a far pointer which resides somewhere below 1MB ( I'm not talking about the OEM Vendor Name just the OEM string).But i don't seem to find any string at all. Since I do this stuff in my bootloader, here's the code in assembly:
The value oem_string_ptr is passed to the kernel as the packed structure in the memory(with other values such as memory size, adress of frame buffer etc. all packed as a table in memory). I retrieve the oem_string_ptr from the memory from my kernel but the oem_string_ptr seems to point to the location where no string exists. Have I missed something?
Last edited by Chandra on Fri Oct 29, 2010 6:01 am, edited 1 time in total.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
are you actually using it as a segment:offset address, and not a 32-bit address?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
You folks realize that this is not valid assembly?
Have you tried to print the original value (what is it?) and determine for yourself what the correct physical address should be?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
You folks realize that this is not valid assembly?
I know that very well. Its not worth mentioning it that the assembler reports it as a 'mismatch in operand sizes'.It should be mov ax,WORD [VESAINFO+8]. Anyway, that's not what I am having problem with. Any more help please?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
add eax, WORD [VESAINFO+8]
(...) mov ax,WORD [VESAINFO+8]
Start with finding a substitute that actually does what the original intended to do. This one is plain broken. No wonder you got the wrong values. (hint: you need more than one instruction)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
mov ax, [VESAINFO+6]
mov si, [VESAINFO+8]
mov es,ax ;es:si = far pointer to OEM string
If this doesn't work, check that the routine you're using to print strings can handle far pointers (and if it doesn't, maybe consider writing an alternative version of it that uses "es lodsb" instead of just "lodsb", or "mov al,[es:si]" instead of just "mov al,[si]").
Of course it's also possible that the video card doesn't bother with the OEM string - it's not like it serves any practical purpose (and not like video card manufacturers actually implement everything VBE says they should correctly).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Thank you Gigasoft. I need to retrieve the OEM string in protected mode(from my kernel) and your code to change far ptr to near ptr works awesome. Thank you Brendan too for real mode code. And thank you all.
Great!
Programming is not about using a language to solve a problem, it's about using logic to find a solution !