What makes the OS for QL any better, different, unique ?

A place to discuss general QL issues.
stephen_usher
Trump Card
Posts: 242
Joined: Tue Mar 11, 2014 8:00 pm

Re: What makes the OS for QL any better, different, unique ?

Postby stephen_usher » Sun Jul 19, 2020 7:30 pm

I can see the QL out performing a 4.77MHz 8088, as that's a 8 bit hobbled 16 bit processor too, but not an AT. Having said that, the PC-XT didn't have to drive the screen and interleave memory as I seem to remember that the MGA or MDA card had its own memory and hardware scrolling, so it would seem quicker.


User avatar
janbredenbeek
Gold Card
Posts: 387
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: What makes the OS for QL any better, different, unique ?

Postby janbredenbeek » Sun Jul 19, 2020 10:37 pm

stephen_usher wrote:I can see the QL out performing a 4.77MHz 8088, as that's a 8 bit hobbled 16 bit processor too, but not an AT. Having said that, the PC-XT didn't have to drive the screen and interleave memory as I seem to remember that the MGA or MDA card had its own memory and hardware scrolling, so it would seem quicker.

It's difficult to compare the many screen modes of the PC (especially the character-mapped modes from MDA or Hercules) to the bit-mapped modes of the QL. Character-mapped modes will always outperform bit-mapped modes in terms of speed, but have very limited graphics capabilities (only the usual box drawings etc).
Also, the standard DOS/BIOS system calls for screen I/O were known for their poor performance, causing many software developers to ignore them and write directly to the screen memory. If you wanted to have windows and pop-up menus in DOS, you had to write the code yourself or use a third-party library.
QDOS, even without PE, has an extensive set of screen I/O calls but the character-based calls were not very speed-efficient (Speedscreen or Lightning did improve quite a lot) and scrolling up to 32K of contended memory on an 8-bit databus will be relatively slow compared with a 25x80 character mapped screen which occupies just 2K of memory.


User avatar
ql_freak
Gold Card
Posts: 251
Joined: Sun Jan 18, 2015 1:29 am

Re: What makes the OS for QL any better, different, unique ?

Postby ql_freak » Mon Jul 20, 2020 10:33 pm

bwinkel67 wrote:To answer here, the term multitasking and the specific categories of preemptive (Unix/Linux/QL OS's/most modern ones) and cooperative (original Mac OS)


AFAIK neither the original Macintosh nor the original Atari ST have any multitasking neither preemptive nor cooperative. They both are single tasking operating systems with a GUI (Graphical User Interface). Windows 3.0 (3.1) was a cooperative multitasking operating system. You could load a lot of Windows programs at the same time, e.g. a word processor and a spreadsheet and switch between the both. This was IMHO never possible on an original Mac or Atari ST. When you were in the word processor and want to look into a table, you have to quit the word processor and start the spread sheet program.

Cooperative multitasking means, if a program return access to the operating system (perhaps implicitly by an input), than you can switch to another program. As you have written, if it's an endless calculating loop, with no operating system calls, than Windows 3.1 hangs (one exception are the DOS boxes, which run in preemptive multitasking). See cooperative versus preemptive multitasking in Wikipedia.

OK I have read in this article, that the classic Mac supports cooperative Multitasking, BUT IS THIS TRUE? I don't think that it was possible to start a word processor and a spreadsheet in parallel. Perhaps Mac OS was clever and simulated a switch: Leaving the word processor but store the file and the position, start the spreadsheet, and when switching back, leave spreadsheet, load word processor file and go to same position. But this is of course no real cooperative multitasking.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE§() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
ql_freak
Gold Card
Posts: 251
Joined: Sun Jan 18, 2015 1:29 am

Re: What makes the OS for QL any better, different, unique ?

Postby ql_freak » Mon Jul 20, 2020 10:41 pm

tcat wrote:Hi,

Code: Select all

10 LET j = 1
20 FOR i=1 TO 1000
30 LET j = i*j
40 NEXT i


This sort of bench would complete much faster on Speccy to XT machines with their ROM BASIC.

I am led to believe so was QL outperforming IBM XTs and early ATs.


Well for BASIC benchmarks one of the fastest home computers was the Acorn BBC. Its BASIC was faster than SuperBASIC in most benchmark programs. And even faster was the DAI.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE§() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
bwinkel67
Gold Card
Posts: 455
Joined: Thu Oct 03, 2019 2:09 am

Re: What makes the OS for QL any better, different, unique ?

Postby bwinkel67 » Mon Jul 20, 2020 11:18 pm

ql_freak wrote:AFAIK neither the original Macintosh nor the original Atari ST have any multitasking neither preemptive nor cooperative. They both are single tasking operating systems with a GUI (Graphical User Interface). Windows 3.0 (3.1) was a cooperative multitasking operating system. You could load a lot of Windows programs at the same time, e.g. a word processor and a spreadsheet and switch between the both. This was IMHO never possible on an original Mac or Atari ST. When you were in the word processor and want to look into a table, you have to quit the word processor and start the spread sheet program.

Cooperative multitasking means, if a program return access to the operating system (perhaps implicitly by an input), than you can switch to another program. As you have written, if it's an endless calculating loop, with no operating system calls, than Windows 3.1 hangs (one exception are the DOS boxes, which run in preemptive multitasking). See cooperative versus preemptive multitasking in Wikipedia.

OK I have read in this article, that the classic Mac supports cooperative Multitasking, BUT IS THIS TRUE? I don't think that it was possible to start a word processor and a spreadsheet in parallel. Perhaps Mac OS was clever and simulated a switch: Leaving the word processor but store the file and the position, start the spreadsheet, and when switching back, leave spreadsheet, load word processor file and go to same position. But this is of course no real cooperative multitasking.


So the Mac that came out in 1984 was a single tasking OS. It added Multifinder sometimes in 1987 (first the functionality then fully integrated) which implemented cooperative multitasking. The original Windows was also single tasking and then added some for of limited multitasking in 1987/88 -- to quote a wiki "this version had some specific code to the 80286 CPU allowing limited MS-DOS multitasking." -- but I'm not sure what "limited" here means. Windows 3.0 finally added true cooperative multitasking in 1990.

So the way cooperative multitasking is implemented and why it actually worked well in both Windows and on the Mac is that the GUI environments forced you to write event driven loops where you make a call to the OS at the top of the loop to grab the next event. So if you wrote your programs accordingly you would return control constantly to the OS whenever you wanted to grab the next mouse-movement or mouse-click or key-entry. Since programs don't want to be non-responsive, this sort of things worked pretty well. However, if you had a bug in your code (i.e. an unwanted infinite loop) you would hang the machine. Writing event loops wasn't that difficult and coding for the Mac/Windows did take on a completely different flavor. Still, fundamentally, preemptive multitasking is much better and you can write non-event-driven programs and not worry about the consequences. Plus it is much nicer to have the OS kernel decide at what level to task swap a program and not be reliant on each application to decide at what discrete chunk it would give up control.


User avatar
pjw
Super Gold Card
Posts: 686
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: What makes the OS for QL any better, different, unique ?

Postby pjw » Mon Jul 20, 2020 11:51 pm

I dont think the first priority for SuperBASIC was speed. Rather it was
versatility, flexibility, and extendability. These, naturally, come at some
detriment to speed. Turbo is mainly about speed, but at the cost of many of
those things that make SuperBASIC great. It seems that its hard to have both.

SBASIC helps to make good on some of SuperBASIC's deficiencies. It refines the
tokenised code one step further: to threaded machine code, while keeping all the
advantages of SuperBASIC and an interpreted language.

After all these years I still think it is pure genius!

Personally, I also liked PSION's BASIC, as found on the S3. I didnt get much
acquainted with its inner workings as my S3 broke down after a short while and
the company I bought it from went bust (and took my warranty and money with it)
but I suspect the language, as a language, was modelled on SuperBASIC. I dont
think it was integrated as a command language for the machine, but it was great
for writing simple applications.

Menuing was built in, in a clever and simple way, and it could access the
machine's graphic fonts, which was neat. I miss those capabilities in S*BASIC!


Per
Be wary of large West-Coast corporations bearing gifts!
- Ancient Trojan proverb
User avatar
ql_freak
Gold Card
Posts: 251
Joined: Sun Jan 18, 2015 1:29 am

Re: What makes the OS for QL any better, different, unique ?

Postby ql_freak » Tue Jul 21, 2020 12:21 am

pjw wrote:Personally, I also liked PSION's BASIC, as found on the S3.


I LOVE MY PSION 5 mx PRO! And the language is not BASIC, it's named OPL (Organizer Programming Language, later renamed to Open Programming Language) :-)

A mobile computer (fits into the inner pocket of a normal jacket) with a much better office than XChange, which operates for about 1 month with 3 AA batteries :-)

