-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
QEMU booting in endless looping at post-03 #1301
Comments
Could you try checking out and running the |
@phil-opp Thank you. |
Same endless boot issue? |
Yes, same with the above video. |
That's weird. We have a CI job that tests the code regularly and it worked with the same QEMU version on macOS this night. Could you please try running |
I just ran into something similar. I found I had a newer version of |
That's very interesting, could you please send the changes in your code that occurred when downgrading from |
add my Cargo.toml. (also added to the top)
And even if i run |
Note that the first commit is a backwards-edit, i.e., I started with finished (working) code from I'm running QEMU v8.2.91 on Windows 11: $ qemu-system-x86_64 --version
QEMU emulator version 8.2.91 (v9.0.0-rc1-12050-gb494cb57ce)
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers |
Thank you very much, @MichaelZalla. It seems that Rust's code-generator generates different assembly instructions for the two different versions of volatile. Edit: It seems to be something to do with the introduced Edit2: I can reproduce, will be comparing generated assembly |
Ok, so, here's the situation, I figured out why your implementation @MichaelZalla boot-loops. This is your #[panic_handler]
fn panic_handler(_info: &PanicInfo) -> ! {
vga_buffer::print_something();
loop {}
}
#[no_mangle]
pub extern "C" fn _start() -> ! {
panic!("Some panic message");
} The cycle of your program is as such:
|
+1 still happening (Windows). |
I have found the issue! It is with this line in print_something: I don't know what is happening, but without that line it works. |
Yes, that line will cause it, however, It seems that there is an issue with actually WRITING to volatile memory in the new version |
+1 But I am also experiencing the same behaviour when writing with |
@MichaelZalla @AtomicGamer9523 @UnexDev While implementing the volatile writes without the use of the Explanationrepr(transparent)
struct Buffer {
chars: [[VolatilePtr<'static, ScreenChar>; BUFFER_SIZE_X]; BUFFER_SIZE_Y]
} You now declared lazy_static! {
pub static ref WRITER: Mutex<Writer> = Mutex::new(Writer {
column_pos: 0,
color_code: ColorCode::new(Color::White, Color::Black),
buffer: unsafe { &mut *(0xb8000 as *mut Buffer) },
});
} Therefore what lies there is our ScreenChar values. NOT pointers to them. This means In my implementation I had repr(transparent)
struct Buffer {
chars: [[&'static mut ScreenChar; BUFFER_SIZE_X]; BUFFER_SIZE_Y]
} which resulted in the same behavior because the actual values are interpreted as references. Why does
|
Oh my God, that makes so much sense now. Thank you for finding this, I was already starting to loose hope. |
Unfortunately I am not sure if this also resolves the original problem as from what I understand the boot loop occurs even with |
Finally have some free time on my hands. Started working on a fix / explanation here. |
When I implemented until
Newlines
section atpost-03
and then boot the QUME, cause endless loop like following.Screen.Recording.2024-03-01.at.4.50.06.mov
I think if I add a
volatile
type implementation, they won't work.Could you tell me how to resolve?
Thank you.
Environment
Following is source code(
vga_buffer.rs
)Added(2024 April 08)
Cargo.toml
The text was updated successfully, but these errors were encountered: