VGA

os

25x80の配列で, 要素は

0..=7: ASCII
8..=11: Foreground color
12..=14: Background color
15: 点滅
  • #[repr()]: 代替メモリレイアウト

    • rust 1種類のEnum の mem::size_of::<E>() が0は謎, 2種類だと1byte todo
  • unsafe { &mut *(0xb8000 as *mut Buffer) }, mutな参照が欲しいので回りくどいことをしている

// C++ -> Rust
// (int *const a) -> (a: &i32)
// (int *a) -> (a: &mut i32)

// *const T
// *mut T
// (a: std::unique_ptr<T>) -> a: Rc<T>

rustcpp のポインタ周りの対応これでいいのかな

CPU例外