My Operating System GUI

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.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:My Operating System GUI

Post by Candy »

Tim Robinson wrote: No, lack of memory protection was the main reason why Windows 3.1 was unstable (and it's the same main reason why the Win9x series was unstable too).
If I may kick several of you under the girdle, AmigaOS didn't do any protection either. Why didn't it suffer from these things, or if it did, isn't that because it was in a protected (fan-only) environment? Wouldn't it have been even worse than Windows had it been so widespread?
In practice, programs use cooperative multitasking more often than preemptive. Every time you do a read(), or a select(), or a WaitForSingleObject() -- in fact, any time you issue a blocking call -- you are cooperatively multitasking. By calling a blocking function, you are saying to the OS, "I don't want to do anything until this function completes". During that time, the OS is free to schedule other threads as it wishes.
When implementing multitasking you have the choice to do cooperative, or cooperative with preemptive (you COULD do without cooperative, but that'd completely suck in terms of performance). Preemptive requires mutexes, semaphores and thinking whereas cooperative doesn't. If your code is fit for preemptive, it's always fit for cooperative (in terms of concurrency).
Preemptive multitasking exists to correctly handle the case when two or more threads are non-blocked at the same time. For instance, if you had one program drawing a fractal, and another calculating pi, and another running Seti@home, you rely on preemptive multitasking to keep all three running at the same time.
In other words, if you forgot an "UNTIL" in VB under the 9x series, you'd be hard pressed to get it to work again. I sure did find a good reason to quit basic forgood...

Cooperative multitasking is based on the idea that programs cooperate and play nice. The real world is that programs do NOT cooperate, and most certainly do not play nice, intentionally or because of a bug. The only time cooperative is truly fit is when you are /SURE/ the only program that's ever going to run is going to be written by you or somebody trustable. Unfortunately, this is impossible except for pacemakers etc.

But I'm going off topic even more.

For DOS, it's useless to make a GUI. There are two parts about DOS, both of which you'll have to rewrite to get it to work. That's the IO interface which needs work for any half-new device, and the command line which is exactly what the gui is meant to replace.

Solution: make your own OS.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:My Operating System GUI

Post by Pype.Clicker »

it sounds like there's a misunderstanding about the 'GUI' term around here ...

Let's call what you see when launching KDE or WinXP a "desktop environment", that is, a graphical shell with embedded widgets like toolbars, icons, etc. This has the same role as a startup menu and thus could be interresting even for DOS (if you want to start DeluxPaint by clicking on a pencil rather than Typing DP2.BAT, why not after all)...

Let's call that boxes messes made of rectangles abstracting a screen for each running application in X or Windows the 'Window Manager'. There are two uses for such a manager:
- you have a system in which several programs run at the same time and often switch from one to another because you're actually doing a task that involves several programs.
- you have a single program that should display many stuff (documents ?) at the same time.

Imho, that part is irrelevant for a DOS-based system (except for the "hey look, my GUI has windows" stuff) as
- you're unable to run decently several program
- you're unable to prevent a program to screw up the whole display, anyway

And if you have several documents to display, just use tabs, split-screens (? la 3D modeller or Norton Commander), etc. no need for the two texts you edit to overlap, right ?

Finally you have the subsystem that helps drawing controls and rendering documents on screen. Let's call this the 'widget library'. Even in DOS a widget library is of course interresting, though every existing programs will use their own rendering features (thus it's only interresting for the new programs you'll write :P )
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:My Operating System GUI

Post by Solar »

OT warning...
Candy wrote: AmigaOS didn't do any protection either. Why didn't it suffer from these things, or if it did, isn't that because it was in a protected (fan-only) environment?
As an AmigaOS programmer, you knew that a single off-by-one pointer could wreck your system. Hence, tools like Enforcer, Mungwall and Lint saw widespread use. Moreover, bad tools got a bad reputation rather quickly, and people stayed away from them.
Wouldn't it have been even worse than Windows had it been so widespread?
I think Amiga's weakness turned into an asset here: Windows software, quite frequently, is written by corporations that have to meet deadlines and believe in a buerocratic (sp?) approach to software. Many AmigaOS software titles started out as hobbyist projects: They were ready when they were ready. Many tools showed a high polish that you seldom find in Windows software.

And from the experience of the last few years, I can claim it's a mindset. Many AmigaOS titles have since migrated to Windows, and still they "feel special".
Preemptive requires mutexes, semaphores and thinking whereas cooperative doesn't.
You'll need them as soon as you want to do multithreading, anyway...
Every good solution is obvious once you've found it.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:My Operating System GUI

Post by Candy »

Solar wrote:
Candy wrote: AmigaOS didn't do any protection either. Why didn't it suffer from these things, or if it did, isn't that because it was in a protected (fan-only) environment?
As an AmigaOS programmer, you knew that a single off-by-one pointer could wreck your system. Hence, tools like Enforcer, Mungwall and Lint saw widespread use. Moreover, bad tools got a bad reputation rather quickly, and people stayed away from them.
As a Windows user you know that running _ANY_ program that's made by dubious websites and spam mails, from anybody, is a stupid idea. How many people actually care?

BTW, you can give any tool a bad image, but for noobs the image doesn't matter. They'll run it just the same. We're not targetting osdevers only here :)
Wouldn't it have been even worse than Windows had it been so widespread?
I think Amiga's weakness turned into an asset here: Windows software, quite frequently, is written by corporations that have to meet deadlines and believe in a buerocratic (sp?) approach to software. Many AmigaOS software titles started out as hobbyist projects: They were ready when they were ready. Many tools showed a high polish that you seldom find in Windows software.

And from the experience of the last few years, I can claim it's a mindset. Many AmigaOS titles have since migrated to Windows, and still they "feel special".
The only reasoning I can find behind this is that the AmigaOS people feel they are special somehow, that the rules do not apply to them (sorry, just had to :)). Polish is not something found only in those projects, it's found in every good project, among which an amazingly high amount of hobbyist projects. Note though, I explicitly leave out GNU and Linux, they were not made to be polished & nice, they were complete & full. I'm still going for the polished & nice, with the features you need, not what somebody might want.
Preemptive requires mutexes, semaphores and thinking whereas cooperative doesn't.
You'll need them as soon as you want to do multithreading, anyway...
Well, only if you want to allow multiple threads in the kernel ::)... But needless to say, Linux proved that it was pretty stupid not to do that.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:My Operating System GUI

