Kernel: Add framebuffer information to kernel image

This commit is contained in:
Bananymous 2023-12-09 17:33:58 +02:00
parent abc69fa3d5
commit 284a012509
2 changed files with 19 additions and 4 deletions

View File

@ -2,6 +2,10 @@
.set PG_READ_WRITE, 1<<1
.set PG_PAGE_SIZE, 1<<7
.set FB_WIDTH, 800
.set FB_HEIGHT, 600
.set FB_BPP, 32
#define KERNEL_OFFSET 0xFFFFFFFF80000000
#define V2P(vaddr) ((vaddr) - KERNEL_OFFSET)
@ -9,8 +13,8 @@
# multiboot2 header
.section .multiboot, "aw"
multiboot2_start:
.align 8
multiboot2_start:
.long 0xE85250D6
.long 0
.long multiboot2_end - multiboot2_start
@ -21,9 +25,9 @@ multiboot2_start:
.short 5
.short 0
.long 20
.long 800
.long 600
.long 32
.long FB_WIDTH
.long FB_HEIGHT
.long FB_BPP
# legacy start
.align 8
@ -38,6 +42,16 @@ multiboot2_start:
.long 8
multiboot2_end:
.section .bananboot, "aw"
.align 8
bananboot_start:
.long 0xBABAB007
.long -(0xBABAB007 + FB_WIDTH + FB_HEIGHT + FB_BPP)
.long FB_WIDTH
.long FB_HEIGHT
.long FB_BPP
bananboot_end:
.section .bss, "aw", @nobits
# Create stack
.global g_boot_stack_bottom

View File

@ -11,6 +11,7 @@ SECTIONS
{
g_kernel_execute_start = .;
*(.multiboot)
*(.bananboot)
*(.text.*)
}
.userspace ALIGN(4K) : AT(ADDR(.userspace) - KERNEL_OFFSET)