Page 2 of 3

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 6:20 am
by Heater
DavidS,
If only Linux would have stayed away from bloat better.
You are often saying such things. I always wonder what you mean. I take is as meaning that you think there is code in there that is unnecessary or bigger than it need be. Well, what is it you would remove?

Linux systems can be pretty small. I have been using it in small embedded systems for well over a decade now. That's how it ends up in tiny embedded systems like this: https://www.kickstarter.com/projects/on ... d-by-linux

Certainly it may never be pared down to the size of a RISC OS, Amiga OS, GEM etc. But then it has an awful lot more functionality in it.

And finally, who cares if it's bigger? Memory is huge, now a days. Also very cheap, small, fast and low power consumption. A basic Linux install takes up a fraction of any media I boot it from. It takes a small fraction of RAM when running.
Just look at the workarounds that we need to use in the way things are done in Linux. Thing that could be done directly in Amiga OS, DOS, RISC OS, and even Windows. Though we find weird workarounds to implement features that the end user expects though is not well suited to a Unix like system.
You will have to give us some examples of "weird workarounds". I can't think of any.
Unfortunately we are forced to use it for now,...
What do you mean "Unfortunately" and "forced" ?

I was over the moon when I deleted Win 95 from my PC's and replaced it with RedHat back in 1997 or so. I have been very fortunate in not having to use Windows ever since.

Certainly nobody "forces" you to use Linux.
...as most of the software development targets this OS, attempting to treat it as a Desk Top operating system
Actually I don't think that is true. An awful lot of software is written for Unix, or should I say POSIX, and is easily run on many other systems beside Linux.

But what I'm seeing today is that there is a lot of stuff that runs everywhere, Win, Mac and Linux. For example I have in daily use: Chrome, Firefox, Visual Studio Code, Virtual Box, GIMP, Lazarus, qtcreator, Python, node.js, etc, etc. Sometimes I forget which OS I'm using (Yeah, been using Win 10 a lot these past two months, God help me).

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 6:45 am
by gkreidl
CarlRJ wrote:...]There is a version of UNIX that is a great desktop operating system, by the way - it's called Mac OS X. So many years were heralded as "this is the year of Linux on the desktop", but Mac OS X got there first, and Linux still hasn't made it there in any real volume. And I don't feel in any way forced to use UNIX and Linux - rather I feel incredibly lucky to get to use such a well-designed operating system every day....
http://www.techrepublic.com/blog/10-thi ... than-os-x/

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 7:39 am
by CarlRJ
gkreidl wrote:
CarlRJ wrote:...]There is a version of UNIX that is a great desktop operating system, by the way - it's called Mac OS X. So many years were heralded as "this is the year of Linux on the desktop", but Mac OS X got there first, and Linux still hasn't made it there in any real volume. And I don't feel in any way forced to use UNIX and Linux - rather I feel incredibly lucky to get to use such a well-designed operating system every day....
http://www.techrepublic.com/blog/10-thi ... than-os-x/
Interesting list. Some valid points, and some fatally flawed. He complains:
This is one area of OS X that I simply can't figure out. Why didn't Apple just migrate the Linux coreutils over to OS X? There are projects aimed at getting coreutils to compile on OS X, but it would have made more sense to have this by default. The coreutils package is a huge toolkit that contains nearly every basic command you need. OS X had to reinvent that wheel.
Oh. My. God. Seriously? This guy thinks Apple reinvented the wheel? Mac OS X, being partly based on FreeBSD, contains most of the FreeBSD "userland" (the contents of /bin, /usr/bin, etc.). Largely the same utilities found in GNU's coreutils, except these ones have their origins in BSD going back to the 70's and 80's and Bell Labs before that -- GNU COREUTILS REINVENTED THE WHEEL BY COPYING THESE BSD UTILITIES AND THEIR AT&T COUNTERPARTS. Like I was saying, there are a whole bunch of Linux fans who don't understand history and think Linus Torvalds and Richard Stallman said, "Let there be light" and created the world. That's not the way that it happened.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 7:50 am
by fruitoftheloom
NextStep (OSX parent) was compiled around 1988/89 by Steve Jobs and his team after he left Apple, which is before Linux, so was there any need to latterly to include "Linux Tools" ?? Steve Jobs always wanted everything his way !! Just saying.........

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 8:16 am
by gkreidl
CarlRJ wrote:
gkreidl wrote:
CarlRJ wrote:...]There is a version of UNIX that is a great desktop operating system, by the way - it's called Mac OS X. So many years were heralded as "this is the year of Linux on the desktop", but Mac OS X got there first, and Linux still hasn't made it there in any real volume. And I don't feel in any way forced to use UNIX and Linux - rather I feel incredibly lucky to get to use such a well-designed operating system every day....
http://www.techrepublic.com/blog/10-thi ... than-os-x/
Interesting list. Some valid points, and some fatally flawed. He complains:
This is one area of OS X that I simply can't figure out. Why didn't Apple just migrate the Linux coreutils over to OS X? There are projects aimed at getting coreutils to compile on OS X, but it would have made more sense to have this by default. The coreutils package is a huge toolkit that contains nearly every basic command you need. OS X had to reinvent that wheel.
Oh. My. God. Seriously? This guy thinks Apple reinvented the wheel? Mac OS X, being partly based on FreeBSD, contains most of the FreeBSD "userland" (the contents of /bin, /usr/bin, etc.). Largely the same utilities found in GNU's coreutils, except these ones have their origins in BSD going back to the 70's and 80's and Bell Labs before that -- GNU COREUTILS REINVENTED THE WHEEL BY COPYING THESE BSD UTILITIES AND THEIR AT&T COUNTERPARTS. Like I was saying, there are a whole bunch of Linux fans who don't understand history and think Linus Torvalds and Richard Stallman said, "Let there be light" and created the world. That's not the way that it happened.
You're right. All the basic UNIX command line tools have already been available on NeXT computers (running on a MACH kernel). When Steve Jobs returned to Apple they had to buy all his NeXT developments and the modern MacOS is based on that.
I still remember having to get email to work on a NeXT in 1991 and for a while it really turned me into a UNIX hater with all those cryptic and illogical config files :-)

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 8:24 am
by ejolson
Are the statements
Heater wrote:I was over the moon when I deleted Win 95 from my PC's and replaced it with RedHat back in 1997 or so. I have been very fortunate in not having to use Windows ever since.
and
Heater wrote:Sometimes I forget which OS I'm using (Yeah, been using Win 10 a lot these past two months, God help me).
contradictory?

