I use my own bootloader assembled in NASM and I load the Kernel from floppy.
My problem is that my os crash when I increment a structure int variable or a public static (global) int variable.
Code: Select all
//A
pub fn display(&mut self, data: &str) -> u8{
for byte in data.bytes(){
// [...]
self.column += 1; // for example it will crash here.
if self.column == 80{
self.newline();
self.column = 0;
}
}
return 0;
}
The bootloader's steps (if I forgot something) :
Boot
Read kernel
Switch to PM,
Boot second stage
Enable A20
Switch Long Mode
Call kernel at 0x1000.
(I assemble the second stage as ELF64 and I link it to the Rust code (kernel) using LD then I link it to the first stage BIN file).
Sorry if I did basics mistakes I'm still learning.
Thanks.