C Kernel, and the Runtime Library

Programming, for all ages and all languages.
Post Reply
User avatar
mark3094
Member
Member
Posts: 164
Joined: Mon Feb 14, 2011 10:32 pm
Location: Australia
Contact:

C Kernel, and the Runtime Library

Post by mark3094 »

Hi,

I have written a simple bootloader in assembly, and now I want to begin writing a Kernel in C.

So far I have setup Visual C++ Express according to the guide at: http://www.brokenthorn.com/Resources/OSDevMSVC.html
I have created a simple ASM entry point that sets the stack location (as recommended here: http://www.osdever.net/tutorials/view/s ... ng-your-os) and passes control to a procedure written in C that simply writes a few characters to the screen as a test. All this works well so far.

I am getting a little confused when it comes to understanding how the runtime library works in this case. The first link above refers to creating a runtime environment for VC++, but it looks like they're referring to C++ not C (I don't know any C++ so I'm not sure).

Do I have to create a C runtime environment for my Kernel? Are there any resources which state exactly what the C runtime does? As far as I understand, the C runtime provides a starting environment for the Kernel, which I have partly done by setting up the stack and other registers in my entry routine. What else does it need to do?


Thankyou very much for your advice
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: C Kernel, and the Runtime Library

Post by thepowersgang »

There is no need for a runtime library to use C, you can (and must, when doing kernel dev) do it all yourself.

C++ needs runtime libs for some of the more complex features (exception handling for one)
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply