A day with Solar OS

...

Motto:

There has to be an invisible Sun...
Really close to the real one!

The Police - Invisible Sun


Copyright (c) 2006-2007 Bogdan Valentin Ontanu.
All rights reserved

Introduction

What would you say if one day you would have found that:

Would you think it is not possible?

Think again!

It actually exists, and yes it has a very nice fully featured Graphical User interface.
This GUI interface is featuring:

Welcome into the Dream land

You think you are in dream land?

Well then, I will not promise you the moon light my reader, but I will surely give you the Solar sunshine in this article ;)

Let me further excite you with the promise of:

New concepts

Amazingly this tiny simple OS is not a trimmed down version of another one. Neither it is based on any other OS.

There are no dependency and no external LIBs used.

Instead everything is fully rewritten from scratch, using modern and very well organized ASM (no spaghetti) and even more it takes a very special and bold cooperative approach in order to reduce context switch while still offering Multitasking and GUI.

To name a few bold concepts:

This OS is the only modern OS with a general purpose GUI that exposes full control to the hardware and is not building protective concentric walls around its Kernel Castle.

Because of this original approach it gains great speed and simplicity.

It is the first OS that poses a philosophic question to the hacker:

Yes I know you can break me, but since it is so easy by design, there is also no glory in doing this... so why doing it?

Creation and Construction my friend are much more honorable, valuable and harder to achieve than entering a simple house that has no locked doors or "windows".

Besides my core shell is read only, small, simple, fast and does not auto run nothing.

How on this Earth are you going to convince me to compile and insert your code into my GUI Kernel?

Enchanting

Come with me, follow me into this the exploration of a real technological dream. A passionate dream of simplicity, efficiency and the clarity of mind; A dream that has a name, and this name is real: "Solar OS"


Our First Fine Hours

Let us Find it, Get it, and Run it!

The Links

Here are the links:

Of course you only need the binary file for a test run.

If interested you can check the main site for instructions or reference. You can check the screenshots section to get a first look of the GUI and finally you could use the forums for asking questions and support.

And yes it is a special build made for this article. But the last released version is very close behind: on 2006.06.11 and has mainly the same features.

Set it up!

You will notice the claim that this OS does run very well into Virtual PC. Virtualization is on vogue now and it will allow us not to deal with partitioning our Hard drive, using floppy or writing bootable CD-ROMS.

It is a very good choice for an OS developer to support at least a few virtual machines. This way you can test freely without any danger of corrupting or damaging your hardware

In fact I always have a few virtual machines packed up with empty or formatted HDDs floppy and CD-ROMS images ready for such "no danger" testing of new hobby OSes. I am going to use Virtual PC for this test but that is my preference.

Now it is time to observe another special feature of this OS: it can run without a HDD or CD-ROM, just straight up from a floppy. So let us hurry up a little and simply let the floppy image boot in Virtual PC

Our First Boot

Oh, there is nothing like the first boot of an OS. You know that special feeling: the first kiss, the first girl, the first car, the first boot of Solar OS... ok, not necessary in this order.

So, find the location where you have downloaded the sol_os_2006_06_21_bin.zip file. Unzip it and find the file named "os8.dsk" inside

If you do not have one, it is time to create a test Virtual machine:

After a brief loading message you should see something like this:

VPC Boot Screen

Observe for a second the GUI resolution options. The author recommends the 800x600x16 for performance reasons but there is nothing stopping you from using 1280x1024x16 or even greater if you have a powerful CPU.

For a genuine explorer the S-Special options is much to obvious not to try it. And it brings an additional screen like this:

VPC Boot Screen2

Obviously this has something to do with transferring the OS on a HDD but since we might have selected NO HDD in our Virtual Machine we leave this "special" location for now, and return to the original resolution selection screen above.

In order to reduce the size of the screenshots I will choose a smaller 640x480x16 resolution and fire up Solar_OS.

Tada! First Contact

after selecting resolution and pressing the Enter key you will be in face of this screen:

GUI Screen 01

Explore a little and play ;)

