Change how bootstrapping works, update multiboot stuff
This commit is contained in:
parent
46b75085b6
commit
b23aea77ed
@ -4,6 +4,14 @@
|
|||||||
;Tyler McGurrin ;
|
;Tyler McGurrin ;
|
||||||
;/////////////////////;
|
;/////////////////////;
|
||||||
[bits 32]
|
[bits 32]
|
||||||
|
section .boot
|
||||||
|
start:
|
||||||
|
push 0
|
||||||
|
popf
|
||||||
|
push ebx
|
||||||
|
push eax
|
||||||
|
call start
|
||||||
|
|
||||||
section .multiboot_header
|
section .multiboot_header
|
||||||
header_start:
|
header_start:
|
||||||
dd 0xe85250d6 ; magic number
|
dd 0xe85250d6 ; magic number
|
||||||
@ -15,4 +23,9 @@ header_start:
|
|||||||
dw 0 ; type
|
dw 0 ; type
|
||||||
dw 0 ; flags
|
dw 0 ; flags
|
||||||
dd 8 ; size
|
dd 8 ; size
|
||||||
header_end:
|
header_end:
|
||||||
|
|
||||||
|
loop:
|
||||||
|
hlt
|
||||||
|
jmp loop
|
||||||
|
|
||||||
@ -4,7 +4,8 @@ SECTIONS
|
|||||||
{
|
{
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
|
|
||||||
.entry : { KEEP(*(.multiboot_header)) __entry_start = .; *(.entry) }
|
.boot : { KEEP(*(.multiboot_header)) __boot_start = .; *(.boot) }
|
||||||
|
.entry : { __entry_start = .; *(.entry) }
|
||||||
.text : { __text_start = .; *(.text) }
|
.text : { __text_start = .; *(.text) }
|
||||||
.data : { __data_start = .; *(.data) }
|
.data : { __data_start = .; *(.data) }
|
||||||
.rodata : { __rodata_start = .; *(.rodata) }
|
.rodata : { __rodata_start = .; *(.rodata) }
|
||||||
|
|||||||
@ -10,10 +10,14 @@
|
|||||||
#include <arch/i686/irq.h>
|
#include <arch/i686/irq.h>
|
||||||
#include <arch/i686/util.h>
|
#include <arch/i686/util.h>
|
||||||
|
|
||||||
|
// stdlibs
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
|
||||||
|
// Drivers
|
||||||
|
|
||||||
#include <dri/keyboard.h>
|
#include <dri/keyboard.h>
|
||||||
#include <dri/cmos.h>
|
#include <dri/cmos.h>
|
||||||
#include <dri/timer.h>
|
#include <dri/timer.h>
|
||||||
@ -23,9 +27,13 @@
|
|||||||
#include <dri/disk/ata.h>
|
#include <dri/disk/ata.h>
|
||||||
#include <dri/sound/pcspeaker.h>
|
#include <dri/sound/pcspeaker.h>
|
||||||
|
|
||||||
|
// Core
|
||||||
|
|
||||||
#include <core/hal/hal.h>
|
#include <core/hal/hal.h>
|
||||||
#include <core/memory/page.h>
|
#include <core/memory/page.h>
|
||||||
|
|
||||||
|
// Utilities
|
||||||
|
|
||||||
#include <util/param.h>
|
#include <util/param.h>
|
||||||
#include <util/util.h>
|
#include <util/util.h>
|
||||||
#include <util/binary.h>
|
#include <util/binary.h>
|
||||||
@ -38,8 +46,7 @@ extern uint8_t __end;
|
|||||||
extern int uptime;
|
extern int uptime;
|
||||||
|
|
||||||
uint16_t DEBUG_COM_PORT = COM1_PORT;
|
uint16_t DEBUG_COM_PORT = COM1_PORT;
|
||||||
|
void start(unsigned long multiboot_magic, unsigned long multiboot_addr) {
|
||||||
void __attribute__((section(".entry"))) start(uint64_t multiboot_magic, void *multiboot_data) {
|
|
||||||
|
|
||||||
// multiboot 2 shit
|
// multiboot 2 shit
|
||||||
// int padded_size = tag->size + ((tag->size % 8)?(8-(tag->size%8)):0);
|
// 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...");
|
printf("Initializing Memory Paging...");
|
||||||
Memory_Page_Init();
|
Memory_Page_Init();
|
||||||
printf("Done!\n");
|
printf("Done!\n");
|
||||||
printf("Multiboot Magic: %d\n", multiboot_magic);
|
Serial_Printf(DEBUG_COM_PORT, "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 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_Hours)),
|
||||||
BCD2BIN(Read_CMOS(CMOS_RTC_Minutes)),
|
BCD2BIN(Read_CMOS(CMOS_RTC_Minutes)),
|
||||||
BCD2BIN(Read_CMOS(CMOS_RTC_Seconds)),
|
BCD2BIN(Read_CMOS(CMOS_RTC_Seconds)),
|
||||||
|
|||||||
@ -6,4 +6,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define LOGO " _ _____ _ __________________\n / | / / | / | / / _/_ __/ ____/\n / |/ / /| | / |/ // / / / / __/ \n / /| / ___ |/ /| // / / / / /___ \n/_/ |_/_/ |_/_/ |_/___/ /_/ /_____/ \n"
|
#define LOGO " _ _____ _ __________________\n / | / / | / | / / _/_ __/ ____/\n / |/ / /| | / |/ // / / / / __/ \n / /| / ___ |/ /| // / / / / /___ \n/_/ |_/_/ |_/_/ |_/___/ /_/ /_____/ \n"
|
||||||
#define VERSION "RD-00048"
|
#define VERSION "RD-00049"
|
||||||
Loading…
x
Reference in New Issue
Block a user