It's a C issue, not an implementation issue. Learn C well.
Alternatively, study OS kernels not implemented in C. It's all basic algorithms and can be implemented in any language, if you content with abstraction and don't mind working with emulated "devices".
Alternatively, study OS kernels not implemented in C. It's all basic algorithms and can be implemented in any language, if you content with abstraction and don't mind working with emulated "devices".