Skip to content

Commit

Permalink
Implements uk_flags for keg_small_init (#1242)
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon authored Jan 12, 2025
1 parent 5ba8a39 commit b84b0f0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![CI](https://github.com/obhq/obliteration/actions/workflows/main.yml/badge.svg)](https://github.com/obhq/obliteration/actions/workflows/main.yml)
[![Zulip](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://obkrnl.zulipchat.com)

Obliteration is a free and open-source PlayStation 4 kernel rewritten in Rust. Our goal is to run the PlayStation 4 system software on Windows, Linux and macOS using a custom made virtualization stack optimized specifically for Obliteration. **The project is under development and cannot run any games yet**. The reason it take so long is because we decided to go with the correct path without stubbing as much as possible.
Obliteration is a free and open-source PlayStation 4 kernel rewritten in Rust. Our goal is not running on the PlayStation 4 but to run the dumped PlayStation 4 system software on Windows, Linux and macOS using a custom made virtualization stack optimized specifically for Obliteration.

This project started as a hard-fork from [Kyty](https://github.com/InoriRus/Kyty). Then we decided to rewrite the whole project from scratch by using Kyty and [Uplift](https://github.com/idc/uplift) as a reference to help us getting started with the project.

Expand All @@ -19,6 +19,16 @@ So we want to take this opportunity to go beyond a PlayStation 4 emulator since

The project logo and icon was designed by [VocalFan](https://github.com/VocalFan).

## Status

Currently we cannot run any games yet. The reason it take so long is because we try to implement things without stubbing as much as possible.

## Key features

- Cross-platform with native binary for each platform.
- On-demand memory allocation instead of pre-allocated 8 GB at startup.
- Near-native performance by using [Windows Hypervisor Platform](https://learn.microsoft.com/en-us/virtualization/api/#windows-hypervisor-platform), [KVM](https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine) or [Hypervisor Framework](https://developer.apple.com/documentation/hypervisor) directly with custom made virtual devices for optimized MMIO.

## Get a daily build

Please note that we cannot run any games yet as stated on the above. But if you want to try or help on testing you can download binaries from the latest commits [here](https://github.com/obhq/obliteration/actions/workflows/main.yml). You **MUST** sign in to GitHub otherwise you will not be able to download files.
Expand Down
19 changes: 18 additions & 1 deletion kernel/src/uma/keg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,25 @@ impl UmaKeg {
if (size.get() + (min.size() - off)) > (PAGE_SIZE.get() - min.size()) {
todo!()
} else {
todo!()
// TODO: Set uk_ppera, uk_ipers and uk_rsize.
if !flags.has(UmaFlags::Internal) {
flags |= UmaFlags::Offpage;

if !flags.has(UmaFlags::VToSlab) {
flags |= UmaFlags::Hash;
}
}
}
}

if flags.has(UmaFlags::Offpage) {
if flags.has(UmaFlags::RefCnt) {
// TODO: Set uk_slabzone to slabrefzone.
} else {
// TODO: Set uk_slabzone to slabzone.
}
}

todo!()
}
}
4 changes: 4 additions & 0 deletions kernel/src/uma/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ impl Uma {
pub enum UmaFlags {
/// `UMA_ZONE_ZINIT`.
ZInit = 0x2,
/// `UMA_ZONE_OFFPAGE`.
Offpage = 0x8,
/// `UMA_ZONE_MALLOC`.
Malloc = 0x10,
/// `UMA_ZONE_VM`.
Vm = 0x80,
/// `UMA_ZONE_HASH`.
Hash = 0x100,
/// `UMA_ZONE_SECONDARY`.
Secondary = 0x200,
/// `UMA_ZONE_REFCNT`.
Expand Down

0 comments on commit b84b0f0

Please sign in to comment.