I was just thinking about where (in terms of project layout) the GDT should go.
I have three projects; a HAL which is compiled to a static library, a C static library, and a Kernel project which references the other two libraries. I haven't started the Kernel yet, but I am about to. I have separate libraries so they are easily replacable if needed (portable, etc).
I currently have the GDT being created in the boot loader, but I want it in the Kernel somewhere in case a different boot loader is ever used, then I can be sure the GDT is always set up as I want it.
My initial thought was to put it in the Kernel project, but I have since thought that maybe it should go in the HAL, as it is specific to x86 architecture. If I ever port to any other architecture, only the HAL is replaced.
Does this sound reasonable? Is there anything I have overlooked?
Global Decriptor Table Design
Re: Global Decriptor Table Design
IF GDT is static and able to compiled by gas then I think no need to put it into HAL. it should be kernel, startup asm file with a function load_gdt(); if required later u can use #ifdef in asm file according to architecture.