Page 1 of 1

IO issues on my rust OS

Posted: Mon Jun 26, 2023 10:11 pm
by tokyo
Hi all,

I've recently started developing my own operating system in Rust and have made some progress so far. I have been using this wiki, this series of blogs and used this blog post for my bootloader, but I have simplified it. Additionally, I've created a basic I/O library using inline assembly with the `in` and `out` instructions. Furthermore, I have a functional serial driver.

Now, I'm working on implementing a VGA driver (in drivers/vga.rs) that supports a resolution of 720x480 @ 16 colors. The driver somewhat works, but I am having issues with:
  1. The `write_regs` function: In the last for loop of this function, there is a problem with the first read operation (it's commented out in the source due to it causing triple faults). I believe the issue has the same core problem as the next issue.
  2. When I attempt to set a pixel using the `put_pixel` function with the `set_plane` function uncommented, it causes a triple fault. I suspect this might be due to running multiple outb calls within a for loop in the `set_plane` function.
I'm seeking insights into why these issues are happening and would greatly appreciate any assistance. If you'd like to review my complete source code, you can find it on GitHub: https://github.com/juls0730/toto-os.

Re: IO issues on my rust OS

Posted: Tue Jun 27, 2023 6:26 am
by tokyo
it appears the issue was me loading only 2 sectors from the disk and not loading the whole kernel.

Re: IO issues on my rust OS

Posted: Tue Jun 27, 2023 10:41 am
by Octocontrabass
I see you're using the same broken tutorial bootloader that everyone else seems to be using nowadays. You should throw it away and use something that works correctly, like Limine or the bootloader crate.