Hi Daniel, I have been taking and enjoying your Kernel Development course. I...

David Troendle Answered 1 answer
Question by David Troendle 9 months ago

Question

Hi Daniel,

I have been taking and enjoying your Kernel Development course. I got to lesson 21, Creating a cross compiler, and got a bit confused. I have done some cross compiler work, but it was for applications like cross compiling for a Z80 hosted on a linux platform. For this course, the host and target ISA, are the same, but there is no OS for the target environment. I did not see where we specified the target environment (for instance, has no file system).

Is that done by simply not using any of the standard libraries requiring an OS? While we may not be able to use fprintf, sprintf is useful and does not require OS features (I think). Would we still be able to use sprintf, or are all standard library functions omitted?

Thanks,

David

Answers

Answered by Daniel McCarthy

Instructor

In GCC the C standard library is designed for a particular operating system give it Windows or linux, we cannot use the same standard library in our kernel because the underlying binaries are making system calls to Linux or window kernels since our kernel API does not match the expected routines that the C standard library expects it is simply not possible in PeachOS to use the C standard library, so its compiled with the library disabled. We built our own C standard library as the course progresses. printf will be created towards the end of the course

Thanks
Dan