Linked by Thom Holwerda on Mon 12th Jun 2006 13:29 UTC, submitted by david
General Unix "UnixLite is a lightweight UNIX/Linux compatible operating system written in c++; it is open source and released under the GNU General Public License. The complete operating system is made up of a kernel and applications; just like Linux, UnixLite is only the kernel. The kernel itself is written from scratch and the biggest part is written in c++; however, the library used by UnixLite comes from uClibc and applicaitons running on UnixLite come from the GNU project."
Order by: Score:
Advantage
by Snake007uk (1.35) on Mon 12th Jun 2006 14:05 UTC
Snake007uk
Member since:
2005-07-20
Fans: 0

Is there any advantages in writing Kernel is c++ ?

for that matter anything in c++ rather then C ? i am not a programmer and am just curious.

RE: Advantage
by Cloudy (2.68) on Mon 12th Jun 2006 19:38 UTC in reply to "Advantage"
Cloudy Member since:
2006-02-15
Fans: 9

That's a controversial question, but most kernel developers would say there is no advantage to writing kernels in C++ rather C because the kernel is the part of the system that does resource management, especially memory management, so we prefer to write in languages that don't do any implicit resource management (other than the call stack) in order to maintain maximum control.

RE[2]: Advantage
by slate (1.12) on Mon 12th Jun 2006 21:11 UTC in reply to "RE: Advantage"
slate Member since:
2006-04-04
Fans: 0

I think there's a few factors here.

First is that kernel developers feel comfortable with C. C++ is a multi-paradigm language and when you have other developers starting to write crazy templates, or insanse object hierarchies, other people aren't going to appreciate their way of thinking.

C is simple. You've got macros, structures, and functions. That's it. There's much less room for "creative" types that want to inject wacky way of doing things.

There's no reason you can't write a successful, tight kernel in C++. It's just that it would probably work better with a tight knit group of developers, and not the freestyle of the linux kernel.

v why?
by Luxzenburg (-3) on Mon 12th Jun 2006 14:13 UTC
RE: why?
by nxsty (5.12) on Mon 12th Jun 2006 14:18 UTC in reply to "why?"
nxsty Member since:
2005-11-12
Fans: 1

Well, why not?

RE: why?
by Ronald Vos (1.64) on Mon 12th Jun 2006 16:08 UTC in reply to "why?"
Ronald Vos Member since:
2005-07-06
Fans: 0

There are a lot more than 2 FOSS Unix systems in the world.

But please tell me: why do people feel the need to ask 'Why?'? It seems pretty obvious not every OS has the same set of priorities and goals.

RE[2]: why?
by EliGottlieb (1.76) on Mon 12th Jun 2006 16:19 UTC in reply to "RE: why?"
EliGottlieb Member since:
2005-10-30
Fans: 0

Yeah, every OS has the same priorities and goals: Provide a nice interface for programmers and users. However, NOT EVERY SYSTEM needs to be a Unix clone. I agree with the gist of the OP, we've got too many Unix workalikes around.

RE[3]: why?
by whartung (3.8) on Mon 12th Jun 2006 17:48 UTC in reply to "RE[2]: why?"
whartung Member since:
2005-07-06
Fans: 0

However, NOT EVERY SYSTEM needs to be a Unix clone. I agree with the gist of the OP, we've got too many Unix workalikes around.

No, not every system needs be a unix clone.

However, as far as OSes go, Unix has a lot going for it as a hobby or educational OS.

1) Well documented. Lots of books and articles document the internal architecture of a Unix OS.

2) Tool suite. Writing a Unix kernel gives you access to the vast array of GNU tools which adds meat and functionality to your OS quickly.

3) Examples. Minix, Linux, BSDs, etc all provide ample working examples you can refer to when crafting your hobby OS.

With a Unix based OS, you pretty much need to write the kernel, implement enough necessary system calls and compile up a bunch of free software to flesh the thing out and give you something that you can work easily with.

If you wanted to write a VMS clone, you get to write the kernel, shell, editors, utilities, etc.

Creating an OS today, particularly a Unix inspired one, is not particularly rocket science, but that doesn't make it a trivial task. Still of lot of basic work coding the fundamentals, writing your device drivers, and debugging the darn thing.

And once you write one OS, then you have ideas on what and where to go next. It's difficult to have those idea simply using an OS, or even reading their code. You need to work through the problems that others did to better understand why and how things are done, so you're better educated on why you should or should not change them.

RE[4]: why?
by EliGottlieb (1.76) on Mon 12th Jun 2006 19:06 UTC in reply to "RE[3]: why?"
EliGottlieb Member since:
2005-10-30
Fans: 0


If you wanted to write a VMS clone, you get to write the kernel, shell, editors, utilities, etc.


Why should all new kernels be clones?

RE: why?
by Arno (1.88) on Tue 13th Jun 2006 13:06 UTC in reply to "why?"
Arno Member since:
2006-01-10
Fans: 0

There are already 2 F/LOSS Unix system in the world: BSD and Linux, why is there a need for a third one?

There is already one dominant OS in this world, why still create a site called "OSnews"?
Because he fellt like it, that's probably why but it doesn't matter, what matters is that you too can enjoi it, and ignore when you think is too much.

From the FAQ
by smitty_one_each (1.4) on Mon 12th Jun 2006 14:14 UTC
smitty_one_each
Member since:
2005-07-07
Fans: 0

Is c++ suitable for system programming?
We only use plain c++ functionality: member function, single inheritance, and virtual function. That's enough. We think there is no essential difference between c and c++ without using the following c++ features:
exception handling
multiple inheritence
run time type identification
operator overloading except new and delete
template magic

So you're arguably improving code legibility and getting GCC to do more type checking.

Edited 2006-06-12 14:14

RE: From the FAQ
by Cloudy (2.68) on Mon 12th Jun 2006 19:42 UTC in reply to "From the FAQ"
Cloudy Member since:
2006-02-15
Fans: 9

... We think there is no essential difference between c and c++ without ...

Even single inheritance is a significant difference between C and C++ semantically. Constructors, and their side effects, make the language behavior enough different to matter to a kernel developer.

Not saying that this is necessarily bad, only that it's a real difference.

About the name
by kajaman (2.48) on Mon 12th Jun 2006 14:32 UTC
kajaman
Member since:
2006-01-06
Fans: 1

I bealive that using "UNIX" in a name of this OS i illegal ;) .

RE: About the name
by ThanhLy (2.64) on Mon 12th Jun 2006 16:13 UTC in reply to "About the name"
ThanhLy Member since:
2006-03-14
Fans: 1

You would have been right if you had typed it "Unix" which is the way the name of this new OS is written anyways.

"UNIX" is the concept, "Unix" is the trademark.

RE: About the name
by KenJackson (3.48) on Tue 13th Jun 2006 00:11 UTC in reply to "About the name"
KenJackson Member since:
2005-07-18
Fans: 5

I immediately wondered about the name and wondered if they had secured someone's blessing that had some historical claim to the name. But I can find no mention of the issue on their site at all.

That business about UNIX vs Unix won't cut it if the trademark lawyers start cruisin' for a fight. A number of years ago, if I remember, QNX had to run ads declaring that QNX is not Unix. And that name doesn't even have U or I.

The only thing I can figure is that they expect the for educational purposes clause to save them.

Nitpicking
by GreatBunzinni (2.56) on Mon 12th Jun 2006 14:53 UTC
GreatBunzinni
Member since:
2005-10-31
Fans: 1

this may be nitpicking but it would be very interesting to see exception handling being used in the kernel itself. All the other C++ features would also be interesting to check out but exceptions would be a great thing to offer.

RE: Nitpicking
by EliGottlieb (1.76) on Mon 12th Jun 2006 16:21 UTC in reply to "Nitpicking"
EliGottlieb Member since:
2005-10-30
Fans: 0

http://www.invalidsoftware.net/home/modules/news/

That's a whole bunch of people writing kernels in C++, some of them with exceptions. Personally, I can say that my kernel's use of exception handling has made development/debugging go at least 1.5x faster than without.

RE[2]: Nitpicking
by fdavid (2) on Tue 13th Jun 2006 00:04 UTC in reply to "RE: Nitpicking"
fdavid Member since:
2006-06-13
Fans: 0

Choices is one of the older C++ operating system
kernels in existence. http://choices.cs.uiuc.edu/
We have recently added exception handling support and done some initial evaluation as well.
The paper is at
http://choices.cs.uiuc.edu/exceptions.pdf

RE[3]: Nitpicking
by Cloudy (2.68) on Tue 13th Jun 2006 02:27 UTC in reply to "RE[2]: Nitpicking"
Cloudy Member since:
2006-02-15
Fans: 9

