OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 9:23 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Choosing a license
PostPosted: Wed Dec 03, 2014 5:33 am 
Offline
User avatar

Joined: Fri Nov 21, 2014 6:30 am
Posts: 24
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.


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 6:14 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
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.

_________________
Developer of tyndur - community OS of Lowlevel (German)


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 6:51 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 21, 2012 3:01 pm
Posts: 930
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_Tutorial_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.


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 9:10 am 
Offline
User avatar

Joined: Fri Nov 21, 2014 6:30 am
Posts: 24
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_Tutorial_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.


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 9:19 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
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.

_________________
Developer of tyndur - community OS of Lowlevel (German)


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 9:38 am 
Offline
User avatar

Joined: Fri Nov 21, 2014 6:30 am
Posts: 24
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.


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 9:48 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 21, 2011 9:47 pm
Posts: 286
Location: Tustin, CA USA
Espanish wrote:
True, but that's only if I have to debug it.


You will.

_________________
Adam

The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal

"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 10:04 am 
Offline
Member
Member
User avatar

Joined: Wed Jul 13, 2011 7:38 pm
Posts: 558
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.


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 10:21 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
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.)

Quote:
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.

_________________
Developer of tyndur - community OS of Lowlevel (German)


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 11:59 am 
Offline
Member
Member
User avatar

Joined: Wed Mar 21, 2012 3:01 pm
Posts: 930
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.


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 12:58 pm 
Offline
Member
Member

Joined: Thu Jul 05, 2012 5:12 am
Posts: 923
Location: Finland
@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.

_________________
Undefined behavior since 2012


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Wed Dec 03, 2014 4:33 pm 
Offline
Member
Member
User avatar

Joined: Wed Mar 21, 2012 3:01 pm
Posts: 930
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.


Top
 Profile  
 
 Post subject: Re: Choosing a license
PostPosted: Fri Dec 05, 2014 3:12 am 
Offline
User avatar

Joined: Fri Nov 21, 2014 6:30 am
Posts: 24
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 52 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group