BREAKING: bootloader refacto and loading star
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:
Julien CLEMENT 2021-12-02 08:56:10 +01:00
parent fc5afb7e2f
commit b9db05978f
4 changed files with 16 additions and 2 deletions

@ -4,7 +4,7 @@ INSTALL_ROOT = iso
ABS_INSTALL = $(abspath $(INSTALL_ROOT))
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
GRUB_CFG = grub/grub.cfg

@ -9,11 +9,14 @@ fn panic(_info: &core::panic::PanicInfo) -> !
static HELLO: &[u8] = b"Welcome to the JuliOS";
static STAR: &[u8] = b"|/-\\";
#[no_mangle]
pub extern "C" fn julios_main() -> !
{
let vga_buffer: *mut u8 = 0xb8000 as *mut u8;
let mut k: usize = 0;
for (i, &byte) in HELLO.iter().enumerate()
{
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 + 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;
}
}
}