I think biggest kludges in popular Linux distributions are D-Bus, PulseAudio and NetworkManager.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 8:50 am
by Heater
CarlRJ,
GNU COREUTILS REINVENTED THE WHEEL BY COPYING THESE BSD UTILITIES AND THEIR AT&T COUNTERPARTS. Like I was saying, there are a whole bunch of Linux fans who don't understand history and think Linus Torvalds and Richard Stallman said, "Let there be light" and created the world. That's not the way that it happened.
Actually, Richard Stallman did say "Let there be light" and create the world. Linus came along with Linux and added to that world. Let me explain...

There is one extremely important detail that is essential to the history of GNU and Linux. The licence. The GPL.

Certainly Unix came first. It multiplied into operating systems for HP, Sun, SCO, whoever. It found it's way into Apple. There was also Minix. Somewhat different in being an experiment in a microkernel based system. All good stuff.

But none of those were going anywhere. They were expensive. They only ran on the hardware the vendor supplied. The copyright licensing was going to kill them.

Richard Stallman wanted his own operating system and system software. One that he could do what he liked with. He wanted the world to have it's own unencumbered software. So he dreams up the General Public Licence and sets about creating his OS. Starting with a C compiler and an editor and other utilities. All the stuff yon need to build an OS. The GPL was Richard's "Let there be light".

This was a popular idea but could not really spread very fast. After all, you needed a running Unix system to use it!

Enter Linus and Linux. With that kernel finally people could build a Linux like system, GNU, for themselves and run it on A PC. And bang it spread like wild fire. I mean "bang" as in "big bang" that created the universe. The big bang that made the world of Google, Facebook, LinkedIn, Amazon, and tons of others possible. Not to mention billions of embedded systems, telephones and so on.

The critical decision here was when Linus released his kernel under the GPL.

I can't imagine that Richard Stallman wanted to spend years cloning the Unix core utils and writing a compiler. He had to. There was no other way.

What about BSD? You say. Well that's great and all. The legal issues finally got put to bed. Problem is... If I am going to spend considerable time and effort writing software with the intention of it being open source and free for all, then I don't want it to be possible for some company to take my code, polish it, wrap it up in something else and then sell it for huge profits. No, I want them to contribute any useful changes they make back to the open source community. That way we all benefit from the open source effort.

The GPL ensures this freedom for my code. The BSD does not.

Note: When I say "I" and "we" above I don't just mean lone hackers in there basements. The same logic works, for the benefit of all, if the participants are corporations or educational establishments etc.

And that is why we should celebrate 25 years of Linux. It's not about the kernel, it's about the enormous amount of work done over years by thousands of people to make this possible. The birth of Linux is a significant land mark in all of that.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 8:56 am
by karrika
+1

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 9:20 am
by Heater
ejolson,
contradictory?
Hmm...may sound like that.

I only ever used Windows long term for about a year of so before Win 95. Before that I worked with Vax VMS and all kind of other systems. At home I had some CP/M machines and an Atari 520. Never had the urge to buy a PC, ugly horrendous machines that they were (are). Then came the Internet and the need for PC and Windows to run Netscape on.

Luckily I soon discovered RedHat. Soon realized it did everything I needed and delete Windows 95. Disks were small then and I could not waste the space on that dross.

So it's been a Linux only world for me at home and work ever since. Except for a couple of years working for Nokia where I had to use Win 2000 for odd tasks.

When I say "Sometimes I forget which OS I'm using..." that comes down to being bought a MS Surface Pro to take on some recent travels. So I find myself thousands of miles from home stuck with Win 10. I was surprised to find that a lot of the software I use works on Windows. This was not always the case. Not very well but it does work. This is just an aberration, a fling, I'll be back with Debian soon enough.

Aside: One of the main reasons the boss insisted I take a Surface Pro with me is that he wanted to be sure I was in contact using Skype. Oddly enough we cannot get Skype to work on this machine!
I think biggest kludges in popular Linux distributions are D-Bus, PulseAudio and NetworkManager.
You may have a point there. I know nothing of PulseAudio, except that when it does not work it's impossible to fix it. Never understood what NetworkManager was for. What was wrong with ifup/ifdown ?

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 10:06 am
by jamesh
Weird.

Normally I have to step in to tell people not to argue in the usual Windows vs Linux war.

This time, I'm going to step in and tell be to be polite to each other in a thread solely about Linux (with diversions to RISCOS).

Like I said, weird. Make's me think that is doesn't matter if people are all talking about the same OS, some people just cannot stop themselves arguing about frivolities.

It's here, it works, it's used worldwide, it run the Pi.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 12:47 pm
by kusti8
CarlRJ wrote:
gkreidl wrote:
CarlRJ wrote:...]There is a version of UNIX that is a great desktop operating system, by the way - it's called Mac OS X. So many years were heralded as "this is the year of Linux on the desktop", but Mac OS X got there first, and Linux still hasn't made it there in any real volume. And I don't feel in any way forced to use UNIX and Linux - rather I feel incredibly lucky to get to use such a well-designed operating system every day....
http://www.techrepublic.com/blog/10-thi ... than-os-x/
Interesting list. Some valid points, and some fatally flawed. He complains:
This is one area of OS X that I simply can't figure out. Why didn't Apple just migrate the Linux coreutils over to OS X? There are projects aimed at getting coreutils to compile on OS X, but it would have made more sense to have this by default. The coreutils package is a huge toolkit that contains nearly every basic command you need. OS X had to reinvent that wheel.
Oh. My. God. Seriously? This guy thinks Apple reinvented the wheel? Mac OS X, being partly based on FreeBSD, contains most of the FreeBSD "userland" (the contents of /bin, /usr/bin, etc.). Largely the same utilities found in GNU's coreutils, except these ones have their origins in BSD going back to the 70's and 80's and Bell Labs before that -- GNU COREUTILS REINVENTED THE WHEEL BY COPYING THESE BSD UTILITIES AND THEIR AT&T COUNTERPARTS. Like I was saying, there are a whole bunch of Linux fans who don't understand history and think Linus Torvalds and Richard Stallman said, "Let there be light" and created the world. That's not the way that it happened.
I actually switched over from OSX to Linux because it was annoying me so so much. Sure it presents a simple and nice UI, but when you try to do actual work like compiling or developing, you quickly run into tons of problems. I tried using homebrew, but ran into mayhem with unnecessary symlinks and limited software in the repo. I had 2 versions of Python and had to change the order of my path to do that. I would try and compile some sort of thing like Chromium and then remember that I couldn't. I tried dual booting Linux, but that wouldn't work because the weird bootloader doesn't support Ubuntu natively and having to require tons of patches. Don't get me wrong, it was much better than Windows, but I still couldn't access ext4 file systems because FUSE wouldn't work no matter what. My Mac was so slow I couldn't run a VM at all and software support wasn't much better than Linux because if you make a Mac port you might as well do Linux. My hard drive was filling up with junk that I had no idea where it all was because all the apps were in one place, but who knows where everything they depended on was? I view it as half Linux, almost there but not quite in many points.

Maybe I was just made for Linux and not Mac, but all of these things and more which I just can't think of made me build my own much more powerful computer for a lot less and also upgradable and installing Arch. I compiled Chromium on my Ubuntu dual boot, which was a cinch to setup with grub do I now have a triple boot with Windows, and Ubuntu on one SSD and Arch on the other. It allows me more control on what I install and had the best support. I can easily uninstall things and find out what takes the most space with a shell script. For me, OSX just didn't work at all and was a nightmare for developing.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 1:33 pm
by DavidS
Heater wrote:DavidS,
If only Linux would have stayed away from bloat better.
You are often saying such things. I always wonder what you mean. I take is as meaning that you think there is code in there that is unnecessary or bigger than it need be. Well, what is it you would remove?

Linux systems can be pretty small. I have been using it in small embedded systems for well over a decade now. That's how it ends up in tiny embedded systems like this: https://www.kickstarter.com/projects/on ... d-by-linux

