I have read it in a fast manner and I can give some sort of feedback now. HAL is more or less well documented in doxygen. My main problems are to understand kernel usage logic.
What is missing in Chibios documentation (or what is miss me) is a simple kernel usage tutorial. But not in the way of doxygen format, more like a guide with examples. Your system, more or less has an unique kernel conception. Or let's say unique in user interface. For examlpe:
chSYSLock();
chMBPostS();
chSysUnlock();
I have an experience with few other OS and such a code structure looks strange for me on first view. For most of the people the scheduler/interrupts are blocked for entire section and this code is wrong. After a deep digging in the forum, I found the explanation. In my opinion it should be written clearly some where in documentation that context switch is happens inside. Because immediately the next question arrives - OK, where the "protection" of the section finishes? At the exit of wait function or after sys unlock? What about if I have second wait in this section, is it also protected or not? And why I need to lock kernel before posting a message? I understand that such an interface give us a simple and fast code, but it must be explained in deeper details to be used correctly, because to produce a good code, the user needs to know the kernel operation strategy.
I have similar doubts with mailboxes and memory pools. In most of the OS I have touch, mailbox and memory pool are combined in an abstraction level to automate usage. So for the user all memory pool operation is hidden. I understand your implementation - abstraction always reduces efficiency of the code. But again - it should be documented well, since for the 90% of new users this is an unknown mailbox interface (even they have experience with other OS).
The same with memory pool - for most of the users, memory pool is exactly what you have implement in one of the trunk revisions - mail pool. This is the common memory pool interface known from the other OS. I don't know why you decide to kill this part of the code, for me this is something really useful and well organized from user point of view.
All these features of the OS makes the user interface of Chibios more or less unique. And exactly these features need to be documented more detailed and with a simple and straightway examples. I found a lot of examples in demos and test, but most of them don't give a clear view, since they are specified and optimized for a specific usage which not covers 90% of the user needs in real development. For me this way of education is not correct - the example must give us the simplest and clear way to use a given primitive. The user will use this for a base and built what he/she needs. The examples in test code cannot be used for basic education. The code there is already "deformed" for specific usage.
Another section which miss documentation is the interrupts handling. In my opinion this is the part where most of the beginners has the biggest problems. Comparing with other OS - Chibios is really well designed for reaction time. For example MQX and Nuttx has a common interrupt vector which makes a critical time reaction more or less impossible. Nuttx don't support fast interrupts at all (or not support them on usable level). To have a Cortex on 180Mhz and to have a reaction times of 10 us looks crazy
You are on the right way - the efficient code. But the lack of abstractions needs a better documentation for usage. Because we have more freedom to make a mistakes also
In fact Chibios is more or less unique in the following - we have freedom and efficiency with a maximum possible level of abstraction (without efficiency reduction). This is why I like it.
A part of these questions will be resolved with CMSIS-RTOS abstraction layer. But I don't like this conception at all, so I'm not sure this is the right way to find the answers.
To be absolutely clear - this is not a critic! You are making a great job! This is a proposition of a person which has an outside view of the system. These are the problems/questions that I have. I think in the book you need to focus on this point a bit more - kernel/synchronization usage tutorial with simple examples coming from real life development. Where we need to lock? Where we don't need to lock? How to create an usable mailbox for an arbitrary structure and thread to thread communication (interrupt to thread)? And etc....
Regards
Ceco