.skip 16384
stack_top:
+.section .note.GNU-stack,"",@progbits
+
/* Helper symbol for map loop limit */
_kernel_physical_end:
\ No newline at end of file
ljmp $0x08, $flush_cs
flush_cs:
ret
+
+ .section .note.GNU-stack,"",@progbits
/* Syscall vector (int 0x80 -> 128) */
ISR_NOERRCODE 128
+
+ .section .note.GNU-stack,"",@progbits
/* But we want to run at 3GB + 1MB virtual */
KERNEL_VIRT_BASE = 0xC0000000;
+PHDRS
+{
+ text PT_LOAD FLAGS(5);
+ rodata PT_LOAD FLAGS(4);
+ data PT_LOAD FLAGS(6);
+}
+
SECTIONS
{
/*
*(.boot_text)
/* Rest of the kernel code */
*(.text)
- }
+ } :text
+
+ . = ALIGN(0x1000);
.rodata : AT(ADDR(.rodata) - KERNEL_VIRT_BASE)
{
*(.rodata)
- }
+ } :rodata
+
+ . = ALIGN(0x1000);
.data : AT(ADDR(.data) - KERNEL_VIRT_BASE)
{
*(.data)
- }
+ } :data
+
+ . = ALIGN(0x1000);
.bss : AT(ADDR(.bss) - KERNEL_VIRT_BASE)
{
*(.bss)
*(COMMON)
- }
+ } :data
_end = .;
}
/* 5. Return */
/* Since we changed ESP, this 'ret' pops the EIP from the NEW stack! */
ret
+
+ .section .note.GNU-stack,"",@progbits
mov 4(%esp), %ax
ltr %ax
ret
+
+ .section .note.GNU-stack,"",@progbits