Post by Solar »

Candy wrote:
Solar wrote: The only reasoning I can find behind this is that the AmigaOS people feel they are special somehow, that the rules do not apply to them (sorry, just had to :)). Polish is not something found only in those projects, it's found in every good project, among which an amazingly high amount of hobbyist projects.
If your Windows tool installs everything into a single directory (instead of scattering .dll's all over the place), if it uninstalls neatly without leaving rubbish behind, if it feels "smooth", intuitive, and well-documented even in the depths of Tools / Options / blahblah; if it is usable right out of the box without having to read some lengthy intro first, has an easy-to-extend plug-in interface and handles esoteric formats right out of the box...

...I found, from author feedback, an *astounding* percentage of the developers of those tools (8 out of 9 in my case) to have a somewhat Amiga-related background.

;-)
Note though, I explicitly leave out GNU and Linux, they were not made to be polished & nice, they were complete & full.
One isn't mutual exclusive with the other. Even if many GNU/Linux user try to tell you that a clean interface just takes away power from the user. :-P
I'm still going for the polished & nice, with the features you need, not what somebody might want.
If it's rough around the edges, I don't want to use it daily (getting chafed by the rough edges day-in, day-out). Just like a crafter, I prefer tools that feel nice when handled.
Well, only if you want to allow multiple threads in the kernel ::)... But needless to say, Linux proved that it was pretty stupid not to do that.
Double ACK... usually, when people step up and say "I want to make a realtime kernel", what they really mean is a *preemptive* kernel. (Not meaning a kernel that preempts, but one that can *be* preempted. Low latency is the buzzword.)
Every good solution is obvious once you've found it.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:My Operating System GUI

Post by distantvoices »

isn't a preemptive kernel best achieved by permitting threads in kernel land?

This way, upon interrupt, a thread is woken up and time spent in the interrupt handler is gloriously low - and other interrupts can trigger as often as they want.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:My Operating System GUI

Post by Candy »

