Age | Commit message (Collapse) | Author |
|
Introduce a libc disk_query() to invoke the query operation of specific
disks via __disk_io()
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|
|
Introduce disk_query() implementation which allows information about a
specific disk to be retrieved.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
- Rename 'disk_meta' -> 'disk_root'
- Add 'disk_info' structure
- Add boot 'canary' value to 'disk_root'
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|
|
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>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
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>
|