2 OUTPUT_FORMAT(elf32-i386)
4 _phys_base = 0x00100000 ; /* physical base address of kernel (where GRUB will load us) */
5 _virt_base = 0xC0000000 ; /* virtual base address of kernel (where we will map ourself to) */
8 /* this segment contains the code that runs at physical addresses, which
9 includes only the bootcode. flags: read + write + execute */
10 physical PT_LOAD FLAGS(7) ;
11 /* this segment contains the code that runs at virtual addresses, which
12 is almost everything. flags: read + write + execute */
13 virtual PT_LOAD FLAGS(7) ;
17 /* put the multiboot header at the very start of the image,
18 then the startup code. Link at physical addresses. */
19 .start _phys_base : AT(_phys_base) {
26 /* put all the normal code of the kernel in a section linked at
27 0xC0000000. Note that the multiboot header and startup code will
28 also get mapped, so this section will get linked at something
30 .text . - _phys_base + _virt_base : AT( _phys_base + SIZEOF(.start) ) {
50 _edata = ADDR(.bss) - _virt_base + _phys_base ;
51 _end = _edata + SIZEOF(.bss) ;
55 *(.eh_frame) /* eh_frame is not used */