Standalone C library: libsa

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
jamesb

Standalone C library: libsa

Post by jamesb »

I'm working on a standalone C library that I desperately need. It contains a minimal implementation of things that I can use before I have all my device drivers written and that sort of thing.

So far I have a full kprintf that supports colour text and background colour attributes. I'm working on various assembly language goodies to go with it. I'll start uploading the code to my website sometime later today. I'm porting RedHat's newlib C library to work standalone on IBM and compatible PCs with Intel and compatible CPUs, and eventually I hope to have a very decent "libsa."

I'm working from snippets of code I find over the net, but writing most of it from scratch myself. I'm going to port across code from NetBSD's "libsa" over the coming weeks. The network code in there will be very useful, to say the least... (saves me writing my own... *cough*).

Anyone else got a standalone library for their kernel? Any contributions to make? Any random thoughts, suggestions?

I'll post here again when it's finished, with a link to download the library and docs for using it with your own kernel. Hopefully it'll save all of us a lot of boring work before getting to the exciting parts of OS deving, the kernel proper, without working in a tight, limited capability environment... :P
jamesb

Re:Standalone C library: libsa

Post by jamesb »

You might be wondering, why not use OSKit? Well, I've used it here and there until I hit a dead end with the multiboot stuff (the Utah Uni guys who wrote OSKit created the multiboot standard, so go figure...)

The damn thing just wouldn't link. And it was poorly documented. And nobody answered my emails. So to hell with it.
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Standalone C library: libsa

Post by df »

i write my own libc as I need, and i dont need a full libc yet.

also, multiboot standard was defined by Erich Boleyn, nothing to do with oskit, iirc.
-- Stu --
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Standalone C library: libsa

Post by Solar »

Actually, I started working on the PDPCLib, a public domain implementation of a C standard library, intending to have a fully C99 compliant, POSIX free standard lib when I'm finished.

As things look now, I consider releasing the thing back into the public domain.

How do you handle the licensing? When you are "porting over" from NetBSD and newlibc?
Every good solution is obvious once you've found it.
jamesb

Re:Standalone C library: libsa

Post by jamesb »

df wrote: also, multiboot standard was defined by Erich Boleyn, nothing to do with oskit, iirc.
Who worked with the Utah professor, who wrote OSKit. The multiboot standard was inspired by the OSKit development.
jamesb

Re:Standalone C library: libsa

Post by jamesb »

Solar wrote: How do you handle the licensing? When you are "porting over" from NetBSD and newlibc?
Basically, I don't care about licencing. All my own work is going to be public domain with no licence. Refer to the individual licences of the included components (e.g. NetBSD libsa stuff, GPL stuff) for licencing on individual parts of the library.
jamesb

Re:Standalone C library: libsa

Post by jamesb »

Solar wrote: When you are "porting over" from NetBSD and newlibc?
Sorry, I forgot to answer that. I'm porting right now.

RedHat has a guide to writing the system-supplied low level functions that sit underneath newlib, and I'm working from there. NetBSD stuff is next on the list.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Standalone C library: libsa

Post by Solar »

Sorry, misunderstanding on the "When". That should have been an "if".

If you "don't care about licensing", you'll be in serious trouble should you release your work to the public domain and the license advocates realize.

If you add e.g. GPL stuff to your library, your library is GPL and must not be released to the public domain, period.

Beware, the FSF doesn't allow any leeway in that direction. (Since that would weaken their position in e.g. the SCO lawsuit.)
Every good solution is obvious once you've found it.
jamesb

Re:Standalone C library: libsa

Post by jamesb »

Solar wrote: Sorry, misunderstanding on the "When". That should have been an "if".

If you "don't care about licensing", you'll be in serious trouble should you release your work to the public domain and the license advocates realize.

If you add e.g. GPL stuff to your library, your library is GPL and must not be released to the public domain, period.

Beware, the FSF doesn't allow any leeway in that direction. (Since that would weaken their position in e.g. the SCO lawsuit.)
Hmm, thanks very much for pointing this out. I didn't consider this because there are many competing licences in all the source files and as far as my own code is concerned, I couldn't give a hoot, because I was going to give it away to all who wanted it.

However, since I won't be releasing binaries, and I won't be "altering" (as in "improving" or otherwise) the GPL code, merely offering a bunch of source files of my own with others, it probably doesn't come under the GPL since the works are not derivative.

But, I am not a lawyer so I don't know...

Thanks for bringing this to my attention. I'll just release my own code as public domain without any licence, and put a notice up that other source files come "as is" under their own licences.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Standalone C library: libsa

Post by Solar »

Again, warning. You misunderstand the scope of those licenses, especially the GPL! You are not a lawyer, but that won't protect you from lawsuits!

Short intro to the fine print of the GPL, "Terms and Conditions" paragraph 0:
...a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language.
Read, a work (like, your C Lib) containing the Program or a portion of it (like, even as little as a single function from their C Lib) is considered a "derivative work" and falls under the GPL as a whole.

When the FSF says that "public domain is compatible with the GPL", they mean it is OK to take public domain code and place it under the GPL. They do not mean you're allowed to release GPL'ed code to the public domain.

Repeat, you are not allowed to release GPL'ed code into the public domain, and would indeed be subject to lawsuits for breach of licensing contract.

(That's not me threatening you with a lawsuit; in fact, I don't like the GPL myself. I just want to warn you that tampering with the GPL / FSF is dangerous business. They bite just as well as any company, perhaps more so.)
Every good solution is obvious once you've found it.
Therx

Re:Standalone C library: libsa

Post by Therx »

You could release your code in the public domain and then tell others where they can find the other bits. Then they download them frmo the original author. Its not as though a libc is a 'program' as such and I'd guess that most OS devers won't just link in your code but take bits that they need.

Pete
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Standalone C library: libsa

Post by Solar »

That is, of course, a possibility.
Every good solution is obvious once you've found it.
jamesb

Re:Standalone C library: libsa

Post by jamesb »

Solar wrote: Again, warning... <snip>
It looks like I have indeed misunderstood the scope of the GPL. I am glad you have gone to the trouble of pointing that out to me, otherwise I wouldn't have known. I am not a fan of paper pushing bureaucracy, so I tend to just ignore it at my peril :-\

I think the best way to go forward is to understand the parts under the GPL and other licences I don't want to use for this particular project, and write everything from scratch. Rather defeats the purpose of code re-use and open source to a certain extent, but still, it's my opinion that a free-for-all BSD style licence or no licence/public domain is better than the GPL for this project.

If I wanted protection specifically for my open source, free software kernel that I had put years of effort into, I would probably choose the GPL. But not for this standalone C library. It's not that important in terms of creative energy: it's just grunge work that has to be done. And I want anyone and everyone to be able to use it with no restrictions whatsoever, if they choose to use it. Personal, educational, commerical, whatever.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Standalone C library: libsa

Post by Solar »

You might want to check out the PDPClib (available from http://freespace.virgin.net/paul.edwards3/program.htm), which is public domain and can serve as a starting point.

(It's not complete, but already has lots of valuable code.)

I would invite you to join me in my efforts to extend the PDPCLib to a complete, C99 compliant library, but I have not yet completely made up my mind as to whether I'll release that work back into PD. I'd hate to see some dude taking my work, turning it into GPL and continuing from there, with me being unable to merge back stuff without being forced to adopt the GPL myself.

If you are interested, mail me at [email protected]. Perhaps we can work out an agreement that suits all sides, or you can dissolve my doubts about a PD release. ;-)
Every good solution is obvious once you've found it.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Standalone C library: libsa

Post by Solar »

Ah, to hell with it. There isn't much to a C library, once it's "ready", that anyone could "turn into GPL and continue from there".

Since we decided to take the "dynamic" parts of our project website offline (i.e., repository, bug tracker, forum), and since this can well be described to be a project of its own, I opened up a SourceForge project.

The name is "Public Domain C Library" (pdclib - inventive, no? ;D ). It should be approved by next week. I hope that this weekend will be long enough so I can bring my work to a state fit to serve as "initial load" of the repository.

Contributions of course wellcome. Come on! There's no sense in every single one of us battling with his/her very own C library. Let's solve this once and for all (and everybody). Don't fear the corps "stealing" a C lib - how much is there to a ISO standard that could possibly be "stolen"?!? 8)
Every good solution is obvious once you've found it.
Post Reply