changing the colors of the bg and fg
This commit is contained in:
parent
53751a7b0b
commit
becc123d1f
3
Cargo.lock
generated
3
Cargo.lock
generated
|
@ -987,8 +987,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "vga"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67cbcb7bfff998d176ffb8f2c3dfd6cb0fe62740e36dee6c64fc3928c01001bf"
|
||||
source = "git+https://git.ablecorp.us/able/vga.git#9e72fa603927983e359c8a7c56cb110a81eb161e"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"conquer-once",
|
||||
|
|
|
@ -145,5 +145,5 @@ uart_16550 = "0.2.0"
|
|||
volatile = "0.2.6"
|
||||
x86_64 = "0.14.8"
|
||||
pc-beeper = { git = "https://github.com/AbleOS/pc-beeper" }
|
||||
vga = "0.2.7"
|
||||
acpi = "4.1.0"
|
||||
vga = { git = "https://git.ablecorp.us:443/able/vga.git" }
|
||||
|
|
11
ableos/assets/balloon.txt
Normal file
11
ableos/assets/balloon.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
,-""""-. OS: AbleOS
|
||||
,'\ _ _`. Host: ???
|
||||
/ \)_)-)_)-\ Kernel: AKern-{}-v{}
|
||||
: : Uptime: {}
|
||||
\ / Packages: None
|
||||
\ / Shell: RhaiShell
|
||||
`. ,' Resolution: 640x480
|
||||
`. ,' Terminal: VGABuffer
|
||||
`.,' CPU: {}
|
||||
/\`. ,-._ GPU: VGA Compatible
|
||||
`-' Memory: {}/{}
|
|
@ -1,4 +1,7 @@
|
|||
use crate::arch::drivers::sysinfo::master;
|
||||
use crate::arch::interrupts::{reset_pit_for_cpu, set_pit_2};
|
||||
use crate::systeminfo::{KERNEL_VERSION, RELEASE_TYPE};
|
||||
use crate::time::fetch_time;
|
||||
use crate::{
|
||||
arch::shutdown, filesystem::FILE_SYSTEM, rhai_shell::KEYBUFF, vterm::Term,
|
||||
wasm_jumploader::run_program,
|
||||
|
@ -9,7 +12,9 @@ use cpuio::{inb, outb};
|
|||
use ext2::fs::sync::{DirectoryEntry, Synced};
|
||||
use ext2::{fs::Ext2, sector::Size1024};
|
||||
use genfs::{Fs, OpenOptions};
|
||||
use kernel::allocator::ALLOCATOR;
|
||||
use spin::Lazy;
|
||||
use x86_64::instructions::interrupts::{disable, enable};
|
||||
|
||||
// TODO: move to a better place
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
|
@ -53,6 +58,30 @@ impl Path {
|
|||
/// Experimental scratchpad for testing.
|
||||
pub fn scratchpad() {
|
||||
// bruh();
|
||||
// panic!(":>");
|
||||
|
||||
disable();
|
||||
let tick_time = fetch_time();
|
||||
|
||||
let allocator = ALLOCATOR.lock();
|
||||
let size = allocator.size();
|
||||
let used = allocator.used();
|
||||
drop(allocator);
|
||||
enable();
|
||||
|
||||
println!(
|
||||
include_str!("../assets/balloon.txt"),
|
||||
// kstate.hostname,
|
||||
RELEASE_TYPE,
|
||||
KERNEL_VERSION,
|
||||
tick_time,
|
||||
master().unwrap().brand_string().unwrap(),
|
||||
// "",
|
||||
// mem
|
||||
used,
|
||||
size
|
||||
);
|
||||
|
||||
real_shell();
|
||||
}
|
||||
|
||||
|
@ -212,7 +241,10 @@ pub fn sound_off() {
|
|||
reset_pit_for_cpu();
|
||||
}
|
||||
|
||||
pub fn list_files_in_dir(fs: &Synced<Ext2<Size1024, Vec<u8>>>, _path: &[u8]) -> Vec<DirectoryEntry> {
|
||||
pub fn list_files_in_dir(
|
||||
fs: &Synced<Ext2<Size1024, Vec<u8>>>,
|
||||
_path: &[u8],
|
||||
) -> Vec<DirectoryEntry> {
|
||||
let mut entry_list = vec![];
|
||||
|
||||
let dirr = fs.read_dir(b"/").unwrap();
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::{hardware::MOUSE, vga_e::VGAE};
|
|||
use vga::{colors::Color16, writers::GraphicsWriter};
|
||||
|
||||
const TERM_MINUS_ONE_LINE: usize = 4720;
|
||||
// const CURSOR_COLOR: Color16 = Color16::Cyan;
|
||||
const CURSOR_COLOR: Color16 = Color16::Cyan;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Term {
|
||||
|
@ -75,11 +75,10 @@ impl Term {
|
|||
pub fn draw_term(&mut self) {
|
||||
if self.is_dirty() {
|
||||
trace!("Redrawing");
|
||||
use Color16::*;
|
||||
let mode = VGAE.lock();
|
||||
mode.clear_screen(Color16::Black);
|
||||
mode.clear_screen(DarkGrey);
|
||||
|
||||
// /*
|
||||
const CURSOR_COLOR: Color16 = Color16::Red;
|
||||
let mouse_coord = x86_64::instructions::interrupts::without_interrupts(|| {
|
||||
let cursor = MOUSE.lock();
|
||||
|
||||
|
@ -102,12 +101,11 @@ impl Term {
|
|||
CURSOR_COLOR,
|
||||
);
|
||||
|
||||
// */
|
||||
let mut x = 0;
|
||||
let mut y = 0;
|
||||
|
||||
for c in self.term {
|
||||
mode.draw_character(x * 8, y * 8, c, Color16::White);
|
||||
mode.draw_character(x * 8, y * 8, c, White);
|
||||
if x == 79 {
|
||||
y += 1;
|
||||
x = 0;
|
||||
|
@ -115,6 +113,7 @@ impl Term {
|
|||
x += 1
|
||||
}
|
||||
}
|
||||
|
||||
self.set_dirty(false);
|
||||
trace!("Finished drawing");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue