IO issues on my rust OS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
tokyo
Posts: 2
Joined: Sat Jun 17, 2023 8:42 pm

IO issues on my rust OS

Post 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.
User avatar
tokyo
Posts: 2
Joined: Sat Jun 17, 2023 8:42 pm

Re: IO issues on my rust OS

Post by tokyo »

it appears the issue was me loading only 2 sectors from the disk and not loading the whole kernel.
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: IO issues on my rust OS

Post 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.
Post Reply