MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / write_byte

Method write_byte

kernel/src/vga_buffer.rs:58–77  ·  view source on GitHub ↗
(&mut self, byte: u8)

Source from the content-addressed store, hash-verified

56
57impl Writer {
58 pub fn write_byte(&mut self, byte: u8) {
59 match byte {
60 b'\n' => self.new_line(),
61 byte => {
62 if self.column_position >= BUFFER_WIDTH {
63 self.new_line();
64 }
65
66 let row = BUFFER_HEIGHT - 1;
67 let col = self.column_position;
68
69 let color_code = self.color_code;
70 self.buffer.chars[row][col].write(ScreenChar {
71 ascii_character: byte,
72 color_code,
73 });
74 self.column_position += 1;
75 }
76 }
77 }
78
79 fn new_line(&mut self) {
80 for row in 1..BUFFER_HEIGHT {

Callers 1

write_stringMethod · 0.80

Calls 2

new_lineMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected