Page 1 of 1

Choosing a license

Posted: Wed Dec 03, 2014 5:33 am
by Espanish
I have read the Wiki page on [Licensing].
I am aware that code in the Wiki is licensed as [CC0].

However, neither Bran Friesen's nor James Molloy's tutorials make any mention of the license they use.
So considering I use (modified) code from both tutorials and also the Wiki, what license can I use for my own work?

I want to use something that will allow people to reuse my code and binaries however they want.
Currently I am considering CC0 or Expat, if those are possible to use in this case.

Re: Choosing a license

Posted: Wed Dec 03, 2014 6:14 am
by Kevin
If you don't have an explicit license to use some code, that doesn't mean that you can do what you want. The copyright law applies, which varies by country, but essentially means that without permission of the copyright holder you can't do anything with the code (except reading it).

I seem to remember that James once gave a very permissive license for all of his tutorial code, but I don't remember the details. I don't know about the other tutorial.

In any case, it's better to understand what needs to be done and write the code to do it all by yourself.

Re: Choosing a license

Posted: Wed Dec 03, 2014 6:51 am
by sortie
It would defeat the purpose if you couldn't use the tutorial code as your own.

In these cases, please completely disregard those tutorials. The code isn't that good. They are old and do not contain any of the experience the community has learned over the past years, they'll give you trouble and bad advise. I suggest you read http://wiki.osdev.org/Bran%27s_Known_Bugs and http://wiki.osdev.org/James_Molloy%27s_ ... Known_Bugs to undo the damage that may have occurred. The osdev wiki may not be a complete replacement for those tutorials, if that is the case, please notify me what you would like to see, and I'll write a wiki article on the matter.

Re: Choosing a license

Posted: Wed Dec 03, 2014 9:10 am
by Espanish
Kevin wrote:I seem to remember that James once gave a very permissive license for all of his tutorial code, but I don't remember the details. I don't know about the other tutorial.
I have sent JamesM a PM asking about the license, waiting for a reply.
Kevin wrote:In any case, it's better to understand what needs to be done and write the code to do it all by yourself.
For simple things like printing colored text, that's not so difficult, and even I could do it on my own.
However when it gets to loading the GDT and IDT and generating the code for IRQ's and ISR's, that's suddenly nasty. And it feels like reinventing the wheel, together with small things like the linker.ld script. So honestly I just copy-pasted those parts.
sortie wrote:It would defeat the purpose if you couldn't use the tutorial code as your own.
Indeed, it would. However the tutorial code should have a license to clarify how it can be reused.
sortie wrote:In these cases, please completely disregard those tutorials. The code isn't that good. They are old and do not contain any of the experience the community has learned over the past years, they'll give you trouble and bad advise. I suggest you read http://wiki.osdev.org/Bran%27s_Known_Bugs and http://wiki.osdev.org/James_Molloy%27s_ ... Known_Bugs to undo the damage that may have occurred.
Thank you for the links.
Regarding possible bugs, I had to fix the linker.ld script to prevent Grub from giving Error 13, but I'm not sure if that's a bug in the original Molloy tutorial or in an early Grub which I was using (pre 0.97). If nobody else had this problem then it's probably just me.
sortie wrote:The osdev wiki may not be a complete replacement for those tutorials, if that is the case, please notify me what you would like to see, and I'll write a wiki article on the matter.
I will just say that setting up the GDT and IDT feels like homework more than anything else.
There's a discussion to be had about why (not) to use bit fields in the GDT, but for actually loading it it's better to just copy-paste somebody else's tested code, IMO.

Re: Choosing a license

Posted: Wed Dec 03, 2014 9:19 am
by Kevin
Espanish wrote:However when it gets to loading the GDT and IDT and generating the code for IRQ's and ISR's, that's suddenly nasty. And it feels like reinventing the wheel, together with small things like the linker.ld script. So honestly I just copy-pasted those parts.
OS development is all about reinventing the wheel. Otherwise you could just take a Linux kernel.

Also, failing to understand the code you use in your OS means that you won't be able to debug it.

Re: Choosing a license

Posted: Wed Dec 03, 2014 9:38 am
by Espanish
Kevin wrote:OS development is all about reinventing the wheel. Otherwise you could just take a Linux kernel.
"Reinventing the wheel" in this case is just an expression for "rewriting the same code".
I can think of my own unique way to print colored text, but not to load the GDT.
Kevin wrote:Also, failing to understand the code you use in your OS means that you won't be able to debug it.
True, but that's only if I have to debug it. If it's well-tested by at least one knowledgeable person (the tutorial author) then it's likely that I won't have problems with it, and I can focus on creatively reinventing the wheel and pursuing my own goals.

As for the topic of this thread, I don't mind if it's slowly derailed. However, I'd like to hear from others who have been in my situation, with the licenses and following the above tutorials.

Re: Choosing a license

Posted: Wed Dec 03, 2014 9:48 am
by eryjus
Espanish wrote:True, but that's only if I have to debug it.
You will.

Re: Choosing a license

Posted: Wed Dec 03, 2014 10:04 am
by Kazinsal
Espanish wrote:If it's well-tested by at least one knowledgeable person (the tutorial author) [...]
There's a reason we're not advocating use of those tutorials anymore.

Re: Choosing a license

Posted: Wed Dec 03, 2014 10:21 am
by Kevin
Espanish wrote:I can think of my own unique way to print colored text, but not to load the GDT.
Only shows that you still got a bit to learn about the GDT. (If there weren't more than one way to fill it, it wouldn't exist.)
If it's well-tested by at least one knowledgeable person (the tutorial author) then it's likely that I won't have problems with it, and I can focus on creatively reinventing the wheel and pursuing my own goals.
Chances are that you'll have to modify this code at some point in order to implement your own goals.

Re: Choosing a license

Posted: Wed Dec 03, 2014 11:59 am
by sortie
Espanish wrote:I will just say that setting up the GDT and IDT feels like homework more than anything else. There's a discussion to be had about why (not) to use bit fields in the GDT, but for actually loading it it's better to just copy-paste somebody else's tested code, IMO.
Yes, by all means use somebody's else GDT code. For instance, use mine! My point is that these tutorials have copy-pasted that same GDT code from other tutorials, and everyone uses this code. There is no improvement going on, everyone has the same crappy GDT code. Obvious improvements include initializing it at compile time rather than with code, loading the GDT in the bootstrap assembly immediately, and so on. That's my problem with these tutorials, there is no improvement or community-based improvement going on.

Re: Choosing a license

Posted: Wed Dec 03, 2014 12:58 pm
by Antti
@sortie: What is your "struct gdt_entry gdt[]" guaranteed alignment? Is it 2 (uint16_t) or 8 (struct gdt_entry)? This is an honest question because I am not sure what the standard says here. This same applies to IDT.

Re: Choosing a license

Posted: Wed Dec 03, 2014 4:33 pm
by sortie
Antti wrote:@sortie: What is your "struct gdt_entry gdt[]" guaranteed alignment? Is it 2 (uint16_t) or 8 (struct gdt_entry)? This is an honest question because I am not sure what the standard says here. This same applies to IDT.
The alignment is at least the alignment of all the struct members. I expect it to be 2-byte aligned as uint16_t is the largest. I realize now that might not be good enough. I'll check the manual.

Re: Choosing a license

Posted: Fri Dec 05, 2014 3:12 am
by Espanish
Still waiting for JamesM to reply, but seeing as his last activity was April this year, I'm not holding my breath.
Also I find it curious that he didn't fix his tutorial code despite of the Wiki page dedicated to it.