What a blast from the past. I'm surprised that the paper doesn't reference Brevix, which codified the interruption-into-exception model of hardware exception handling back in '93. Of course, Brevix exceptions were language-independent, and designed in from the begining.

It's interesting to see how Choices has bolted-on an exception model.

I look forward to seeing how you develop a fault model that incorporates Choices exceptions

Who?
by GreatBunzinni (2.56) on Mon 12th Jun 2006 15:01 UTC
GreatBunzinni
Member since:
2005-10-31
Fans: 1

One more thing: who in the hell wrote it? There is absolutely no mention about the authors in the project's site. Respect must be given, damn it!

RE: Who?
by jmansion (1.84) on Mon 12th Jun 2006 16:47 UTC in reply to "Who?"
jmansion Member since:
2006-02-20
Fans: 0

Well, the first screenshot says:

COPYRIGHT (C) 2005 NUAA CS DEPT.

RE: Who?
by kamil_chatrnuch (2.6) on Mon 12th Jun 2006 16:48 UTC in reply to "Who?"
kamil_chatrnuch Member since:
2005-07-07
Fans: 0

from the site:
Copyright © 2005-2006, The UnixLite Software Foundation

from whois:
...
Registrant Organization:Nanjing University of Aeronautics and Astronautics
...
Registrant City:Nanjing
Registrant State/Province:Jiangsu
Registrant Postal Code:210001
Registrant Country:CN
...

AS400 - proof that C++ is good for kernels
by JeffS (4.08) on Mon 12th Jun 2006 16:52 UTC
JeffS
Member since:
2005-07-12
Fans: 5

IBM's OS400, which runs their AS400/iSeries servers, which sell like hot cakes, and which run and run and run and run and run for months and months and years and years, and that customers love, is written in C++.

I work for a software company whose software only runs on Windows, but connects to a large variety of platforms, including AS400. And we have a huge AS400 customer install base. I talk to these people all the time, and they absolutely love AS400s. They rave about AS400's efficiency and reliability, and relative ease of use. In short, AS400's, running OS400, are kick-butt servers.l

Proof positive that C is not the only option for kernel development.

It also puts a squelch on Linus Torvalds' famouns rant about using C++ in the Linux kernel. He basically said that C++ sucks for kernel development. Anyway, it's probably not a good idea to put C++ in the Linux kernel at this point, and it may indeed not be a good for how the Linux kernel is designed, but that's just for the Linux kernel. While Torvalds' opinion is valid for his uses and the Linux kernel, it's not valid for all kernels or situations. IBM's OS400 proves this, quite emphatically.

So, in short, more power to these guys developing UnixLite.

bsd_geek Member since:
2006-05-04
Fans: 0

You are right! AS/400 do run and run and run ....

We have and 810 box and the machine pretty much requires no maintenance at all. Although, it does do a PWRDWNSYS on the weekends for safe measure. The interface is a breeze to work with. I can move through the screens an eye blistering rate. Mostly I work with output queues and writers which is by far better than anything in windows or even lpd.

Almost everything on our box is homegrown. We do not use a package other than for EDI and AS/2. We have in-house RPG programmers. RPG was never a laguage that I can get into (fixed form is eewwww), but it does do the job quite well whether it's for screens, reports, you name it.

Unfortunately, upper management tends to see the AS/400 as an old dinosaur because it doesn't have a pretty GUI. Of course, you can write a client/server GUI application but the green screen is far superior in my opinion.

The AS/400 can run Unix stuff as well. Perl has been ported to it as well as other similar applications. If it can run in PACE, then you're good to go. It also does SMB (like Samba) so I can see the AS/400's network drives.

Oh, and everything is an object. A lirbrary is an object, a member is an object, etc. The OS is an object oriented OS where everything is an object.

The only thing I have issues with is that there aren't any open source methods of accessing the AS/400 data. I mean, there doesn't appear to be and open source ODBC driver or any anything of that nature that can maybe work with perl, python or php. So, let's say I wanted to setup a FreeBSD webserver to access AS/400 data then I can't. Unless, I maybe use Linux binaries running under emulation (which I have never tried) but who would really want to do that? For me, it's either all or nothing. I guess maybe the only other alternative is Java and JDBC, but then I'd have to copy packages and stuff over from Websphere Studio or something.

