A true webOS?

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
platform
Member
Member
Posts: 32
Joined: Thu Jul 19, 2012 4:38 pm

A true webOS?

Post by platform »

Hi, I am new in this forum and in OS development.

I have searched, so I know that it's stupid, very difficult,... but... could we speak about a true webOS? I just wanna know if that is technically possible, and how could it be implemented.

For example, the bootloader obviously can't be written in Javascript. But what about the kernel?

I propose:

Bootloader (ASM) => minimal kernel (C++) => render engine and javascript VM => apps, GUI (web tech.)

or

Bootloader (ASM) => kernel (compiled Javascript?) => apps, GUI (web tech.).

What do you think? (besides I am stupid :P )
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: A true webOS?

Post by NickJohnson »

Define webOS.
platform
Member
Member
Posts: 32
Joined: Thu Jul 19, 2012 4:38 pm

Re: A true webOS?

Post by platform »

NickJohnson wrote:Define webOS.
An OS created with web tech. We cannot create it 100% in web tech., but, for me, a webOS should be written with as web tech. as we can.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: A true webOS?

Post by NickJohnson »

What precisely is "web tech"? I can make an HTTP request and retrieve the Linux kernel sources.
platform
Member
Member
Posts: 32
Joined: Thu Jul 19, 2012 4:38 pm

Re: A true webOS?

Post by platform »

NickJohnson wrote:What precisely is "web tech"? I can make an HTTP request and retrieve the Linux kernel sources.
HTML, CSS and JS.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: A true webOS?

Post by NickJohnson »

We can already do that: just run a browser from within Linux. Why would we want to construct an OS that only uses those things? It would just boil down to reimplementing JS browser APIs, otherwise you'd break compatibility, and then all you get is a browser.

The Internet/WWW is a lot more than just the client-side components of webpages anyway. What about the cloud? RESTful architecture? SaaS? I have heard insufficiently many buzzwords to believe you know what you're talking about.

Also, seriously, who wants to increase the number of things we have to run JS on?
platform
Member
Member
Posts: 32
Joined: Thu Jul 19, 2012 4:38 pm

Re: A true webOS?

Post by platform »

NickJohnson wrote:We can already do that: just run a browser from within Linux. Why would we want to construct an OS that only uses those things? It would just boil down to reimplementing JS browser APIs, otherwise you'd break compatibility, and then all you get is a browser.

The Internet/WWW is a lot more than just the client-side components of webpages anyway. What about the cloud? RESTful architecture? SaaS? I have heard insufficiently many buzzwords to believe you know what you're talking about.

Also, seriously, who wants to increase the number of things we have to run JS on?
Mozilla wants :P .

Ok, I am going to expain better what I mean.

There are many projects which aim to create an OS with web interface, such as Firefox OS, Tizen,...

But I have curiosity to know how we could build an OS with medium and low level elements in web technologies.

Yes, I know that it's stupid, but I have curiosity. I wanna see a "kernel.js" :P .
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: A true webOS?

Post by NickJohnson »

Okay, okay, I'll stop giving you a hard time. :P

I can see the potential advantage in making a standalone application use client-side web technologies, just because they are standardized and many people know how to use them. It just seems like an odd choice, since many of the complexities in stuff like HTML rendering are due to the fact that a small amount of information has to describe a complex screen layout, when there is no such restriction for normal GUI applications. Still, with the choice being between some new GUI framework and something web-based, the latter does seem sort of attractive.

This is, of course, not much of an argument for trying to write a kernel in JS.
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: A true webOS?

Post by Tosi »

I think the idea is interesting but could better be implemented as a shell which integrates the system and the internet tightly. i.e., you open a directory and it opens as a tab in the browser. when you open an application, it can open as a tab in the browser. If it is a command line application it can be run from a terminal in its own tab. However all this could be built on top of a regular kernel written in C or whatever low level language, for example, have the browser/shell run as an X window manager or as a replacement for the Windows shell.

As for actually writing the kernel using "web technology", you have the same problems as writing a kernel in Java (which has been done with some success). Unless you write a javascript compiler that creates native machine code or assembly and add extensions for accessing low-level aspects of the system, you will have to write a microkernel that handles the low-level stuff and interprets the javascript (which should be compiled to bytecode). There will be a performance hit here, but you could still make it work possibly. HTML/CSS seems useless for writing the actual kernel, since it is just meant for formatting information. You could use XML for configuration files and this does work pretty good, but you will have to either write an XML parser or port an existing one.

If you just want to define the user-interface using HTML/CSS/Javascript, you are better off writing a window manager or widget kit as mentioned in the wiki.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: A true webOS?

Post by bluemoon »

Are you guys talking about Chromium OS?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: A true webOS?

Post by Combuster »

WebOS is just a stupid buzzword IMNSHO.

After all, any of the free internet kiosks you'll find at college would qualify as a webos pretty much regardless of the definition you give to the term. And we probably all agree we rather browse the internet on our home computer where our bookmarks do get preserved. :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
platform
Member
Member
Posts: 32
Joined: Thu Jul 19, 2012 4:38 pm

Re: A true webOS?

Post by platform »

NickJohnson wrote:Okay, okay, I'll stop giving you a hard time. :P

I can see the potential advantage in making a standalone application use client-side web technologies, just because they are standardized and many people know how to use them. It just seems like an odd choice, since many of the complexities in stuff like HTML rendering are due to the fact that a small amount of information has to describe a complex screen layout, when there is no such restriction for normal GUI applications. Still, with the choice being between some new GUI framework and something web-based, the latter does seem sort of attractive.