Certainly it may never be pared down to the size of a RISC OS, Amiga OS, GEM etc. But then it has an awful lot more functionality in it.

And finally, who cares if it's bigger? Memory is huge, now a days. Also very cheap, small, fast and low power consumption. A basic Linux install takes up a fraction of any media I boot it from. It takes a small fraction of RAM when running.
Last I looked at it the kernel source is pretty good, able to be compiled in under 64KB if you do not need much for hardware support. A lot of the GNU userspace is pretty good as well.

Though some things are unneededly large, like many of the hardware supporting kernel modules (46KB of code, and 21KB of data to drive an SB16 sound card, REALY?, etc...).

Then there is the GNU GCC toolchain (which includes support for many more languages than just C). It takes multiple MB of disk space, and that is configured with only bintools, and the minimum for ANSI C and C++, no extras.

Take also the example of:

Code: Select all

#include <stdio.h>

int main(int argc, char **argv)
{
 puts("Hello World, Huge aye!");
 return 0;
}

A program that if compiled oprimaly would have 8 instructions for init, four instructions to set up for the call to the shared lib (LibC, or what ever the particular linux uses), a branch with link, and 3 instructions to clean up and return. Add to that the data for the string, and the ELF linking information, you have a hello world program that is less than 1KB,

Now compile it with gcc and see what you get. It is prety huge for what it does.
Just look at the workarounds that we need to use in the way things are done in Linux. Thing that could be done directly in Amiga OS, DOS, RISC OS, and even Windows. Though we find weird workarounds to implement features that the end user expects though is not well suited to a Unix like system.
You will have to give us some examples of "weird workarounds". I can't think of any.
GTK, FrameBuffer device, FLTK, the shared C library, etc.

The shared C lib is a good thing. It is only a kludge when used because the inturupt/trap/swi interface does change, so the compilers can not support simple compiled kernel calls.

I am playing with writing for XLib, as it is the X11 with out the kludge. Though every one keeps telling me I should use the kludge. This turns me off to Linux (and unix in general).
Unfortunately we are forced to use it for now,...
What do you mean "Unfortunately" and "forced" ?

I was over the moon when I deleted Win 95 from my PC's and replaced it with RedHat back in 1997 or so. I have been very fortunate in not having to use Windows ever since.

Certainly nobody "forces" you to use Linux.
I was just making a point. I actualy like n*x systems, and use them as desktop systems even though I know that is not where they truely excel.

My point was that most software is developed to target a small subset of OSes, even in cases it would be very easy to make it truely portable. I often run across software that clames to be portable, though requires this lib, that toolkit, etc. That is not true portability, keeping anything system specific in a couple of SMALL source files, and making it very simpleto replace the system specific stuff is how you go truely portable.

Using these libs and other things just makes that much more that needs to be ported to port a program. There are still some systems in use that do not support dynamic linking, so the extra libraries would have to be staticaly linked to the applications.
...as most of the software development targets this OS, attempting to treat it as a Desk Top operating system
Actually I don't think that is true. An awful lot of software is written for Unix, or should I say POSIX, and is easily run on many other systems beside Linux.
You are agreeing with me. As I stated, these things are in part as it is a unix alike. The unix alikes make up a small fraction of what is out there.

Though yet not many programs are written for anything else. And those that are are often limited to the few systems that have toolkit x, or interpreter y.

There is nothing wrong with targetting a specific subset of OSes, in fact it is a good thing. This is what keeps the coding wars alive, and should encourage every one regardless of OS to attempt to outdo what is being done on the competing OSes.
But what I'm seeing today is that there is a lot of stuff that runs everywhere, Win, Mac and Linux. For example I have in daily use: Chrome, Firefox, Visual Studio Code, Virtual Box, GIMP, Lazarus, qtcreator, Python, node.js, etc, etc. Sometimes I forget which OS I'm using (Yeah, been using Win 10 a lot these past two months, God help me).
And you list a good number of programs that are stuck to the limited number of OSes, until porters do a tone of work getting other OSes to have what is needed to support these applications. It does not make very good sence to say that programs that run only on a small subset of OSes run on a lot. Most of those need either Win32/Win64 or a unix like enviroment to be present on the target system.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 2:35 pm
by DavidS
Linux itself is a great system. That is Linux (which is a kernel) and the GNU CoreUtils (or other equilivent). Also the X Windowing System is a great GUI, and OpenGL is a great graphics library. There are even some very good Window managers.

It is possible to set up an entire Linux System with kernel, CoreUtils, a shared C library, X11, a desktop enviroment, OpenGL, and the most used day to day programs in under 2MB of disk space. Though once you add GCC things begin to get huge, or adding this toolkit, that toolkit, this support lib, that support lib, etc.

GNU+Linux+X11 is great, it is everything that is now required on top of that that is an issue.

So my hat is off to Linus for his kernel, and to Richard Stallman for founding the GNU project that provided much of the user space programs used in Linux.

==========================================

While Linux provides the most supported kernel today, there is also MINIX 3 now. In many ways MINIX 3 is a better designed kernel, with a mostley BSD userspace. And best of all it uses CLang for its C compiler.

MINIX as of version 3 is able to support shared libraries, and as such anything targeting Unix Like systems can be ported with out to much effort.

=========================================

Linux is the kernel that brought us very much. It was the open source alternative when BSD was having leagle trouble, and the Hurd kernel had not gotten off of the ground. There is a lot of positive to say for Linux.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 2:46 pm
by Heater
DavidS,

I have no idea about an SB16 driver. If there is redundant code and data in there that you can remove, without breaking some needed functionality, it would be great if you would do that and submit a patch to the upstream maintainers.
Now compile it with gcc and see what you get. It is prety huge for what it does
OK. I get this on a Pi 3:

Code: Select all

pi@raspberrypi3:~ $ cat hello.c
#include <stdio.h>

int main(int argc, char **argv)
{
 puts("Hello World, Huge aye!");
 return 0;
}
pi@raspberrypi3:~ $ gcc -Os -Wall -o hello hello.c
pi@raspberrypi3:~ $ strip hello
\pi@raspberrypi3:~ $ls -l helloc
-rwxr-xr-x 1 pi pi 2992 Aug 27 16:57 hello
Less than 3K. Not bad. Of course that is the ELF file size. I suspect it takes less space in memory once running.

What are you compiling on such that the executable file is 1K?

I would not call GTK a "cludge". It's an abstraction layer for graphical stuff. It makes writing programs for X11 easier. It enables code using it, like GIMP, to be portable to other operating systems. Of course if you don't care about allowing more people, using different systems, to use your code it's an overhead. But the why use X11? You probably don't need the features it provides, it's an overhead, just write to the frame buffer. Err, ..see below.

I would not call the frame buffer device a "cludge". Again it enables code using the frame buffer to be used on different architectures with different graphics cards. I have code that uses GLES and the Qt library that runs just as well on a Pi or a PC. Thanks to the frame buffer device. Again, perhaps if you don't care about the usability of your code it's an overhead.

No idea about FLTK. I suspect the same applies.

Write code to the raw X11 API if you like. I don't know why you would want to make the extra work and complexity for yourself for little gain. Or limit the platforms your efforts can run on. It's like writing in assembler when we have pretty efficient high level languages.
There is nothing wrong with targetting a specific subset of OSes,....And you list a good number of programs that are stuck to the limited number of OSes, until porters do a tone of work getting other OSes to have what is needed to support these applications.
I think this is a good point. There is no way I'm going out of my way to try and target everything. But if with use of GTK, SDL, Qt, whatever I can reach 99.9% of people in the world that is quite OK for me. I'm not about to try and cover RISC OS or whatever obscure thing a few people maybe using out there.
It does not make very good sence to say that programs that run only on a small subset of OSes run on a lot. Most of those need either Win32/Win64 or a unix like enviroment to be present on the target system.
Quite so. Thing is, things end up running on different platforms because users of those platforms want them to. Take node.js as an example. Originally node only ran on Linux/Unix, basically POSIX, systems. People wanted it to run on their Windows so they stepped up and made it so. It helps a great deal if the program is written to some common API, like GTK, QT, SDL, etc. If the users of whatever obscure OS don't want to do that then they have to go without.

But you raise a serious point. We have had computers around for half a century and more. And still today it's not possible to write a program and have it run on any machine with any OS. Once you get past "Hello World" it gets tricky. Anything graphical and you have a problem.

This inefficient and scandalous situation perpetuates because all vendors want to lock in their customers to their systems.

Ah well.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 3:07 pm
by DavidS
Heater wrote:DavidS,
OK. I get this on a Pi 3:

Code: Select all

pi@raspberrypi3:~ $ cat hello.c
#include <stdio.h>

int main(int argc, char **argv)
{
 puts("Hello World, Huge aye!");
 return 0;
}
pi@raspberrypi3:~ $ gcc -Os -Wall -o hello hello.c
pi@raspberrypi3:~ $ strip hello
\pi@raspberrypi3:~ $ls -l helloc
-rwxr-xr-x 1 pi pi 2992 Aug 27 16:57 hello
Less than 3K. Not bad. Of course that is the ELF file size. I suspect it takes less space in memory once running.

What are you compiling on such that the executable file is 1K?
There are compilers out there that will correctly inline thngs like puts();.

Though the 1K quote was with a hand compile, and hand written ELF. It was actualy 688 bytes in size.
I would not call GTK a "cludge". It's an abstraction layer for graphical stuff. It makes writing programs for X11 easier. It enables code using it, like GIMP, to be portable to other operating systems. Of course if you don't care about allowing more people, using different systems, to use your code it's an overhead. But the why use X11? You probably don't need the features it provides, it's an overhead, just write to the frame buffer. Err, ..see below.
Um, you are not making much since.

