Fix the kernel having an .init section linked at a high address.

The .init section for global constructors in the kernel is unused at the
moment as the _init function is never invoked, but its existence means
it got linked at 128 MiB on i686. This address isn't mapped by the
kernel and the bootloader requires the machine to have that much
physical memory. Unfortunately that meant the i686 build didn't work on
machines with less than 129 MiB of memory.
This commit is contained in:
Jonas 'Sortie' Termansen 2022-01-09 17:55:49 +01:00
parent ffc3751713
commit 4e86394e3d
1 changed files with 6 additions and 2 deletions

View File

@ -167,8 +167,12 @@ $(OBJS) \
$(CRTN_OBJ) \
end.o
LINK_OBJECTS=\
$(CRTI_OBJ) $(CRTBEGIN_OBJ) $(OBJS) $(LIBS) $(CRTN_OBJ) $(CRTEND_OBJ) end.o
# TODO: The .init section is linked at 128 MiB on i686 and at 4 MiB on x86_64
# which increases the memory requirement (and isn't mapped) and the _init
# function isn't invoked yet in the kernel anyway.
#LINK_OBJECTS=\
#$(CRTI_OBJ) $(CRTBEGIN_OBJ) $(OBJS) $(LIBS) $(CRTN_OBJ) $(CRTEND_OBJ) end.o
LINK_OBJECTS=$(OBJS) $(LIBS) end.o
# Rules and recipes for building the kernel.