Struct vga::vga::Vga

source ·
pub struct Vga {
    pub general_registers: GeneralRegisters,
    pub sequencer_registers: SequencerRegisters,
    pub graphics_controller_registers: GraphicsControllerRegisters,
    pub attribute_controller_registers: AttributeControllerRegisters,
    pub crtc_controller_registers: CrtcControllerRegisters,
    pub color_palette_registers: ColorPaletteRegisters,
    /* private fields */
}
Expand description

Represents a vga graphics card with it’s common registers, as well as the most recent video mode.

Fields§

§general_registers: GeneralRegisters

Represents the general registers on vga hardware.

§sequencer_registers: SequencerRegisters

Represents the sequencer registers on vga hardware.

§graphics_controller_registers: GraphicsControllerRegisters

Represents the graphics controller registers on vga hardware.

§attribute_controller_registers: AttributeControllerRegisters

Represents the attribute controller registers on vga hardware.

§crtc_controller_registers: CrtcControllerRegisters

Represents the crtc controller registers on vga hardware.

§color_palette_registers: ColorPaletteRegisters

Represents the color palette registers on vga hardware.

Implementations§

source§

impl Vga

source

pub fn set_memory_start(&mut self, video_memory_start: usize)

Set the start of video memory

The default is 0xA0000 for identity map to physical memory

Example
use vga;

vga::vga::VGA.lock().set_memory_start(0xa0000);
source

pub fn set_video_mode(&mut self, video_mode: VideoMode)

Sets the vga graphics card to the given VideoMode.

source

pub fn get_frame_buffer(&mut self) -> FrameBuffer

Gets the FrameBuffer address as specified by the Miscellaneous Output Register.

source

pub fn get_most_recent_video_mode(&self) -> Option<VideoMode>

Returns the most recent video mode, or None if no video mode has been set yet.

source

pub fn get_emulation_mode(&mut self) -> EmulationMode

Returns the current EmulationMode as determined by the miscellaneous output register.

source

pub fn load_font(&mut self, vga_font: &VgaFont)

Loads a vga text mode font as specified by vga_font.

Auto Trait Implementations§

§

impl RefUnwindSafe for Vga

§

impl Send for Vga

§

impl Sync for Vga

§

impl Unpin for Vga

§

impl UnwindSafe for Vga

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.