-
Notifications
You must be signed in to change notification settings - Fork 4
Make it API compatible with the existing vga crate. #2
Conversation
This technically leads to a functional regression, but that's okay for now. The new vga driver does not have the ability to blink the cursor, that's being tracked over at intermezzOS/vga#3 This also needs intermezzOS/vga#2 to be merged before it will work here.
76c7e50
to
f3c97c3
Compare
08ba96c
to
238243d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some nits:
- move the stuff that has nothing to do with the lib out of
lib.rs
- update to use new
COL_BYTES
constant
pub static BUFFER: Mutex<Vga> = Mutex::new( | ||
Vga { | ||
location: 0xb8000 as *mut u8, | ||
buffer: [0; ROWS * COLS * 2], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update to use COL_BYTES
/// kprintln!("Hello, world!"); | ||
/// ``` | ||
#[macro_export] | ||
macro_rules! kprintln { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we put this in a separate util.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or print.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
util.rs
is a bad name, but I'm not sure if you're married to the idea of that name or it's just to not have it in this file- I actually want to kill this entirely, but that requires upstream refactoring first.
so, my vote would be to just leave it in for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name it whatever you want ✨ but i want it out of this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OR: spend 5min trying to figure out how to get rid of it, and then if we can at least put it all the way at the end
/// ``` | ||
/// kprint!("Hello, world!"); | ||
/// ``` | ||
#[macro_export] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also this
🎉 |
Changes: 1. Adding the kprintln!/kprint! macros. 2. Adding a spinlock to hold a global, so that those work. This also then requires `const fn` and so makes things nightly-only. For now!
Changes:
This also then requires
const fn
and so makes things nightly-only. Fornow!
r? @ashleygwilliams