OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Oct 23, 2019 7:25 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: What makes an OS a Unix variant?
PostPosted: Sun May 26, 2019 11:53 am 
Offline
Member
Member

Joined: Tue Apr 24, 2018 9:46 pm
Posts: 56
What makes an OS a variant of Unix? Is it the use of fork and exec to create new processes? Or is it supporting all the "standard Unix" system calls? Is it a question of implementation or of API (i.e. it doesn't matter how you implement it, if you give the "standard Unix system calls" you are a Unix variant)?

Fork, exec, and other "Unix system calls" seem pretty fundamental. I can't see how you can create an OS without them...


Top
 Profile  
 
 Post subject: Re: What makes an OS a Unix variant?
PostPosted: Sun May 26, 2019 1:01 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 256
UNIX-ness is usuallyy understood to be equivalent to POSIX-compatibility. Important here is, compatibility with the "Base Definitions". Things like what a path is, what a process is, what a thread is, etc.

To me, the most important things are: (1) Everything is a file, and (2) there is a unified file system. I'll tell you what I mean.

At work, I have to deal a lot with an obscure operating system called OS-9. OS-9 styles itself as unixoid, but it really isn't. It does have the forward slash as path separator, but that is about it. Oooh, and it has signals. It doesn't have a unified file system; every drive gets its own "descriptor", which is the first part of the path name, and they are all strictly disjoint file systems. This whole "drives" concept is rather DOS in its design, and the descriptors don't help. And there are no device files, and nothing as straightforward as /proc and /sys. Processes not only have a current data directory, but also a current execution directory, and they need not be the same. You can only execute a binary in the current execution directory, or if it was loaded into the module directory first.

It has some similar concepts and then proceeds to f*** them up. There are file descriptors. However, the current file position is bound to the underlying object, and if the descriptor is duped, the dupe and original use the same file position. If my current process reads a file from stdin, and then spawns a child process that also reads from stdin, the file position in the parent will be changed. Also, if two processes have the same file open, one for reading and one for writing, and the read FD happens to approach then end of file, then further reading will not return 0, but block until the write FD is closed or new data is written.

Most of this goes against the base definitions of POSIX. The lack of a fork() system call is pretty incidental in this light.

As for how to create an OS without fork() and exec(): You create a spawn() system call, that creates a new process executing another program. Think CreateProcess() on Windows. Basically, fork() and exec() rolled into one.

And yes, implementation doesn't matter as long as you can provide the interface. Windows is not unixoid, but Cygwin sure is.


Top
 Profile  
 
 Post subject: Re: What makes an OS a Unix variant?
PostPosted: Sun May 26, 2019 1:42 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1489
Location: Athens, GA, USA
nullplan wrote:
At work, I have to deal a lot with an obscure operating system called OS-9. OS-9 styles itself as unixoid, but it really isn't.


If this is the same operating system I know of by that name, it was developed in the late 1970s, and was the primary OS for the TRS-80 Color Computer (and according to that Wikipedia article, the Dragon32 as well); the '9' originally referred to the 6809 CPU which the system was initially developed for. It certainly isn't Unixoid; I would be very surprised if anyone advertised it as such, though given the nonsense which marketing departments pump out it wouldn't be impossible. It's probably closer to QNX (which, despite the name, isn't Unixoid either) than anything else I know of, and indeed it is often presented as a soft-RT OS. Beyond that, I don't know a lot about it.

I'm really quite surprised it is still in use at all, frankly. I know it was ported to the 68K some time in the 1980s (I recall reading about a single board computer which used it along with a BIOS monitor called HUMBUG, as an alternative to another obscure OS called SK*DOS, which was presented in a series of magazine articles around 1990), but that was the last I heard of it. However, according to the Wikipedia article I linked to above, it has been ported to several other platforms, and is mostly used for RT control systems (the article mentions both silicon wafer scrubbers and traffic light control systems).

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
μή εἶναι βασιλικήν ἀτραπόν ἐπί γεωμετρίαν
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: What makes an OS a Unix variant?
PostPosted: Sun May 26, 2019 5:13 pm 
Offline
Member
Member

Joined: Mon Feb 02, 2015 7:11 pm
Posts: 305
Schol-R-LEA wrote:
and was the primary OS for the TRS-80 Color Computer


I wouldn't say it was the "primary OS". The integrated BASIC in ROM was getting far more use. But it was a pretty common OS for the CoCo 2 and 3. I grew up on these machines... Ah the nostalgia. I did love OS-9 at the time and I still think it did amazing things for the CoCo.


Schol-R-LEA wrote:
it has been ported to several other platforms, and is mostly used for RT control systems.


It is indeed still alive in some fields, although it's been a while since I've heard of it. I believe it was used inside the Space Shuttle (for navigation? not sure...), but I can't seem to find a reference to this.

_________________
https://github.com/kiznit/rainbow-os


Top
 Profile  
 
 Post subject: Re: What makes an OS a Unix variant?
PostPosted: Sun May 26, 2019 6:38 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 488
Seems to be a reference in this 1984 document that Cape Canaveral used 4 OS-9 systems to keep the shuttle flying but don't appear to be systems onboard the actual shuttle:

"OS-9 even helps keep the Space Shuttle flyi ng. NASA uses
four Gimix systems running OS-9 at Cape Canaveral, and one of
them performs the pre-fl ight fuel tank tests before every launch. "


Top
 Profile  
 
 Post subject: Re: What makes an OS a Unix variant?
PostPosted: Sun May 26, 2019 9:44 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 256
Well, this went off-topic in a hurry.

OS-9 has a lengthy history behind it. Right now it is being developed by Microsys in Germany. I've met one of the developers. If he's anything to go by, the problem will solve itself biologically one way or the other rather soon. But then, that problem is plaguing so many German companies of late.

The system has been sold as unixoid to me at least, but yes, marketing... right now we use it on a PowerPC, with a ROM-based debugger called ROMBUG, for when the system really cr@ps out.

The "soft-RT" part is what makes my employer buy it. But the way it works is just round-robin with priorities (all runnable processes are in some kind of collection. If a process is entered, its dynamic prio is initialized to its static prio. Every time a runnable process is passed over, dynamic prio is incremented. Runnable process with highest dynamic prio is selected and removed from the collection. Therefore, no matter how many processes are in the collection, at some point every process will run). Would be a lot more convincing if I didn't know most of our processes are sleeping all the time anyway. Bossman says we have to react to certain inputs within a certain timeframe. But nobody ever did the calculations on whether we'd be able to. It always just sort of worked out. And if you want a real e-stop button, it will have to be a hardware solution (that turns the power off), anyway.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: MSN [Bot], thomtl and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group