flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Accessing Video Card RAM?

Goto page Previous  1, 2, 3  Next
Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 28 Dec 2007, 20:13
Quote:
vid - Can you point Feryno to this thread with maybe an explaination of how he did it?

I think he comes online only when he is in work... i'd quess by 2nd january. Send him a PM.

I do have that code, but i am not sure if I am supposed to give it away Smile
Post 28 Dec 2007, 20:13
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 28 Dec 2007, 20:19
rhyno_dagreat wrote:
DOS386 - I failed to read it! I apologize. What can I run it with? MiniDOS?
It won't work in MiniDOS... Time to try FreeDOS... if it will work. =-/

MiniDos is a very basic Dos clone, many function are not implemented, i was hope coder would add to it, to make it better, but so far its not happened and i have little time.

When you set up vesa you need to call a function that fills out a Mode_Info, you can get the LFB address from eg: ModeInfo_PhysBasePtr

See the example from cdpod

For programming the Xbox see here: http://www.xbdev.net/non_xdk/nonxdk.php


Description:
Download
Filename: vesa.inc
Filesize: 2.18 KB
Downloaded: 460 Time(s)

Post 28 Dec 2007, 20:19
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 794
Location: Adelaide
sinsi 29 Dec 2007, 00:27
> Sinsi - How can I get the LFB address from Vesa?

Here's one of my first fasm programs - a bit crap, but shows some stuff


Description:
Download
Filename: VESAINFO.zip
Filesize: 2.33 KB
Downloaded: 465 Time(s)

Post 29 Dec 2007, 00:27
View user's profile Send private message Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat 29 Dec 2007, 19:55
Thank you all for the info!

I'm thinking if we each with our different video cards can use Fenryo's method of figuring out the base pointer for a certain mode, then we can compile a open-listing of different lfb addresses for different modes for different graphics cards.

But it would be nice for us all to figure out how to change modes without VESA, but through ports (if possible, which I think it would be.)
Post 29 Dec 2007, 19:55
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 30 Dec 2007, 00:10
> But it would be nice for us all

YES.

> to figure out how to change modes without VESA,
> but through ports (if possible, which I think it would be.)

1. It definitely is possible.

2. There is no quick hack to discover. It's card specific, and messy. Linux reportedly has some open source graph "drivers" - compiled into the kernel (???) - OTOH the guys are "open" for closed source drivers as well (provided by card manufacturers, as for "Windows") - check Linux source (C mixed with GAS, not what I personally prefer) Sad

Maybe some Linux experts can reveal more details ? Rolling Eyes
Post 30 Dec 2007, 00:10
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 Dec 2007, 01:40
Dos386 is right. It *is* possible, info how to do it already is in linux sources. It's just to find it.
Post 30 Dec 2007, 01:40
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin 30 Dec 2007, 03:37
Her is a website that has linux open source drivers...

http://www.viaarena.com/default.aspx?PageID=2&OSID=25&CatID=2580

just click on the ones avail and download..

Though its all in C style code.. It still can be helpfull!
Post 30 Dec 2007, 03:37
View user's profile Send private message Reply with quote
Raedwulf



Joined: 13 Jul 2005
Posts: 375
Location: United Kingdom
Raedwulf 31 Dec 2007, 16:04
rhyno, you might like to have a look at this:
http://web.inter.nl.net/users/be-hold/BeOS/NVdriver/index.html
Post 31 Dec 2007, 16:04
View user's profile Send private message MSN Messenger Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat 01 Jan 2008, 19:04
Thanks Raedwulf!

I'm going to email this guy and ask him how he got his info, because it seems he knows something we all don't. Very Happy
Post 01 Jan 2008, 19:04
View user's profile Send private message Reply with quote
Raedwulf



Joined: 13 Jul 2005
Posts: 375
Location: United Kingdom
Raedwulf 02 Jan 2008, 08:43
Apparently before linux was too popular with video drivers, there was some agreements to release various info.

I'm however toying with another idea, what if you can wrap the windows drivers and use it? Something like ndiswrapper but for video drivers. Is this even possible? I wonder...

Tasks would include:
Windows 2000 Display Driver Interface OR WDF (for vista drivers)
ABI translation (esp. for 64-bit)
Host operating system Display Interface...

The benefits of starting a wrapper, is any hobbyist OS could maybe in the far distant future support 3d graphics cards... and games Very Happy.
Post 02 Jan 2008, 08:43
View user's profile Send private message MSN Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 02 Jan 2008, 08:52
To make a wrapper you only have to know which OS functions the drivers use and emulate them. So I think it would be possible although not necessarily easy.

However for Vista, with it's DRM requirements. you may be SOL on that count Sad It would be interesting to see if a Vista driver could be successfully fooled into believing it was in a secure environment.
Post 02 Jan 2008, 08:52
View user's profile Send private message Visit poster's website Reply with quote
Raedwulf



