liballoc.. any suggestions?

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.
Post Reply
Zz
Posts: 17
Joined: Mon Nov 04, 2013 7:54 pm

liballoc.. any suggestions?

Post by Zz »

Maybe it was the fact that I started looking at one tired until I passed out at five that I did not find it.. BUT I was wondering before I spend anymore time or attempt to crack at it myself if anyone had a suggestion. The library on the wiki is broken so I went on a quest and found lots of information on allocation. I heard that it is best to use a pool allocator. Any direction?
Last edited by Zz on Fri Nov 22, 2013 3:14 pm, edited 1 time in total.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: liballoc.. any suggestions?

Post by Combuster »

The library on the wiki is broken
Which one, where? The wiki only contains references to libraries.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Zz
Posts: 17
Joined: Mon Nov 04, 2013 7:54 pm

Re: liballoc.. any suggestions?

Post by Zz »

Liballoc on http://wiki.osdev.org/C%2B%2B "An easy malloc implementation you can port to your OS is >>liballoc<<. It only requires basic Paging (that is, store a list of used and free pages, and have a function to find the next free page) to work."
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: liballoc.. any suggestions?

Post by Combuster »

wiki wrote:liballoc - Excellent allocator that was part of the Spoon Operating System and designed to be plugged into hobby OS's. Unfortunately it is no longer available.
And the only other link on the wiki 404s. There are however lots of other links you should try, or you can hijack it from elsewhere (no license or documentation found)

If you want to write an allocator on your own, you can do two things: keep it simple but inefficient so you can just use it (first-fit allocator), or design a full-fledged system in which case there are too many design considerations involved to call for one design.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Zz
Posts: 17
Joined: Mon Nov 04, 2013 7:54 pm

Re: liballoc.. any suggestions?

Post by Zz »

Alrighty, I'll learn that source well and then go about making a simple one for the knowledge. Thanks!
Zz
Posts: 17
Joined: Mon Nov 04, 2013 7:54 pm

Re: liballoc.. any suggestions?

Post by Zz »

ANNNND I'm rolling, time to play with it!
blanham
Posts: 10
Joined: Sat Apr 28, 2012 5:16 pm

Re: liballoc.. any suggestions?

Post by blanham »

Combuster wrote:
wiki wrote:liballoc - Excellent allocator that was part of the Spoon Operating System and designed to be plugged into hobby OS's. Unfortunately it is no longer available.
And the only other link on the wiki 404s. There are however lots of other links you should try, or you can hijack it from elsewhere (no license or documentation found)

If you want to write an allocator on your own, you can do two things: keep it simple but inefficient so you can just use it (first-fit allocator), or design a full-fledged system in which case there are too many design considerations involved to call for one design.
I'm using liballoc in my kernel and originally found a copy of liballoc by using (at the time) Google Code Search. The original hosting page was archived on the Wayback Machine here: https://web.archive.org/web/20070221204 ... /liballoc/ and indicates that liballoc is in the public domain. Unfortunately it didn't archive a copy of the original tar ball But, the source for the kernel that used liballoc is archived here: https://web.archive.org/web/20060219201 ... on/smk.php in the smk tarball, which had a BSD license on it, so you should be good to go either way.
blanham
Posts: 10
Joined: Sat Apr 28, 2012 5:16 pm

Re: liballoc.. any suggestions?

Post by blanham »

Bumping this to say I found the full source of liballoc in the Spoon OS snapshot tarball on the Wayback Machine and uploaded the contents to github:

https://github.com/blanham/liballoc
Quick download here: https://github.com/blanham/liballoc/releases/

The rest of the source for spoon/smk/libunix is also on my github for easy access. I'll update the wiki with a link to liballoc.

And original post w/ info here: http://forum.osdev.org/viewtopic.php?f= ... 1&p=19211a
Post Reply