How is vga drivers development going on + some tutorials

Feb 15, 2012 at 6:56 PM

Hi,,

i just wanted to know how the development on the new drivers is working out .

 

And are there some up to date tutorials on how to make a gui + doing some file reading writing and executing ?

HD2HD

Feb 15, 2012 at 7:06 PM

VGA Drivers: VMWare SVGA or VGAScreen

Tutorials: http://cosmos-tutorials.webs.com - works with DevKit.

Feb 15, 2012 at 7:07 PM
HD2HD wrote:

Hi,,

i just wanted to know how the development on the new drivers is working out .

 

And are there some up to date tutorials on how to make a gui + doing some file reading writing and executing ?

HD2HD

Well there isn't any tutorials I know of, but I know one place thats full of examples: pearos.codeplex.com

If everyone wants I can go write some tutorials for the new source. Oh and we have a hacking activity at Pear, look into it you might like it. We are trying to see if anyone can reverse engineer my Pear Hashing code and get the original input. =), Happy hacking, muwahahaha. Thanks - Matt 

Feb 15, 2012 at 7:13 PM
civilwarrock wrote:
HD2HD wrote:

Hi,,

i just wanted to know how the development on the new drivers is working out .

 

And are there some up to date tutorials on how to make a gui + doing some file reading writing and executing ?

HD2HD

Well there isn't any tutorials I know of, but I know one place thats full of examples: pearos.codeplex.com

If everyone wants I can go write some tutorials for the new source. Oh and we have a hacking activity at Pear, look into it you might like it. We are trying to see if anyone can reverse engineer my Pear Hashing code and get the original input. =), Happy hacking, muwahahaha. Thanks - Matt 

If you want to write tutorials, just contribute to my tutorial index. Link in the 2nd post.

Feb 15, 2012 at 7:24 PM
Aurora01 wrote:
civilwarrock wrote:
HD2HD wrote:

Hi,,

i just wanted to know how the development on the new drivers is working out .

 

And are there some up to date tutorials on how to make a gui + doing some file reading writing and executing ?

HD2HD

Well there isn't any tutorials I know of, but I know one place thats full of examples: pearos.codeplex.com

If everyone wants I can go write some tutorials for the new source. Oh and we have a hacking activity at Pear, look into it you might like it. We are trying to see if anyone can reverse engineer my Pear Hashing code and get the original input. =), Happy hacking, muwahahaha. Thanks - Matt 

If you want to write tutorials, just contribute to my tutorial index. Link in the 2nd post.

Ok ill see what I can do. Thanks - Matt

Feb 16, 2012 at 9:14 AM

Matt: Look at the format of my articles and try and create them to that sort of template if you can. Happy tutorial writing, 

Aurora

Feb 16, 2012 at 5:16 PM
Aurora01 wrote:

Matt: Look at the format of my articles and try and create them to that sort of template if you can. Happy tutorial writing, 

Aurora

Ok I can do that. Thanks - Matt

Feb 16, 2012 at 5:26 PM

i mean the vmware SVGA drivers.

VGAscreen sucks at the moment with its 320x200x8.

it makes me think if i'm not better of making my own in assembly language.

But for the moment it will do.

Oh and aurora01 i watched your site it has potential, good luck with it !

Developer
Feb 16, 2012 at 5:36 PM

A small hint on how to get the VMWare SVGA working, you have to first set the pixel, and then you also have to call Update(), otherwise it doesn't update what's actually drawn. (It's done that way so you can hide the indivual setting of pixels, and is the standard way of doing things with modern graphics cards)

Feb 16, 2012 at 5:45 PM
Edited Feb 16, 2012 at 5:45 PM
HD2HD wrote:

i mean the vmware SVGA drivers.

VGAscreen sucks at the moment with its 320x200x8.

it makes me think if i'm not better of making my own in assembly language.

But for the moment it will do.

Oh and aurora01 i watched your site it has potential, good luck with it !

Thanks. :)

Feb 16, 2012 at 5:46 PM
blah38621 wrote:

