December 18th, 2004
EDIT: Ultimate has grown into its own LJ community, ultimateos. Hope to see you there.
And now for something completely different...
A long time ago ('96 to be exact), in a high school far, far away, our hero was taking a computer science which was an academically acceptable waste of a period.
The class was being 'taught' C++ by a math teacher who didn't really know anything about computers and probably would have failed the intro to computer class (which mercifully, I never had to take).
One day, he briefly breathed on the topic of operating systems and a girl in the front asked, "What's the ultimate operating system?"
This teacher was unfortunately of the school that thinking while teaching is wrong, so he hems and haws about how it depends on what you're doing. Half credit for that, I suppose.
So the girl says, "Well, I mean with all that in consideration, what would you consider the best general purpose operating system?"
So he goes off with "Well, what do you mean by general?"
So the girl says, "For everyday use by a wide range of people."
So he says, "Well then, I'd say that Windows 3.11 is the ultimate operating system."
This was especially funny. Partly since Windows 3.11 wasn't an operating system at all (although it happened to be what the lab computers booted into at the time). Mostly because the concept of Windows 3.11 being the ultimate operating system was so obviously false to us.
So, we decided that we ought to give that girl a real answer to her question. We decided that we should make an operating system and since it would probably suck in one way or another, we'd make sure that it was at least ultimate in name. So we called it "Ultimate".
I have a few notes on what I want Ultimate to be. I want it to be expandable. By expandable, I intend for the default boot mode to be not unlike DOS, where it's usable for a single task and a single user. This would probably be best characterized as an exokernel. It's not really an operating system at all, rather it's a set of routines which different applications can run.
On this setup, you can then load a multitasking suite which would consist of somewhat sophisticated memory management and process scheduling. At this point, the system will run multiple tasks for a single user.
In order to set up multiple users, you'd ideally load login programs.
This is all pretty straightforward stuff. It sounds almost like a microkernel, except a microkernel typically depends on everything else loaded in. Ideally, I'd want the kernel to be able to stand alone and load programs into memory (including, as in DOS, to be able to load over itself).
More to the point, I'd want everything else to depend on that small framework and grow out of it. Instead of it being a bunch of daemons that talk to each other, I'd want this to build layer on layer on layer. That way things don't necessarily need to talk to each other if you're careful about defining entry points to services.
Enough about the system end, let me explain what I want the user to see.
The user (presumably connecting to a fully loaded system) logs in and has a shell (graphical or CLI, I care not). The reality is that the system they have logged into is a virtual system. This goes beyond chroot to making the entire system a bunch of airtight compartments. Anything done between different users involves using local sockets and communicating over the network.
When a user runs a program, there is an implicit call to an execution environment. Linux does this to an extent with misc binary formats which were able to call up a JVM and load a java program into it. This obviously would need to be definable.
Part of me believes that it might not be a bad idea to treat everything as a binary file (for example, running a JPEG calls up an image viewer), but that also feels dangerously close to one of the more dangerous security holes in Windows. Of course, if it's single user and it's on a virtual system, I'm inclined to say that it's their data. They can cat /dev/null over it all if they'd like and I won't care one whit.
But then again, I'd like to not make it trivial for someone else to ruin someone else's day.
The important part would be that I could decide to run an old Macintosh game (we'll say Bolo. I'm fond of that one) and an execution environment is called up and the game is called in the context of that environment...whether or not the underlying architecture is a 68k or a PPC. This means absolute emulation. At the very worst, you could run the necessary operating system with an execution environment similar to that of VMWare or Bochs, and load the program into that.
I also believe that with some creative allocation of resources, this could be done for a large number of users somewhat reasonably.
This makes security a very interesting thing to implement. After all, the user's login program could run in a defined execution environment, thus making all the OS services that are normally called in the process of a program go through that execution environment.
In fact, this would probably be the right way to compartmentalize the system.
There is one other bit, but I'll wait for comments on this first.
|Date:||December 19th, 2004 01:08 am (UTC)|| |
*sets flame bit to 1*
Sorry, I should've said useful comments. I suppose that was rather asking for every closed minded bigot to come along.
Pray, why on Earth would I use netBSD when it's slower on any benchmark you care to choose than a linux box? I'll answer my own question. I wouldn't. It'd be a waste of my wonderful hunk of hardware.
Let's have a bit of introspection shall we? Any particular reason you declared this "boring"? Or do you need a reason to pop in and make unsubstantiated claims?
Truly, if I wanted to bore people, I'd've posted your exact comment. Irrespective of the topic.
dual core processors will start to make that a real reality
My ultimate OS would be one that allowed any number of other OSs to run on the same machine at the same time. It'd work like this...
You'd install UltimateOS but you wouldn't be able to do anything much with it other than install other OSs on top of it - each of them thinking they had the computer to themselves, except what they had was a virtual image of a computer provided to them by UltimateOS.
From the users POV, they could then boot X number of OSs at once, each of them having their own screen, they then switching between those screens as they needed to access programs running on the different OSs.
Oh, and the ultimate OS in the days of Win3.11 was of course AmigaOS, but I'm sure you knew that. :-)
Sounds like your ultimate OS already exists in VMWare. They have an enterprise edition that I tried desperately to get my grubby little hands on, but never quite managed to do.
The biggest problem with multiple OSes is that they take more space than merely emulating the execution environment. One thing I really hope to do with this is bootstrap off of Linux's success with the ability to run linux drivers in a similar manner. Actually, it might not be impossible to load Windows drivers, although that's somewhat more complex.
Of course, execution environments can exist in small shared libraries and make it possible for a much greater number of users to run binaries from other OSes.
AmigaOS was a fine bit of work, and better than the contenders on the desktop, but it will forever (in my mind) stand in the shadow of OS/2 ; )
*nods and smiles and pretends to understand*
Sorry. I'm a geek. It's in my nature to propose silly ideas like this. 8)
And if you took a mere 2 years of CS classes at UCSC, you too could post like me! ; )
|Date:||December 19th, 2004 05:56 am (UTC)|| |
|(Link)|The important part would be that I could decide to run an old Macintosh game (we'll say Bolo. I'm fond of that one) and an execution environment is called up and the game is called in the context of that environment...whether or not the underlying architecture is a 68k or a PPC. This means absolute emulation. At the very worst, you could run the necessary operating system with an execution environment similar to that of VMWare or Bochs, and load the program into that.
What would make this more interesting would be a multi-architecture CPU configurable by the OS. I think it would take the following:
A stack (with a setting for which direction it grows
A register file
A Big-Endian / Little-Endian setting
A setting for whether a branch has a delay slot
A setting for whether each instruction waits for the one before it to finish (I hear MIPS doesn't)
A mapping of ISA register addresses to native (maybe make native match x86 for x86 performance)
A mapping of ISA instruction numbers to native (again, consider matching x86)
SPARC doesn't wait for instructions to finish either.
Since most of the mappings aren't 1-1 for instructions and some of them require hardware support which isn't necessarily found on the underlying system, I prefer to leave that to the execution environment.
Also, I don't really intend for execution environments (apart from the default) to be a part of the OS. Rather, I'd expect the administrator to install them.
|Date:||December 19th, 2004 07:54 pm (UTC)|| |
Very secure, since every user's userspace is completely walled off. Only problem with compartmentalization (wow, that took me three tries), is there will be an inevitable slowdown. Having to go through more things than just "two daemons talking to eachother." Nonetheless, infinitely more secure.
I'd like to see this OS made a reality. I'd play with it, atleast.
Not necessarily a problem with compartmentalization (I got it the first time because I copied and pasted ; ) ). It just requires more work in the hardware abstraction layer.
The theory is that all system calls pass through a user-specific sort of init. It catches all the system calls and does the necessary translation. Most OSes have similar code in interrupts and certainly in the area of memory management, so I'm fairly confident that it can be done without a significant performance hit.
|Date:||December 19th, 2004 09:24 pm (UTC)|| |
I'm currently writing an OS, too. Don't let the morons trying to suck you into their operating system communities get you down; they don't understand that in order to contribute to an operating system, it helps to have written one so you know what you're doing
Doing a project like that takes one of two forms, I've observed. It's either a little throwaway thing that you do to gain experience and/or satisfy a very narrow niche, or it turns into a colossal project that draws in thousands of other people and takes over your life. I haven't seen any projects end up between those two extremes; it always seems to be one or the other.
Examples in the first group: mine, the winning IOCCC entry this year, some of Linus's early projects, processor test software at chip companies, etc. Examples in the latter group: AtheOS
, Linux, FreeVMS, etc.
I suggest that you decide now which camp you want to be in before finding out the hard way you've ended up in the second camp. That's a quick way to go broke, because for every Linux there's 20 people who didn't get lucky like Linus did.
Other than that, your architecture describes some interesting features that I'd like to study myself. May I suggest that you also investigate hyperqueues
as an IPC mechanism? Modern MMUs allow them to be implemented as the primary IPC mechanism these days, and they offer several benefits. It is also especially noteworthy that hyperqueues or a similar shared memory mechanism allow zero copy system calls...
I should also point out that access to the graphics devices needs to be arbitrated between the text and graphics drawing code, which almost certainly means that you'll have to store a bunch of state in the layer that's being called to do the drawing. That prevents you from implementing the OS as "a set of routines", because you'll have to also implement a bunch of other stuff like paging, handles to the graphics resources, and dynamic memory to ensure that that state is protected from the rest of the running tasks.
IIRC, you're the guy who was writing ToyOS, yeah? That's what brought all this to the forefront.
Like Linus, I don't particularly care whether it takes off or not. J.T.S. Moore asked him if he cared that a bunch of people were using Linux at companies and making tons of money that he didn't have a stake in.
He answered that if he hadn't made Linux, he still wouldn't have a stake in that money.
If it takes off, I'll be gratified. It'll be nice to have done something larger for the geek community.
Hyperqueues seem interesting. I'd certainly be happy to implement them, but for what I have planned, they won't really work as an internal OS mechanism.
I intend for the OS to have multitasking and so on, but the most basic part (the exokernel) will be little more than DOS. Multitasking, paging, graphics beyond a default text mode, drivers, and so on will all be modules more or less which are loaded in.
The reason for this is that I've always loved how CP/M and MS-DOS would almost infallibly run on almost any combination of hardware. I want to have some sort of uber safe mode which does the absolute minimum necessary.
Also, someone might not want all that multitasking stuff anyway. ; )
Thanks for the actually thoughtful comment 8)
Personally, I think it sounds awesome. I didn't understand it all, but what I did understand, I liked. If I knew how, I'd be making an OS, too.
If you need any help (that someone as adept at computers as a geeky 17 year old can be could render), let met know. I'd love to help.
In any case, good luck! I'd love to see what you come up with.
Thank you for the offer. I may take you up on it in time. I'll certainly keep in touch with those who
didn't go off plugging NetBSD seemed enthusiastic. 8)
BTW, don't sell yourself short re: age. I don't think I've gotten a whole lot smarter as a programmer since I was 17 ; )
|Date:||December 20th, 2004 05:26 am (UTC)|| |
I'm of the mind that an operating system can never and will never be good by its own merit. It's absolutely impossible. The entire idea behind an Ultimate Operating System is a facade. This is why I use Windows instead of Linux. I will never say that Windows is a better technical achievement on the vast majority of issues, not in a million, but I will say that it can do more. Simply and clearly, Windows can do more than Linux, and it always will be able to until either Wine stops sucking or the market control shifts. Windows is the Ultimate Operating System. And I hate Windows.
I'm so, so sorry.
|Date:||December 20th, 2004 05:44 am (UTC)|| |
Or until virtual machines start freaking supporting DirectX.
go to slackware.com and go to an ftp site with the slackware stuff. Check in rootdisks and there's a file called smartboot.dsk or some such.
That's what you need.
Yes, I suppose that I ONCE AGAIN will have to drag you forcibly into the future by giving you an ultimate partition at some point.
|Date:||January 9th, 2005 12:02 pm (UTC)|| |
Couple of things:
Why don't you consider Windows 3.11 as an operating system? Is it because it booted on top of DOS?
Apart from it not running Mac apps - although it's not its fault, as I've no emulator for it - VMWare's Work Station is pretty near perfect as far as I'm concerned currently.
Exactly right. Windows 3.11 doesn't really do anything except scheduling and memory management. I'd consider Windows 3.11 + DOS to be an OS, but that really wasn't the answer given.
VMWare is great, great stuff. I really wanted to get my hands on the enterprise edition at one point because it sounds exactly like what I want Ultimate to be, but never did.
Why is it that this post immediately started a flamewar?! Aside from the obvious first troll. Why the religious cult following, and the "I use this, it is the only TRUE way"-type attitudes? Surely it's better to look at systems on their individual merits, rather than just pure faith.
The *BSD family and the Linux distros have a lot in common. Hell, they share a lot of the same code for the compiler kits, programs etc. They often both benefit from code sharing. Personally, I'm a FreeBSD man, as it's more suited to running the web servers I run, and it's sheer blistering speed. But each O/S tends to be suited to different situations.
As far as I can tell, what we need is to take the best features of the UNIX-like/derived O/S's, and slap them with a redesigned core.
But I'll continue this in ultimateos
No idea why it started flamewars at all. 8) I wasn't around, but I'm curious if Linus had people telling him that XENIX or FreeBSD or whatever did whatever "Linux" was going to do.
Besides, reinventing the wheel's good for the soul. ; )
I mostly agree with you, but I think that modern OSes don't need to be as large as they are. When a system is well and truly broken, I don't reach for Linux. I reach for MS-DOS. I want that same sort of functionality without sacrificing all the yummy *nixy goodness that I've come to know and love.
This has the interesting side effect that you could in theory (with infinite manpower for the port) run the exact same OS on any box from an embedded device up to the Earth simulator.