My Kernel Design (Pt1) - Compiler And Language
Posted: Fri Apr 08, 2011 6:19 am
Hello All!
Ive read almost every post on this forum, and can tell there is some great talent here, and would love to share my design ideas with everyone and get some good feedback.
The reason I am making a kernel is for two reasons, I love computers and programming and really see this as a great experiment and learning experience. Secondly, I have some issues with Linux/unix(i) which I think really shouldn't exist.
By far my biggest issue is Information Management. The linux kernel is very messy, and documentation is very poor (even out of date). Making the entry level for a kernel programmer very high. Retention of information is also very poor. The ck patches incident is one example. Due to programmer 'differences' and a dictatorship decision of 'we dont want two cpu schedulers', All the information that ck had built was wiped clean. That information should have been retained regardless of its use to aid future decisions or research.
=== Design ===
Anyway! I have decided to make everything from scratch. A compiler toolkit, kernel, and operating system applications.
My compiler toolkit is powered by XML. Currently only in test snubs and old prototypes, using XSL(i). The XML is closer to an AST than a programming language, but can be abstracted to any level to provide more detailed descriptions of code.
The main reason for this is I do not have the time/experience to create a compiler from scratch. Having a wealth of XML tools available on all platforms was the only feasible way to achieve this.
XML is also machine readable, So Documentation, Checked Exceptions(iv) and Optimisations are completely automated. Architectures are contained in separate files allowing for portability(iii).
Applications are based on the MVC paradigm. This means that only data is shared between applications. RPC is not possible.
Data is either a Collection, or a Member. You never specify "Array", "Directory", "Linked List" etc. All collections begin as a doubly-linked list. Then the type of the collection is selected at compile time depending on the functions that are used on the collection. (next, prev, etc)(v)
Additional collection information is stored separately to the collection data, So if the data is shared and another application requires a different type of collection, the collection is bootstrapped to allow of the additional information.
Data is synchronised with atomic operations and ID's/fingerprints/revision numbers. Watch() and polling (push is an optimisation) is used to signal changes to data.
The kernel is a hybrid. But is designed purely as a micro-kernel. When a driver is compiled to binary, I have additional information which allows the driver to be moved at link/run-time from user-space into kernel-space, and visa-versa. Included in this extra information is optimisation hints which can be applied at link time(vi). Such as static numbers etc.
Sorry for the long post! Comments welcome
Mike Brown
======
I name linux purely as I have read and worked on linux software and the kernel, and it has been my home operating system for over a decade.
[ii] XSL is turing complete. (http://www.unidex.com/turing/utm.htm)
[iii] (Opinion) Information portability is more important than binary portability. The kernel is compiled to each specific architecture/hardware.
[iv] All errors must be handled, or they get passed up to the calling function. Until it is passed outside of main() in which it displays an error message.
[v] Indexed collections are similarly possible.
[vi] Link time optimisations not going so well yet!
Ive read almost every post on this forum, and can tell there is some great talent here, and would love to share my design ideas with everyone and get some good feedback.
The reason I am making a kernel is for two reasons, I love computers and programming and really see this as a great experiment and learning experience. Secondly, I have some issues with Linux/unix(i) which I think really shouldn't exist.
By far my biggest issue is Information Management. The linux kernel is very messy, and documentation is very poor (even out of date). Making the entry level for a kernel programmer very high. Retention of information is also very poor. The ck patches incident is one example. Due to programmer 'differences' and a dictatorship decision of 'we dont want two cpu schedulers', All the information that ck had built was wiped clean. That information should have been retained regardless of its use to aid future decisions or research.
=== Design ===
Anyway! I have decided to make everything from scratch. A compiler toolkit, kernel, and operating system applications.
My compiler toolkit is powered by XML. Currently only in test snubs and old prototypes, using XSL(i). The XML is closer to an AST than a programming language, but can be abstracted to any level to provide more detailed descriptions of code.
The main reason for this is I do not have the time/experience to create a compiler from scratch. Having a wealth of XML tools available on all platforms was the only feasible way to achieve this.
XML is also machine readable, So Documentation, Checked Exceptions(iv) and Optimisations are completely automated. Architectures are contained in separate files allowing for portability(iii).
Applications are based on the MVC paradigm. This means that only data is shared between applications. RPC is not possible.
Data is either a Collection, or a Member. You never specify "Array", "Directory", "Linked List" etc. All collections begin as a doubly-linked list. Then the type of the collection is selected at compile time depending on the functions that are used on the collection. (next, prev, etc)(v)
Additional collection information is stored separately to the collection data, So if the data is shared and another application requires a different type of collection, the collection is bootstrapped to allow of the additional information.
Data is synchronised with atomic operations and ID's/fingerprints/revision numbers. Watch() and polling (push is an optimisation) is used to signal changes to data.
The kernel is a hybrid. But is designed purely as a micro-kernel. When a driver is compiled to binary, I have additional information which allows the driver to be moved at link/run-time from user-space into kernel-space, and visa-versa. Included in this extra information is optimisation hints which can be applied at link time(vi). Such as static numbers etc.
Sorry for the long post! Comments welcome
Mike Brown
======
I name linux purely as I have read and worked on linux software and the kernel, and it has been my home operating system for over a decade.
[ii] XSL is turing complete. (http://www.unidex.com/turing/utm.htm)
[iii] (Opinion) Information portability is more important than binary portability. The kernel is compiled to each specific architecture/hardware.
[iv] All errors must be handled, or they get passed up to the calling function. Until it is passed outside of main() in which it displays an error message.
[v] Indexed collections are similarly possible.
[vi] Link time optimisations not going so well yet!