Re: Call Simple C Kernel
Posted: Sat Nov 22, 2014 2:03 am
The assembly stub defines the entry point that the boot application needs to call. In the case of multiboot, his software needs to scan to locate the header (E.g. the multiboot header structure.) and obtain the entry point to call.But the intention by both people was to call main, whether from a boot sector or a boot loader you rarely if ever call main directly. Even the multiboot specification includes an asm stub.
For example, in the assembly stub provided by multiboot, it exports the symbols start and _start which is the entry point of the kernel or executive. The boot application must call this entry point by locating the multiboot header structure that which the kernel defines. I am sure you are already aware of this which is why I do not understand the confusion.
The point I was emphasizing was that the original poster still needs the code to call the stubs entry point. And he does not currently have that code as the provided boot record assumes a flat binary image which GCC does not output.
However his kernel is also not currently multiboot compliant.
For clarification, I used the symbol _main previously for example purposes only. I never claimed that you would call _main. Operating systems typically always have a custom named entry point that which provides operating system and boot loader specific parameters. I suspect this might be the confusion. It is also to avoid ambiguity with the standard C definitions of _main which may result in potential problems in some compiler environments.
If this is indeed where the confusion is, then I hope it clarifies it. To put simply, I agree with you.