Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Make it API compatible with the existing vga crate. #2

Merged
merged 1 commit into from
Sep 25, 2016
Merged

Conversation

steveklabnik
Copy link
Member

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!

r? @ashleygwilliams

steveklabnik added a commit to intermezzOS/kernel that referenced this pull request Sep 25, 2016
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.
@ashleygwilliams ashleygwilliams self-assigned this Sep 25, 2016
@steveklabnik steveklabnik force-pushed the api branch 2 times, most recently from 08ba96c to 238243d Compare September 25, 2016 14:57
Copy link
Member

@ashleygwilliams ashleygwilliams left a 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],
Copy link
Member

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 {
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or print.rs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 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
  2. 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.

Copy link
Member

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

Copy link
Member

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]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this

@ashleygwilliams
Copy link
Member

🎉

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!
@ashleygwilliams ashleygwilliams merged commit 8df53ec into master Sep 25, 2016
@ashleygwilliams ashleygwilliams deleted the api branch September 25, 2016 15:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants