Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 31 Jul 2014, 11:59
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Puppy In-House Development
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 17 of 19 [285 Posts]   Goto page: Previous 1, 2, 3, ..., 15, 16, 17, 18, 19 Next
Author Message
amigo

Joined: 02 Apr 2007
Posts: 2226

PostPosted: Thu 05 Jun 2014, 03:00    Post subject:  

I wound up cloning the whole repo -about 590MB, but following on technosaurus about wget recursive, I was able to get just the patches with:
Code:
 wget -r -l1 --no-parent http://cgit.openembedded.org/openembedded/plain/recipes/xorg-xserver
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4292

PostPosted: Thu 05 Jun 2014, 14:56    Post subject:  

@amigo thanks for the wget command. I'm in the process of moving so doing everything from my droid. I wouldn't be too concerned with the 560mbs though, you may discover some other interesting finds. I noted some interesting projects that I'd never heard of before.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4292

PostPosted: Mon 16 Jun 2014, 00:22    Post subject:  

I posted a public domain MP3 and MP2 decoder here:
https://github.com/technosaurus/PDMP3
https://github.com/technosaurus/PDMP2
I'm still looking through them to see if it would be hard to merge them.
<edit>
I wrote a little (public domain) ogg player too using stb_vorbis ... compiles to 44kb with dietlibc, but I'll post just the source till I get a musl toolchain up.
Code:
//diet gcc -Os -finline-small-functions oggplay.c -ffunction-sections -fdata-sections -fmerge-all-constants -Wl,--gc-sections,-s -o oggplay -lm
#define STB_ONLY
#include "stb.h"           /*  http://nothings.org/stb.h  */
#include "stb_vorbis.c"
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/soundcard.h>
#include <errno.h>

static inline void write2(char *msg){
   fputs(msg,stderr);
}

int main(int argc, char **argv){
   int error,
   value = AFMT_S16_LE ,
   pcm = open("/dev/dsp", O_WRONLY);
   if (pcm < 0)
      write2("cannot get fd\n");
   if (ioctl(pcm, SNDCTL_DSP_SETFMT, &value) < 0)
      write2("cannot set audio format: %s\n");

while (--argc) {
    short *decoded;
    int channels, len, sample_rate;
    len = stb_vorbis_decode_filename(argv[argc], &channels, &sample_rate, &decoded);
    if (ioctl(pcm, SNDCTL_DSP_CHANNELS, &channels) < 0)
      write2("cannot set channels");
    if (ioctl(pcm, SNDCTL_DSP_SPEED, &sample_rate) < 0)
      write2("cannot set sample rate");
   write(pcm,decoded,len*channels);
}
close(pcm);
return 0;
}


</edit>
So, I've been writing my own libc that is specifically designed for small static builds and as part of that I have been splitting each function into its own file with its own header so that instead of #include <string.h> and possibly getting unwanted garbage you can just #include "strlen.h", which is good in that you don't have to remember what functions go with what headers but can become rather tedious so I wrote this awk script that will find any occurrence of supported functions and generate an include file.

Code:
#!/bin/awk -f
BEGIN{
   FS="[^a-zA-Z_]"

#supported functions are comma-separate in "allfuncs" file
   while ((getline line < "allfuncs") > 0)
      allfuncs=allfuncs line
   close("allfuncs")
}
{
   for(i=1;i<NF;i++)
      if (index(allfuncs,","$i","))
         if (needed[$i])   needed[$i]++;
         else needed[$i]=1
}
END{
   printf "#ifndef BQC_CONFIG_H\n#define BQC_CONFIG_H\n"
   for (i in needed) print "#include <" i ".h> //uses = " needed[i]
   print "#endif"
}


This is just the start, I am also working on a script to detect which %* parameters are used in *printf functions so that unneeded conversion functions can be omitted and unused case labels removed. This can save a few kb.

I've also been messing around with building a shared c library where all of the functions are hidden and accessed through a few arrays of function pointers ... similar to how Linux syscalls work

Code:
int f0(int a, int b){return a+b;} //ADD
int f1(int a, int b){return a-b;} //SUBTRACT
int f2(int a, int b){return a*b;} //MULTIPLY
int f3(int a, int b){return a/b;} //DIVIDE

//use these to access the function in the array
enum{ ADD, SUBTRACT, MULTIPLY, DIVIDE, NUM_FUNCS};

//assign the corresponding functions in same order as enum above
//type checking and number of parameters are for wusses
int (*f[NUM_FUNCS]) () = {f0,f1,f2,f3};

#define F(x,...) (*f[x]) (__VA_ARGS__)
 
#define add(...) F(ADD,__VA_ARGS__)
//note, the compiler probably won't complain if you add("hello","world")
//....

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4292

PostPosted: Thu 19 Jun 2014, 20:00    Post subject:  

