rust-osdev / vga

Library to program vga hardware.
Apache License 2.0
54 stars 14 forks source link

Access VGA memory at arbitrary address #27

Closed bendudson closed 1 year ago

bendudson commented 2 years ago

The purpose of this is to support user-space VGA drivers with video memory mapped at arbitrary virtual addresses. The default behavior isn't changed except that the address type is usize rather than u32.

FrameBuffer now stores the address (usize), which is calculated in FrameBuffer::new() by combining the video memory start address (default 0xa0000) with an offset which depends on the video map mode.

The video memory start address can be set in the Vga object with the set_memory_start method:

use vga;

vga::vga::VGA.lock().set_memory_start(0xa0000);
RKennedy9064 commented 2 years ago

Thanks for this PR. Working on getting the build checks working again. Once they do and everything passes I'll merge this in.