MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / set_attributectl_reg

Function set_attributectl_reg

src/graphics/vga/mod.rs:774–794  ·  view source on GitHub ↗

Set attribute control register

(idx: u8, val: u8)

Source from the content-addressed store, hash-verified

772
773// Set attribute control register
774fn set_attributectl_reg(idx: u8, val: u8)
775{
776 interrupts::without_interrupts(||
777 {
778 // Input status register
779 let mut isr: Port<u8> = Port::new(INPUT_STATUS_REG);
780
781 // Address
782 let mut address: Port<u8> = Port::new(ATTRIBUTE_ADDRESS_DATA_REG);
783
784 unsafe
785 {
786 // Reset to address mode
787 isr.read();
788 let tmp = address.read();
789 address.write(idx);
790 address.write(val);
791 address.write(tmp);
792 }
793 })
794}
795
796
797// Set color

Callers 1

initFunction · 0.85

Calls 2

readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected