mirror of
https://github.com/XunilGroup/XunilOS.git
synced 2026-04-25 11:49:03 +02:00
Add ET_DYN support for the ELF loader, which required adding
relocations, add some more functions to libxunil, use include inside of tests instead of manually defining types and add basic libc header files. Move libxunil to the user folder, and add helloworld and doomgeneric as apps
This commit is contained in:
32
user/libxunil/src/syscall.rs
Normal file
32
user/libxunil/src/syscall.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
#[inline(always)]
|
||||
pub unsafe fn syscall0(num: usize) -> isize {
|
||||
let ret: isize;
|
||||
unsafe {
|
||||
core::arch::asm!(
|
||||
"int 0x80",
|
||||
in("rax") num,
|
||||
lateout("rax") ret,
|
||||
options(nostack)
|
||||
);
|
||||
}
|
||||
|
||||
ret
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub unsafe fn syscall3(num: usize, arg0: usize, arg1: usize, arg2: usize) -> isize {
|
||||
let ret: isize;
|
||||
unsafe {
|
||||
core::arch::asm!(
|
||||
"int 0x80",
|
||||
in("rax") num,
|
||||
in("rdi") arg0,
|
||||
in("rsi") arg1,
|
||||
in("rdx") arg2,
|
||||
lateout("rax") ret,
|
||||
options(nostack)
|
||||
);
|
||||
}
|
||||
|
||||
ret
|
||||
}
|
||||
Reference in New Issue
Block a user