summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
38 hourskernel/amd64: Use seperate stack for double faultsIan Moffett
This commit gives the double fault handling context a dedicated kernel stack to ensure it has a clean space to vomit up a trapframe into without encountering too many issues besides the inevitable panic to the user's despair and distress. Signed-off-by: Ian Moffett <ian@osmora.org>
38 hourskernel/amd64: trap: Remove erroneous spl callsIan Moffett
The trap_handler() function is a very sensitive code path and thus calling things like splraise(), splx(), etc is quite unsafe and also somewhat not needed. This commit removes those calls from the trap_handler() function. Signed-off-by: Ian Moffett <ian@osmora.org>
42 hourskernel/amd64: Do not run off callstack in traceIan Moffett
Previously, if RBP becomes NULL (indicating that the END of the callstack has been reached), we still had a chance of dereferencing a NULL pointer when attempting to grab the next value for 'rip'. This commit checks if RBP is NULL before we get the next instruction pointer value. Signed-off-by: Ian Moffett <ian@osmora.org>
43 hourskernel/amd64: Do not hit self in cpu_halt_others()Ian Moffett
Previously the logic for cpu_halt_others() would fall back to halting the current processor. However this is not correct and we should instead bail if there are no other processors to halt. Signed-off-by: Ian Moffett <ian@osmora.org>
43 hourskernel: physmem: Panic when out of memoryIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
43 hourskernel: physmem: Update page counts on alloc/freeIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel/amd64: reboot: Add reboot fallback methodsIan Moffett
This commit introduces several fallback methods for system reboots in case once fails. Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysusr: screensave: Lower tv_nsec to 3000000Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysusr: screensave: Fix typo in commentIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: synch: Deprecate global __syslockIan Moffett
The global spinlock is highly contentious and can be a great performance bottleneck in SMP systems. Use of such mechanisms are discouraged. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: exit: Panic if core is not preemptableIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: Disable preemption on spinlock_acquire()Ian Moffett
To prevent priority inversion by disabling task preemption upon spinlock acquisition and reenabling upon release Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: Allow preemption to be enabled/disabledIan Moffett
Introduce sched_preempt_set() which can be useful to implement priority inheritance for preventing priority inversion Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel/amd64: Add preemptable flag to cpu_infoIan Moffett
Add a new 'preempt' field to cpu_info' to indicate if that specific processor is preemptable. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel/amd64: i8042: Remove unused global variableIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel: Do not spin in spinlock_try_acquire()Ian Moffett
The spinlock_try_acquire() function should *not* block as it is meant to simply attempt to acquire the lock and return its status. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel/amd64: Add initial ext scancode supportIan Moffett
Most keyboards nowadays support extended scancodes which are multi-byte packets prefixed with a 0xE0 byte to represent non-standard special keys. This commit introduces the initial groundwork for supporting such scancodes. - i8042_drain() now takes a (nullable) pointer to a i8042 data buffer which will hold bytes drained - Made some timing adjustments between i8042 register reads in the i8042_drain() function - Removed nonessential and contentious locks which choked up input performance Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayskernel/amd64: isa: Seperate i8042 capslock logicIan Moffett
This commit moves all of the capslock logic from i8042_kb_getc() into its own capslock_toggle() function. Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysusr: Add glitch-art 'screensave' programIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysusr: reboot: Fix typoIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysosh: Seperate 'shutdown' command from builtinsIan Moffett
Gives the shutdown command its own binary in /usr/bin/shutdown Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysusr: reboot: Add default case for bad flagsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysusr: reboot: Add method flagsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysusr: osh: Seperate 'reboot' command from builtinsIan Moffett
Gives the reboot command its own binary in /usr/bin/reboot Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel/amd64: cpu: Fix uninitialized variableIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayslibc: disk: Implement disk_query() interfaceIan Moffett
Introduce a libc disk_query() to invoke the query operation of specific disks via __disk_io() Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: disk: Add DISK_IO_QUERY op to disk engineIan Moffett
This commit introduces the DISK_IO_QUERY opcode to the disk engine so that a user application may query specific devices. Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: disk: Implement disk_query()Ian Moffett
Introduce disk_query() implementation which allows information about a specific disk to be retrieved. Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: disk: Improve tracking of disk informationIan Moffett
- Rename 'disk_meta' -> 'disk_root' - Add 'disk_info' structure - Add boot 'canary' value to 'disk_root' Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: disk: Use 'void *' in disk_param_init()Ian Moffett
The disk parameters allow data to be passed into the disk engine via its interface. The data may be raw byte streams from the drive, or bytes to be written to the drive. However not all the time is the data to be an arbitrary stream of bytes and may contain structured data instead. Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: disk: Remove redundant decl clutterIan Moffett
Move the common disk I/O routines out side of the _KERNEL guard so that they are visible from both within the kernel as well as from the user side. Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: disk: Document disk READ/WRITE opcodesIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 dayskernel: disk: Use DISK_NAME_MAX for disk name lenIan Moffett
The NAME_MAX constant is typically used for filenames, do not rely on this value and create our own. Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysusr: libc: Silence type mismatch warningsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysdocs: kernel: Add disk framework docsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: disk: Add comment of V_BSIZE requirementsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: disk: Describe 'bsize' as HW specificIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: disk: Introduce virtual blocksIan Moffett
This commit implements the concept of virtual blocks which may be bigger than the hardware block size (e.g., 512 bytes). The virtual block size must be a multiple of the hardware blocksize. The system will panic if this condition is not met. Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: ahci: Register drives with disk frameworkIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: ahci: Improve identify interfaceIan Moffett
This commit improves the ahci_dump_identity() function by returning an information structure rather than dumping it on the spot. Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: disk: Add disk limit enforcementsIan Moffett
The number of disks registered within the system should not exceed the DISK_MAX limit. Log an error and bail if that happens. Signed-off-by: Ian Moffett <ian@osmora.org>
8 daysusr: libc: Add initial disk engine interfaceIan Moffett
This commit implements a libc interface to the Hyra disk engine and adds functions such as disk_read() and disk_write(). There is also a mostly internal __disk_io() routine which is made to have external linkage as it could potentially be useful for cases where fine grained control over the engine is needed, though it is recommended to rely on the other functions whenever possible. Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: disk: Add initial disk engine sourcesIan Moffett
This commit introduces the initial disk engine sources. The Hyra disk engine refers to the software layer that intercepts SYS_disk syscalls and routes standard opcodes to internal disk routines. Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: conf: Add 'DISK_MAX' config optionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: Introduce disk management frameworkIan Moffett
This commit introduces the initial Hyra disk management framework. The goal of this framework is to provide a simplistic API for the management of storage devices in a way that is more suitable for complex operations. Upon detection and initialization of a block-based storage medium, the driver may create a named disk object using the 'disk_add()' function. Disks that have been registered with the system may be acquired via the 'disk_get_id()' function. As of the current revision, each disk is given a monotonically incremental ID for identification and lookups. A disk ID of zero indicates a primary disk on the system. Disks may be written to or read from using the 'disk_read()' and 'disk_write()' functions. Memory buffers used for these operations must be created with the 'disk_buf_alloc()' function and freed with the 'disk_buf_free()' function. Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: ahci: Add separate ahci_register() routineIan Moffett
This commit seperates device registration logic from ahci_init_port() into a seperates ahci_register() function to improve modularity and clarity. Signed-off-by: Ian Moffett <ian@osmora.org>
8 dayskernel: Initialize UACPI right before driversIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
9 daysbuild: Speed up build with -j$(nproc)Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel/amd64: cpu: Add detection of invariant TSCIan Moffett
This commit introduces the 'CPU_FEAT_TSCINV' feature bit to indicate whether or not the CPU supports an invariant TSC. Signed-off-by: Ian Moffett <ian@osmora.org>
10 dayskernel/amd64: conf: Add CPU_UMIP config optionIan Moffett
This commit adds the CPU_UMIP kconf(9) option to allow the user to configure whether or not the kernel should enable the CR4.UMIP bit. It is recommended to keep this to "yes" as user applications should not be able to execute the SGDT, SIDT, SLDT, SMSW or STR instructions at all for security reasons. Signed-off-by: Ian Moffett <ian@osmora.org>