-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add blank command * Move vga driver to module * Remove vga command * Split vga module * Rename vga device type * Add /dev/vga/mode device file * Restore font after mode change * Remove cvs support for palette * Refactor api::vga::color * Move api::vga::color to sys::vga::color * Move api::vga::palette to sys::vga::palette * Use 256 colors palette * Refactor Color * Rename Color#to_vga_reg to Color#register * Add Palette#set * Add write-only /dev/vga/palette * Remove unused set_palette * Add read operation to /dev/vga/palette * Add palette backup and restore * Check for device presence * Backup palette only in 80x25 mode * Clear screen on mode change * Make /dev/vga/mode readable * Fix double buffer allocation * Add framebuffer:addr() * Add /dev/vga/buffer device * Reorder device files * Rename some functions * Move test * Run clippy * Add color test * Refactor code * Move blank to userspace
- Loading branch information
Showing
23 changed files
with
936 additions
and
769 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
/bin/blank |
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,4 +1,5 @@ | ||
beep | ||
blank | ||
chess | ||
exec | ||
fonts | ||
|
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
This file was deleted.
Oops, something went wrong.
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,5 +1,16 @@ | ||
pub mod color; | ||
pub mod palette; | ||
use crate::api::fs; | ||
|
||
pub use color::Color; | ||
pub use palette::Palette; | ||
pub fn graphic_mode() { | ||
let dev = "/dev/vga/mode"; | ||
if fs::is_device(dev) { | ||
fs::write(dev, b"320x200").ok(); | ||
} | ||
} | ||
|
||
pub fn text_mode() { | ||
let dev = "/dev/vga/mode"; | ||
if fs::is_device(dev) { | ||
fs::write(dev, b"80x25").ok(); | ||
print!("\x1b[2J\x1b[1;1H"); // Clear screen and move to top | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
#![no_std] | ||
#![no_main] | ||
|
||
extern crate alloc; | ||
|
||
use moros::print; | ||
use moros::api::io; | ||
use moros::api::vga; | ||
use moros::entry_point; | ||
|
||
entry_point!(main); | ||
|
||
fn main(_args: &[&str]) { | ||
vga::graphic_mode(); | ||
print!("\x1b]R\x1b[1A"); // Reset palette | ||
while io::stdin().read_char().is_none() { | ||
x86_64::instructions::hlt(); | ||
} | ||
vga::text_mode(); | ||
} |
Oops, something went wrong.