summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-09-05 19:01:32 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-09-05 19:01:32 +0800
commit365b581ca5c37305f9583cf08d0c25c4426f47e2 (patch)
tree4a77be797bc192a5919728a7337937407075c119 /src
parentb4d9a57f193c64bca188a76e4f711cc168da9737 (diff)
migrate: limine -> bootloader_api
Diffstat (limited to 'src')
-rw-r--r--src/io.rs1
-rw-r--r--src/io/render.rs1
-rw-r--r--src/io/render/fb.rs2
-rw-r--r--src/io/render/fb/graphic.rs0
-rw-r--r--src/io/render/fb/text.rs1
-rw-r--r--src/lib.rs3
-rw-r--r--src/main.rs76
7 files changed, 0 insertions, 84 deletions
diff --git a/src/io.rs b/src/io.rs
deleted file mode 100644
index cf25e6c..0000000
--- a/src/io.rs
+++ /dev/null
@@ -1 +0,0 @@
-pub mod render;
diff --git a/src/io/render.rs b/src/io/render.rs
deleted file mode 100644
index 402daf7..0000000
--- a/src/io/render.rs
+++ /dev/null
@@ -1 +0,0 @@
-pub mod fb;
diff --git a/src/io/render/fb.rs b/src/io/render/fb.rs
deleted file mode 100644
index 2924838..0000000
--- a/src/io/render/fb.rs
+++ /dev/null
@@ -1,2 +0,0 @@
-pub mod graphic;
-pub mod text;
diff --git a/src/io/render/fb/graphic.rs b/src/io/render/fb/graphic.rs
deleted file mode 100644
index e69de29..0000000
--- a/src/io/render/fb/graphic.rs
+++ /dev/null
diff --git a/src/io/render/fb/text.rs b/src/io/render/fb/text.rs
deleted file mode 100644
index 8b13789..0000000
--- a/src/io/render/fb/text.rs
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/lib.rs b/src/lib.rs
deleted file mode 100644
index f0111d3..0000000
--- a/src/lib.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-#![no_std]
-
-pub mod io;
diff --git a/src/main.rs b/src/main.rs
deleted file mode 100644
index bf338df..0000000
--- a/src/main.rs
+++ /dev/null
@@ -1,76 +0,0 @@
-#![no_std]
-#![no_main]
-#![feature(used_with_arg)]
-
-use core::panic::PanicInfo;
-use font8x8::UnicodeFonts;
-use limine::{BaseRevision, request::FramebufferRequest};
-
-#[used(linker)]
-#[unsafe(link_section = ".requests")]
-static BASE_REVISION: BaseRevision = BaseRevision::new();
-
-#[used(linker)]
-#[unsafe(link_section = ".requests")]
-static FRAMEBUFFER_REQUEST: FramebufferRequest = FramebufferRequest::new();
-
-#[unsafe(no_mangle)]
-pub extern "C" fn _start() -> ! {
- if !BASE_REVISION.is_supported() {
- panic!("Limine Base Revision not supported");
- }
-
- if let Some(response) = FRAMEBUFFER_REQUEST.response() {
- if let Some(fb) = response
- .framebuffers()
- .first()
- {
- let pitch = fb.pitch as usize;
- let bpp = fb.bpp as usize;
-
- if bpp == 32 {
- let slice = unsafe { fb.as_slice_mut() };
- let msg = "Hello World!";
- let mut cursor_x = 10;
- let cursor_y = 10;
-
- for c in msg.chars() {
- if let Some(glyph) = font8x8::BASIC_FONTS.get(c) {
- for (y, row) in glyph
- .iter()
- .enumerate()
- {
- for x in 0..8 {
- if (*row & (1 << x)) != 0 {
- let pixel_offset = (cursor_y + y) * pitch + (cursor_x + x) * 4;
- if pixel_offset + 3 < slice.len() {
- slice[pixel_offset] = 0xFF; // B
- slice[pixel_offset + 1] = 0xFF; // G
- slice[pixel_offset + 2] = 0xFF; // R
- }
- }
- }
- }
- }
- cursor_x += 8;
- }
- }
- }
- }
-
- hcf();
-}
-
-fn hcf() -> ! {
- unsafe {
- core::arch::asm!("cli");
- loop {
- core::arch::asm!("hlt");
- }
- }
-}
-
-#[panic_handler]
-fn panic(_info: &PanicInfo) -> ! {
- hcf()
-}