Solar wrote: If your Windows tool installs everything into a single directory (instead of scattering .dll's all over the place), if it uninstalls neatly without leaving rubbish behind, if it feels "smooth", intuitive, and well-documented even in the depths of Tools / Options / blahblah; if it is usable right out of the box without having to read some lengthy intro first, has an easy-to-extend plug-in interface and handles esoteric formats right out of the box...

...I found, from author feedback, an *astounding* percentage of the developers of those tools (8 out of 9 in my case) to have a somewhat Amiga-related background.

;-)
That's a good thing to hear... Still, I feel that developers make what works best for them, and if they don't care about something they won't care.

PS: upon reading a lot of your AmigaOS posts, I've noticed that although I've never even had an amiga, my OS design is really quite like it... Although I do enforce some things, such as keeping your sh*t to yourselves... Still working out the delicate balance between keeping all to the app, and supporting shared libraries... I think I'm going to pretend all apps have a simple purpose, each app has dependencies and a usage count, and all apps you explicitly install get a user-chose-to-flag. That way, you remove all libraries you don't need.
Note though, I explicitly leave out GNU and Linux, they were not made to be polished & nice, they were complete & full.
One isn't mutual exclusive with the other. Even if many GNU/Linux user try to tell you that a clean interface just takes away power from the user. :-P
Although that might be true, clean interfaces /DO/ give me the power I want, and hide the parts I don't care about. For the GNU people, think preferences.
Well, only if you want to allow multiple threads in the kernel ::)... But needless to say, Linux proved that it was pretty stupid not to do that.
Double ACK... usually, when people step up and say "I want to make a realtime kernel", what they really mean is a *preemptive* kernel. (Not meaning a kernel that preempts, but one that can *be* preempted. Low latency is the buzzword.)
Now, no, that's not true. There are two patches for the linux kernel, the preempt patch (which made it possible for the kernel to be preempted), and the lowlatency patch, which AFAIK removed some latency because of buffer copies etc. They are separate, lowlatency doesn't always mean preemptible.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:My Operating System GUI

Post by Solar »

Candy wrote: Still, I feel that developers make what works best for them, and if they don't care about something they won't care.
Let's put it this way:

* Linux - everything *I* need is in there. If you want something else, it's Open Source, so write that part yourself.

* Windows - everything you could *possibly* want is in there. Here's the bill.

* Amiga - I wrote a tool just about everyone could put to good use. If you feel something is amiss, drop me a mail and I'll add it to the next release. Version 1 was freeware, version 2 is shareware, and I have no idea yet if version 3 will be a professional software package or released as Open Source because I lost interest.

That's not as much in jest as it might look at first.
PS: upon reading a lot of your AmigaOS posts, I've noticed that although I've never even had an amiga, my OS design is really quite like it...
I tend to claim it's a matter of thinking things through and never stop thinking, instead of following a cut-and-dried recipee or ideology.
There are two patches for the linux kernel, the preempt patch (which made it possible for the kernel to be preempted), and the lowlatency patch, which AFAIK removed some latency because of buffer copies etc. They are separate, lowlatency doesn't always mean preemptible.
I meant to say a preemptive kernel being a means, low latency being the goal. Both Linux "patch families" attempt the same thing - making Linux more responsive and better suited for e.g. multimedia - but both are retrofits to a Unix-lookalike kernel, which implies "to hell with latency if I can have high throughput on my server box".

I don't want to flame either Linux or the efforts to "juice it up", but it is retrofitting, and we all know what that means in kernel space...
Every good solution is obvious once you've found it.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:My Operating System GUI

Post by Candy »

Solar wrote: Let's put it this way:

* Linux - everything *I* need is in there. If you want something else, it's Open Source, so write that part yourself.

* Windows - everything you could *possibly* want is in there. Here's the bill.

* Amiga - I wrote a tool just about everyone could put to good use. If you feel something is amiss, drop me a mail and I'll add it to the next release. Version 1 was freeware, version 2 is shareware, and I have no idea yet if version 3 will be a professional software package or released as Open Source because I lost interest.
Linux - I put in what I was using, and I strongly advise you all to add everything you might use, so in the end we get a computer that we all can use

Windows - I put in everything that sells, so I make most money (bad spelling intended, goes with the usual amateur windows program...)

