Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alessiob07 opened this issue Feb 4, 2024 · 4 comments
Open
Labels

Comments

@alessiob07
Copy link

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 alessiob07 added the Bug label Feb 4, 2024
@tails1154
Copy link

same thing

@9xbt
Copy link
Contributor

9xbt commented Feb 25, 2024

seems like a cgs issue

@cameronos
Copy link
Contributor

Effects VBox as well.

@cameronos
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants