CosmosOS / Cosmos

Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
https://www.goCosmos.org
BSD 3-Clause "New" or "Revised" License
2.94k stars 551 forks source link

CPU crashes when trying to disableing canvas and returning to CLI mode. #2942

Open alessiob07 opened 9 months ago

alessiob07 commented 9 months ago

Area of Cosmos - What area of Cosmos are we dealing with?

I think with Canvas.Disable

Expected Behaviour - What do you think that should happen?

Kills the grahics driver and return to normal CLI/TTY mode

Actual Behaviour - What unexpectedly happens?

Vmware disaplays this error: image

Reproduction - How did you get this error to appear?

with this custom function: public static void Disable() { try { cnv.Disable(); ProcessMgr.running.Clear(); Kernel.SetGraphicsMode('c'); } catch(Exception ex) { aText.Errore("disable gpu",ex.Message); } }

p.s. cnv is the Canvas.

and kernel.setgraphics mode 'c' is: [...] case 'c': onGUI = false; if (!aCLI.alreadyInit) { aCLI.Init(); aCLI.alreadyInit = true; } graphicsMode = 'c'; break; [...]

and kernel loop is: try { //update the clock
aClock.Aggiorna(); //Ottimizza la gestione della Memoria - Memory manager optimization Heap.Collect();

 //update respectevly about graphics mode.
 switch (graphicsMode)
 {
     /*
     * c => CLI/TTY mode
     * g => GPU drivers & GUI at Window with Mouse.
     * e => When occoures a severe error (a.k.a. crash)
     */

     default:
     case 'c':
         aCLI.Loop();
         break;

[...]

Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)?

I'm using devkit v106027

tails1154 commented 8 months ago

same thing

9xbt commented 8 months ago

seems like a cgs issue

cameronos commented 8 months ago

Effects VBox as well.

cameronos commented 7 months ago

I've found an odd workaround that works for me and created this method for it - I just call it after doing canvas.Disable();


public static void SetupCLI()
{
    VGAScreen.SetGraphicsMode(Cosmos.HAL.Drivers.Video.VGADriver.ScreenSize.Size320x200, ColorDepth.ColorDepth4);
    VGAScreen.SetTextMode(Cosmos.HAL.Drivers.Video.VGADriver.TextSize.Size80x25);
}