Aran
Posts: 21
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Tue Mar 05, 2019 10:35 pm

I see that the assembler unleashes the passions. Perhaps after all, every language has these advantages in specific areas. I also think of Julia, who seems to be a good compromise between modernity and performance.
Personnaly I remain an irreducible of assembly language ;-)

DavidS, I'm a little taken by the time right now, but you're right I intend to put my online development of Spider-OS on my site. Besides, I will perhaps make a table of contents when there will be many posts.
In any case, happy that it pleases.

Heater
Posts: 12095
Joined: Tue Jul 17, 2012 3:02 pm

Re: Spider-OS a new operating system

Wed Mar 06, 2019 5:35 am

Aran,
I see that the assembler unleashes the passions.
Certainly does. I love it!

I do have to push back about some absurd claims made about it though. Perhaps I just should not.
Perhaps after all, every language has these advantages in specific areas.
Very wise.

User avatar
DavidS
Posts: 3800
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Spider-OS a new operating system

Fri Mar 15, 2019 10:55 am

As it seems that you are intending to use a purely compositing window manager, I feel that I should point out that this makes for a very large use of memory. It may be a better bet to look at using a compositing window manager for the front most window and any that are flagged as compositing only (usefull in some graphics intensive cases).

Compositing could easily take upto 8MB each, and with only a total available of 1024MB even alocating half of that to the window data comes to 512MB/8MB=64 windows of maximum currently visible content size. And at about 4GB/s maximum single point throughput (2GB/s for copying mem) on the system bus without interfering with anything else you will find that you run short in a hurry.

Using a simple rectangle clipping window manager for most cases is more effecient. It also makes implementing DMA easy for drawing to the frame buffer from the visable portions of current windows that are clipped by other windows/menus/objects.
RPi = Way for me to have fun and save power.
100% Off Grid.
Household TTL Electricity Usage = 1.4KW/h per day.
500W Solar System, produces 2.8KW/h per day average.

Aran
Posts: 21
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Fri Mar 15, 2019 9:44 pm

Hi DavidS,

yes indeed it is a compositing window manager. But I did some optimizations. I created a function that optimally places the windows in memory. An area of ​​1920 * 1080 is divided into 8 zones of 480 * 270. Thus a window takes the place only covered areas. So my windows do not take 8 MB each time ;-)

At the moment, I am working on the Videocore, and I really want to integrate it into the window manager to optimize all that.

Moreover with a compositing window manager, we can do a lot of visual effects, as shown on wikipedia : https://en.wikipedia.org/wiki/Compositi ... ow_manager

Aran
Posts: 21
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Fri Apr 05, 2019 7:28 pm

Hello,

I just published a new post on Videocore. I managed to display a 3D cube with textured faces, and in rotation. For this, I use the TMU and indexed vertices, and some mathematical formulas.

A screenshot of the result obtained on my Raspberry Pi.

I make you a tutorial here. Some explanations on the 3D, and of course the assembly code ;-)

Image

LdB
Posts: 1100
Joined: Wed Dec 07, 2016 2:29 pm

Re: Spider-OS a new operating system

Sat Apr 06, 2019 1:47 am

The rotation is fun but for your O/S don't you need to translate your window buffer as a texture onto just two triangles that represent that window in flat 2D space?

Or are you doing a 3D UI?

With your wanting to do things for speed the rotation can be actually be done in the shader by the VC4 rather than the ARM you can just pass it a float being the angle. To create the shader download MESA, setup a GLSL rotation shader and use VC4_DEBUG=qpu and it will dump the VC4 shader code.

User avatar
Gavinmc42
Posts: 2882
Joined: Wed Aug 28, 2013 3:31 am

Re: Spider-OS a new operating system

Sat Apr 06, 2019 5:10 am

Very impressive.
Have you tried OpenVG yet?

I'm wondering if OpenVG will work with z buffer.
Bring stuff to the foreground by changing the z.
I have been drawing stuff last if I want it on top.
If there was a threshold the OpenVG windows would disappear, sort of into the fog?

