Re: Implementing a Function to Switch Standard VGA Video Mod
Posted: Tue May 24, 2016 11:56 pm
Why not pause just a second to see if you promote any useful discussion with your diatribe?
The Place to Start for Operating System Developers
http://f.osdev.org/
I really want to see difficult and hard to find things become trivial, define the basics and then do the same with the most advanced topics. I really prefer to keep talking in implementation terms of full code that drive a specific software or hardware device. This is what I'd like to see in other posts to discuss in this way and to ask in function of code.iansjack wrote:That's a very worrying statement. This guy intends to swamp the forums with noise rather than putting onformation in the proper place - the Wiki. That will ruin the forum as a place for discussion.I intend to do it with the rest of elements that involve OS development. Absolutely everything about hardware and software. They are so many, but it's necessary to cover them once and for all from all of the very most basics.
Code: Select all
VGA_Attribute_Controller__EnablePalette:
push eax
push edx
;Reset flip/flop
;;
mov dx,0x3DA
in al,dx
;Set bit 5 to enable palette
;(this bit is contained in the
;index register):
;;
mov dx,0x03C0
mov al,00100000b
out dx,al
;Reset flip/flop again to realign
;access to the Attribute Controller port:
;;
mov dx,0x3DA
in al,dx
pop edx
pop eax
ret
Code: Select all
;//Input parameters:
;//---------
;//$DX: Input Port (0x3D4 color; 0x3B4 monochrome)
;//
;//AH: Bit 7 protects (1) or unprotects (0) CRTC registers 0-7.
;// The other bits are ignored. -
;// 10000000b -- protect registers
;// 00000000b -- unprotect registers
;// -
;//
;//Outputs:
;//---------
;//
;//Effect:
;//---------
;// This function unprotects the write of CRTC registers 0-7
;// which normally cannot be written.
;///
VGA_protect_unprotect_CRTC_regs:
push eax;
push edx;
;//Correctly force to 0 bits 0-6 of this bit set
;//for a future OR operation:
;///
and ah,10000000b;
;//We want to access CRTC register at offset 0x11:
;///
mov al,0x11;
;//Set the index register of the CRTC:
;///
out dx,al
;//Point to the data register 0x3D5 (color) or 0x3B5 (mono) to truly
;//reconfigure the bits with protection enabled/disabled:
;///
inc dx;
;//Save the register and set bit 7, protection bit,
;//to the specified value to protect/unprotect registers 0-7:
;///
in al,dx
and al,01111111b
or al,ah;
;///
;//We don't need to set the CRTC index register again.
;//We assume that no other code running will modify it
;//while we are doing this:
;///
out dx,al
pop edx;
pop eax;
ret