paxcoder wrote:I always thought porting (of applications, for example) boiled down to recompiling...
For code that uses nothing but the standard library of a language, that is true for every platform supporting that language.
Code: Select all
#include <stdio.h>
int main()
{
puts( "Hello world!" );
return 0;
}
This will run (virtually) everywhere with a simple recompile, because the differences in platforms are hidden away behind the "#include <stdio.h>". It has a well-defined interface towards the application, which guarantees that puts() (or printf() etc.) always do the same on all platforms.
However, when you're doing kernel-space programming, you are on the
other side of that well-defined interface. Your job is to take whatever the platform does for printing text - int 0x10, writing to 0xb8000, graphics output - and
provide a way for puts() to print its line. You have to
support a standard library before you can enjoy its benefits...
Especially in the early phases of system setup, which the "Baby Steps" and "Bare Bones" tutorials are about, are
very much platform dependent, and there's next to nothing you could do about it.