The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: ArtemESC on April 08, 2006, 07:59:19 PM

Title: Low-level interface with video-memory...
Post by: ArtemESC on April 08, 2006, 07:59:19 PM
 How make it without using of BIOS interrupts?
  WritePixel, ReadPixel, ChangeVideopage
Title: Re: Low-level interface with video-memory...
Post by: BogdanOntanu on April 08, 2006, 09:45:36 PM
You must give us more details about what and why you want to do it like this...
Nobody can guess what is inside your mind so you will not get answers unless you describe what you need more clearely...

Basic answer: you can not.

You are supposed to use the interfaces provided to you by the Operating System.

Some of those interfaces for different Operating systems are: GDI, DirectX, OpenGL, VESA, Framebuffer, SDL, MESSA, etc

Some interfaces do offer you direct access to the video memory buffer content and by this you can write your own PutPixel etc routines... some do not...

Anyway graphics done pixel by pixel are very slow...

Very low level could also mean that you will have to make a driver for each video board available in PCs.
The information for doing this is not available and usually secret for important new boards like ATI or NVidia.



Title: Re: Low-level interface with video-memory...
Post by: MichaelW on April 08, 2006, 10:27:35 PM
ArtemESC,

I moved this topic and your ASSUME topic because the code you posted in the ASSUME topic is 16-bit DOS code, and, as Bogdan stated, you cannot interface directly to the video memory, or to the display controller, from a Windows app.

The attachment is a simple 16-bit DOS program that shows the essential thing that the VGA BIOS does to change the active display page. Under Windows 2000/XP the program properties must be set to run it full screen. If the properties are set to run it in a window, it will still run full screen, but it will not be able to receive input from the keyboard.

For WritePixel and WriteLine, try searching this forum.





[attachment deleted by admin]
Title: Re: Low-level interface with video-memory...
Post by: ArtemESC on April 09, 2006, 07:31:58 AM
>>MichaelW
Why did my topic moved? I asked it for 32-bit processors.
 
      I write the program without support any OS, therefore memory is completely available...
Title: Re: Low-level interface with video-memory...
Post by: MichaelW on April 09, 2006, 09:12:29 AM
The "16 bit" in the name of this forum does not refer to 16-bit processors, but to 16-bit real-mode programs. In your assume thread you posted code for a 16-bit real-mode program, and the low-level access you are asking about here cannot reasonably be done from a Windows program.

Title: Re: Low-level interface with video-memory...
Post by: BogdanOntanu on April 09, 2006, 11:49:22 AM
It can be somehow done via a kernel mode driver in Windows but this looks much too complicated (and kind of useless) for the poster's assumed level of expertize. That is why I have asked for details about the poster's expertize, target and specifications of the task at hand.

Moderators are not to be take llightly on this forum ... so Michael had all the reasons to move the post based on his own assumptions... mainly because the original poster failed to provide the answers to the questions.

Should you provide this information we might consider moving the post again to a better place to get the right exposure and attention.

It is somehow clear to me that we do not understand what you want to do or achieve ...
Please explain...
Title: Re: Low-level interface with video-memory...
Post by: ArtemESC on April 09, 2006, 03:20:06 PM
>>...kernel mode driver in Windows...<<
  I write a program for boot sector and don't understand how write and read pixels of video-memory...
Title: Re: Low-level interface with video-memory...
Post by: MichaelW on April 09, 2006, 05:36:38 PM
ArtemESC,

What display hardware are you targeting? Will you be doing this from real mode or protected mode?

Title: Re: Low-level interface with video-memory...
Post by: ArtemESC on April 12, 2006, 04:06:11 PM
>>MichaelW
      Protected-mode...   
Title: Re: Low-level interface with video-memory...
Post by: MichaelW on April 12, 2006, 07:47:04 PM
Ok,

Protected mode, but you did not state what video hardware you are targeting. I think there are only two reasonable choices, VGA and SVGA. VGA would be by far the easiest. As far as I know the VGA has no protected mode features, so access to the display memory works the same for protected mode as it does for real mode. For SVGA, VBE3 introduced a new Protected Mode Entry Point that can be used to directly call the VBE functions as 16-bit protected mode code, and a hardware linear frame buffer that provides direct access to the display memory. Unfortunately, this feature is not supported by many or most SVGA implementations.

I posted a VESA information program here (16-bit DOS, but it will run OK under Windows 2000 and probably XP if you set the PIF to run it full screen):

http://www.masmforum.com/simple/index.php?topic=158.msg3088#msg3088

The VESA link in the post does not work, but this should:

http://www.vesa.org/public/VBE/