kolibrios-syscalls 0.2.0

Running KolibriOS sysfuncs/syscalls from Rust
Documentation
  • Coverage
  • 11.11%
    1 out of 9 items documented1 out of 1 items with examples
  • Size
  • Source code size: 7.85 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 143.82 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ilovefurnaces/rust-kolibrios-syscalls
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ilovefurnaces

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);
    };
}