Skip to content

Commit

Permalink
Adds soaccept
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed May 19, 2024
1 parent 1ff846c commit e19e740
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Orbis Kernel Framework

Orbis Kernel Framework (OKF) is a Rust crate for developing an application that run inside a PS4 kernel.

## Develop a kernel application

Keep in mind that any static item that need to be dropped **will live forever until the PS4 is restarted** because Rust will not drop it. This is not an issue on the user-mode application due to the kernel will free all of used resources after the process is terminated.

## License

MIT
3 changes: 3 additions & 0 deletions kernel-1100/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ impl okf::Kernel for Kernel {
#[offset(0x1A4220)]
unsafe fn malloc(self, size: usize, ty: *mut Self::Malloc, flags: MallocFlags) -> *mut u8;

#[offset(0x264AF0)]
unsafe fn soaccept(self, so: *mut Self::Socket, nam: *mut *mut SockAddr) -> c_int;

#[offset(0x264600)]
unsafe fn sobind(
self,
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ pub trait Kernel: MappedKernel {
/// `ty` cannot be null.
unsafe fn malloc(self, size: usize, ty: *mut Self::Malloc, flags: MallocFlags) -> *mut u8;

/// # Safety
/// - `so` cannot be null.
/// - `nam` cannot be null.
unsafe fn soaccept(self, so: *mut Self::Socket, nam: *mut *mut SockAddr) -> c_int;

/// # Safety
/// - `so` cannot be null.
/// - `nam` cannot be null.
Expand Down

0 comments on commit e19e740

Please sign in to comment.