Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|
|
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>
|
|
To prevent user programs from performing any operations related to
system memory structures (such as the GDT, TSS, etc), we will always set
CR4.UMIP if possible to improve the security of Hyra.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Some older CPUs may not even support the TSC so it would be a good idea
to check before we start assuming its existence.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Introduce the USER_TSC kernel config option to control whether or not
the 'rdtsc' instruction should be accessible in a user context.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
This commit introduces a vendor field within the 'cpu_info' structure.
This allows kernel code to detect the CPU vendor by comparing it with
the CPU_VENDOR_* defines that have also been added.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
- Extend 'nswitch' to 64-bits as it increments fast
- Ensure writes to 'nswitch' are atomic
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
This commit introduces reporting of total system memory supported
through the vmstat subsystem
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Introduce the '/ctl/vm/stat' control file for providing virtual memory
related statistics to userland.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Sometimes we may rely on a specific kind of timer. While we are able to
grab scheduler specific timers, general purpose timers, etc. One might
need to for example, check whether their general purpose timer timer is
monotonic or not.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Introduce the 'proc.count' sysctl variable which contains the number of
running processes in the system.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
It seems somewhat dangerous to have to manually increment the number of
threads every time we make a process. This change makes every call to
proc_init() increment the number of threads. The value is decremented
once the process exits.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
This commit includes several changes:
- Improves documentation in sys/workqueue.h
- Removes useless 'func' field in workqueue structure
- Duplicate strings and introduce work_destroy()
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|
|
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>
|
|
This commit adds the "rb" mode for compatibility purposes. It is mapped
to the same file seal as "r".
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|