Change how bootstrapping works, update multiboot stuff

This commit is contained in:
Tyler McGurrin 2025-08-04 19:27:59 -04:00
parent 46b75085b6
commit b23aea77ed
4 changed files with 29 additions and 7 deletions

View File

@ -4,6 +4,14 @@
;Tyler McGurrin ;
;/////////////////////;
[bits 32]
section .boot
start:
push 0
popf
push ebx
push eax
call start
section .multiboot_header
header_start:
dd 0xe85250d6 ; magic number
@ -16,3 +24,8 @@ header_start:
dw 0 ; flags
dd 8 ; size
header_end:
loop:
hlt
jmp loop

View File

@ -4,7 +4,8 @@ SECTIONS
{
. = ALIGN(8);
.entry : { KEEP(*(.multiboot_header)) __entry_start = .; *(.entry) }
.boot : { KEEP(*(.multiboot_header)) __boot_start = .; *(.boot) }
.entry : { __entry_start = .; *(.entry) }
.text : { __text_start = .; *(.text) }
.data : { __data_start = .; *(.data) }
.rodata : { __rodata_start = .; *(.rodata) }

View File

@ -10,10 +10,14 @@
#include <arch/i686/irq.h>
#include <arch/i686/util.h>
// stdlibs
#include <stdint.h>
#include <stdio.h>
#include <memory.h>
// Drivers
#include <dri/keyboard.h>
#include <dri/cmos.h>
#include <dri/timer.h>
@ -23,9 +27,13 @@
#include <dri/disk/ata.h>
#include <dri/sound/pcspeaker.h>
// Core
#include <core/hal/hal.h>
#include <core/memory/page.h>
// Utilities
#include <util/param.h>
#include <util/util.h>
#include <util/binary.h>
@ -38,8 +46,7 @@ extern uint8_t __end;
extern int uptime;
uint16_t DEBUG_COM_PORT = COM1_PORT;
void __attribute__((section(".entry"))) start(uint64_t multiboot_magic, void *multiboot_data) {
void start(unsigned long multiboot_magic, unsigned long multiboot_addr) {
// multiboot 2 shit
// int padded_size = tag->size + ((tag->size % 8)?(8-(tag->size%8)):0);
@ -75,8 +82,9 @@ void __attribute__((section(".entry"))) start(uint64_t multiboot_magic, void *mu
printf("Initializing Memory Paging...");
Memory_Page_Init();
printf("Done!\n");
printf("Multiboot Magic: %d\n", multiboot_magic);
printf("The Current Time and Date Is: %d:%d:%d %d/%d/%d%d\n",
Serial_Printf(DEBUG_COM_PORT, "Multiboot Magic: %d\n", multiboot_magic);
Serial_Printf(DEBUG_COM_PORT, "Multiboot Address: %d\n", multiboot_addr);
printf("\nThe Current Time and Date Is: %d:%d:%d %d/%d/%d%d\n",
BCD2BIN(Read_CMOS(CMOS_RTC_Hours)),
BCD2BIN(Read_CMOS(CMOS_RTC_Minutes)),
BCD2BIN(Read_CMOS(CMOS_RTC_Seconds)),

View File

@ -6,4 +6,4 @@
#pragma once
#define LOGO " _ _____ _ __________________\n / | / / | / | / / _/_ __/ ____/\n / |/ / /| | / |/ // / / / / __/ \n / /| / ___ |/ /| // / / / / /___ \n/_/ |_/_/ |_/_/ |_/___/ /_/ /_____/ \n"
#define VERSION "RD-00048"
#define VERSION "RD-00049"