Unbloated coding resources
Got it to compile with a little minor tweaking and the help of a search engine. No idea what to do with it though!!
- Attachments
-
- Screenshot(1).jpg
- (101.48 KiB) Downloaded 733 times
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
FWIW I never tracked down the (proprietary?) MorphOS sources either; however, there are a couple of forks with some improvements tinysdgl and picogl IIRC
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
tinysdgl seems to have lost all non-SDL support, unlike picogl...but I see comments that indicate that picogl is stripped down relative to tinygl, to the point of rarely being usable.technosaurus wrote:FWIW I never tracked down the (proprietary?) MorphOS sources either; however, there are a couple of forks with some improvements tinysdgl and picogl IIRC
picogl supports X, NanoX, sdl, and VesaFB backends (not sure what the last is).
I ran across a variant of tinygl included in residualvm, but it included a switch to C++ in the "improvements"; it might be possible to cherrypick some of the real improvements...
Does anyone know of sources for a C derivative of tinygl 0.4 that doesn't have the double rendering bug? (Or do we need to make one--perhaps from PicoGl and TinyGL, perhaps residualvm
C++ -> C99?)
Is this any use?
http://www.ocera.org/archive/upvlc/publ ... e2/TinyGL/
http://www.ocera.org/archive/upvlc/publ ... e2/TinyGL/
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Not to me, they slapped a GPL on it and munged up the code trying to add namespace prefixes or something and "misplaced" the original license.Keef wrote:Is this any use?
http://www.ocera.org/archive/upvlc/publ ... e2/TinyGL/
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Bluez alternative for bluetooth:
https://github.com/tiancj/bluedroid.for.linux
or
http://blue-machines.googlecode.com/svn ... rces/soft/
there is fork of this at https://github.com/lwalkera/lwBT but I looked at a couple of commits and some of the changes are non-portable (changing void* to int only works on 32 bit x86 for instance) - so either avoid or revert the non-portable changes
smaller alternative to tinyX
http://galos.no-ip.org/siX
alternative to stb_image:
http://galos.no-ip.org/libimg
alternative to httpd:
http://galos.no-ip.org/evil
another alternative init:
http://galos.no-ip.org/qinit
alternative dhcp:
http://galos.no-ip.org/sdhcp
My current todo is to find/create alternatives to the common daemon processes such as those listed here:
https://wiki.archlinux.org/index.php/Daemons_List
https://github.com/tiancj/bluedroid.for.linux
or
http://blue-machines.googlecode.com/svn ... rces/soft/
there is fork of this at https://github.com/lwalkera/lwBT but I looked at a couple of commits and some of the changes are non-portable (changing void* to int only works on 32 bit x86 for instance) - so either avoid or revert the non-portable changes
smaller alternative to tinyX
http://galos.no-ip.org/siX
alternative to stb_image:
http://galos.no-ip.org/libimg
alternative to httpd:
http://galos.no-ip.org/evil
another alternative init:
http://galos.no-ip.org/qinit
alternative dhcp:
http://galos.no-ip.org/sdhcp
My current todo is to find/create alternatives to the common daemon processes such as those listed here:
https://wiki.archlinux.org/index.php/Daemons_List
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
void * should cast properly to any pointer type (technically function pointers have slightly different rules though), that is why it should not be changed to simply int (instead of int* which is the same as intptr_t) because int is not always the same size as void* ... if you want an integer type that is the same size as void*, use size_t for unsigned and ptrdiff_t for signed... Even if size_t is larger than you need, it will simplify the assembly code because smaller types require a superfluous MOV{*} operation and it will be portable across 32/64 bit systemsvovchik wrote:Dear guys,
I had some success recently getting void* work on 32 and 64-bit machines by changing that void to intptr_t. Anybody want to try that and report the results?
With kind regards,
vovchik
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
If you're using a POSIX-like system, it's certain to follow ILP32/LP64: sizeof(int)==4; sizeof(long)==sizeof(void *);technosaurus wrote:void * should cast properly to any pointer type (technically function pointers have slightly different rules though), that is why it should not be changed to simply int (instead of int* which is the same as intptr_t) because int is not always the same size as void* ... if you want an integer type that is the same size as void*, use size_t for unsigned and ptrdiff_t for signed... Even if size_t is larger than you need, it will simplify the assembly code because smaller types require a superfluous MOV{*} operation and it will be portable across 32/64 bit systemsvovchik wrote:Dear guys,
I had some success recently getting void* work on 32 and 64-bit machines by changing that void to intptr_t. Anybody want to try that and report the results?
With kind regards,
vovchik
sizeof(char)==1; sizeof(short)==2; sizeof(long long)==8; are also true on semi-recent POSIX-like systems.
More stuff...
Dropbear is a small ssh package; it can be built with ssh, sshd, scp, and key generator/convertor in one binary.
Uses libtom* for crypto; sqlite and wpa_supplicant can also be configured to use libtom*.
Toybox includes a dhcp client, dhcp server, syslogd/klogd, tftpd, and crond/crontab. Bootchartd, inotifyd, and telnetd might also be interesting. Haven't tested if toybox mount works right with fstab yet.
Lots of neat stuff over at litcave, especially neatroff and fbvnc.
fbvis is a tiny framebuffer image viewer (132 kb linked static against musl); supports JPEG PNG PPM TGA BMP PSD GIF(partial) HDR PIC, using lodepng, stb_image, and a builtin ppm loader.
Keys: vi keys for scrolling (hjkl), J/n for next image, K/p for previous, f for zoom to height, w is zoom to width.
See README for more.
Thinking it would be handy to have a thermald/powerd or such (monitors temperature, load, and battery; controls cpu frequency/governor and fan; can run arbitrary commands).
Is there an update for libc.h, or was 0.1 the last release?
Dropbear is a small ssh package; it can be built with ssh, sshd, scp, and key generator/convertor in one binary.
Uses libtom* for crypto; sqlite and wpa_supplicant can also be configured to use libtom*.
Toybox includes a dhcp client, dhcp server, syslogd/klogd, tftpd, and crond/crontab. Bootchartd, inotifyd, and telnetd might also be interesting. Haven't tested if toybox mount works right with fstab yet.
Lots of neat stuff over at litcave, especially neatroff and fbvnc.
fbvis is a tiny framebuffer image viewer (132 kb linked static against musl); supports JPEG PNG PPM TGA BMP PSD GIF(partial) HDR PIC, using lodepng, stb_image, and a builtin ppm loader.
Keys: vi keys for scrolling (hjkl), J/n for next image, K/p for previous, f for zoom to height, w is zoom to width.
See README for more.
Thinking it would be handy to have a thermald/powerd or such (monitors temperature, load, and battery; controls cpu frequency/governor and fan; can run arbitrary commands).
Is there an update for libc.h, or was 0.1 the last release?
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Yeah I like the litcave frame buffer tools as well ... Fbvis can be modified to only use stb_image with only a couple of modifications... Can't believe I didn't already mention dropbear but yeah... I wonder if we could add audio forwarding capability to dropbear? Maybe by capturing/dev/dsp and putting it on a udp or tcp socket
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Probably not reliably; AFAICT, that would only work for OSS3 dynamically linked stuff, we'd need to handle ioctls, etc...technosaurus wrote:Can't believe I didn't already mention dropbear but yeah... I wonder if we could add audio forwarding capability to dropbear? Maybe by capturing/dev/dsp and putting it on a udp or tcp socket
(OSS4 uses a slightly different set of ioctls; Pulse and ALSA are pretty different.)
I'm still wondering whether libc.h has been upgraded since 0.1, if the string.h replacements ever happened, and what the status of all that is.
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
The reason I ask, is that I am trying to figure out a way to use linux containers to allow up to 65k users to run applications on the same system. X apps can use ssh -X -C, but so far pulse audio is the only thing in use ... well, there is NAS (which I would prefer due to licensing and less general suck-ness) _but_ according to https://bugs.debian.org/cgi-bin/bugrepo ... bug=655361, it will take some patching. ... but that is probably a topic for another thread, especially since (IMHO) this is an area where systemd can be useful and any mention of it tends to awaken all the rabble-rousers.Ibidem wrote:Probably not reliably; AFAICT, that would only work for OSS3 dynamically linked stuff, we'd need to handle ioctls, etc...technosaurus wrote:Can't believe I didn't already mention dropbear but yeah... I wonder if we could add audio forwarding capability to dropbear? Maybe by capturing/dev/dsp and putting it on a udp or tcp socket
(OSS4 uses a slightly different set of ioctls; Pulse and ALSA are pretty different.)
I don't know about upgraded, so much as changed. I did a lot of testing and compilers had difficulty eliminating unused code without the --*-sections flags. Adding static to the functions helped, but made programs built from multiple *.c files larger due to duplicated functions.Ibidem wrote:I'm still wondering whether libc.h has been upgraded since 0.1, if the string.h replacements ever happened, and what the status of all that is.
After a lot of experimentation I started separating each function into its own file and using an awk script to detect usage of functions and build a stripped down libc.h adding static to functions if only a single c file (main.c) is used or the function is only used once.
Part of this was also preparing for a future version where shared libraries are allowed (my current _start function does not handle shared libraries), so that we are capable of building a single shared library with only functions needed by multiple programs (others will be built in to the single program that uses it) similar to http://libraryopt.sourceforge.net/ but only requiring awk (even the busybox version) and a C toolchain. The resulting library should also be significantly smaller than the libraryopt rebuild, but with the requirement of a busybox/toybox (more like buildroot) style build system.
If having a single libc.h is desirable, I could probably add a build script or make file target to generate it.... possibly even a target to build it into the standard *.h files like string.h, stdio.h, etc... In the mean time musl-libc is what I normally use unless I am trying to squeeze an app into CPU cache.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Sorry for the late reply. The copy of siX that I had, does not include a license, so I can' repost it, but I did find some info here:minux wrote:Good morning ,do you have the file ?
I think galos is offline.
http://betteros.org/tut/graphics1.php
Its actually the best tutorial I have found on low level Linux graphics.
I've been meaning to do some experiments with replacing X11/xcb with a C99+structs based alternative - total "library" size should be minimal (<32kb) but designed for static builds as a single file header library. My initial experiments actually decreased the size of the binary because only 1 struct is created per request and no extraneous data needs to be saved between function calls (such as data saved in callee clobbered registers that would need to be pushed and popped from the stack) It was also faster because data doesn't need to be copied to a new struct for each request (nearly every X function) ... it also shrinks the code a bit too because it doesn't have to do a memcpy and because of this, allows the compiler to fully optimize and inline many functions into "leaf" functions that can also be easily be inlined (thus eliminating most of the function call overhead).
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact: