summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
31 hourskernel: sysctl: Report 'hw.*' variablesIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
34 hourskernel: sysctl: Set 'oldlenp' to NULL if neededIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
35 hourskernel: sysctl: Add 'kern.hostname' varIan Moffett
This commit introduces the 'kern.hostname' sysctl variable to store the machines hostname. Signed-off-by: Ian Moffett <ian@osmora.org>
35 hourskernel: Do not blacklist AHCIIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
35 hourskernel: sysctl: Allow 'old*' fields to be NULLIan Moffett
When setting sysctl variables from userspace, the 'old' fields will unused and thus typically be set to NULL. This commit modifies the behaviour of do_sysctl() to enable this. Signed-off-by: Ian Moffett <ian@osmora.org>
35 hourskernel: sysctl: Be sure to set 'newlen' in argsIan Moffett
Since we are approaching the point to where we'll need to set sysctl variables from userspace. It would be a wise idea to actually set the length of the new data. Signed-off-by: Ian Moffett <ian@osmora.org>
35 hourskernel: sysctl: Add sysctl_clearstr()Ian Moffett
Introduce the sysctl_clearstr() function to clear string variables that aren't readonly to a known state. Signed-off-by: Ian Moffett <ian@osmora.org>
44 hourskernel: vcache: Include '\0' in sysctl stringIan Moffett
The strlen() function does not count the null terminator when measuring the length of the string and therefore a value of 1 must be added to do so. Signed-off-by: Ian Moffett <ian@osmora.org>
2 dayskernel: sysctl: Use user headers ifndef _KERNELIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2 daysMerge branch 'expt' of github.com:sigsegv7/Hyra into exptIan Moffett
2 dayskernel/amd64: Limit frame depth in backtraceIan Moffett
A backtrace usually occurs during critcal system events like panics. When the system in a error state, we cannot trust the correctness of the stack. This commit aims to improve checks done in a731d4e by adding a max frame depth that limits how many frames can be walked. Signed-off-by: Ian Moffett <ian@osmora.org>
2 dayskernel/amd64: Add better checks on 'rbp' and 'rip'Ian Moffett
Improve handling within the stacktrace logic used during system panics and critical events. - Perform checks on 'rbp' *before* logging - Ensure RBP is 8-byte aligned Signed-off-by: Ian Moffett <ian@osmora.org>
2 dayskernel/amd64: Add better checks on 'rbp' and 'rip'Ian Moffett
Improve handling within the stacktrace logic used during system panics and critical events. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: socket: Fake success on missing optIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: socket: Fix typo in commentIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
4 dayskernel & libc: Add POSIX setsockopt syscallIan Moffett
This commit implements the POSIX setsockopt syscall so that user programs may be able to configure sockets they have created. Signed-off-by: Ian Moffett <ian@osmora.org>
4 dayskernel: socket: Implement recv() timeoutIan Moffett
This commit implements proper timeout handling for recv(). Previously, the recv() syscall would yield the current process forver until data is available to be read. Obviously, that is not the most ideal as it is not uncommon for programs to try seeing if any data exists on the socket before deferring to perform some other task until data arrives. The basics of how this work is that we try reading data off of some specified socket. However, if no data is present, we must wait for the given timeout value before attempting to read again. While this is pretty effective and works perfectly fine as of now, it might be worth optimizing this later to allow that timeout period to be somehow "interrupted" by data arriving at a socket so that the program does not have to defer execution for the full wait-period. Signed-off-by: Ian Moffett <ian@osmora.org>
4 dayskernel: socket: Add POSIX setsockopt()Ian Moffett
This commit introduces the kernel-side implementation of setsockopt() for setting options on a socket file descriptor. See POSIX setsockopt() for more information. https://pubs.opengroup.org/onlinepubs/9690949499/functions/setsockopt.html Signed-off-by: Ian Moffett <ian@osmora.org>
4 dayskernel: socket: Fix typo in code commentIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
4 dayskernel: sched: Add sched_suspend()Ian Moffett
Introduce a new sched_suspend() function that allows the caller to suspend themselves (equivalent to a yield) for a specified amount of time described by a 'timeval'. Signed-off-by: Ian Moffett <ian@osmora.org>
4 dayskernel: socket: Refactor recv() implIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
4 dayskernel: socket: Zero newly allocated 'ksock'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: ctlfs: Keep comment up to dateIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: dmi: Add '/ctl/dmi/board' ctl entryIan Moffett
Add ctlfs entry for DMI to allow for easy system information from userspace by reading '/ctl/dmi/*'. This commit implements a ctlfs node that reports information about the host board. Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: dmi: Add dmi_prodfam()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: dmi: Add dmi_cpu_version()Ian Moffett
Add DMI helper to grab processor version string Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: Add SYS_connect syscallIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: socket: Implement connect()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: socket: Improve control message logicIan Moffett
- Zero new control buffer before usage - Block if the control message queue is empty Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: socket: Block is recv queue is emptyIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: socket: Block if cmsg queue is emptyIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: socket: Log socket owner PID on SCM_RIGHTSIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: socket: Create a socket file in /tmp/Ian Moffett
This commit adds logic to socket() that creates a temp file that represents it. Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: socket: Keep track of socket ownerIan Moffett
Keep track of the process that created a socket. Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayssys: types: Use internal typenames for typedefsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: descrip: Add 'td' parameter to fd routinesIan Moffett
Update the signature of 'fd_get()', 'fd_alloc()' and 'fd_dup()' to include a pointer to the process to target. This improves the flexibility of the file descriptor API. Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: socket: Ensure AF_UNIX in recvmsg()Ian Moffett
Ensure that the file descriptor represented by 'socket' is of type AF_UNIX before performing the rest of recvmsg() Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: Add SYS_sendmsg and SYS_recvmsgIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: socket: Add initial SCM + CMSG implIan Moffett
Introduce initial implementation for out-of-band socket control messages and an SCM_RIGHTS stub. Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: uio: Add iovec copyin/copyout routinesIan Moffett
Introduce copyin() and copyout() type functions made for iovec/uio operation. Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: posix: Add POSIX 'uio'Ian Moffett
See https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/uio.h.html Signed-off-by: Ian Moffett <ian@osmora.org>
11 dayskernel: Introduce per-arch M_WORD_SIZEIan Moffett
The machine word size describes how many bytes of data can be processed at once. Add a per-arch M_WORD_SIZE constant to represent this platform specific characteristic. This commit also adds an MALIGN() helper macro to sys/param.h which can be used for optimization purposes in cases where you want data to be perfectly aligned on a machine word boundary. Signed-off-by: Ian Moffett <ian@osmora.org>
11 dayskernel: net: Add socket syscallsIan Moffett
Introduce the following syscalls: - SYS_socket - SYS_bind - SYS_recv - SYS_send Signed-off-by: Ian Moffett <ian@osmora.org>
11 dayskernel: net: Introduce initial socket implIan Moffett
Introduce initial support for POSIX sockets. This commit currently implements the AF_UNIX family for IPC. Signed-off-by: Ian Moffett <ian@osmora.org>
11 dayskernel: net: Add missing sys/types.h includeIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
13 dayskernel: vsr: Add 'td' argument for most funcsIan Moffett
Allow specification of which process should be targeted for specific operations. Signed-off-by: Ian Moffett <ian@osmora.org>
13 dayskernel: Introduce initial VSR implIan Moffett
This commit introduces the initial implementation of Virtual System Resources (VSRs). Virtual system resources enable specific subsystems to control global state while the VSR acts as a middle man between the process, and the actual resource itself. This allows the products of certain operations to be routed to either the global state or a local (per-process) "shallow copy" whose data and side effects are only visible through that process. An example of something this would be useful for is some sort of transparent access control mechanism where if a process should not modify global system-wide state, it can at least modify the state for itself. Signed-off-by: Ian Moffett <ian@osmora.org>
13 dayskernel: lib: Add strdup() to string.hIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
13 dayskernel: termios: Add c_oflag bit definesIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
13 dayskernel: termios: Add compatibility flagsIan Moffett
Adds compatibility flags for c_iflag as well as improved documentation for the defines. Signed-off-by: Ian Moffett <ian@osmora.org>