os-tutorial
os-tutorial copied to clipboard
Linker script
In most projects online you can find a linker script that defines the memory segments of the kernel. My questions are: Do I need one and why does this project doesn't use one? Thanks
a linker script does one thing : define where on memory the segments of the program will be loaded and some attributes like how they are going to be aligned into memory, the size and much more. E.g the .text will load on 0x10000, .data on 0x50000 and so on. It is not necessary, but really useful if needed Edit: basically you can use it to define the linking arguments too, like the output format
Where do I define these parameters in this project?
you include your linker file with -T link.ld eg. i386-elf-ld -T link.ld where link.ld in the name of the linker script file Now in this project i don't think you really need a linker script, except you are facing problems with making the kernel to work