Untitled_Kernel/linker.ld
lordtet d32c1fab63 dude PLEASE i dont want to implement ISRs dude PLEASEEEEE
I did set up all of the stuff around it tho. Gotta implement some
handlers.
2025-06-12 01:19:59 -04:00

40 lines
1.1 KiB
Text

/*We have to write out this linker script so the linker knows where to put all the soup of stuff we put in start.s and main.c. i'll write out reasoning as i go. */
/*letting em know our entry point is actually label "start" in start.s, and not some function in the c file.*/
ENTRY(start)
SECTIONS
{
/*start me at 1Mb because below that is x86 essential stuff, which we dont want to be written on top of.*/
. = 1M;
/* we're going to maintain 4K alignment - apparently useful for paging, and i'm not complaining about the lost space anyway. */
/*our multiboot header from start.s - has to go at the beginning of the executable so the bootloader knows we're loadable.*/
/*executable section*/
.text BLOCK(4K) : ALIGN(4K)
{
*(.multiboot)
*(.text)
}
/*general read only data*/
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata*)
*(.gdt_sect)
*(.idtr)
}
/*initialized rw data. */
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
}
/*uninitialized data, and our stack as defined in start.s*/
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
*(.idt)
}
}