I could have just edited my last post, but in case anyone is following the thread, I wanted to get input on setting up a github team. As it goes most listings of the most difficult things in programming include "naming stuff". After considering PNG (short for puppy next generation after DSLR tradition of ungoogleable names) I thought Mite would be fitting for several reasons:
worlds fastest animal by size
some of the most powerful animals by size
their makeup defies traditional wisdom based on other species
they make use of stuff left behind by others
they occupy a wide range of niches
There are almost 50000 species to choose from for code-naming sub projects each with varying characteristics.

The os could be called Acari (the taxonomy subclass of all mites) or Acarina.

Any thoughts? I'm also amenable to a whole dinosaur based naming scheme.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3956
Location: Kiel,Germany

PostPosted: Thu 19 Jun 2014, 20:32    Post subject:  

MITE ??
I actually had to look up
http://en.wikipedia.org/wiki/Mite

MINOSUARUS ?

TIME ? Tiny Imbedded Modular Environment ?


But I have no stocks in C code though ..

_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send private message Visit poster's website 
greengeek

Joined: 20 Jul 2010
Posts: 2413
Location: New Zealand

PostPosted: Thu 19 Jun 2014, 21:49    Post subject:  

Yes, i think that "mite" be a very appropriate name.

Apparently puppies are an excellent host for mites...

http://puppies.about.com/od/OwnerPuppyCare/a/Ear-Mite-Treatment-Natural-Remedies-For-Ear-Mites.htm

Smile
puppy mite.JPG
 Description   
 Filesize   30.45 KB
 Viewed   564 Time(s)

puppy mite.JPG

Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 1571

PostPosted: Fri 20 Jun 2014, 00:57    Post subject:  

Mite also sounds like might (=strength),
but do you really want to name an OS after a whole bunch of ugly BUGs? Shocked Razz

(yes, mites are not insects but they are "bugs" just the same)

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send private message 
Moat

Joined: 16 Jul 2013
Posts: 158

PostPosted: Fri 20 Jun 2014, 02:37    Post subject:  

I think the Mite naming idea is great. Acari & Acarina = excellent. Mighty Mite!
Back to top
View user's profile Send private message 
NeroVance


Joined: 10 Oct 2012
Posts: 149
Location: Canada

PostPosted: Mon 23 Jun 2014, 08:52    Post subject:  

technosaurus wrote:
I could have just edited my last post, but in case anyone is following the thread, I wanted to get input on setting up a github team. As it goes most listings of the most difficult things in programming include "naming stuff". After considering PNG (short for puppy next generation after DSLR tradition of ungoogleable names) I thought Mite would be fitting for several reasons:
worlds fastest animal by size
some of the most powerful animals by size
their makeup defies traditional wisdom based on other species
they make use of stuff left behind by others
they occupy a wide range of niches
There are almost 50000 species to choose from for code-naming sub projects each with varying characteristics.

The os could be called Acari (the taxonomy subclass of all mites) or Acarina.

Any thoughts? I'm also amenable to a whole dinosaur based naming scheme.


I do like the concept of something called Mite Linux or AcarinaPup(py) which would be quite nice.

I think I should look into developing using gtk1 somewhat as something I can do during my college break, but to also develop some tools for Mite. Anyone want to possibly build a Mite Forum and perhaps find a decent base to begin our work? Since while this is puppy derived, it does seem very different in it's scope and goal, and would benefit from being more of derivative in it's own right.

I'll try to design a logo for Mite, probably using public domain images to get a good visual for it.
Back to top
View user's profile Send private message Visit poster's website 
Scooby

Joined: 03 Mar 2012
Posts: 288

PostPosted: Mon 23 Jun 2014, 13:18    Post subject:  

Tried out luufs, but not much documentation?

not even "--help"

Is there a wiki or somthing somewhere?
Back to top
View user's profile Send private message 
Iguleder


Joined: 11 Aug 2009
Posts: 1873
Location: Israel, somewhere in the beautiful desert

PostPosted: Mon 23 Jun 2014, 14:01    Post subject:  

There's a man page.
_________________
My homepage
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
ICQ Number 
Scooby

Joined: 03 Mar 2012
Posts: 288

PostPosted: Mon 23 Jun 2014, 15:03    Post subject:  

Thanks man, I didn't see it

*EDIT*
got it, use absolute path Very Happy
keeping below for reference
----------------------------------------------------------------------------------------------------------------------
tried it though and got

Code:
> ls -l
d????????? ? ?    ?       ?            ? target/

> ls target
ls: cannot access target: No such file or directory

> mount
...
luufs on /mnt/live/tmp/scratch/luufs/target type fuse.luufs (rw,nosuid,nodev,relatime,user_id=0,group_id=0)


Does it have any dependencies?
Tried it in /tmp, /root (aufs writable branch) and HD
Back to top
View user's profile Send private message 
Iguleder


Joined: 11 Aug 2009
Posts: 1873
Location: Israel, somewhere in the beautiful desert