The other advantage I found with OpenVG is the window can be any shape as it is not pushing rects of pixels around.
A real 3D GUI, well that is beyond my comprehension apart from that Looking Glass stuff.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Paeryn
Posts: 2512
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Spider-OS a new operating system

Sat Apr 06, 2019 12:23 pm

Gavinmc42 wrote:
Sat Apr 06, 2019 5:10 am
I'm wondering if OpenVG will work with z buffer.
Bring stuff to the foreground by changing the z.
I have been drawing stuff last if I want it on top.
If there was a threshold the OpenVG windows would disappear, sort of into the fog?
No, OpenVG is strictly 2D, all rendering happens on top of what is already there. From reading the docs the VC4 uses the 3D hardware for the rendering but coordinates have an implicit Z=0.5, W=1.0. Also OpenVG has a coverage mode in which case the tile memory which would be used for the Z and Stencil buffers is appropriated for use as the Coverage buffer.
She who travels light — forgot something.

User avatar
Gavinmc42
Posts: 2882
Joined: Wed Aug 28, 2013 3:31 am

Re: Spider-OS a new operating system

Sun Apr 07, 2019 1:13 am

No, OpenVG is strictly 2D, all rendering happens on top of what is already there.
Rats, I thought I had seen that VG tiger on a 3D cube somewhere, perhaps it was converted to pixels first?
OpenVG to texture map?

Found some Looking Glass videos, still impressive even now and back then it was done with 32MB of GPU memory ;)
Was interesting to see video from the back, reminded me of that Pi cube that has Big Buck Bunny on it.

Looking Glass was a Java project, would it be faster in C on a Pi these days?
To me and probably most people OS's and GUI's go hand in hand.
Sure I can use command line, I am DOS era old, but until I get an new "old" mechanical keyboard I still use GUI's and drop and drag:D.
The Pi's allow us to explore options and try new things or even make old things new.

Like writing an OS from scratch, I never would of dreamed that was still doable be just one person.
Yet it is being done by at least a half dozen.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

StevoD
Posts: 27
Joined: Tue Aug 29, 2017 11:37 am

Re: Spider-OS a new operating system

Sun Apr 07, 2019 9:35 am

Aran wrote:
Fri Apr 05, 2019 7:28 pm

A screenshot of the result obtained on my Raspberry Pi.

I make you a tutorial here. Some explanations on the 3D, and of course the assembly code ;-)
The rotating cube is one thing but any chance you can post the code you used to do the video grab, bare metal video screenshot to youtube is kinda unique as far as I know.

Aran
Posts: 21
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Sun Apr 07, 2019 10:30 am

The rotating cube is one thing but any chance you can post the code you used to do the video grab, bare metal video screenshot to youtube is kinda unique as far as I know.
I do not use code, that's the trick ;-) I have this equipment to capture the video via hdmi : http://www.hauppauge.co.uk/site/product ... -plus.html
The rotation is fun but for your O/S don't you need to translate your window buffer as a texture onto just two triangles that represent that window in flat 2D space?

Or are you doing a 3D UI?
I do not pretend to create a graphic system in 3D :-) I study Videocore in fact, to eventually add 3D effects.
With your wanting to do things for speed the rotation can be actually be done in the shader by the VC4 rather than the ARM you can just pass it a float being the angle. To create the shader download MESA, setup a GLSL rotation shader and use VC4_DEBUG=qpu and it will dump the VC4 shader code.
LdB, good point. Indeed it will be faster, if it is the chip that performs 3D calculations directly. I just hit, that the chip integrates native OpenGL language, so we can send the compiled code. I did not know how to do, thanks for the way with MESA.

I install MESA with this link : https://fdossena.com/?p=mesa/build.frag, but I admit that I have not yet understood how to use it ?

User avatar
Gavinmc42
Posts: 2882
Joined: Wed Aug 28, 2013 3:31 am

Re: Spider-OS a new operating system

Mon Apr 08, 2019 1:46 am

I have been trying to move all my Pi development to Pi's.
Because I wanted to do aarch64 baremetal I had to wait for a 64bit OS.

