Improve syscall interfaces
The current ABI stability policy, is to define the stable ABI layer in relibc, and allow internal breaking changes to the syscall ABI. This may and likely will change in the future, when the kernel and its interfaces reach a certain level of maturity.
Move most file operations to the fd
-
Change=>chmod(path, mode)
tofchmod(fd, mode)
chmod
has been removed in favor offchmod
-
Add=> already addedfchown(fd, owner, group)
dup
less magical
Make -
Change dup(fd, buf)
todup(fd)
-
Change dup2(fd, newfd, buf)
todup2(fd, newfd)
-
Add openat(fd, path, flags)
.
With the dup buffer removed, schemes will no longer receive SYS_DUP requests, instead SYS_OPENAT.
Use standard methods more often
memory management
-
Usefmap
to implementphysmap
-
Usefunmap
to implementphysunmap
-
Replace physalloc
-
Replace physfree
-
Decide whether virttophys
should still exist. One of the proposed alternatives to physalloc/physfree is to do mmap with a "physically contiguous" flag, which would necessitate a syscall for virt=>phys translation. -
Consider using=> SYS_BRK has already been removed from the kernelfmap
to implementbrk
process management
(let proc/...
be an alias for thisproc:current/...
)
-
Replace chdir and getcwd withproc/cwd
- Replace getegid, getens, geteuid, getns, getpid, getpgid/setpgid, getppid, getuid, setregid, setrens, setreuid, umask, sigprocmask with corresponding files
- Replace sigaction get/set with
proc/sigaction
Cleanup other syscalls
-
Replace pipe2
withopen/openatopen/dup - Implement or remove
link(old, new)
Misc
- Remove
int 0x80
on x86_64? - Add UTIME_NOW and UTIME_OMIT?
ABI stabilization (WIP)
A large part of growing the adoption of a kernel is to stabilize the ABI used. I would like to work on a stable ABI in the next few months, and a 1.0 version of the kernel
and syscall
crate. I am proposing the following for ABI stabilization: