-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f41ae9
commit a62147f
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
mod display; | ||
|
||
use std::{ | ||
cmp::Ordering, | ||
collections::HashMap, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use std::{cell::UnsafeCell, marker::PhantomData, pin::Pin, sync::atomic::{AtomicU16, AtomicU8, Ordering}}; | ||
|
||
use async_std::task::JoinHandle; | ||
|
||
const FONT: &[u8; 1 << 12] = include_bytes!("../vga-font.rom"); | ||
|
||
pub struct TextBuffer { | ||
data: Pin<Box<[u8; 1 << 12]>>, | ||
handle: JoinHandle<()>, | ||
} | ||
|
||
struct BufferPtr(*const [u8; 1 << 12]); | ||
unsafe impl Send for BufferPtr {} | ||
|
||
impl TextBuffer { | ||
pub fn spawn() -> TextBuffer { | ||
let data = Box::pin([0; 1 << 12]); | ||
|
||
let handle = async_std::task::spawn(run_handle(BufferPtr(&*data))); | ||
|
||
TextBuffer {data, handle} | ||
} | ||
} | ||
|
||
async fn run_handle(buffer: BufferPtr) { | ||
|
||
} |