Refactor framebuffer

This commit is contained in:
Qingsong Chen
2025-04-29 08:45:08 +00:00
committed by Tate, Hongliang Tian
parent ef898e572c
commit 88f08de3af
10 changed files with 494 additions and 204 deletions

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::string::ToString;
use aster_framebuffer::{CONSOLE_NAME, FRAMEBUFFER_CONSOLE};
use log::info;
pub fn init() {
@ -7,4 +10,8 @@ pub fn init() {
for (name, _) in aster_input::all_devices() {
info!("Found Input device, name:{}", name);
}
if let Some(console) = FRAMEBUFFER_CONSOLE.get() {
aster_console::register_device(CONSOLE_NAME.to_string(), console.clone());
}
}

View File

@ -32,6 +32,7 @@
#![feature(associated_type_defaults)]
#![register_tool(component_access_control)]
use aster_framebuffer::FRAMEBUFFER_CONSOLE;
use kcmdline::KCmdlineArg;
use ostd::{
arch::qemu::{exit_qemu, QemuExitCode},
@ -145,6 +146,13 @@ fn init_thread() {
print_banner();
// FIXME: CI fails due to suspected performance issues with the framebuffer console.
// Additionally, userspace program may render GUIs using the framebuffer,
// so we disable the framebuffer console here.
if let Some(console) = FRAMEBUFFER_CONSOLE.get() {
console.disable();
};
let karg: KCmdlineArg = boot_info().kernel_cmdline.as_str().into();
let initproc = Process::spawn_user_process(