Cosmos icon indicating copy to clipboard operation
Cosmos copied to clipboard

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

Open alessiob07 opened this issue 1 year ago • 4 comments

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

alessiob07 avatar Feb 04 '24 13:02 alessiob07

same thing

tails1154 avatar Feb 24 '24 17:02 tails1154

seems like a cgs issue

9xbt avatar Feb 25 '24 09:02 9xbt

Effects VBox as well.

cameronos avatar Mar 16 '24 05:03 cameronos

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);
}

cameronos avatar Mar 24 '24 16:03 cameronos