Joined: 13 Jul 2005
Posts: 375
Location: United Kingdom
Raedwulf 02 Jan 2008, 09:16
I think Windows 2000 drivers are the way to go because:
1.) Better compatibility
2.) Lighter/better performance
3.) Less api to deal with as you said revolution Smile

But thanks for the vote of confidence, at least im not a mad hatter after all hehe Smile
Basically the inspiration for this is, there is Windows, Linux and MacOSX (and a bit of FreeBSD) which take up the majority of the userbase, and all other OSes are ignored because there is no 3d acceleration. (This may be true or untrue Razz) but with 3d acceleration, who knows? At least for people like us, it would be fun to play quake3 on something like menuetos.

_________________
Raedwulf
Post 02 Jan 2008, 09:16
View user's profile Send private message MSN Messenger Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 02 Jan 2008, 10:52
http://www.reactos.org/en/index.html - they aim to be binary compatible for windows drives. Oh, and check http://www.tinykrnl.org/ as well.

Edit: oh bollocks, tinykrnl has been shut down Sad
Post 02 Jan 2008, 10:52
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 02 Jan 2008, 11:42
Raedwulf wrote:
I think Windows 2000 drivers are the way to go ...
For 64bitness then Vista or XP drivers will be needed.
Post 02 Jan 2008, 11:42
View user's profile Send private message Visit poster's website Reply with quote
Raedwulf



Joined: 13 Jul 2005
Posts: 375
Location: United Kingdom
Raedwulf 05 Jan 2008, 21:23
windows 2000 and xp share the same api according to microsoft, so i guess 64-bit api is similar

_________________
Raedwulf
Post 05 Jan 2008, 21:23
View user's profile Send private message MSN Messenger Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 05 Jan 2008, 21:28
2000 and XP are very similar yes (NT5.0 and NT5.1), there's kernel changes on XP though, and some changes in userland win32 API as well... but I think drivers written for one should basically run out of the box for the other.

The ISSUE, however, is not 2000 vs. XP, it's 32 vs 64 bits. You can't just use drivers for one mode in the other.

Also, XP64 is actually based on 64bit win2k3 server code, not 32bit XP code... but again, 2k3 server is still NT5.x afaik.
Post 05 Jan 2008, 21:28
View user's profile Send private message Visit poster's website Reply with quote
Feryno



Joined: 23 Mar 2005
Posts: 514
Location: Czech republic, Slovak republic
Feryno 07 Jan 2008, 11:56
1. method: int 10h - vesa call - returns dword of framebuffer memory
; ---
2. method: PCI scan - this method is able to handle qword address of framebuffer (perhpas good for computers with 4 GB of RAM or more but I have an idea where frambuffer is still under 4 GB limit in such configs... needs test on such machine)
this method uses allmost every new OS, including win - you can see various memory and port ranges in device manager
;---
After obtraining the framebuffer memory, YOU MUST MAP THAT MEMORY into virtual memory space if your OS runs under protected mode !!! You mustn't write directly into framebuffer memory under protected mode without mapping it somewhere... It is e.g. 1 API under win - less than 10 instructions or about 20-40 instructions under OS you are developping
I'll post win64 sample driver how to do it, but I'll manage it not earlier than the day after tomorrow.
Don't worry, you'll be able to improve it further, e.g. not to obtain only the start of framebuffer, but to obtain the end of framebuffer too (as you can see it in win device manager).
Post 07 Jan 2008, 11:56
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 07 Jan 2008, 13:23
Okay - the question remains - are there ANY graphics cores broken until today? Is is possible (of course it is, when you've got infinite amount of time) to reverse-engineer only ONE card, say the upcoming N9x core from nVidia and test the reverse-engineered sample say, on MenuetOS? I'd like to see how much difference does VESA have in speed compared to flipping frames in that fast hardware and having all those fancy Blit operations with AntiAliasing and Transparency Razz

Is it too much to ask (rhetorical)...
Post 07 Jan 2008, 13:23
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
rhyno_dagreat



Joined: 31 Jul 2006
Posts: 487
Location: Maryland, Unol Daleithiau
rhyno_dagreat 07 Jan 2008, 15:11
Madis, we're trying to figure out a way around reverse engineering graphics drivers. Wink
Post 07 Jan 2008, 15:11
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 08 Jan 2008, 01:36
Quote:
After obtraining the framebuffer memory, YOU MUST MAP THAT MEMORY into virtual memory space if your OS runs under protected mode !!! You mustn't write directly into framebuffer memory under protected mode without mapping it somewhere..


NOT true. You must map if you have paging enabled ... you can "directly" write to $E800'000 or whatever if you don't use paging Idea

Quote:
1. method: int 10h - vesa call - returns dword of framebuffer memory
; ---
2. method: PCI scan - this method is able to handle qword address of framebuffer


Maybe ... but still very insufficient Crying or Very sad Writing into the LFB won't have any (useful) effect without setting the mode before ... and there is no universal method to do except VESA Sad

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 08 Jan 2008, 01:36
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3  Next

< 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


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.