Linking exception of the license
Moderators: RoccoMarco, lbednarz, tfAteba
-
Freddie Chopin
- Posts: 36
- Joined: Wed Oct 17, 2012 8:57 am
Linking exception of the license
Hi!
Does the linking exception to the GPL forbid me to use ChibiOS/RT with some modifications to the RTOS itself (providing source code of the RTOS)? If that's the case than it's pretty strange... Let's say that I'd like to change how the memory allocator using malloc() works, by removing all locks from chHeapAlloc() and defining newlib's hooks __malloc_lock() and __malloc_unlock() to use a mutex/semaphore/disabling-of-system/sth-else (that's the preferred method in newlib, as core newlib functions will not use chHeapAlloc() but malloc() and you should secure that). If I understand the license correctly such modification when using ChibiOS/RT in a commercial product (closed-source) is forbidden?
Thx for clarifications!
4\/3!!
Does the linking exception to the GPL forbid me to use ChibiOS/RT with some modifications to the RTOS itself (providing source code of the RTOS)? If that's the case than it's pretty strange... Let's say that I'd like to change how the memory allocator using malloc() works, by removing all locks from chHeapAlloc() and defining newlib's hooks __malloc_lock() and __malloc_unlock() to use a mutex/semaphore/disabling-of-system/sth-else (that's the preferred method in newlib, as core newlib functions will not use chHeapAlloc() but malloc() and you should secure that). If I understand the license correctly such modification when using ChibiOS/RT in a commercial product (closed-source) is forbidden?
Thx for clarifications!
4\/3!!
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Linking exception of the license
Hi,
The exception forbids modification to the core files except examples, configuration files and template files. You can enhance the system (new ports, new device drivers) but not modify it. Commercial licenses also allow modifications. Pure GPL users can do anything of course.
Of course exceptions can be discussed, if a change is beneficial to the project and is ported in the main line then it is acceptable, it already happened that a stable branch has been updated because needs of a non-commercial user. A better support of newlib would not be a problem.
About your proposal, the newlib malloc() and system chHeapAlloc() can co-exist, you don't need to modify chHeapAlloc() to do so.
Just implement sbrk() using chCoreAlloc() and implement those locks using a semaphore as you proposed. The application could then safely use both malloc() and chHeapAlloc(), both would be feed memory chunks by the core allocator.
Giovanni
The exception forbids modification to the core files except examples, configuration files and template files. You can enhance the system (new ports, new device drivers) but not modify it. Commercial licenses also allow modifications. Pure GPL users can do anything of course.
Of course exceptions can be discussed, if a change is beneficial to the project and is ported in the main line then it is acceptable, it already happened that a stable branch has been updated because needs of a non-commercial user. A better support of newlib would not be a problem.
About your proposal, the newlib malloc() and system chHeapAlloc() can co-exist, you don't need to modify chHeapAlloc() to do so.
Just implement sbrk() using chCoreAlloc() and implement those locks using a semaphore as you proposed. The application could then safely use both malloc() and chHeapAlloc(), both would be feed memory chunks by the core allocator.
Giovanni
-
Freddie Chopin
- Posts: 36
- Joined: Wed Oct 17, 2012 8:57 am
Re: Linking exception of the license
Giovanni wrote:The exception forbids modification to the core files except examples, configuration files and template files. You can enhance the system (new ports, new device drivers) but not modify it. Commercial licenses also allow modifications. Pure GPL users can do anything of course.
Of course exceptions can be discussed, if a change is beneficial to the project and is ported in the main line then it is acceptable, it already happened that a stable branch has been updated because needs of a non-commercial user. A better support of newlib would not be a problem.
That's a very big pity... In this area FreeRTOS has a more premissive license - you can modify the FreeRTOS as much as you like, just publish the source of the RTOS.
About your proposal, the newlib malloc() and system chHeapAlloc() can co-exist, you don't need to modify chHeapAlloc() to do so.
Just implement sbrk() using chCoreAlloc() and implement those locks using a semaphore as you proposed. The application could then safely use both malloc() and chHeapAlloc(), both would be feed memory chunks by the core allocator.
Dynamic allocation was just an example of possible modifications one could need, but going deeper into your proposal I think it would be hard to do that way (implementing sbrk() to use chCoreAlloc()) - sbrk() can be called from the thread, from interrupt, from anywhere the code needs dynamic allocation, so you'd need at least chCoreAllocI() and that would probably not work for all the cases. Of course you could not use chCoreAlloc() for anything else, as sbrk() should return blocks that are adjacent - chCoreAlloc() would have to be used exclusively by sbrk()... Wouldn't using locks for malloc() and chHeapAlloc() be enough, while sbrk() be implemented without any knowledge of RTOS? These question - maybe not related to the main topic (license) - may seem trivial, as I don't fully understand the concepts and architecture of ChibiOS/RT yet - it seems to be much more complex than FreeRTOS for example...
4\/3!!
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Linking exception of the license
Hi,
The architecture probably is more complex, it tries to formalize the correct usage of the various APIs in the various contexts, there is also a state checker that is able to test the call context of each function and helps writing correct code. The "what can I do in this context?" is, IMO, the biggest source of random failures after stack overflows in RTOS-based systems. The idea is to simply prevent that.
About sbrk(), the question is: is it really meant to be used from ISRs? in that context you should probably use chCoreAllocI() or, even better, the pool allocator. OS-provided primitives are probably safer in contexts that are not defined by the C standard.
Returning to the licensing, probably it is true that the exception is a bit more restrictive than FreeRTOS's one, there are reasons for that:
1) I am concerned about ChibiOS/RT based product failing because changes to the released code.
2) Give commercial users reasons to buy licenses or the project will never become self-sustaining.
Giovanni
The architecture probably is more complex, it tries to formalize the correct usage of the various APIs in the various contexts, there is also a state checker that is able to test the call context of each function and helps writing correct code. The "what can I do in this context?" is, IMO, the biggest source of random failures after stack overflows in RTOS-based systems. The idea is to simply prevent that.
About sbrk(), the question is: is it really meant to be used from ISRs? in that context you should probably use chCoreAllocI() or, even better, the pool allocator. OS-provided primitives are probably safer in contexts that are not defined by the C standard.
Returning to the licensing, probably it is true that the exception is a bit more restrictive than FreeRTOS's one, there are reasons for that:
1) I am concerned about ChibiOS/RT based product failing because changes to the released code.
2) Give commercial users reasons to buy licenses or the project will never become self-sustaining.
Giovanni
-
Freddie Chopin
- Posts: 36
- Joined: Wed Oct 17, 2012 8:57 am
Re: Linking exception of the license
Giovanni wrote:The architecture probably is more complex, it tries to formalize the correct usage of the various APIs in the various contexts, there is also a state checker that is able to test the call context of each function and helps writing correct code. The "what can I do in this context?" is, IMO, the biggest source of random failures after stack overflows in RTOS-based systems. The idea is to simply prevent that.
Probably the problem is lack of documentation other than the one from doxygen - something like a description of when to use it, how to use it, with a nice example. There are some articles on the site, but they don't cover all the aspects... I'm talking about FreeRTOS all the time, but some articles like "Getting started" from their site would be nice. Some short descriptions + trivial example of use for stuff that is "widely known" (semaphores, mutexes, ...), something longer for things rarely used in embedded world, like events, conditional variables, etc. - I wouldn't know how to use these by just reading the doxygen docs...
Returning to the licensing, probably it is true that the exception is a bit more restrictive than FreeRTOS's one, there are reasons for that:
1) I am concerned about ChibiOS/RT based product failing because changes to the released code.
2) Give commercial users reasons to buy licenses or the project will never become self-sustaining.
The problem is that a small developer like me cannot afford a commercial license - you should probably consider something like FreeRTOS has done - the in-depth books about using the RTOS can be bought for a reasonable price, so a lot of developers AND hobbyists could buy that.
Don't get me wrong - I'm interested in your project and at the first look it seems more powerful than FreeRTOS (event system - great thing!), but at the same time there are some "cons" - the license, the documentation, the complexity (that's actually related to documentation).
I don't know whether I'd need to change anything in the kernel but it's better to be safe than sorry - if I find something that HAS to be changed to fit my needs after spending some time on the project with a soon-to-come deadline it won't be a nice situation (; I used malloc() as an example because that's the first thing I changed in FreeRTOS. Apart from that I've changed formatting of debug output for run-time stats and task list, but these features are not present in ChibiOS/RT anyway. This debate may seem a little "adacemic", as from what I've seen most of things that sometimes need adjustment are configurable anyway, without need to change anything, but I'm exploring the depths (;
Hope you don't mind this discussion (;
4\/3!!
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Linking exception of the license
Absolutely I don't mind discussion.
It is fun, there have been complaints about too much documentation to read
Other sources of examples are provided with the RTOS:
- Under ./test there is at least one use example for each kernel API.
- Under ./teshhal there are examples for the various device drivers.
The articles in the documentation section mostly spawned in the forum, if something is discussed then it probably goes into an article. I must say condition variables never received much attention, it is a Posix-derived mechanism but probably too exotic for most users. Feel free to request new articles.
This has been discussed, there was also an idea of a community-driven book. It is in the to-do list.
It is not an absolute barrier, it can be discussed case by case and I don't have problem with giving waivers.
Giovanni
Freddie Chopin wrote:Probably the problem is lack of documentation other than the one from doxygen - something like a description of when to use it, how to use it, with a nice example. There are some articles on the site, but they don't cover all the aspects... I'm talking about FreeRTOS all the time, but some articles like "Getting started" from their site would be nice. Some short descriptions + trivial example of use for stuff that is "widely known" (semaphores, mutexes, ...), something longer for things rarely used in embedded world, like events, conditional variables, etc. - I wouldn't know how to use these by just reading the doxygen docs...
It is fun, there have been complaints about too much documentation to read
Other sources of examples are provided with the RTOS:
- Under ./test there is at least one use example for each kernel API.
- Under ./teshhal there are examples for the various device drivers.
The articles in the documentation section mostly spawned in the forum, if something is discussed then it probably goes into an article. I must say condition variables never received much attention, it is a Posix-derived mechanism but probably too exotic for most users. Feel free to request new articles.
Freddie Chopin wrote:The problem is that a small developer like me cannot afford a commercial license - you should probably consider something like FreeRTOS has done - the in-depth books about using the RTOS can be bought for a reasonable price, so a lot of developers AND hobbyists could buy that.
This has been discussed, there was also an idea of a community-driven book. It is in the to-do list.
Freddie Chopin wrote:I don't know whether I'd need to change anything in the kernel but it's better to be safe than sorry - if I find something that HAS to be changed to fit my needs after spending some time on the project with a soon-to-come deadline it won't be a nice situation
It is not an absolute barrier, it can be discussed case by case and I don't have problem with giving waivers.
Giovanni
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Linking exception of the license
Freddie Chopin wrote:debug output for run-time stats and task list, but these features are not present in ChibiOS/RT anyway
I am not sure if we are talking about the same thing but in ChibiOS/RT there is chprintf() that can print on any abstract stream and the registry subsystem that keeps track of all active threads.
Giovanni
-
Freddie Chopin
- Posts: 36
- Joined: Wed Oct 17, 2012 8:57 am
Re: Linking exception of the license
Giovanni wrote:Absolutely I don't mind discussion.
Great (;
It is fun, there have been complaints about too much documentation to read
Maybe I've used a wrong word - documentation (the one from doxygen) is great and mostly complete - what I miss are more guide-articles like:
- "How to use feature-X?" - conditional variables are a mystery for me [; , as for events, the article describes the implementation, not giving any examples
- "How to write a simple application in ChibiOS/RS?" with a simple example of something typical like device with some interfaces + LCD + some buttons for user interface - something in a spirit of a step-by-step tutorial (using "abstract" functions like GetButton() and PrintLCD(), as these are not the main concern of such article)
- "Unusual functionalities of feature-X" - some mechanisms in ChibiOS/RT can be used in various ways that are not so typical - for example counting semaphores with both negative and positive counter values - these usually can be only positive, or the "link application defined pointer" field in I/O queues - that's something not usually seen, and I have no idea what's that for, examples of using memory pools (the API is a bit cryptic), ...
Other sources of examples are provided with the RTOS:
- Under ./test there is at least one use example for each kernel API.
- Under ./teshhal there are examples for the various device drivers.
Good to know, I haven't browsed that deep (; BTW - is ChibiOS/RT "deeply coupled" with it's HAL abstraction layer, or maybe you can use it without supplied HAL at all?
The articles in the documentation section mostly spawned in the forum, if something is discussed then it probably goes into an article. I must say condition variables never received much attention, it is a Posix-derived mechanism but probably too exotic for most users. Feel free to request new articles.
Some ideas above [; Generally a article explaining each feature of RTOS with a short (trivial) example would be most welcome - these can always be expanded if needed.
This has been discussed, there was also an idea of a community-driven book. It is in the to-do list.
Good to know - I'm looking for buying it (;
It is not an absolute barrier, it can be discussed case by case and I don't have problem with giving waivers.
Great (;
I am not sure if we are talking about the same thing but in ChibiOS/RT there is chprintf() that can print on any abstract stream and the registry subsystem that keeps track of all active threads.
As I've said I haven't used your project yet, for now I'm just browsing through the docs, the code, the site, ... . So you say a similar thing as vTaskGetRunTimeStats() and vTaskList() in FreeRTOS is possible here? Is it possible to use it without chprintf(), memstreams and HAL? I actually prefer a more full-blown stdio versions with my own "virtual file system" and my own drivers for hardware...
4\/3!!
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Linking exception of the license
Freddie Chopin wrote:Good to know, I haven't browsed that deep (; BTW - is ChibiOS/RT "deeply coupled" with it's HAL abstraction layer, or maybe you can use it without supplied HAL at all?
The kernel is usable standalone, it does not have dependencies, if you look into the demos you will find also a kernel-only one. It is the HAL that requires the kernel, see the architecture document
Freddie Chopin wrote:for example counting semaphores with both negative and positive counter values
Classic counter semaphores as defined by Dijkstra require a signed counter: http://en.wikipedia.org/wiki/Counting_semaphore
The implementation is very similar to that definition except for ChibiOS-specific extensions like: timeouts, resets and atomic aggregated operations.
Freddie Chopin wrote:vTaskGetRunTimeStats() and vTaskList() in FreeRTOS is possible here?
Look for the kernel registry, it as access methods to the threads list. Runtime stats are limited to the time consumed by the thread currently.
Freddie Chopin wrote:Is it possible to use it without chprintf(), memstreams and HAL?
The registry is not dependent on any of those, chprintf() can be used for debug output by writing on a user-defined debug stream. Abstract streams are an interface over anything, so you can stream over a serial port or to the debugger or to a memory buffer for example.
Giovanni
Re: Linking exception of the license
Hello,
I see interesting discussion ;D and I have some questions too.
As far as I understood license I can use ChibiOS in commercial project only for one small condition, recipient of product must have information, that I used ChibiOS, in specified version, give him chance to get a source code for ChibiOS, right ? So for example in product instruction should be note including that informations, it that way tolerably ?
Also I have some doubts with that kind of situation:
I'm just developer of intellectual property, I create, for example, project of MP3 player. I develop hardware design and code software for it. Then, I sell this project to "Big company" so I'm obligated to add a note in documentation about ChibiOS. Its OK for me, but whether this "Big company" also have to put similar note about your system in instruction of this MP3 player for end customer or not ? If he had to, it would be quite inconvenient.
I see interesting discussion ;D and I have some questions too.
As far as I understood license I can use ChibiOS in commercial project only for one small condition, recipient of product must have information, that I used ChibiOS, in specified version, give him chance to get a source code for ChibiOS, right ? So for example in product instruction should be note including that informations, it that way tolerably ?
Also I have some doubts with that kind of situation:
I'm just developer of intellectual property, I create, for example, project of MP3 player. I develop hardware design and code software for it. Then, I sell this project to "Big company" so I'm obligated to add a note in documentation about ChibiOS. Its OK for me, but whether this "Big company" also have to put similar note about your system in instruction of this MP3 player for end customer or not ? If he had to, it would be quite inconvenient.