What's new? | Help | Directory | Sign in
Google
es-operating-system
ES operating system
  
  
  
  
    
Search
for
Updated Apr 02, 2008 by tagawa.daniel
UsingES  
How to use the ES operating system.

Introduction

If you turn on the PC installed with the ES operating system, the following screen appears on your SVGA monitor.

esjs file/shell.js
alloc count: 2400
yypase() ok.
% 

Once the ES operating system kernel gets executing, it will start the event manger (eventManager.elf) and the canvas service (console.elf) in userland. The event manager is a user process that records the inputs from the keyboard and from the mouse as events so that the other processes can get the events. The canvas service repeatedly reads the events from the event manager converting the keyboard input events into a stream of characters; The canvas service also accepts the requests from the yet other processes to draw graphics and texts in the screen.

The kernel then starts the ECMAScript interpreter (esjs.elf), which execute the command line shell program written in ECMAScript (shell.js). The command line shell provides the interactive environment to the user using the canvas service.

Using commands

From the command line shell, you can use the programs like below. Most of the commands are written in ECMAScript:

Command Name Description
cat [file ...] Prints the contents of files to the screen
cd [dir] Sets the current directory to dir
clear Clears the canvas for drawing graphics
date [-u] Displays the current date and time.
echo [arg ...] Prints the arguments to the screen
edit [file] Edits text files
exit Exits the command line shell
figure Draws chars using the CanvasRenderingContext2D interface (A demo script)
ls [dir ...] Lists names of objects in the directory
rm [file ...] Removes the files
squeak Squeak - a Smalltalk programming environment

Namespace

You can list the objects in the current directory by executing the ls command without specifying any arguments:

% ls
device
network
class
interface
file 
% 

You can change the current directory to any place in the namespace using the cd command. Initially, the current directory is set to the root of the namespace. In the following example, names of device objects in the device directory are shown:

% cd device
% ls
rtc
cga
beep
framebuffer
cursor
keyboard
mouse
ata
floppy
loopback
soundInput
soundOutput
ethernet
event
console
%

The event and console device objects are dynamically registered objects by the event manager and the canvas service, respectively. In the ES operating system, you can dynamically extend the system features that can be used from the other programs by executing userland programs like this way.

To set the current directory back to the root, invoke the cd comand without any arguments:

% cd
% ls
device
network
class
interface
file 
% 

Your local disk drive is mounted in the file object. To display the names of files in your disk, invoke the ls command with an argument file:

% ls file
es.ldr
es.img
eventManager.elf
console.elf
esjs.elf
shell.js
cat.js
cd.js
date.js
echo.js
edit.js
ls.js
% 

You can draw graphics on the screen: type figure in the command line and hit enter:

figure is another ECMAScript program that invokes the canvas service. You might want to read the program by typing

% cat file/figure.js

The APIs used in figure.js are basically same as the ones defined in the CanvasRenderingContext2D interface in the HTML5 specification.

To shut down the computer, just invoke the exit command. It will automatically turn off your computer.

% exit

Programming in the ES operating system

To extend the operating system features, you still need to write the programs like the event manger or the canvas service in C or in C++. However, you can easily write your program using those services in ECMAScript. For example, let's take a look into the date program:

% cat file/date.js
var date = new Date();
var str = date.toString();
stdout.write(str + '\n', str.length + 1);
%

It's just three lines of code. In this script, you see a non-standard ECMAScript object is used: stdout. In ECMAScript programs invoked from the command line shell - shell.js - you can use the following objects:

Object Interface Description
System ICurrentProcess The current process
stdin IStream The standard input
stdout IStream The standard output
stderr IStream The standard error output
root IContext The root namespace
cwd IContext The current directory
classStore IClassStore The class store
path Array Array of pathnames in which programs are looked up by the shell

The ECMAScript interpreter esjs is implemented in a way that it can invoke any programming interfaces defined in the standard interface definition language (IDL). For example, you can invoke any method provided by the ICurrentProcess interface using the System object.

To obtain a different interface of an object, just write as below:

unknown = iter.next();
file = IFile(unknown);        // get IFile interface for unknown.

The second line can also be written as below:

file = new IFile(unknown);
// or
file = unknown.queryInterface("0325f4e6-25db-11db-9c02-0009bf000001");

If you want to edit a tiny script program, you may use the edit command:

% edit file/date.js
3
1,$p
var date = new Date();
var str = date.toString();
stdout.write(str + '\n', str.length + 1);
q
%

The edit program is originally introduced by Kernighan and Plauger [1, 2]. It was written in Ratfor and then in Pascal at that time. In ES, edit is another ECMAScript script. ECMAScript is actually a powerful language with the support for exception, regular expression, and more. In the ES operating system, you can easily write a command line shell program or a text editor in ECMAScript; those programs are usually written in C or in C++ in the other operating systems.

References

[1] B. W. Kernighan and P. J. Plauger, Software Tools, Addison-Wesley, 1976.

[2] B. W. Kernighan and P. J. Plauger, Software Tools in Pascal, Addison-Wesley, 1981.


Comment by crazyhotboy4u2nv, Feb 08, 2008

yes i can finaly go to somethig new

Comment by ProphetPX, Mar 02, 2008

ok, where can I find a "HOWTO" in order to get started TRYING the "ES" operating system? Does it install natively on it's own partition? or can it run somehow virtually inside VMware or Virtual PC? Or even cooperatively within Linux or Windows XP? This page is very incomplete. Where can I find more information? And could "ES" be considered as the "Future" Operating System (within a browser) of the XUL platform by Mozilla?

--ProphetPX

Comment by Shiki.Okasaka, Mar 02, 2008

Thank you very much for taking a look into this page. There are links to the how-to pages in the Project Home page, and we are working on improving the how-to pages. The ES operating system runs on qemu and on actual PCs. We've tested with the following configurations so far:

  • Pentium III/440BX + SB16 + RTL8029AS
  • Pentium 4/865G+ICH5 + ES1370 + RTL8029AS
  • Core 2 Duo/945G+ICH7 + ES1370 + RTL8029AS

Your last question is a really interesting point. Our approach is probably more like, "What if a XULRunner like environment is the actual operating system kernel." Is this an answer to your question?

Best,

Shiki

Comment by ekylypse, Mar 05, 2008

very interesting, I think what is more interesting is that this could easily be a full blown os. Is it an XUL environment? I currently employ a team of developers creating a linux based XUL OS. but I can imagine that ES is very quick to render and light on ram... hmm..

maybe you should drop me an email. I cannot find a way to contact you. Hope you read it soon.

Anthony Dillavou

Comment by Shiki.Okasaka, Mar 05, 2008

Hi Anthony,

Please feel free to send me an email to Shiki.Okasaka at gmail.com.

Best,

Shiki

Comment by daxxar, Mar 06, 2008

Has there been any attempts to run ES under any other virtualization environments? (I.e. VirtualBox? or VMWare)

Comment by Shiki.Okasaka, Mar 07, 2008

We've been testing ES only on QEMU and actual PCs so far. But supporting other virtualization environments sounds a good idea.

Thanks,

Shiki


Sign in to add a comment