I'm surprised Rust is letting you do this at all (modifying a mutable static -- or even interacting with one -- is unsafe). Try storing all your contextual data (I'm assuming this is the VGA buffer) in a struct, then use the lazy_static crate to initialize it on its first use. (I'd highly recommend you also use the spin crate and lock a spinlock around it to prevent a data race.)
Finally, ensure your running on the nightly channel; OS Development requires a lot of unsafe and unstable features
. Some crates that will help you greatly:
x86_64 - allows you to use some asm instructions and read/write to some CPU registers
uart_16550 - serial port output (but not input)
volatile - ensures that volatile reads/writes to memory are not optimized away
spin - great, handy, useful spinlocks
pic8259_simple - simple interaction with the 8259 PIC (I still don't know how to use the APIC, am trying to get ACPI in haha)
pc-keyboard - decoding and processing of keys. (Don't use this as your sole keyboard processor though, build a keyboard driver -- its much better that way IMO)!
raw-cpuid - easy CPU identification
cpuio - CPU IO to ports
bit_field - easy manipulation of bit fields