AmigaOS (guess) - I made this program so I can use it, but I worked it out the way it should have been. Don't expect me to add anything I don't think should be in there, but do expect me to change my opinion.
I tend to claim it's a matter of thinking things through and never stop thinking, instead of following a cut-and-dried recipee or ideology.
Can say that too, but I could also put it as making things that JustWork(tm). You know, tested through, no self-contradicting design points... things like that :)
I meant to say a preemptive kernel being a means, low latency being the goal. Both Linux "patch families" attempt the same thing - making Linux more responsive and better suited for e.g. multimedia - but both are retrofits to a Unix-lookalike kernel, which implies "to hell with latency if I can have high throughput on my server box".
Couldn't suppress a smile reading that :). Point with unix is that it's designed for 70's systems, whereas most design ideas are total bull now (throughput? I'd like some response. Aligning for a tape? what's a tape?). Also, some things just weren't thought through (fork copying the entire process, bad idea for non-COW computers, and not good for COWers either. Threading? Why make any design choice for that...)
I don't want to flame either Linux or the efforts to "juice it up", but it is retrofitting, and we all know what that means in kernel space...
Somehow the word "DOS box" jumped in my mind... can you find something to connect it with?
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:My Operating System GUI

Post by bubach »

I can?t recall that Windows 3.1 was that unstable...
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:My Operating System GUI

Post by Solar »

Candy wrote: AmigaOS (guess) - I made this program so I can use it, but I worked it out the way it should have been. Don't expect me to add anything I don't think should be in there, but do expect me to change my opinion.
Exactly. Couldn't have put it any better way.

And without even realizing it, you also phrased what qualms I have in placing big projects under GPL.

(Damn, I did it again, mentioning the "G" word where it doesn't really belong... ;-) )
Throughput? I'd like some response.
Unless you're running some kind of server. ;-)
fork copying the entire process, bad idea for non-COW computers, and not good for COWers either.
Hm... fork() isn't that bad as long as you have COW, but most people horribly abuse it.

"If all you have is a hammer, every problem starts to look like a nail."
I don't want to flame either Linux or the efforts to "juice it up", but it is retrofitting, and we all know what that means in kernel space...
Somehow the word "DOS box" jumped in my mind... can you find something to connect it with?
Multitasking? GUI? 8)
Every good solution is obvious once you've found it.
BI lazy

Re:My Operating System GUI

Post by BI lazy »

wouldna call Linux boxes Denial Of Service Boxes. 8-)

@Solar: It's a *three-letter* word, not a *four-letter* one. So, no problem with that. :-p
Schol-R-LEA

Re:My Operating System GUI

Post by Schol-R-LEA »

Actually, the real reason for the greater stability of the Amiga was twofold: first, AmigaExec was the only OS for the Amiga, and it was a 32-bit OS from the start (it didn't even have the issues with tagged data pointers that Macs did) with a single flat memory model. Thus, unlike Windows, it never had to work with a mix of DOS real mode programs, legacy real mode Windows programs, 16-bit protected mode programs, and 32-bit protected mode programs, all at the same time. Furthermore, the GUI was integrated into the OS from the start, so it never had the issues that Windows had of having to go from a graphical overlay on an existing system to a full OS in it's own right. Finally, the original TripOS design which it was based on was much cleaner and more complete than the original Windows model was - it was a fully preemptive OS from the beginning, which among other things made it possible to break out of misbehaving programs so long as they didn't corrupt system memory - so it did not have to change as drastically later, and thus didn't have the 'moving target' problems which the APIs of both Windows and MacOS had.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:My Operating System GUI

Post by Solar »

Good summary, Schol-R-LEA, except for two details:
Schol-R-LEA wrote: AmigaExec was the only OS for the Amiga [...]
Exec was the kernel. The "window manager" (although it was a quite different beast from Unix WM's) was Intuition, and the desktop was the Workbench.

The OS was... well, AmigaOS. ;-)
Finally, the original TripOS design which it was based on was much cleaner and more complete than the original Windows model was...
AmigaOS was not based on Tripos. Tripos came into the game only late, as a plug-in replacement for the DOS subsystem of AmigaOS (as in, "Disk Operating System" - the stuff handling your files) because the in-house developed CAOS didn't make it to completion in time.

And, if anything, Tripos was a pretty ugly hack, because Tripos was written in BCPL while the rest of the OS was written in C (except for Exec, which was Assembly). Including all the issues you get when you mix C (byte adressing) with BCPL (word adressing) - alignment, pointer conversions, ...

Sorry. I'm a bit of an Amiga historian. ;-) The rest is quite correct though. ;-)
Every good solution is obvious once you've found it.
Post Reply