Learn My Old Code
Read the code I read serveral months ago.
Learn My Old Code
Code are all in my old repo DoKernel
This post is a review for improving my next repo dotkernel. there are 2 reusable files.
config/config.mk
1 | DIR_PATH=/home/doot/sysmaking/dokernel |
- assembler flags :
-f elf32for output format,-F dwarffor debug infomation format,-gfor enable debug infomation - linker flags :
-ffreestandingmeans that standard library may not exst or enable the freestanding environment,-nostdlibtells linker not to link startup files. - compiler flags :
-std=gun11,-ffreestanding,-m32means generating code for 32bit abi,-masm=intelchoices the intel syntax,-Wall,-Wextra,-Wno-address-of-packed-memberdisable some warning.
boot/link.ld
1 | SECTIONS |
It seems that there are no hightlighting scheme for link script, I just use C.
. = 0x7c00, assign the VMA and MBR is here to run.allsize = ABSOLUTE(.), we can get the size of code and data above.AT(0x7c00 + 0x200), assign the LMA of the section