user2997204
user2997204

Reputation: 1384

Draw a pixel with VGA in long mode

How do I draw a pixel with AT&T assembly in long mode? I've already enabled VGA mode in the real mode state.

Upvotes: 1

Views: 1029

Answers (1)

Stephen Duffy
Stephen Duffy

Reputation: 505

My rep is only 1 so I cant comment but if you'll accept this as a partial answer you should investigate bitplanes. Mode 13 is easy peasy because it all fits in less than 64k at 0xA000 (64000 bytes) but when the graphics mode needs more memory than 64k the VGA adapter employs the overly complicated solution of bitplanes.

A bit plane is a 64k chunk of memory stored on the VGA controllers internal memory which contains at least 4 of these "banks". You need to talk to the VGA controller using the in and out instruction for the relevant ports so as to tell the VGA adaptor which bank you want mapped onto the 0xA000 segment and then you work on the 0xA000 via mov,xor,and, etc as you would with Mode 13.... but.... heres where it gets complicated.

These banks dont just appear as contguous blocks for all Modes. In 16bit and 24bit colour modes, a singly byte in a bank can represent just one of the RGB components and the final output is infact a combination of all the bitplanes overlapping one another like three slides on a projector screen but you can only manipulate one slide at a time having to talk to the VGA controller via IN and OUT instructions to to tell it what bank you want to use.

If memory serves me correct, the VGA controller is a 16 bit bus that needs to be talked to one byte at a time making it even more annoying. Im not sure of the ports but you'll find them on any list thats out there.

Sorry its not a full answer, but a path to investigate. "VGA bitplanes".

Upvotes: 1

Related Questions