summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
14 hourskernel: proc: Add proc_init() routineIan Moffett
This commit moves a lot of initialization logic within spawn() into the proc_init() function. The logic of spawning a process from an executable should not have mixed with the logic of initializing a process. Signed-off-by: Ian Moffett <ian@osmora.org>
15 hourskernel: Add initial workqueue frameworkIan Moffett
This commit introduces the initial groundwork for the workqueue framework which allows operations to be ran in its on thread context. Signed-off-by: Ian Moffett <ian@osmora.org>
42 hourskernel/amd64: Introduce flexible IPI managementIan Moffett
This commit greatly improves the handling of how inter-processor interrupts are allocated and managed. Previously Hyra used handlers at fixed interrupt vectors for IPIs, however, that is very rigid and not very scalable at all. With the new IPI framework, one may allocate IPIs by calling 'md_ipi_alloc()' and initializing the handler field. To send an IPI to a specific processor, one can use cpu_ipi_send() and pass the specific CPU structure as well as the IPI identifier. Signed-off-by: Ian Moffett <ian@osmora.org>
47 hourskernel: xhci: Add USBSTS_CNR definitionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: xhci: Wait until xHC is ready in resetIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: xhci: Ensure portno is valid for portscIan Moffett
In the previous implementation, passing 0 or values higher than 'hc->maxports' would not be filtered and would result in underflow/overflow Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: xhci: Add xhci_stop_hc() to stop the xHCIan Moffett
Implement a new xhci_stop_hc() an call it before we perform a reset. We cannot be certain that the firmware (e.g., UEFI, BIOS) took the care to stop the xHCI before passing control over to us. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: xhci: Fake success if already runningIan Moffett
Do not return an error in xhci_start_hc() if it is already running as it complicates things. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: xhci: Log reset timeoutsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: xhci: Fix zeroing of NULL pageIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: xhci: Do not offset segment table baseIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: xhci: Fix off-by-one bugIan Moffett
The DCBAA has indexing that starts at zero so 1 must be added to make it correct. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: acpi: Add GAS I/O access definitionsIan Moffett
This commit adds ACPI address space ID (not to be confused with virtual memory ASIDs) definitions as well as ones describing various access sizes. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: acpi: Add handling of GPEs and notifyIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: sysctl: Add 'hw.machine' variableIan Moffett
Introduce the 'hw.machine' sysctl variable to represent the current machine architecture. Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: descrip: Fix byte count on read()Ian Moffett
Byte count returned must be the number of bytes read() which may be less than the number of bytes actually requested. Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: sysctl: Report 'hw.*' variablesIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: sysctl: Set 'oldlenp' to NULL if neededIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: 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>
5 dayskernel: Do not blacklist AHCIIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: 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>
5 dayskernel: 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>
5 dayskernel: 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>
5 dayskernel: 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>
6 dayskernel: sysctl: Use user headers ifndef _KERNELIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysMerge branch 'expt' of github.com:sigsegv7/Hyra into exptIan Moffett
6 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>
6 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>
6 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>
7 dayskernel: socket: Fake success on missing optIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: socket: Fix typo in commentIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 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>
7 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>
7 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>
7 dayskernel: socket: Fix typo in code commentIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 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>
7 dayskernel: socket: Refactor recv() implIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: socket: Zero newly allocated 'ksock'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: ctlfs: Keep comment up to dateIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
10 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>
10 dayskernel: dmi: Add dmi_prodfam()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel: dmi: Add dmi_cpu_version()Ian Moffett
Add DMI helper to grab processor version string Signed-off-by: Ian Moffett <ian@osmora.org>
11 dayskernel: Add SYS_connect syscallIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
11 dayskernel: socket: Implement connect()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
11 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>
11 dayskernel: socket: Block is recv queue is emptyIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
11 dayskernel: socket: Block if cmsg queue is emptyIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
11 dayskernel: socket: Log socket owner PID on SCM_RIGHTSIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
11 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>
11 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>