There are a lot more platforms out there that support XLib than GTK or QT. And it is a lot easier to port XLib to other OSes than it is to port GTK or QT to other OSes.

A current implementation of XLib exists for RISC OS, Amiga OS (with no n*x stuff), Atari TOS+MiNT (ok it is a n*x), Win32 (even with outh the n*x stuff).

Remember that implementing XLib does not require the entire X Windowing System. And often times simple Window Managers for XLib on other systems are just an abstraction of the native OS's window manager.

Thus writing something to dynamicaly link against XLib is more portable than writing something with these toolkits.
I would not call the frame buffer device a "cludge". Again it enables code using the frame buffer to be used on different architectures with different graphics cards. I have code that uses GLES and the Qt library that runs just as well on a Pi or a PC. Thanks to the frame buffer device. Again, perhaps if you don't care about the usability of your code it's an overhead.
If that were truely all that the framebuffer device did I would agree.
No idea about FLTK. I suspect the same applies.

Write code to the raw X11 API if you like. I don't know why you would want to make the extra work and complexity for yourself for little gain. Or limit the platforms your efforts can run on. It's like writing in assembler when we have pretty efficient high level languages.
I do not want to limit my code to the few platforms that support the toolkits that you would recommend. XLib is more widely supported than any of them (with the possible exception of FLTK).

And now that I am doing some XLib programmin, and have looked at the other toolkits, it is a lot easier overall to write an XLib program than it is to use the toolkits in many cases. Admitedly using XCB (the newer replacement for XLib) would be easier, though less portable.
There is nothing wrong with targetting a specific subset of OSes,....And you list a good number of programs that are stuck to the limited number of OSes, until porters do a tone of work getting other OSes to have what is needed to support these applications.
I think this is a good point. There is no way I'm going out of my way to try and target everything. But if with use of GTK, SDL, Qt, whatever I can reach 99.9% of people in the world that is quite OK for me. I'm not about to try and cover RISC OS or whatever obscure thing a few people maybe using out there.
As long as what ever toolbox cals you use are confined to a few files, that are only the system specific stuff, it should be easy to port.

And again XLib is supported on way way more systems than any of those toolkits.
It does not make very good sence to say that programs that run only on a small subset of OSes run on a lot. Most of those need either Win32/Win64 or a unix like enviroment to be present on the target system.
Quite so. Thing is, things end up running on different platforms because users of those platforms want them to. Take node.js as an example. Originally node only ran on Linux/Unix, basically POSIX, systems. People wanted it to run on their Windows so they stepped up and made it so. It helps a great deal if the program is written to some common API, like GTK, QT, SDL, etc. If the users of whatever obscure OS don't want to do that then they have to go without.

But you raise a serious point. We have had computers around for half a century and more. And still today it's not possible to write a program and have it run on any machine with any OS. Once you get past "Hello World" it gets tricky. Anything graphical and you have a problem.

This inefficient and scandalous situation perpetuates because all vendors want to lock in their customers to their systems.

Ah well.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 3:42 pm
by Heater
DavidS,

I'm not sure what you mean by "inline puts". The output of puts() may go to a console, a file, a socket, a serial port. Depending on how I run the program. The compiler correctly generates a call to puts(). That means I can use something other than libc if I want. Or even provide my own puts() function in a module I link to. Also it makes the code smaller :)

I don't know about a 1K executable or 688 bytes executable file size. Makes no odds. The code generated is only 5 instructions plus whatever it takes for the string. I bet this takes only tens of bytes in memory at run time.
There are a lot more platforms out there that support XLib than GTK or QT. And it is a lot easier to port XLib to other OSes than it is to port GTK or QT to other OSes.
True enough. But what if I want my program to run where there is no XLib? Say Windows or Android. Or perhaps an embedded system with no Windows at all, just a frame buffer, or what about systems not even running Linux with no XLib and no frame buffer?

XLib is not a cross platform solution. Things like Qt and GTK are.
Thus writing something to dynamicaly link against XLib is more portable than writing something with these toolkits.
Not thus at all. See above.
If that were truely all that the framebuffer device did I would agree.
What does the frame buffer device do that you think it should not do?
I do not want to limit my code to the few platforms that support the toolkits that you would recommend. XLib is more widely supported than any of them (with the possible exception of FLTK).
How are you going to run your program on Windows without a X Window manager installed? Might as well use Qt and skip that.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 4:28 pm
by DavidS
Heater wrote:DavidS,

I'm not sure what you mean by "inline puts". The output of puts() may go to a console, a file, a socket, a serial port. Depending on how I run the program. The compiler correctly generates a call to puts(). That means I can use something other than libc if I want. Or even provide my own puts() function in a module I link to. Also it makes the code smaller :)
You are thinking of fputs(,); . The puts(); function is a special case, that is equilivent to sending fputs to the console. Though puts() can be implemented without fputs(,) and some times is.

