design principles ----------------- The final goal is a self-hosting, self-compiling system, so we will have to implement or port the assember, the C compiler, a linker and a make program into the new operating system. So featuritis and non-standards will kill the project fast! Use strict ANSI C99. This means no inline-assembly. This means we have to write assembly routines if we need things not available in C (lgdt, in, out, etc.). Use the cdecl calling convetion when calling assembly from C. Stick to NASM assembly bare features (equ, org). Use only the absolute minimum. Use only as much assembly as needed, if necessary call a stub function from C doing the things we would normally do in inlined assembly. Make sure it compiles with every ANSI C99 compiler (gcc, clang, tcc, pcc, ...). Use only what is needed, nothing fancy. Try to compile as often as possible with different compilers on different host systems. Use only very simple makefile rules. Make sure we could also just use a simple shell script to compile the kernel. Avoid implementation and using of unsafe C functions. Provide safe counterparts wherever possible. There are of course exceptions like scrolling the VGA buffer with a memmove. Use standard C functions early on, even if they have to be glued funnilly to early functions as in VGA text console, etc.