obhq / obliteration

Experimental PS4 emulator written in Rust for Windows, macOS and Linux
https://obliteration.net
MIT License
581 stars 17 forks source link

Gets vcpu mmap size, refactors kvm and vm #856

Closed SuchAFuriousDeath closed 2 months ago

SuchAFuriousDeath commented 2 months ago

I think this is rougly what we want. Tbh, I'm not completely sure about the Error::from_raw_os_error.

SuchAFuriousDeath commented 2 months ago

I decided to do a refactor, so Kvm and Vm now have their own wrapper types around OwnedFd. I think this is better because it makes it more clear whata method on kvm and what is a method on vm

SuchAFuriousDeath commented 2 months ago

@ultimaweapon If we only run the game in a vm, how do we deal with multiple threads?

ultimaweapon commented 2 months ago

It will be the same as other kernels. That is, switch between threads when the VM exits due to the time slice used up.

SuchAFuriousDeath commented 2 months ago

Didn't know that was possible. Nice

SuchAFuriousDeath commented 2 months ago

So I guess ... now we just map the module into memory, set the registers and run the KVM_RUN ioctl, right? Roughly

SuchAFuriousDeath commented 2 months ago

+ the scheduler

ultimaweapon commented 2 months ago

We need to fix the process VM to allocate from Ram and setup page table for the game process.

VocalFan commented 2 months ago

@ultimaweapon

image

IDPS do be broken tho-

VocalFan commented 2 months ago

Yeah you... Never defined it in UI, Ultima xD

ultimaweapon commented 2 months ago

Better to create an issue for this.