A small hint on how to get the VMWare SVGA working, you have to first set the pixel, and then you also have to call Update(), otherwise it doesn't update what's actually drawn. (It's done that way so you can hide the indivual setting of pixels, and is the standard way of doing things with modern graphics cards)

I found two problems with VMWare SVGA: SetMode is protected, so you have to make a wrapper around it, and there's no SetPalette. Could you explain how it works please, blah?

Developer
Feb 16, 2012 at 7:19 PM
Edited Feb 16, 2012 at 7:30 PM

There will never be a set palette with SVGA, because it's using 32-bit color. I have no idea why it's protected, but I'm about to commit a change that will make it public. It will also be slightly faster (due to the fact we don't need to be reading the width every time we go to set a pixel, when we've already set the size of the screen ourself)

 

hmmm... I seem to be causing a crash when I go to use the SVGA driver....

Developer
Feb 16, 2012 at 10:52 PM
Did you make a change so we can get the screen size blah? Cause we need that implemented in the mouse at some point.

//HKS

On Thu, Feb 16, 2012 at 9:19 PM, blah38621 <notifications@codeplex.com> wrote:

From: blah38621

There will never be a set palette with SVGA, because it's using 32-bit color. I have no idea why it's protected, but I'm about to commit a change that will make it public. It will also be slightly faster (due to the fact we don't need to be reading the width every time we go to set a pixel, when we've already set the size of the screen ourself)

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 4:04 AM
HKS wrote:
Did you make a change so we can get the screen size blah? Cause we need that implemented in the mouse at some point.
//HKS

On Thu, Feb 16, 2012 at 9:19 PM, blah38621 <notifications@codeplex.com> wrote:

From: blah38621

There will never be a set palette with SVGA, because it's using 32-bit color. I have no idea why it's protected, but I'm about to commit a change that will make it public. It will also be slightly faster (due to the fact we don't need to be reading the width every time we go to set a pixel, when we've already set the size of the screen ourself)

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Can anyone show me how to set a green pixel? Thanks - Matt

Feb 17, 2012 at 7:31 AM
blah38621 wrote:

There will never be a set palette with SVGA, because it's using 32-bit color. I have no idea why it's protected, but I'm about to commit a change that will make it public. It will also be slightly faster (due to the fact we don't need to be reading the width every time we go to set a pixel, when we've already set the size of the screen ourself)

 

hmmm... I seem to be causing a crash when I go to use the SVGA driver....

blah: when I tried to set a pixel, I tried multiple ways to set a white pixel: 0xFFFFFF etc, but it's always black. -Aurora

Feb 17, 2012 at 5:14 PM

@blah

do you mean :

cosmos.hardware.vgascreen.setpixeldelegate ?

And if it is that can you just a tip to get me started ?

 

Thanks

Feb 17, 2012 at 5:21 PM

never mind the previous post i found it.

For other people looking for the svgadrvier it's under:

cosmos.hardware.drivers.pci.video.vmwaresvgaII

so to begin on it i need to use the setpixel ?

and then what 

 

Thanks!

Developer
Feb 17, 2012 at 5:22 PM

no, there is a set pixel method in SVGAII, once I figure out why It's crashing on me, I can give a bit more help :P

Feb 17, 2012 at 5:26 PM

blah: I'm not sure why it's crashing on you, if you post the code you're using I'll see what I can do

Feb 17, 2012 at 5:27 PM
HD2HD wrote:

never mind the previous post i found it.

For other people looking for the svgadrvier it's under:

cosmos.hardware.drivers.pci.video.vmwaresvgaII

so to begin on it i need to use the setpixel ?

and then what 

 

Thanks!

you need to set the mode, then then the pixels, then update.

Feb 17, 2012 at 5:32 PM

this is the code i used,

 

if (UserInput == "start")
            {
                Cosmos.Hardware.VGAScreen gui = new Cosmos.Hardware.VGAScreen();

                
                gui.SetPaletteEntry(2, 0, 175, 175);
                
                gui.SetPaletteEntry(5, 220, 220, 220);
  

                Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII video = new Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII();
                video.SetPixel(0,0,2);
                video.Update(0, 0, 1024, 768);
                
                
            }

Feb 17, 2012 at 5:35 PM

Here is some code I think should set a white pixel:

video.SetMode(1024,768,32);

video.SetPixel(0,0,0xFFFFFF);

video.Update(0,0,1024,768);

Feb 17, 2012 at 5:39 PM

i can't find the "setmode" 

Feb 17, 2012 at 5:40 PM
HD2HD wrote:

i can't find the "setmode" 

Update to the latest DevKit version

Developer
Feb 17, 2012 at 5:41 PM

for one, 0xFFFFFF isn't white, it's an opaque blue-green, because the colors are in an RGBA format, meaning 0xFFFFFFFF would be white. (255 for R, G, B & A values)

Secondly, there is no color pallete for SVGA, and messing with the vga screen probably doesn't help the case :P

Feb 17, 2012 at 5:43 PM
blah38621 wrote:

for one, 0xFFFFFF isn't white, it's an opaque blue-green, because the colors are in an RGBA format, meaning 0xFFFFFFFF would be white. (255 for R, G, B & A values)

Secondly, there is no color pallete for SVGA, and messing with the vga screen probably doesn't help the case :P

It's RGBA? That explains it

Feb 17, 2012 at 5:44 PM
Edited Feb 17, 2012 at 5:45 PM

ow i was using the userkit , 

downloading now ...

Feb 17, 2012 at 5:45 PM

Where did you get the UserKit from? Because 87612 shouldn't have SVGA at all should it?

Feb 17, 2012 at 5:47 PM
Edited Feb 17, 2012 at 5:48 PM

i had an older version and it was in there i download also the newest userkit and i'm seeing it right now,

but the devkit is also downlaoded i'm going to use that now.

there us i the userkit the svga but the setmode isn't in there so...

goign to start the dev

Feb 17, 2012 at 5:48 PM

That should fix it.

Feb 17, 2012 at 5:53 PM

where do i need to write the code in wich file ?

like i did in the userkit

Feb 17, 2012 at 5:54 PM

No changes needed

Feb 17, 2012 at 5:56 PM

?

Feb 17, 2012 at 5:57 PM
HD2HD wrote:

?

??

Feb 17, 2012 at 6:00 PM

what do you mean with "no changes needed" i just want to know where i need to type this code in after i loaded the devkit 

"cosmos" solution in visual studio prof .

Feb 17, 2012 at 6:01 PM

Put it in the same place!

-Aurora

Feb 17, 2012 at 6:03 PM

in the same solution like the userkit ?

Feb 17, 2012 at 6:12 PM

still no setmode

Feb 17, 2012 at 6:58 PM

the devkit is really confusing  ,

where do i need to change the code to my code like in the kernel.cs in the userkit.

@aurora you say in the same place where is the same place ?

please i'm totally confused with the devkit.

Feb 17, 2012 at 7:08 PM
HD2HD wrote:

the devkit is really confusing  ,

where do i need to change the code to my code like in the kernel.cs in the userkit.

@aurora you say in the same place where is the same place ?

please i'm totally confused with the devkit.

wait I know why! You cannot just do Cosmos.Hardware.Drivers...SetMode.

You have to do:

public Cosmos.Hardware.Drivers.PCI.VMWare.... SVGAScreen = new Cosmos.Hardware.Drivers.PCI.VMware...();

Then call SVGAScreen.Whatever

Some of those paths may not be correct as it was off the top of my head. Hope it helps - Matt

Feb 17, 2012 at 7:21 PM

It's just the same , no setmode is in the intellisense list.

Developer
Feb 17, 2012 at 7:24 PM

Perhaps you could venture onto the IRC? It's much easier to help people there, and you'll get a faster response with an issue like this :P

Feb 17, 2012 at 8:43 PM
blah38621 wrote:

Perhaps you could venture onto the IRC? It's much easier to help people there, and you'll get a faster response with an issue like this :P

Orvid, what modes do the SVGA driver support? And can you please give me a working example of insilizing the driver and clearing the screen to white? Thanks - Matt

Feb 18, 2012 at 7:26 AM
civilwarrock wrote:
blah38621 wrote:

Perhaps you could venture onto the IRC? It's much easier to help people there, and you'll get a faster response with an issue like this :P

Orvid, what modes do the SVGA driver support? And can you please give me a working example of insilizing the driver and clearing the screen to white? Thanks - Matt

Any mode the screen can handle.

Feb 18, 2012 at 2:13 PM

isn't there a way to just use it in the userkit because the devkit is irritating and there it's just the same

also no setmode method.

please help !

Feb 18, 2012 at 2:25 PM
HD2HD wrote:

isn't there a way to just use it in the userkit because the devkit is irritating and there it's just the same

also no setmode method.

please help !

If you make a class that extends SVGA then add a wrapper around setmode that just calls it with this.SetMode(1024,768,32) it is probably going to work.

Feb 18, 2012 at 2:34 PM

i will try doing this , thanks for the info !

Feb 18, 2012 at 3:03 PM

damn vmware player gives me an error.

This is the kernel code :

public class Kernel : Sys.Kernel
    {
        Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII video = new Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII();
        screenSVGA video2 = new screenSVGA();
        protected override void BeforeRun()
        {
            Console.WriteLine("THE OS [0.1 Build 10] booted successfully.");
            Console.WriteLine("Copyright THE OS . ");
            Console.WriteLine("===========================================================================");
            Console.WriteLine("Type 'start' to continue");
        }

        protected override void Run()
        {
             //init gui
             video2.setmode1024x768x32();
             video.SetPixel(0,0,0xFFFFFF);
             video.Update(0, 0, 1024, 768);
                
                
            
        }
        public static void DrawRect(uint x, uint y, uint Width, uint Height, uint color)
        {
            Cosmos.Hardware.VGAScreen gui = new Cosmos.Hardware.VGAScreen();
            for (uint bb = x; bb < x + Width; bb++)
            {

                for (uint cc = y; cc < y + Height; cc++)
                {
                    gui.SetPixel320x200x8(bb, cc, color);//Since its a rectangle its length and width may not be the same
                }
            }
        }
        public static void DrawSquare(uint x, uint y, uint Length, uint color)
        {
            Cosmos.Hardware.VGAScreen gui = new Cosmos.Hardware.VGAScreen();
            for (uint bb = x; bb < x + Length; bb++)
            {

                for (uint cc = y; cc < y + Length; cc++)//Since it is a Square both Length and width are the same witch is common sence
                {
                    gui.SetPixel320x200x8(bb, cc, color);
                }
            }
        }
    }

and this is the class that extends the svga driver:

 class screenSVGA : Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII
    {
        public void setmode800x600x32()
        {
            this.SetMode(800, 600, 32);
        }
        public void setmode1024x768x32()
        {
            this.SetMode(1024, 768, 32);
        }
        
    }

i'm certaintly doing something wrong but i can't figure it out myself

Feb 18, 2012 at 3:10 PM

I think there's a bug with the update command, because I'm getting it and blah is too. Does it say anything specific?

Feb 18, 2012 at 3:12 PM

Blah: Could you look at this, as a few people seem to be getting errors.

Feb 18, 2012 at 3:14 PM
Edited Feb 18, 2012 at 3:15 PM

but what i'm doing is correct isn't it ?

vmware just says that something is trying to acces 'an' processor or that there is a bug in the host os.

Feb 18, 2012 at 3:17 PM

The code you wrote was correct, except just use video2 for everything, because it inherits the SVGA commands

Feb 18, 2012 at 3:41 PM

okay, 

ps heres the error that vmware gave me:

A fault has occurred causing a virtual CPU to enter the shutdown state. If this fault had occurred outside of a virtual machine, it would have caused the physical machine to restart. The shutdown state can be reached by incorrectly configuring the virtual machine, a bug in the guest operating system, or a problem in VMware Player.Click OK to restart the virtual machine or Cancel to power off the virtual machine.

Feb 18, 2012 at 3:41 PM
Edited Feb 18, 2012 at 3:43 PM

What the? It's causing a triple fault? That's seriously wrong...

PS: I have filed a bug

Feb 18, 2012 at 5:25 PM

what is the problem exactly ?

Feb 18, 2012 at 5:44 PM
HD2HD wrote:

what is the problem exactly ?

There is a problem in a driver, and it's not being caught, so it sort of snowballs and causes the computer to crash (triple fault, because there is the error, then an unhandled error exception, then it crashes)