Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/Pic.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PIC_H
#define PIC_H

#define PIT_FREQUENCY_HZ 100
#define PIT_FREQUENCY_HZ 200

int PicInstall();
void PitInstall();
Expand Down
32 changes: 4 additions & 28 deletions kernel/core/Kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "AsmHelpers.h"
#include "MemOps.h"
#include "VMem.h"
#include "Splash.h"

void KernelMainHigherHalf(void);
extern uint8_t _kernel_phys_start[];
extern uint8_t _kernel_phys_end[];
Expand Down Expand Up @@ -238,33 +240,7 @@ void PrintKernelAt(const char* str, uint32_t line, uint32_t col) {
console.column = saved_col;
}

// Modern splash screen with better formatting
void AsciiSplash(void) {
ClearScreen();

const char* splash_lines[] = {
"+-----------------------------------------------------------------------------+",
"| >> VoidFrameKernel Version 0.0.1-alpha << |",
"| |",
"| Copyright (C) 2025 VoidFrame Project - Atheria |",
"| Licensed under GNU General Public License v2.0 |",
"| |",
"| This program is free software; you can redistribute it and/or modify |",
"| it under the terms of the GNU General Public License as published by |",
"| the Free Software Foundation; either version 2 of the License. |",
"| |",
"+-----------------------------------------------------------------------------+",
"",
NULL
};

ConsoleSetColor(VGA_COLOR_SUCCESS);
for (int i = 0; splash_lines[i]; i++) {
PrintKernel(splash_lines[i]);
PrintKernel("\n");
}
ConsoleSetColor(VGA_COLOR_DEFAULT);
}


// Global variable to store the Multiboot2 info address
static uint32_t g_multiboot_info_addr = 0;
Expand Down Expand Up @@ -391,7 +367,7 @@ void KernelMain(uint32_t magic, uint32_t info) {
PrintKernelHex(magic);
Panic("Unrecognized Multiboot2 magic.");
}
AsciiSplash();
ShowSplashScreen();
PrintKernelSuccess("[SYSTEM] VoidFrame Kernel - Version 0.0.1-alpha loaded\n");
PrintKernel("Magic: ");
PrintKernelHex(magic);
Expand Down
50 changes: 50 additions & 0 deletions kernel/etc/Splash.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include "Splash.h"
#include "stdbool.h"
#include "Kernel.h"
#include "stdint.h"

#define VIDEO_MEMORY (0xB8000)
#define SCREEN_WIDTH 80
#define SCREEN_HEIGHT 25

void DrawBox(int x, int y, int width, int height) {
uint16_t* video_memory = (uint16_t*)VIDEO_MEMORY;
uint16_t color = (0x0F << 8);

// Corners
video_memory[y * SCREEN_WIDTH + x] = color | 201; // Top-left
video_memory[y * SCREEN_WIDTH + x + width - 1] = color | 187; // Top-right
video_memory[(y + height - 1) * SCREEN_WIDTH + x] = color | 200; // Bottom-left
video_memory[(y + height - 1) * SCREEN_WIDTH + x + width - 1] = color | 188; // Bottom-right

// Horizontal lines
for (int i = 1; i < width - 1; i++) {
video_memory[y * SCREEN_WIDTH + x + i] = color | 205;
video_memory[(y + height - 1) * SCREEN_WIDTH + x + i] = color | 205;
}

// Vertical lines
for (int i = 1; i < height - 1; i++) {
video_memory[(y + i) * SCREEN_WIDTH + x] = color | 186;
video_memory[(y + i) * SCREEN_WIDTH + x + width - 1] = color | 186;
}
}

void PrintString(int x, int y, const char* str) {
uint16_t* video_memory = (uint16_t*)VIDEO_MEMORY;
uint16_t color = (0x0F << 8);
int i = 0;
while (str[i] != '\0') {
video_memory[y * SCREEN_WIDTH + x + i] = color | str[i];
i++;
}
}

void ShowSplashScreen() {
ClearScreen();
DrawBox(10, 5, 60, 15);
PrintString(28, 7, "MKernel - v0.0.1-beta");
PrintString(24, 9, "A lightweight 64-bit kernel");
PrintString(25, 11, "Copyright (c) 2025, Atheria");
for (volatile int i = 0; i < 3000000000; i ++);
}
6 changes: 6 additions & 0 deletions kernel/etc/Splash.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef SPLASH_H
#define SPLASH_H

void ShowSplashScreen();

#endif //SPLASH_H
2 changes: 1 addition & 1 deletion kernel/memory/AsmHelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ section .text
global EnablePagingAndJump

EnablePagingAndJump:
mov rdi, cr3
mov cr3, rdi
jmp rsi
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ inc_dirs = [
src_root + '/kernel/ipc',
src_root + '/kernel/memory',
src_root + '/kernel/process',
src_root + '/kernel/etc',
src_root + '/drivers',
arch_root + '/cpu',
arch_root + '/gdt',
Expand Down Expand Up @@ -75,7 +76,8 @@ c_sources = [
src_root + '/drivers/Pic.c',
arch_root + '/cpu/Cpu.c',
src_root + '/kernel/atomic/Atomics.c',
src_root + '/kernel/ipc/Ipc.c'
src_root + '/kernel/ipc/Ipc.c',
src_root + '/kernel/etc/Splash.c'
]

# Build include flags
Expand Down