Patch refactor scm and textui (#289)

* 重构屏幕管理器和textui框架

* 切换字体为spleen,并增加对字体的抽象

* 修正文档

---------

Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
hanjiezhou
2023-08-20 00:19:36 +08:00
committed by GitHub
parent 5db5a5652c
commit abe3a6ea3c
42 changed files with 2005 additions and 1726 deletions

View File

@ -7,10 +7,10 @@ use x86_64::registers::model_specific::EferFlags;
use crate::driver::uart::uart::c_uart_send_str;
use crate::include::bindings::bindings::{
disable_textui, enable_textui, multiboot2_get_memory, multiboot2_iter, multiboot_mmap_entry_t,
video_reinitialize,
multiboot2_get_memory, multiboot2_iter, multiboot_mmap_entry_t,
};
use crate::libs::align::page_align_up;
use crate::libs::lib_ui::screen_manager::scm_disable_put_to_window;
use crate::libs::printk::PrintkWriter;
use crate::libs::spinlock::SpinLock;
@ -315,8 +315,6 @@ pub fn mm_init() {
unsafe { allocator_init() };
// enable mmio
mmio_init();
// 启用printk的alloc选项
PrintkWriter.enable_alloc();
}
unsafe fn allocator_init() {
@ -396,9 +394,8 @@ unsafe fn allocator_init() {
unsafe { set_inner_allocator(buddy_allocator) };
kinfo!("Successfully initialized buddy allocator");
// 关闭显示输出
unsafe {
disable_textui();
}
scm_disable_put_to_window();
// make the new page table current
{
let mut binding = INNER_ALLOCATOR.lock();
@ -416,16 +413,6 @@ unsafe fn allocator_init() {
kdebug!("New page table enabled");
}
kdebug!("Successfully enabled new page table");
// 重置显示输出目标
unsafe {
video_reinitialize(false);
}
// 打开显示输出
unsafe {
enable_textui();
}
kdebug!("Text UI enabled");
}
#[no_mangle]