This is, of course, not much of an argument for trying to write a kernel in JS.
I agree with you. Ok, writting a kernel in JS is not a good idea, but I wanna do it :P .
Tosi wrote:I think the idea is interesting but could better be implemented as a shell which integrates the system and the internet tightly. i.e., you open a directory and it opens as a tab in the browser. when you open an application, it can open as a tab in the browser. If it is a command line application it can be run from a terminal in its own tab. However all this could be built on top of a regular kernel written in C or whatever low level language, for example, have the browser/shell run as an X window manager or as a replacement for the Windows shell.

As for actually writing the kernel using "web technology", you have the same problems as writing a kernel in Java (which has been done with some success). Unless you write a javascript compiler that creates native machine code or assembly and add extensions for accessing low-level aspects of the system, you will have to write a microkernel that handles the low-level stuff and interprets the javascript (which should be compiled to bytecode). There will be a performance hit here, but you could still make it work possibly. HTML/CSS seems useless for writing the actual kernel, since it is just meant for formatting information. You could use XML for configuration files and this does work pretty good, but you will have to either write an XML parser or port an existing one.

If you just want to define the user-interface using HTML/CSS/Javascript, you are better off writing a window manager or widget kit as mentioned in the wiki.
In fact, I was creating a OS based on Linux which has the GUI in web technologies. But I thought: what about writting the medium and low level elements in web tech.? It would be stupid and difficult, but I would be different.

So, I have two options: writting a javascript compiler that creates native machine code (for me, the most difficult option, but the better) or writting a microkernel that interprets javascript.

You suggest XML for configuration files... What about JSON?

I just wanted to define the user-interface in web tech., but now I wanna do something different. A 99% web OS.
bluemoon wrote:Are you guys talking about Chromium OS?
Chromium OS is not a web OS, it has almost code in native tech.
Combuster wrote:WebOS is just a stupid buzzword IMNSHO.

After all, any of the free internet kiosks you'll find at college would qualify as a webos pretty much regardless of the definition you give to the term. And we probably all agree we rather browse the internet on our home computer where our bookmarks do get preserved. :wink:
Yes, but our home computer could run a webOS that could run offline and online too.

If I was very, very crazy, and I wanted to implement this idea, what step would have to be the first? Creating the Javascript compiler [apart from the planification of the project].

Thanks!

EDIT: what about using Rhino Javascript Compiler to translate Javascript to Java and then compiling Java to native code with GCJ? By the way, v8 compiles Javascript?
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Re: A true webOS?

Post by piranha »

In fact, I was creating a OS based on Linux which has the GUI in web technologies. But I thought: what about writting the medium and low level elements in web tech.? It would be stupid and difficult, but I would be different.
So, you wanted to create GUI that was a browser, with all GUI elements being html and javascript. Then you wanted to write the low level OS stuff in javascript as well? That goes back to the scripting-language-for-OS-kernel stuff. The only way you'd be able to run a javascript kernel is if you had a javascript interpreted loaded first, which then executes the kernel. Is it possible? Yes. Is it realistic? Not really. The interpreter would have to be written in a compiled language, and at that point, why not make the kernel in C, asm or whatever and not be forced to deal with a huge performance hit from the scripting language having to be interpreted?

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
GAT
Member
Member
Posts: 75
Joined: Wed Nov 30, 2011 9:51 pm
Contact:

Re: A true webOS?

Post by GAT »

I agree with piranha, partly.
It would be really be inefficient, but IMHO it would be fun to make!
And plus it could be really flexible if you built it right.
One issue I foresee is that you can't really do hardware stuff with scripting languages.
You could do like an exo kernel in native code that would interpret the javascript, and then have device drivers that the javascript or kernel could call to that were in native code.
d3: virtualizing kernel in progress
https://github.com/WizardOfHaas/d3/
platform
Member
Member
Posts: 32
Joined: Thu Jul 19, 2012 4:38 pm

Re: A true webOS?

Post by platform »

piranha wrote:
In fact, I was creating a OS based on Linux which has the GUI in web technologies. But I thought: what about writting the medium and low level elements in web tech.? It would be stupid and difficult, but I would be different.
So, you wanted to create GUI that was a browser, with all GUI elements being html and javascript. Then you wanted to write the low level OS stuff in javascript as well? That goes back to the scripting-language-for-OS-kernel stuff. The only way you'd be able to run a javascript kernel is if you had a javascript interpreted loaded first, which then executes the kernel. Is it possible? Yes. Is it realistic? Not really. The interpreter would have to be written in a compiled language, and at that point, why not make the kernel in C, asm or whatever and not be forced to deal with a huge performance hit from the scripting language having to be interpreted?

-JL
How the Javascript interpreter should be loaded? Because, for example, I suppose that v8 cannot run without some libs and drivers....
GAT wrote:I agree with piranha, partly.
It would be really be inefficient, but IMHO it would be fun to make!
And plus it could be really flexible if you built it right.
One issue I foresee is that you can't really do hardware stuff with scripting languages.
You could do like an exo kernel in native code that would interpret the javascript, and then have device drivers that the javascript or kernel could call to that were in native code.
Why not? "All device drivers are written in Java and executed by the virtual machine" (JavaOS, wikipedia).
Post Reply