flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Accessing Video Card RAM? Goto page 1, 2, 3 Next |
Author |
|
revolution 27 Dec 2007, 21:14
rhyno_dagreat wrote: would I do that directly like any other memory (e.g. move the memory address into ebx, and then store values using [ebx]) or do I have to access it somehow through my PCI/AGP/PCIe bus? |
|||
27 Dec 2007, 21:14 |
|
rhyno_dagreat 27 Dec 2007, 21:25
Well, it would be for my own OS.
But if that's the case, then what's up with having to read from/ write to ports for the PCI (e.g. Dex's Sound card program)? Or is that in the case of a processor on it? |
|||
27 Dec 2007, 21:25 |
|
revolution 27 Dec 2007, 21:29
You gotta set resolutions/colours/mapping/etc. thats what ports are for.
Download the specs for your card. It will tell you how to set memory ranges and things. |
|||
27 Dec 2007, 21:29 |
|
rhyno_dagreat 27 Dec 2007, 21:31
I wish I could, but nVidia wouldn't give out information if their lives depended upon it.
|
|||
27 Dec 2007, 21:31 |
|
dosin 27 Dec 2007, 21:36
What graphics mode are you using?
Last edited by dosin on 27 Dec 2007, 21:57; edited 2 times in total |
|||
27 Dec 2007, 21:36 |
|
rhyno_dagreat 27 Dec 2007, 21:46
I would like to use hardware 800x600x32 (if possible).
I would also like to use hardware 2D drawing routines, maybe 3D in the future. |
|||
27 Dec 2007, 21:46 |
|
dosin 27 Dec 2007, 21:50
Ya! Thats the mode I am working on..
all you need to do is set the mode you want: 0x4115 =800*600 Here is a link to a post for a VesaDemo.zip that Dex4u made: http://board.flatassembler.net/topic.php?t=7037 Dex4u has helped me a lot with this and if you look back in the forum there are different stuff like creating fonts in this mode.. Last edited by dosin on 27 Dec 2007, 22:24; edited 1 time in total |
|||
27 Dec 2007, 21:50 |
|
vid 27 Dec 2007, 22:06
rhyno: It is possible to locate address of video framebuffer by listing PCI devices. Feryno found this method recently.
But switching modes can hardly be done in some general way, you'd have to code card-specific driver, or call VESA, or something like that. |
|||
27 Dec 2007, 22:06 |
|
rhyno_dagreat 27 Dec 2007, 22:25
Ah, I see. But as far as being able to tell what functions are which on the card, that's not standardized among all/most cards, is it?
Just an example, not to be taken literally: Function1 - PutPixel(DWORD XCoord, DWORD YCoord) |
|||
27 Dec 2007, 22:25 |
|
DOS386 28 Dec 2007, 00:33
Quote: I wanted to access the RAM on my video card, would I do that directly like any other memory (e.g. move the memory address into ebx, and then store values using [ebx]) YES. Quote: have to access it somehow through my PCI/AGP/PCIe bus NOT "access", but maybe activate before ? Quote:
Junk range ? 16 MiB anyway ... Quote:
This seems to be the LFB Quote:
Silly IRQ + ports where you will have to deal with if ... you don't use VESA. Quote:
Seems to be VGA 2 options: - VESA (see other nice thread, avoids dealing with PCI/AGP/PCIe) - "somehow through my PCI/AGP/PCIe bus" - YES, but don't ask me about how ! (and ask card inventors why they: 1. make simple things complicated 2. then don't even release the documentation ) Quote:
Trivial as hell: LFBStart + XCoord * BytesPerPixel + YCoord * BytesPerScanline -> BOOM !!! _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug Last edited by DOS386 on 28 Dec 2007, 06:08; edited 2 times in total |
|||
28 Dec 2007, 00:33 |
|
Dex4u 28 Dec 2007, 03:54
Here the problem, you would be able to read/write to that LFB address, but first you would need to switch to the right mode, which is card specific.
Example if you code for the XBOX you would write to memory from 0xf0040000 to 0xf0086000 to write directly to screen, that as a nVidia GeForce 3MX, 64 MB of RAM graphic card. But on the Xbox the mode is set at bootup to 640x480 32bpp. But i have found this link has some good info http://coding.derkeiler.com/Archive/Assembler/alt.lang.asm/2003-11/0150.html PS: I have always had a idea, of us OS dev's comeing up with a cheap and common hardware spec, that we all use or try to get. eg: RTL8139 and a AC97 etc. |
|||
28 Dec 2007, 03:54 |
|
sinsi 28 Dec 2007, 06:00
rhyno_dagreat wrote: Ah, I see. But as far as being able to tell what functions are which on the card, that's not standardized among all/most cards, is it? Look at VESA 2 functions - with a little code, PutPixel is easy-peasy. You get the LFB address, bytes per scan line, bits per pixel - simple arithmetic (for "linear" modes - forget about "banked" modes, not worth the headf*ck). Some nvidia cards actually have VBE 3 and VBE acceleration functions, but VBE 2 has been the norm for a while. edfed, go to sleep man. Edit by Loco: The last line maybe refers to the split part that can be found here Edit by sinsi: thanks man |
|||
28 Dec 2007, 06:00 |
|
rhyno_dagreat 28 Dec 2007, 06:45
vid - Can you point Feryno to this thread with maybe an explaination of how he did it?
DOS386 - That's a lot of info. And the last bit... It acts like DOS video memory in that sense!? *smacks self in forehead* Dex - Thanks for the link, it was interesting. Sinsi - How can I get the LFB address from Vesa? edfed - Lol. I'm wondering, though. Will the LFB point at a random address as the beginning address for each mode when I start up that mode or will it be static like how memory is set in the sense of DOS video memory and such? |
|||
28 Dec 2007, 06:45 |
|
DOS386 28 Dec 2007, 07:00
> Sinsi - How can I get the LFB address from Vesa?
Download my LFB VESATEST (EXE is DOS only) : http://board.flatassembler.net/download.php?id=3472 > It acts like DOS video memory in that sense!? You can access it via $A0000...$AFFFF - but then you will have to switch silly banks. And, this banking will not avoid the need to set a mode first. > Will the LFB point at a random address as the beginning address NO. It's usually > 2 GiB and theoretically can be different for every single mode, but in fact all modes use the same address (0 - no LFB ???). But it varies from card model to model. What a luck that I finalized (ignoring 1'000'000 compiler warnings ) my VESATEST 2 days ago Last edited by DOS386 on 28 Dec 2007, 07:03; edited 1 time in total |
|||
28 Dec 2007, 07:00 |
|
edfed 28 Dec 2007, 07:02
how t launch a XBOX game in a real xbox environment?
i think there is a int 13h like function to load the game, and a jmp game.... but it' only my imagination... 640*480 32bpp .... good, project gotham racing 2 nurburgring... is there a FPU in the xbox? how to control the graphix 3D card? i want to use the pixel shader in asm, how to do? undocumented? |
|||
28 Dec 2007, 07:02 |
|
rhyno_dagreat 28 Dec 2007, 07:25
DOS386 - Finalize it how?
Note - how do I run this? Window's won't let it run. |
|||
28 Dec 2007, 07:25 |
|
DOS386 28 Dec 2007, 07:32
rhyno wrote:
> how do I run this? Window's won't let it run. I had written: > VESATEST (EXE is DOS only) rhyno had written even before: > Well, it would be for my own OS. Then you will have to shut down "Windows" as well _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
28 Dec 2007, 07:32 |
|
rhyno_dagreat 28 Dec 2007, 07:35
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. =-/ |
|||
28 Dec 2007, 07:35 |
|
DOS386 28 Dec 2007, 19:10
> What can I run it with? MiniDOS?
NO. DPMI32 app requiring file I/O. > It won't work in MiniDOS... Yeah ... MiniDOS isn't complete (see FAQ). > Time to try FreeDOS... if it will work YES. It's supposed to and works for me. _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
28 Dec 2007, 19:10 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.