Gentoo64 was the first one that worked and stayed working ;)
It also had newer mesa3d OpenGL drivers, so I just installed the mesa3d examples and had fun straight away.
ftp://ftp.freedesktop.org/pub/mesa/demos/

Of course doing it baremetal gets Linux out of the way and the C dependency hell that can be.
Python is not much better ;) I tried that Python 3D stuff when it first came out, nope not basic enough for me.

Nice trick with the HDMI capture, we were thinking you were some sort of code wizard :lol:
Love the tutorials too, I might understand them one day :oops:
So many old tutorials are not relatable to Pi's or are too simple.
They mostly stop at the rotating triangle/cube.

That's another reason I like the mesa3d examples, they are in one C file and do all sorts of interesting things.
None are optimised for Pi hardware and use OpenGL.
How fast would they be if converted to OpenGLES2?
I would love to convert them to Free Pascal OpenGLES2 so I could use them in Ultibo, but I don't seem to have enough time ;)
Too many interesting things to do with Pi's

Pi's have mobile hardware- OpenGLES but most examples are for desktop PCs, OpenGL :(

That Looking Glass Project has now got me really interested in 3D.
Back when it came out I wanted it, then bastard versions came out like Compiz which ran very slow on the hardware around at the time.
I had hopes for Wayland, but those sorts of things are another layer on top of many layers.

Too many layers and too many dependanices.
Time to go simpler, I just want a nice looking single user OS.

Just heard, Palm are back, making mini phones.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

LdB
Posts: 1100
Joined: Wed Dec 07, 2016 2:29 pm

Re: Spider-OS a new operating system

Mon Apr 08, 2019 2:30 am

Gavinmc42 wrote:
Mon Apr 08, 2019 1:46 am
I have been trying to move all my Pi development to Pi's.
Because I wanted to do aarch64 baremetal I had to wait for a 64bit OS.
You can compile AARCH64 on a 32bit O/S windows or linux, when cross compiling the O/S does not determine the output.

Alternatively you are talking about doing some bit bashing in a linux console program which isn't really baremetal?

User avatar
Gavinmc42
Posts: 2882
Joined: Wed Aug 28, 2013 3:31 am

Re: Spider-OS a new operating system

Mon Apr 08, 2019 3:52 am

You can compile AARCH64 on a 32bit O/S windows or linux
Sure but more fun to do it native and run it on the same box.
Or use an aarch64 OS and cross compile to aarch32.

Cross compiling means rebooting into different OS on Pi or coping exe from x84 to Pi's.
Compile, copy, test, debug cycles take longer doing it this way.

This is also why I am thinking about embedding an interpreted language into my OS.
I found shell script very useful for simple stuff(even webservers) and lots of things don't need C, .libs, IDEs etc.
I have used Micropython on Pi's with shell script for a bit more speed.
Maxed out a Pi B to 2% cpu usage, speed sometimes it not the issue, simple, reliable and it even works editing while running.

Oberon does a sort of extendable OS via modules.
Not sure if any others do that? A Forth based OS?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

LdB
Posts: 1100
Joined: Wed Dec 07, 2016 2:29 pm

Re: Spider-OS a new operating system

Mon Apr 08, 2019 7:58 am

Not sure any of that is features I would want in any O/S .. but it's your O/S so you do what you like :-)

I was just making sure your realized you can cross to AARCh64 and you got that so all good and lets not get sidetracked into lots of other stuff.

Aran
Posts: 21
Joined: Fri Jan 25, 2019 5:55 pm

Re: Spider-OS a new operating system

Mon Apr 08, 2019 5:04 pm

Hello Gavinmc42,

thanks for the ftp link, i will be able to have fun with all that. So I'll have to go to C (GLSL version) ;-) to make the shaders more easily and get the VC4 code (via MESA).

The Raspberry Pi supports OpenGL-ES 2.0 at the hardware level, I intend to enjoy it.
It deviates a bit from my initial project, but after all, it's just for fun.

There is so much to do to have an operating system, so I do it quietly without an absolute goal. I will continue to release posts to show my work anyway.

Return to “Bare metal, Assembly language”