All in all, the AS/400 is a solid machine. I just wish it was more 'open'.

galvanash Member since:
2006-01-25
Fans: 0


IBM's OS400, which runs their AS400/iSeries servers, which sell like hot cakes, and which run and run and run and run and run for months and months and years and years, and that customers love, is written in C++.


That would be quite interesting if it were actually true. The part of OS/400 applicable to this discussion (the SLIC, or System Licensed Internal Code) is written in Assembly. The SLIC handles most of the duties that the kernel in a Unix would be handling plus quite a few more. OS/400 proper may be written in C++, but the kernel certainly isnt, and mostly for exactly the reasons usually given for why implementing a kernel in a high-level language is stupid.

ps. And no, saying that it is only a hardware abstraction layer is not correct. The SLIC implements an entire virtual machine (the MI) for OS/400 to run on top of. All user level programs and the OS itself run on top of this VM, and the VM hides most stuff one would normally associate with the kernel from the user (and even from the OS) (memory management, low-level scheduling, etc). Its quite a bit more than just a HAL.

whartung Member since:
2005-07-06
Fans: 0

I'm not up to date on the details of the history of the AS/400, at least architecturely. But I know the machines existed bak in the late 80's, and I know the current machines run PPC CPUs. It was always my understanding that the legacy software still runs on the current machines.

Was the VM that deep in the system, where applications are written to the VM, not the core processors? or do they pull a similar trick like Apple did/does with their 68K->PPC->Intel layers.

Anyone know?

galvanash Member since:
2006-01-25
Fans: 0

Yes. It was that deep. The MI has been part of the AS/400 design since inception (1989).

galvanash Member since:
2006-01-25
Fans: 0

I should clarify a bit. OS/400 apps are not bytecode and are not interpreted, it is quite different from say Java or Smalltalk. It is more like a compile on demand system (Im simplifying for ease of explaining this of course). A program always retains its MI instruction sequence. Because of this it is possible to move a program between hardware architectures, i.e. the native instruction sequences will be generated as needed.

Pragmatic C++
by KenJackson (3.48) on Tue 13th Jun 2006 00:25 UTC
KenJackson
Member since:
2005-07-18
Fans: 5

We only use plain c++ functionality: member function, single inheritance, and virtual function. That's enough. We think there is no essential difference between c and c++ without using ...

I like their pragmatic approach. If you lay down the rules from the start, that this project will absolutely not use any stinking operator overloading or templates, then there is no reason it can't use some of the nice but gentle features that C++ has.

RE: Pragmatic C++
by Cloudy (2.68) on Tue 13th Jun 2006 02:30 UTC in reply to "Pragmatic C++"
Cloudy Member since:
2006-02-15
Fans: 9

The best take I've seen on the pragmatic approach to C++ is Koenig and Moo's "Rumination on C++".

Both operator overloading and multiple inheritance have a place in a pragmatic C++, if they are used properly.

Koenig's concept of classes as abstract data types and using multiple inheritance for interface definition turns out to be very effective.

RE[4]: why?
by Soulbender (3.12) on Tue 13th Jun 2006 06:32 UTC
Soulbender
Member since:
2005-08-18
Fans: 15

"I agree with the gist of the OP, we've got too many Unix workalikes around."

Fortunately it's not for you to decide what other people are interested in and what they like to work on.

Quite nice kernel
by agentj (1.72) on Tue 13th Jun 2006 07:15 UTC
agentj
Member since:
2005-08-19
Fans: 0

I've read sources of this os and it seems quite nice.

I'm coding my own kernel in C++ ;) The best things that C++ gives for kernel devs I've notified so far are:
- type name trash protection with namespaces
- architecture independent code may use interfaces
- architecture dependent code implements those interfaces
- better type checking
- automatic freeing of class resources by destructors

RE: Quite nice kernel
by fithisux (2.44) on Tue 13th Jun 2006 11:39 UTC in reply to "Quite nice kernel"
fithisux Member since:
2006-01-22
Fans: 0

I totally agree with you on 1. If only c had namespaces.

2 and 3,5 are not necessary, since structs and functions play this role.

4 is part of C standard, it can change.

C is very good for kernel programming, it only needs some polishing-> namespaces and betetr type checking.

nix++
by mjones (1.75) on Wed 14th Jun 2006 10:45 UTC
mjones
Member since:
2006-06-14
Fans: 0

Wouldn't nix++ be a more sensible name.