The boot loader doesn't directly call the C kernel
That is not entirely correct. To see why, we must differentiate between a boot
loader and boot
manager. The boot loader portion is responsible for loading and setting the environment for use by a specific operating system. The boot manager is responsible for calling other boot loaders. Under these terms, the boot loader component of the software is already well aware of the requirements of the respective operating system and thus can call its entry point directly without concern. This is an important task as it allows boot loader configuration for setting kernel initialization command line flags.
The "assembly stub" that is being referred to here that is common in tutorials has nothing to do with calling the kernel program. The assembly stub exports the real entry point method in the same way that a C compiler would export
_main. Thus from the perspective of the boot application, executing the entry point is the same regardless if an assembly stub is used.
With that said, nothing in this thread is about a boot loader but a
boot record which is very different software and is what I think you were referring to. In other words,
remy provided us a
boot record not a boot loader which has very different requirements. And not even a valid boot record (many systems will not attempt to boot it.)
Given the space limitations of boot records, I suggest for
remy to load a separate program and remain in real mode. This separate program is the boot loader, kernel, or executive (depending on your design goals and needs) that can include an assembly stub that switches to protected mode and goes into C.
In short, don't attempt protected mode in a boot record.