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.