The only to write to a file from puts(), is if the OS redirects the output, and that hase nothing to do with the program calling puts().
I don't know about a 1K executable or 688 bytes executable file size. Makes no odds. The code generated is only 5 instructions plus whatever it takes for the string. I bet this takes only tens of bytes in memory at run time.
:) . Yes and in that case either is good, as they are smaller than a single allocation unit on disk. Though it makes a difference on larger projects.

The programs __init() code takes at least 8 instructions.

What good does it do us to have more memory, more storage space, and faster CPU's if we are going to waste it doing things wastefuly? We should be striving for small size and fast execution (unless interpreted, then just small size), so we can truely take advantage of the new abilities of modern hardware. Each page of memory wasted is a page that can not be used by something else, each clock cycle wasted is a clock cycle that another program does not get, etc.

Most of the time we may have more than enough, as most software is somewhat small, and running idle 99.99% of the time. Though that one task that takes a lot of RAM and pushes the CPU to the limit will be the one that all the others make worse, either because of running out of memory and having to page out to disk (slow slow), or because they take away that small bit of time that makes the difference between it being usable and not.

To note the only example I can think of that would excuse usign a lot of RAM and CPU time is a very good raytracer.
There are a lot more platforms out there that support XLib than GTK or QT. And it is a lot easier to port XLib to other OSes than it is to port GTK or QT to other OSes.
True enough. But what if I want my program to run where there is no XLib? Say Windows or Android. Or perhaps an embedded system with no Windows at all, just a frame buffer, or what about systems not even running Linux with no XLib and no frame buffer?

XLib is not a cross platform solution. Things like Qt and GTK are.
QT or GTK without any support? Just an HW framebuffer? Never heard of that, interesting.

Though you can implement/port a small XLib compatible system easy enough (see micro-x), that would take less space than either of those.

As to window management, every system I mentioned and most others with XLib have a WM for X that just redirects from the platform native WM. In cases of platforms with out a GUI you would use TWM or similar.
Thus writing something to dynamicaly link against XLib is more portable than writing something with these toolkits.
Not thus at all. See above.
Again see above.
If that were truely all that the framebuffer device did I would agree.
What does the frame buffer device do that you think it should not do?
I do not want to limit my code to the few platforms that support the toolkits that you would recommend. XLib is more widely supported than any of them (with the possible exception of FLTK).
How are you going to run your program on Windows without a X Window manager installed? Might as well use Qt and skip that.
There are a few small X Window Systems that include Window management using Win32 as a Window Manager on Win32. These are all extremely small and stand alone.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 4:34 pm
by DavidS
Back on topic:
DavidS wrote:Linux itself is a great system. That is Linux (which is a kernel) and the GNU CoreUtils (or other equilivent). Also the X Windowing System is a great GUI, and OpenGL is a great graphics library. There are even some very good Window managers.

It is possible to set up an entire Linux System with kernel, CoreUtils, a shared C library, X11, a desktop enviroment, OpenGL, and the most used day to day programs in under 2MB of disk space. Though once you add GCC things begin to get huge, or adding this toolkit, that toolkit, this support lib, that support lib, etc.

GNU+Linux+X11 is great, it is everything that is now required on top of that that is an issue.

So my hat is off to Linus for his kernel, and to Richard Stallman for founding the GNU project that provided much of the user space programs used in Linux.

==========================================

While Linux provides the most supported kernel today, there is also MINIX 3 now. In many ways MINIX 3 is a better designed kernel, with a mostley BSD userspace. And best of all it uses CLang for its C compiler.

MINIX as of version 3 is able to support shared libraries, and as such anything targeting Unix Like systems can be ported with out to much effort.

=========================================

Linux is the kernel that brought us very much. It was the open source alternative when BSD was having leagle trouble, and the Hurd kernel had not gotten off of the ground. There is a lot of positive to say for Linux.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 5:03 pm
by Heater
DavidS,
The puts(); function is a special case, that is equilivent to sending fputs to the console.
This is not so. From the ISO C standard "puts() writes the string s and a trailing newline to stdout."

Like so:

Code: Select all

pi@raspberrypi3:~ $ gcc -static -Os -Wall  -o hello hello.c
pi@raspberrypi3:~ $ ./hello
Hello World, Huge aye!
pi@raspberrypi3:~ $ ./hello > temp.txt
pi@raspberrypi3:~ $ cat temp.txt
Hello World, Huge aye!
The only to write to a file from puts(), is if the OS redirects the output, and that hase nothing to do with the program calling puts().
Exactly. So the operating system decides where the output goes. You have to make a call to the OS. You cannot in line it.
Most of the time we may have more than enough, as most software is somewhat small, and running idle 99.99% of the time. Though that one task that takes a lot of RAM and pushes the CPU to the limit will be the one that all the others make worse, either because of running out of memory and having to page out to disk (slow slow), or because they take away that small bit of time that makes the difference between it being usable and not.
I do agree. That is why it makes no sense to be working hard to optimize most code for time and space. If on the other hand you have code that takes lots of RAM and sucks CPU performance then perhaps it deserves looking at. A graphics engine or example. Especially if it is code that expected to be running for long periods or all the time on your system.
QT or GTK without any support? Just an HW framebuffer? Never heard of that, interesting.
Certainly people have built embedded systems with no Linux or whatever and tweaked Qt to write directly to their hardware. That means the same code can run on such a system or on Windows, Mac, Linux.