And of course a preemptive multitasking OS (written in C++).


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE§() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
M68008
Brittle Membrane
Posts: 102
Joined: Sat Jan 29, 2011 1:55 am
Contact:

Re: What makes the OS for QL any better, different, unique ?

Postby M68008 » Tue Jul 21, 2020 2:35 am

ql_freak wrote:AFAIK neither the original Macintosh nor the original Atari ST have any multitasking neither preemptive nor cooperative. They both are single tasking operating systems with a GUI (Graphical User Interface).
...
OK I have read in this article, that the classic Mac supports cooperative Multitasking, BUT IS THIS TRUE? I don't think that it was possible to start a word processor and a spreadsheet in parallel.


The original Mac had an extremely limited form of cooperative multitasking that allowed running system accessories like Calculator while an app was running.
System 5 added full cooperative multitasking (switching between multiple apps).

While consumer-Windows got preemptive multitasking (and a degree of process/task protection through virtual memory) with Windows 95, the Mac incredibly didn't get it until OS X in 2001.
One year after the QL, AmigaOS also had preemptive multitasking.


User avatar
bwinkel67
Gold Card
Posts: 455
Joined: Thu Oct 03, 2019 2:09 am

Re: What makes the OS for QL any better, different, unique ?

Postby bwinkel67 » Tue Jul 21, 2020 3:09 am

I did work with the old cooperative kernel on the Mac in the day. It was pretty simple in its round-robin fashion. I will say the applications behavior is random for how each dealt with it. Some put themselves in hibernation mode when not in foreground and just took events to make sure to get awakened and update their screens. As examples, Moire (like the Baton Twirl program I was recently trying to recompile) is a perfect example, it bounces lines and once in the background it stops whereas another, Globe, which just spins a small globe on the screen, will keep changing the images to rotate even when in the background. Plus you could never run the same program more than once unless you duplicated it as the Finder/Multifinder wouldn't let you (may have something to do with wanting to protect the resource fork...dunno why else they made that decision). The only app in modern days that still has that behavior is Excel and I dislike it for that as whenever you try to open two spread sheets (at least in the older version I'm using) you only get to see one.

I wrote a shell for the Mac with an included scripting language and didn't quite follow the rules. If you ran a loop printing, say 100 values, and then stuck it in the background, it would stop until it got a window refresh event (you moved a foreground window causing part of the shell's screen to be covered or revealed) at which point it would go past 5-10 values and back to being stalled. It also didn't allow for the window to be moved while not asking for input (i.e. if running a loop). It was actually well received but in retrospect I broke a lot of the Mac rules...of course that was the insanity of writing code on the Mac back then. You really had to work to make things run seamlessly and of course the trade-off was speed since you had to stick GetNextEvent calls everywhere (and capture all those events and handle them). Just odd behavior like that. I can't believe I used to love the Mac of those days; marketing is a powerful thing :( Unbelievable it took until 2001 for them to get it right.


User avatar
tofro
QL Wafer Drive
Posts: 1963
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: What makes the OS for QL any better, different, unique ?

Postby tofro » Tue Jul 21, 2020 10:25 am

Well, computers nowadays aren't being designed for programmers, but rather for end users.

And, properly written applications assumed, there shouldn't be any noticable difference from an end-user's perspective between a pre-emptive or cooperative design.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO

Who is online

Users browsing this forum: No registered users and 2 guests