An embedded Dialog Editor

Ha? Yes, you can design dialogs right from the OS interface. For example:

The starting point should look somehow like this:

GUI Screen 02

You can drag move a window from the caption or from any part that does not contain a control. For an empty window this means anywhere but not on the RED close button or the yellow minimize/hide button. If you accidentally minimize a window, you can bring it back to existence with the Tasks Application (press Alt+T to show tasks)

After adding controls result could look like this:

GUI Screen 02b

Now let us customize it a little ;)

After customization the end result could look like this:

GUI Screen 03

Of course your mileage might be different, but the limit is your fantasy.

High hopes for driver and device programmers

On the "Scan DVB" button ACT_LEFT_DOWN (on mouse click) message, you could write the code that does direct I/O to the hardware for scanning channels on the DVB stream. On return you could fill up the Listbox with the names of the available channels.

As an alternative, you could also make a request to the DVB driver queue and provide a callback routine, fast exit and wait.

When the DVB scan is complete your Callback will be invoked by the driver and you can fill up the listbox at that time.

For testing and experimentation you will not have to write a driver because direct I/O to ports and hardware IRQ handling is allowed in Solar OS.

But let us not dream about being a programmer.

Simplicity for the users

Instead of a programmer let us be a desktop user wanting to see a picture:

Should look like this:

GUI Screen 04

Then

Note:
This assumes that a FAT32 HDD was pre-setup with some media BMP files and added to the Virtual Machine setup.

OK, on my setup it looks like:

GUI Screen 05

Observe the translucency on top of this nice picture ;)

Or maybe you want to press Enter on a text file:

GUI Screen 06

Is it just me or this desktop (640x480) is getting cluttered. No problem: Sol->Desktops->Desktop:1: ...

Yes! At least some extra free space

Oops, but how do we come back... Guess what: again Sol->Desktops but choose Desktop:1: this time

GUI Screen 07

OK, Now I will share a few little "secrets" from the Help file:

You can observe the "aquatic" skin below:

GUI Screen 08

Some hours later: Hardware information

Let us shift focus to exploring the hardware recognized by Solar_OS. You can find hardware info by running the following applications:

System information

This will show information about:

Hardware tests -> PCI Enumerate

This application will show you information about:

PCI Screen 01


Tip:
You can drag the bottom right corner of the Devices List box and watch the text on the right panel auto rearrange and word wrap.

Hardware requirements

On a real computer you will notice that Solar OS recognizes a wider range of hardware compared to what it can really use. But what does it really need to run?

Here is a list with the hardware requirements:

And one hour for "speed"...

Well, as you might have guessed Solar OS is not yet finished nor optimized.

However there is a checkbox named "Optimize" in the System Counters application. What could this be?

Together with the FPS counter and the ever moving dot they make a good testing pad for benchmarking, let us consider this as an invitation.

First you must disable the "Tk2" and "Cool Down" options from the System Counters window. Both of them try to reduce the CPU utilization of the OS in order to keep your CPU "cool and quiet" on laptops.

But of course for benchmarking we do need full power.

As soon as you disable the above options you can observe a significant speed up in FPS. You can notice it better if you press the "Clear" button. This button acts as a kind of refresh.

But wait it can get even better: You can activate the "optimize" checkbox.

With only the Sol Button and the System Counters application it ca get to 1200 fps in 640x480x16...

Now add a few translucent windows in the upper part of the screen, and it will still stand around 700 fps.

Wow all this with simple generic frame buffer "drivers"!

Speed Screen 01

A few hours for the Network

The network is core technology in Solar OS. It supports Raw packets, ARP, IP, ICMP, UDP.

It also supports multiple network cards and PCI IRQ sharing.

Setup

1) Go to SOL->Hardware tests->Net test

