Malloc Implementation in C

Hey Guys

Some of my friends have got together and we are trying to write a basic kernel similar to Linux. I am trying to implement the malloc function in C and I am using a doubly linked list as the primary data structure. I need to allocate memory for this link list (duh...) and I don't feel like using malloc for it. I mean I am trying to implement a malloc function and it will be kind of stupid to use malloc for it.I was just wondering is there a way to allocate memory for my list without calling malloc.

Any help will be appreciated

I didn't study OS design, but shouldn't the malloc() function be part of the C library, not the kernel?

That aside, I'd write it in assembly language (after all, it's pretty CPU specific, and might even be time-critical). Also, it might help flipping through Tannenbaums Operating Systems Design and Implementation, as I'm sure that there's some information in there. Minix is the implementation of the theories put forth there.

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.