kolibrios-syscalls

Crates.iokolibrios-syscalls
lib.rskolibrios-syscalls
version0.2.0
created_at2025-05-02 17:15:15.011915+00
updated_at2025-05-22 15:39:33.211299+00
descriptionRunning KolibriOS sysfuncs/syscalls from Rust
homepage
repositoryhttps://github.com/ilovefurnaces/rust-kolibrios-syscalls
max_upload_size
id1658008
size7,850
(ilovefurnaces)

documentation

README

KolibriOS syscalls for rust.

Use macro syscall!(eax: u32, ebx: u32, ..) -> (u32, u32). Macro returns (eax, ebx).

Examples

Exit:

fn kolibrios_exit() -> ! {
    unsafe {
        syscall!(u32::MAX);
        unreachable!()
    }
}

Using returned value(s):

use core::ffi::c_void;
/// Allocates x pages so that x*page_size > size
unsafe fn alloc(size: u32) -> *mut c_void {

    let eax; 
    unsafe {
        // Sysfunc 68.12, allocate memory block
        eax = syscall!(68, 12, size).0;
    };
    eax as *mut c_void
}

Hello World: (will write to debug board)

let string = "hello world";
for i in string.bytes() {
    unsafe {
        syscall!(63, 1, i);
    };
}
Commit count: 19

cargo fmt