Net Screen 01

  • 2) click "Detect Cards",
  • 3) Select the "DEC 21140" card from the listbox
  • 4) click Load
  • 5) click Start

    You can now press the SEND button in the lower part of the window and you will see VPC's network light blink.

    Net Screen 02

    In fact you are just using the "raw packet" interface of Solar OS. But as funny as it might look, sending packets into the void is not our main target.

    Setting the IP Stack

    So let us setup and then start the IP network layers:

    Press the IP button

    In the IP Window select again the DEC 2114 network card, and then continue by entering the IP, MASK, Gateway and DNS in the corresponding edit fields.

    For a real PC you should enter your specific values. However Virtual PC is a little strange in this issue and you MUST enter the following values:

    Or on newer versions you can get help from the VPC button that will pre-setup the default IP values. However please edit the DNS IP accordingly!

    Like this:

    Net Screen 03

    Once finished press "SET IP's" button and then the Start button. As a consequence you should see the caption of the IP window changing int: "IP Running".

    Press the ARP button. You should see something like this:

    Net Screen 04

    With at least one Dynamic record for your Gateway's IP. In fact a discussion was made in between Solar_OS and the Gateway inside VPC using the ARP protocol. This resulted in Solar OS obtaining the MAC address of the gateway.

    Very good, now let us proceed even further...

    A ride to OSNews

    Press the DNS and PING buttons. They will start the corresponding applications windows.

    Insert the address "www.osnews.com" into PING! Edit box and then press the PING! button. You should see something like this:

    Net Screen 05

    Or you can first play with the DNS window and request a DNS record for www.osnews.com before sending out a Ping.

    Firewalls:

    Firewalls might not like the pings originating from inside Solar OS and refuse to send them out. In fact I did have to disable Zone Alarm briefly during this test. Take care!

    Another option would be to add OSNEws to the list of trusted zones ;) Such options depend on your firewall type and levels of protection.

    News: OSNews has been pinged

    Beware OSNews because 2x5 pings from Solar OS have touched your servers on 2006_06_21 affirmatively 01 AM.

    Hurry up and check your log files and save the precious first contact packets ;) they did contain some funny OS data signature!

    Again a word about speed

    Emulated, and without virtual additions, the speed of network inside VPC is NOT very big.

    However try it on an real computer with a Realtek 8139 10/100 network card. You will be amazed ;)

    Rumors are that a P1 at 166Mhz with a GUI in 800x600x8 (to reduce video bandwidth) at full speed was able to force:

    This network speed comes from the special ring-o IRQ driven architecture of the drivers and the avoidance of redundant memory copy of packets.

    The merit for this very good network speed belong to Eugen Brasoveanu who designed and implemented it for SOL.

    However... Eugen did not even start to really optimize it; and he has a passion for speed optimizations!

    A few hours for programming

    Ok, let us talk dirty now ;) I guess you can skip to the next chapter if programing is not your thingy...

    In fact how does an application for Solar_OS look like?

    Get your programmer glasses on

    Because it does look like this:

    app_hello_world_sz_caption	db	"Hello World",0
    app_hello_world_sz_msg		db	"Welcome to the Hello World Application!",0
    
    App_Hello_World_Init PROC STDCALL
    	USES	esi
    	LOCAL	@@wnd_handle:dword
    	
    	;------------------------------------
    	; 1) Create Main App Window
    	;------------------------------------
    	mov	eax,FLAG_WND_ALPHA+FLAG_WND_MINI
    	Call	API_Window_Create STDCALL,[desk_crt],132,105,240,112,eax,WND_TYPE_TOP
    	mov	[@@wnd_handle],eax
    
    	;-------------------------------
    	; 2) set callback and caption
    	;-------------------------------
    	Call	API_Window_Set_Callback STDCALL,[@@wnd_handle],OS_CALL_AFTER,offset App_Hello_World_Main_Callback
    	Call	API_Window_Set_Caption STDCALL,[@@wnd_handle],offset app_hello_world_sz_caption
    
    	;--------------------------------------------
    	; 3)this is it! END of Application init code
    	; only callback will be called by OS
    	; from now on
    	;--------------------------------------------
    	ret
    ENDP
    
    ;-------------------------------------------
    ; The Callback routine for main Window
    ;-------------------------------------------
    App_Hello_World_Main_Callback PROC STDCALL
    	USES	ebx,esi
    	ARG	@@wnd_handle:DWORD,@@wnd_action:DWORD,@@wnd_param1:DWORD,@@wnd_param2:DWORD	
    
    	;--------------------------------------
    	; a case based on message/event value
    	;--------------------------------------
    	.IF [@@wnd_action]==ACT_PAINT_CHILD
    		;-------------------
    		; Wnd::On_Paint
    		;--------------------
    		Call	API_Text_Draw STDCALL,[@@wnd_handle],16,32,offset app_hello_world_sz_msg,01fff00h
    		
    	.ELSEIF [@@wnd_action]==ACT_LEFT_DOWN_CHILD
    		;-----------------------------------
    		; Wnd::ON_Mouse_Left_Down :)
    		; todo: add click code here
    		;-----------------------------------
    		
    	.ELSEIF [@@wnd_action]==ACT_LEFT_UP_CHILD
    		;-----------------------------------
    		; Wnd::ON_Mouse_Left_Up :)
    		; todo: add click code here
    		;-----------------------------------
    
    	.ELSEIF [@@wnd_action]==ACT_KEY_CHILD
    		;-----------------------------------
    		; Wnd::ON_Key :)
    		; todo: add keyboard code here
    		;-----------------------------------
    
    	.ELSEIF [@@wnd_action]==ACT_CLOSE_CHILD
    		;---------------------------
    		;Wnd::Destructor
    		;todo:add code here
    		;---------------------------
    	.ENDIF
    
    	;----------------------------------------
    	; by convention you must return zero 
    	; or the parent will terminate you
    	;----------------------------------------
    	xor	eax,eax
    	ret
    ENDP
    
    ;-------------------------------------
    ; End of hello world application
    ;-------------------------------------
    

    Need to say it could have been much shorter on screen if I would have used the API_Window_Create_Ex into the initialization phase and reduced the .ELSEIF case handling to bare minimum.

    However I did considered it is better to also show other API's in use and a more general application layout. I guess nobody is going to limit itself to writing only Hello world ;)

    Honestly it is very simple, all you have to do is:

    The whole thing will compile in just a few bytes (35 to 100 bytes depends on strings, compiler and moon shine) of uncompressed native binary code and will run "as it is from" inside the kernel. In fact you can go to Software Tests-> Hello World and run it ...

    The application template is extremely simple and efficient because it is based on Callbacks. As a programmer you just have to fill in the event handling code for each message received by the Callbacks.

    This makes up for very elegant, event based and OOP like programming style even in ASM.

    Position independent code

    When run from outside the kernel (from HDD for example) Solar_OS applications have to be PIC. That is because the kernel will load and execute each application at the first free address location. Because of this you will notice PIC handling with Delta tricks inside the SDK for external "out of kernel applications".

    The executable loaders

    This PIC issue is being worked on right now and there are PE and ELF loaders in progress.

    The loaders will handle PIC code by compiler generated relocations and in a transparent way for the programmer.

    In fact the PE DLL loader/mapper is already almost functional And you can observe its messaged in the Debug View applications if you press Enter on an .DLL external file in HDD_Explorer

    When this is finished there will be no difference anymore between "inside kernel" and "outside the kernel" applications.

    A few virtual hours for security

    In a world with big concerns about security the choices made by SOLAR_OS might make many worry.

    In fact most people are locked in a "ring inside ring" of protection scheme. This generates the everlasting monolithic versus micro-kernel debates.

    A Conscientious choice to be different

    Solar_OS chooses another path that is out of this "ring box" approach.

    We consider there is no need for costly protection against trusted applications. (hardware and software resources)

    And unlike micro-kernels we do not consider that the trusted code base should be very little. In fact we would like the trusted code base to expand as much as possible.

    Trusted are:

    As you can see Solar OS lives in a world that promotes simplicity, open source code and speedy compilations.

    Because those trusted code is embedded inside the trusted Kernel and fast loaded in a few seconds from any non writable media like:

    And because a HDD is not even needed and nothing is auto started from external media...

    Honestly NOTHING can pervert or hack this HARD OS CORE!

    Well, not unless it is able to write to a non writable device or convince you to write, design, compile and insert a malware code sequence inside your own kernel ... Now really, are you going to fall for that?

    IMHO, armed with a white listed GUI hardcore shell you can safely explore further...

    However threats do exist

    Sadly but true... and honestly in a real world this can not be ignored either. And once in a while one might need to run "untrusted code".

    So what is the Solar_OS answer to his?

    A very simple solution: The Sandbox for the bad only

    Instead of putting the whole OS in JAIL or in ring-3 whatever... Solar OS choses to put ONLY the not trusted applications inside an non breakable sandbox.

    This "Sandbox" for untrusted applications is a core concept in Solar_OS. This way the slowdown and complexity is right where it should be: ONLY around the untrusted code!

    To be honest with the reader: this sandbox is not yet implemented. But is it scheduled to be finished this year. And then my friend we can start a new contest: aim, shoot and fire in order to try and get out of the Solar_OS sandbox.

    With the "white hat" and hands on ASM experience of the Solar_OS author I bet it is going to be some nice proving grounds.

    Security at maximum speed

    Solar_OS new security concept is:

    Choose simplicity, trust, speed and fully unbendable security.

    Conclusions

    The nice parts

    All this in one third of a floppy ;)
    there is still enough space left on this floppy (not to mention CD) for the Browser internet trio...

    Original choices

    After all this was the whole idea: To design and implement a modern Desktop OS that is original, and to make choices that do not end up into walking the same path as Windows or Linux or others.

    "In a world without walls and fences who needs windows, gates, penguins or daemons..."

    All you need is the SOLAR light shining on your own custom path of knowledge.

    Solar_OS is so simple that anybody can understand it in 1 month and then in good will hack it, customize and evolve it to meet your own personal needs.

    The unfinished Parts

    Clearly there are some unfinished pylons
    and unplaced corner stones still missing from Solar OS:

    Yes there is a SDK available on site.

    Into the future

  • Nevertheless all of the needed ingredients are in there, prepared and packed, they just need a little extra time and cooking.

    Yes there is still a long ride to be taken until many of those promises are to be full filed...

    But I do bet it will be a ride full Joy, Art and Sunshine... a Solar Sunshine that is ;)

    Until then my friend Solar_OS simply and "quietly" stands there on the internet... waiting to be discovered.


    About the Author:

    Bogdan Valentin Ontanu

    Electronics and Artificial Intelligence in part university educated and in part a self educated programmer.

    He is passionate by low level programming, ASM and hardware interfaces, Go, Zen, personal spiritual evolution, and bold debates about human species direction of evolution.

    You might also know him as the team leader and architect of the Hostile Encounter RTS game project.

    He made his first OSes on 8 bit CP/M machines and on ZXSpectrum clones.

    Currently he works full time for AVIRA Soft srl Romania, a subsidiary of Avira (formerly H+BEDV) from Germany, the well known producer of AVIRA Antivir solutions.

    Previous workplaces include: Glasword US, MoreTV Munich, Deuromedia Brasov to mention just a few.

    The other important people that helped him in creating Solar_OS are:

    The author will also like to mention special thanks to:

    Since they kindly helped at various moments into his career.

    you can contact me at: bogdanontanu[at]yahoo[dotty]com

    and in the End ...

    I will like to mention that during the writing of this article and the creation of Solar OS, NO PIXELS have been harmed on purpose...
    To the best of my knowledge :)


    Post scriptum Note

    This article is old, it was initially written for OS News where it was accepted but never published. By the time it was posted on SOLAR_OS site (2007_06_24 - one year later) the PE loader of SOLAR_OS was functional so PIC code was no longer necessary and the author is no longer working at his full time job. Also SOLAR_OS was improved and it is not open source anymore. Because of this the link to the source code is broken.

    However besides some minor spell checking the article was kept in it's original form for historical reasons.