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

Function init

src/graphics/vga/mod.rs:860–896  ·  view source on GitHub ↗

Initialization

()

Source from the content-addressed store, hash-verified

858
859// Initialization
860pub fn init()
861{
862 // Map palette registers to color registers
863 set_attributectl_reg(0x0, 0x00);
864 set_attributectl_reg(0x1, 0x01);
865 set_attributectl_reg(0x2, 0x02);
866 set_attributectl_reg(0x3, 0x03);
867 set_attributectl_reg(0x4, 0x04);
868 set_attributectl_reg(0x5, 0x05);
869 set_attributectl_reg(0x6, 0x14);
870 set_attributectl_reg(0x7, 0x07);
871 set_attributectl_reg(0x8, 0x38);
872 set_attributectl_reg(0x9, 0x39);
873 set_attributectl_reg(0xA, 0x3A);
874 set_attributectl_reg(0xB, 0x3B);
875 set_attributectl_reg(0xC, 0x3C);
876 set_attributectl_reg(0xD, 0x3D);
877 set_attributectl_reg(0xE, 0x3E);
878 set_attributectl_reg(0xF, 0x3F);
879
880 setpal(Palette::def());
881
882 // Disable blinking
883
884 // Attribute mode control register
885 let reg = 0x10;
886 let mut attribute = get_attributectl_reg(reg);
887
888 // Clear the bit that enabled blinking
889 attribute.set_bit(3, false);
890 set_attributectl_reg(reg, attribute);
891
892 // Disable underline
893 set_ul_loc(0x1F);
894
895 WRITER.lock().clr_screen();
896}

Callers

nothing calls this directly

Calls 6

set_attributectl_regFunction · 0.85
setpalFunction · 0.85
get_attributectl_regFunction · 0.85
set_ul_locFunction · 0.85
clr_screenMethod · 0.80
lockMethod · 0.80

Tested by

no test coverage detected