BREAKING: bootloader refacto and loading star
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
parent
fc5afb7e2f
commit
b9db05978f
2
Makefile
2
Makefile
@ -4,7 +4,7 @@ INSTALL_ROOT = iso
|
|||||||
ABS_INSTALL = $(abspath $(INSTALL_ROOT))
|
ABS_INSTALL = $(abspath $(INSTALL_ROOT))
|
||||||
|
|
||||||
LINKER_SCRIPT = src/linker.ld
|
LINKER_SCRIPT = src/linker.ld
|
||||||
BOOT_OBJS = src/multiboot.o src/boot.o
|
BOOT_OBJS = src/boot/multiboot.o src/boot/boot.o
|
||||||
LIB_JULIOS = target/x86_64-julios/debug/libjulios.a
|
LIB_JULIOS = target/x86_64-julios/debug/libjulios.a
|
||||||
|
|
||||||
GRUB_CFG = grub/grub.cfg
|
GRUB_CFG = grub/grub.cfg
|
||||||
|
16
src/lib.rs
16
src/lib.rs
@ -9,11 +9,14 @@ fn panic(_info: &core::panic::PanicInfo) -> !
|
|||||||
|
|
||||||
static HELLO: &[u8] = b"Welcome to the JuliOS";
|
static HELLO: &[u8] = b"Welcome to the JuliOS";
|
||||||
|
|
||||||
|
static STAR: &[u8] = b"|/-\\";
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn julios_main() -> !
|
pub extern "C" fn julios_main() -> !
|
||||||
{
|
{
|
||||||
let vga_buffer: *mut u8 = 0xb8000 as *mut u8;
|
let vga_buffer: *mut u8 = 0xb8000 as *mut u8;
|
||||||
|
|
||||||
|
let mut k: usize = 0;
|
||||||
for (i, &byte) in HELLO.iter().enumerate()
|
for (i, &byte) in HELLO.iter().enumerate()
|
||||||
{
|
{
|
||||||
unsafe
|
unsafe
|
||||||
@ -21,7 +24,18 @@ pub extern "C" fn julios_main() -> !
|
|||||||
*vga_buffer.offset(i as isize * 2) = byte;
|
*vga_buffer.offset(i as isize * 2) = byte;
|
||||||
*vga_buffer.offset(i as isize * 2 + 1) = 0xb;
|
*vga_buffer.offset(i as isize * 2 + 1) = 0xb;
|
||||||
}
|
}
|
||||||
|
k = i * 2 + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
loop {}
|
let mut j: usize = 0;
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
unsafe
|
||||||
|
{
|
||||||
|
*vga_buffer.offset(k as isize) = STAR[j];
|
||||||
|
*vga_buffer.offset(k as isize + 1) = 0xb;
|
||||||
|
j += 1;
|
||||||
|
j %= 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user