Compare commits
No commits in common. "e5cf78509742ba97515fb321a54fff3f077d7cb2" and "d018c72200f3eb162e4e9c099641da35542f188b" have entirely different histories.
e5cf785097
...
d018c72200
|
|
@ -3,7 +3,7 @@ ENTRY(stivale2_main)
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
kernel_phys_offset = 0xffffffff80000000;
|
kernel_phys_offset = 0xffffffff80000000;
|
||||||
. = kernel_phys_offset + 1M;
|
. = kernel_phys_offset + 0x100000;
|
||||||
|
|
||||||
.stivale2hdr ALIGN(4K) :
|
.stivale2hdr ALIGN(4K) :
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
/* An Arena allocator is a very basic allocator that simply discards free() calls. */
|
|
||||||
|
|
||||||
#include "arena.h"
|
|
||||||
#include <hal/ops.h>
|
|
||||||
|
|
||||||
void* arena_alloc(struct arena_allocator* alloc, size_t len, size_t align) {
|
|
||||||
if(alloc->begin % align) {
|
|
||||||
alloc->begin += (align - alloc->begin % align);
|
|
||||||
}
|
|
||||||
if(alloc->length < len) {
|
|
||||||
PANIC("Attempt to allocate more memory than is available");
|
|
||||||
}
|
|
||||||
void* retval = (void*)alloc->begin;
|
|
||||||
alloc->begin += len;
|
|
||||||
alloc->length -= len;
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
struct arena_allocator {
|
|
||||||
size_t begin;
|
|
||||||
size_t length;
|
|
||||||
};
|
|
||||||
|
|
||||||
void *arena_alloc(struct arena_allocator* alloc, size_t length, size_t align);
|
|
||||||
|
|
@ -2,10 +2,8 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <arch/x86/stivale2-parse.h>
|
#include "../../main.h"
|
||||||
#include <print/print.h>
|
#include "arch/x86/stivale2-parse.h"
|
||||||
|
|
||||||
#include <main.h>
|
|
||||||
|
|
||||||
static uint8_t stack[4096] = {0};
|
static uint8_t stack[4096] = {0};
|
||||||
void stivale2_main(struct stivale2_struct *info);
|
void stivale2_main(struct stivale2_struct *info);
|
||||||
|
|
@ -30,15 +28,6 @@ void stivale2_main(struct stivale2_struct *info) {
|
||||||
parse_stivale2(info);
|
parse_stivale2(info);
|
||||||
print_stivale2_memmap(info);
|
print_stivale2_memmap(info);
|
||||||
|
|
||||||
uint64_t* cr3;
|
|
||||||
__asm__ __volatile__ (
|
|
||||||
"movq %%cr3, %0\n\t"
|
|
||||||
: "=r" (cr3)
|
|
||||||
: /* no input */
|
|
||||||
: /* no clobbers */
|
|
||||||
);
|
|
||||||
printf("PAGE TABLE AT: %x\n", cr3);
|
|
||||||
|
|
||||||
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
|
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
|
||||||
kmain(3, argv);
|
kmain(3, argv);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue