aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-01-05 01:15:05 -0500
committerRaghuram Subramani <raghus2247@gmail.com>2025-01-05 01:15:23 -0500
commitbff3be3d21989d6c389d064e6f3627572daf65c0 (patch)
treeebc2a32760c9efa2e805e6187ff4ec7a20b3a567
parentfb775fbb1ffe4f7f4e083d066d34e52e41ff7666 (diff)
kernel: Refactor ldscript & kernel_main argument order
-rw-r--r--kernel/boot/init/boot.s2
-rw-r--r--kernel/boot/link.ld8
-rw-r--r--kernel/kernel/kernel.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/kernel/boot/init/boot.s b/kernel/boot/init/boot.s
index 38e21ee..4ae9a0e 100644
--- a/kernel/boot/init/boot.s
+++ b/kernel/boot/init/boot.s
@@ -86,8 +86,8 @@ _start:
movl $stack_top, %esp
/* Push Multiboot values to stack for kernel_main */
- push %eax
push %ebx
+ push %eax
/*
This is a good place to initialize crucial processor state before the
diff --git a/kernel/boot/link.ld b/kernel/boot/link.ld
index 8fb5e85..c90ef51 100644
--- a/kernel/boot/link.ld
+++ b/kernel/boot/link.ld
@@ -40,26 +40,26 @@ SECTIONS
/* First put the multiboot header, as it is required to be put very early
in the image or the bootloader won't recognize the file format.
Next we'll put the .text section. */
- .text BLOCK(4K) : ALIGN(4K)
+ .text : ALIGN(4K)
{
*(.multiboot)
*(.text)
}
/* Read-only data. */
- .rodata BLOCK(4K) : ALIGN(4K)
+ .rodata : ALIGN(4K)
{
*(.rodata)
}
/* Read-write data (initialized) */
- .data BLOCK(4K) : ALIGN(4K)
+ .data : ALIGN(4K)
{
*(.data)
}
/* Read-write data (uninitialized) and stack */
- .bss BLOCK(4K) : ALIGN(4K)
+ .bss : ALIGN(4K)
{
*(COMMON)
*(.bss)
diff --git a/kernel/kernel/kernel.c b/kernel/kernel/kernel.c
index 08e4dc7..8d19b3b 100644
--- a/kernel/kernel/kernel.c
+++ b/kernel/kernel/kernel.c
@@ -29,7 +29,7 @@
#include <drivers/vga_text_buffer.h>
void
-kernel_main(multiboot_info_t *multiboot_info, uint32_t magic)
+kernel_main(uint32_t magic, multiboot_info_t *multiboot_info)
{
serial_initialize();