Do you have an example of a program written to XLib that I can compile and run under Windows with whatever XLib library I need to install?

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 5:04 pm
by Heater
Agreed, Linux is a great system. We should celebrate the achievement. Party time. I'm going to get a beer...

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 7:06 pm
by DavidS
Heater wrote:DavidS,
The puts(); function is a special case, that is equilivent to sending fputs to the console.
This is not so. From the ISO C standard "puts() writes the string s and a trailing newline to stdout."
NOT The physical consol, the OS provided consol. So you agreed with me on that one, while saying "not so" :-\
Like so:

Code: Select all

pi@raspberrypi3:~ $ gcc -static -Os -Wall  -o hello hello.c
pi@raspberrypi3:~ $ ./hello
Hello World, Huge aye!
pi@raspberrypi3:~ $ ./hello > temp.txt
pi@raspberrypi3:~ $ cat temp.txt
Hello World, Huge aye!
The only to write to a file from puts(), is if the OS redirects the output, and that hase nothing to do with the program calling puts().
Exactly. So the operating system decides where the output goes. You have to make a call to the OS. You cannot in line it.
yes that is what I said.
Most of the time we may have more than enough, as most software is somewhat small, and running idle 99.99% of the time. Though that one task that takes a lot of RAM and pushes the CPU to the limit will be the one that all the others make worse, either because of running out of memory and having to page out to disk (slow slow), or because they take away that small bit of time that makes the difference between it being usable and not.
I do agree. That is why it makes no sense to be working hard to optimize most code for time and space. If on the other hand you have code that takes lots of RAM and sucks CPU performance then perhaps it deserves looking at. A graphics engine or example. Especially if it is code that expected to be running for long periods or all the time on your system.
Did you actualy read what I said. If the small stuff is better optimized, it will not take away from that task, if it is not then it could cause trouble when that big task is ran.

So it is important to optimize the small stuff.
QT or GTK without any support? Just an HW framebuffer? Never heard of that, interesting.
Certainly people have built embedded systems with no Linux or whatever and tweaked Qt to write directly to their hardware. That means the same code can run on such a system or on Windows, Mac, Linux.

Do you have an example of a program written to XLib that I can compile and run under Windows with whatever XLib library I need to install?
Choose what ever XLib you prefer for windows, and here is a simple intro to XLib style program:

Code: Select all

/************************************************
 * Compile with:                                *
 * gcc xwin0.c -o xwin -L/usr/X11/lib -lX11     *
 ************************************************/

#include <stdio.h>
#include <X11/Xlib.h>

int evtlp(Display *ds);


int main(int argc, char **argv)
{
  Display *ds;
  int screen;
  Window myWin;

  if (!(ds = XOpenDisplay(NULL))) {fputs("No Connection to X",stderr); return 1;}
  screen = DefaultScreen(ds);

  myWin = XCreateSimpleWindow(ds,RootWindow(ds,screen),0,0,400,400,1,WhitePixel(ds,screen),BlackPixel(ds,screen));
  XSelectInput(ds,myWin,ExposureMask | KeyPressMask);
  XMapWindow(ds,myWin);

  evtlp(ds);

  return 0;
}


int evtlp(Display *ds)
{
  XEvent evt;

  while(1)  XNextEvent(ds,&evt);

  return 0;
}

Obviously change the backslashes to forward, and on the compiler use the path to your X11 XLib instead of the Linux path. It will compile with out any trouble on Windows, Amiga OS, Atari TOS+MiNT, DOS, n*x, RISC OS, etc so long as you have X11 and its development libs+headers installed correctly.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 7:25 pm
by PeterO
Is there a point to this diatribe ?
PeterO

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 7:36 pm
by fruitoftheloom
PeterO wrote:Is there a point to this diatribe ?
PeterO
:lol: :roll: :lol: :roll:

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 8:11 pm
by DavidS
PeterO wrote:Is there a point to this diatribe ?
PeterO
I believe that the point is that Linux is a good Operating System that is 25 years old, and is the Operating System that helped to popularize the RPi.

Re: 25 years ago: the birth of Linux

Posted: Sat Aug 27, 2016 8:23 pm
by linux_author
DavidS wrote:If only Linux would have stayed away from bloat better.
http://www.slackware.com/

:lol:

willie
on the smart-alpha-sierra-sierra Gulf of Mexico