Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
You cannot use library functions, anything that requires you to "#include" any headers [which you did not write yourself] is not possible, everything [including the C/C++ standard library] must be written yourself (If your kernel is going to be Open Source then you can rip parts out of glibc).
AR wrote:
You cannot use library functions, anything that requires you to "#include" any headers [which you did not write yourself] is not possible, everything [including the C/C++ standard library] must be written yourself (If your kernel is going to be Open Source then you can rip parts out of glibc).
There isn't really any specific source of information that I know of, you're expected to know what the functions do, combine that with knowledge of how the hardware works to recreate that functionality in the kernel. Also be aware that some functionality is simply too complex to support without an indepth understanding (ie. exceptions - stack unwinding).
For examples there is GRUB, Linux and BSD (All of which are C, not C++ though).
AR wrote:
There isn't really any specific source of information that I know of, you're expected to know what the functions do, combine that with knowledge of how the hardware works to recreate that functionality in the kernel. Also be aware that some functionality is simply too complex to support without an indepth understanding (ie. exceptions - stack unwinding).
Or you could just randomly write functions and comply to no standard functions and then have to rewrite all applications you port because you renamed half of the functions.
I wouldnt recommend that, for reasons that should be all too clear.
so you will first have to write some text drivers like printf("string");
ok , written it by any language ? can i write it by C , and any open source example please .
The majority of it can be written in C (or any other suitable systems language), but at least some parts must be written in assembly, and you may want to write some other in assembly for efficiency.
Write everything you can in C. Then forget about efficiency, until someone complains about it, and then blame their code.
Seriously, very few library functions can benefit from assembler optimizations. Maybe memcpy/memmove/memset, but that's about it, and if I am not mistaken, compilers like GCC can generate fast inline code for those functions anyway, if you allow that.