toor / lambdaOS

A very basic operating system written in Rust, with some sprinklings of Assembly.
GNU General Public License v3.0
24 stars 2 forks source link

Base pointer is zero after process creation #19

Open robert-w-gries opened 6 years ago

robert-w-gries commented 6 years ago

See robert-w-gries/rxinu#61

We need to set the base pointer register during process creation. Otherwise, we will eventually run into page faults due to a bad initial rbp value of zero.

For example, mov %rax,-0x18(%rbp), where rbp = 0x0 will have us access the memory location of 0x0 - 0x18 = 0xffffffffffffffe8. The reason this issue came up is because I recently changed bootloaders and page protection is properly setup for my kernel now.

I fixed the issue in rxinu in this commit. I would submit a patch for you but it is late and I don't have my dev environment setup 😄

toor commented 6 years ago

Hi Rob,

Thanks for the info, I'll probably patch this at some point. lambdaOS is currently a dead project but it's always nice to have fixes coming in.

robert-w-gries commented 6 years ago

If you're interested in priority preemptive scheduling, I recently merged it in: https://github.com/robert-w-gries/rxinu/pull/68

The kernel is a lot more stable now. After moving to the rust-osdev/x86_64 crate and making some fixes to how processes are initialized, I see much fewer exceptions and lock ups.

Notable changes