| Crates.io | kolibrios-syscalls |
| lib.rs | kolibrios-syscalls |
| version | 0.2.0 |
| created_at | 2025-05-02 17:15:15.011915+00 |
| updated_at | 2025-05-22 15:39:33.211299+00 |
| description | Running KolibriOS sysfuncs/syscalls from Rust |
| homepage | |
| repository | https://github.com/ilovefurnaces/rust-kolibrios-syscalls |
| max_upload_size | |
| id | 1658008 |
| size | 7,850 |
Use macro syscall!(eax: u32, ebx: u32, ..) -> (u32, u32).
Macro returns (eax, ebx).
fn kolibrios_exit() -> ! {
unsafe {
syscall!(u32::MAX);
unreachable!()
}
}
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
}
let string = "hello world";
for i in string.bytes() {
unsafe {
syscall!(63, 1, i);
};
}