diff --git a/Makefile b/Makefile index 80f7cab..337f6f3 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/src/boot.asm b/src/boot/boot.asm similarity index 100% rename from src/boot.asm rename to src/boot/boot.asm diff --git a/src/multiboot.asm b/src/boot/multiboot.asm similarity index 100% rename from src/multiboot.asm rename to src/boot/multiboot.asm diff --git a/src/lib.rs b/src/lib.rs index 4a4742d..2eb77d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; + } + } }