PostPosted: Mon 23 Jun 2014, 15:34    Post subject:  

Just FUSE. It supports musl.
_________________
My homepage
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
ICQ Number 
technosaurus


Joined: 18 May 2008
Posts: 4292

PostPosted: Tue 08 Jul 2014, 17:43    Post subject:  

Here is a simple mixer for use in shell scripts:
usage:
mix /dev/mixer vol #prints current volume
mix /dev/mixer vol $((100*256+100)) #sets left & right volume to 100

you can also get/set bass, treble, synth, pcm, speaker, line, mic, cd, mix, pcm2, rec, igain, ogain, line1, line2, line3, dig1, dig2, dig3, phin, phout, video, radio, monitor

Code:
/*This linux mixer dedicated to the Public Domain by Brad Conroy*/
#include <fcntl.h>
#include <linux/soundcard.h>

int get_dev(const char *name){
   int i;
   const char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
   for (i = 0; i < SOUND_MIXER_NRDEVICES; ++i)
      if (!strcmp(names[i], name)) return i;
   return -1;
}

#ifdef NOPRINTF
void putd(unsigned d){
   if (d==0){
      write(1,"0",1);
   }else{
      unsigned i=1000000000;
      char s[1];
      while (i > d) i/=10;
      while (0<i){
         *s='0'+(d/i);
         write(1,s,1);
         if (i<=d) d%=i;
         i/=10;
      }
   }
   write(1,"\n",1);
}
#else
#include <stdio.h>
#endif

int main(int argc, char **argv){ //mix /dev/mixer dev [value]
   int fd=open(argv[1], O_RDWR|O_NONBLOCK),
      dev=get_dev(argv[2]),
      buf;
   if (fd<0 || dev<0) return -1;
   if (argc>3){
      buf=atoi(argv[3]);
      if(ioctl(fd, MIXER_WRITE(dev),&buf)<0) return -1;
   }
   if(ioctl(fd, MIXER_READ(dev),&buf)<0) return -1;
#ifdef NOPRINTF
   putd(buf);
#else
   printf("%d\n",buf);
#endif
   close(fd);
   return 0;
}


Edit:

This (slightly larger) version accepts list or list: to output device names (and : current values)
    >mix /dev/mixer list
    vol
    line
    mic
    pcm2
    igain
    dig1
    > ./mix /dev/mixer list:
    vol:25700
    line:25700
    mic:25700
    pcm2:25700
    igain:25700
    dig1:25700


Code:
/*This linux mixer dedicated to the Public Domain by Brad Conroy*/
#include <fcntl.h>
#include <string.h>
#include <linux/soundcard.h>
#ifdef NOPRINTF
void putd(unsigned d){
   if (d==0){
      write(1,"0",1);
   }else{
      unsigned i=1000000000;
      char s[1];
      while (i > d) i/=10;
      while (0<i){
         *s='0'+(d/i);
         write(1,s,1);
         if (i<=d) d%=i;
         i/=10;
      }
   }
   write(1,"\n",1);
}
#else
#include <stdio.h>
#define putd(d) printf("%d\n",d)
#endif

int fd,dev,buf,i,mask; //global kludge

int get_dev(const char *name){
   const char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
   if (!strncmp("list", name, 4)){
      ioctl(fd, SOUND_MIXER_READ_DEVMASK,&mask);
      for (i = 0; i < SOUND_MIXER_NRDEVICES; ++i)
         if (1<<i & mask) {
            write(1,names[i],strlen(names[i]));
            if (name[4]==':'){
               write(1,":",1);
               if(ioctl(fd, MIXER_READ(i),&buf)<0) return -1;
               putd(buf);
            }else write(1,"\n",1);
         }
   }else for (i = 0; i < SOUND_MIXER_NRDEVICES; ++i)
      if (!strcmp(names[i], name)) return i;
   return -1;
}


int main(int argc, char **argv){ //mix /dev/mixer dev [value]
   fd=open(argv[1], O_RDWR|O_NONBLOCK);
   dev=get_dev(argv[2]);
   if (fd<0 || dev<0) return -1;
   if (argc>3){
      buf=atoi(argv[3]);
      if(ioctl(fd, MIXER_WRITE(dev),&buf)<0) return -1;
   }
   if(ioctl(fd, MIXER_READ(dev),&buf)<0) return -1;
   putd(buf);
   close(fd);
   return 0;
}

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
wboz

Joined: 20 Nov 2013
Posts: 36

PostPosted: Tue 08 Jul 2014, 19:48    Post subject:  

I haven't reread this thread in its entirety but I am excited about this project. You definitely have my encouragement Smile

I have tried Tiny Core in the past and several aspects put me off. I have strong feeling this group will make a great product.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 17 of 19 [285 Posts]   Goto page: Previous 1, 2, 3, ..., 15, 16, 17, 18, 19 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1161s ][ Queries: 12 (0.0087s) ][ GZIP on ]