Skip to content

Machine shuts down after setting graphics mode #31

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

Open
HENRYMARTIN5 opened this issue Apr 4, 2023 · 2 comments
Open

Machine shuts down after setting graphics mode #31

HENRYMARTIN5 opened this issue Apr 4, 2023 · 2 comments

Comments

@HENRYMARTIN5
Copy link

HENRYMARTIN5 commented Apr 4, 2023

This is my current kernel main function:

extern crate vga;
use vga::colors::Color16;
use vga::writers::{Graphics640x480x16, GraphicsWriter};

#[no_mangle]
pub fn kmain()
{	
	log!("Booted!");
	let mode = Graphics640x480x16::new();
	log!("Created graphics mode");
	mode.set_mode();
	log!("Set graphics mode");
	mode.clear_screen(Color16::White);
	log!("Cleared screen");
	for (offset, character) in "Hello World!".chars().enumerate() {
		log!("Drawing character");
		mode.draw_character(270 + offset * 8, 72, character, Color16::Black)
	}
	loop {} // If we exit, the machine shuts down - we don't want that, so we loop forever
}

Before adding the vga crate, the system would boot and then hang at the loop at the end of the function - but now it seems to be rebooting repeatedly as you can see in the screenshot of the output below:

image

I'm not quite sure what the issue is - I'm following everything exactly as it is in the README. If you need to see more of the source, please let me know.

Edit: I also tested with text mode, and the same thing was happening: Everything was working right up to the point where I call text_mode.set_mode().

@archief2910
Copy link

can i work on this issue?

@HENRYMARTIN5
Copy link
Author

can i work on this issue?

If you want, but at this point I've given up.

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

No branches or pull requests

2 participants