Commit Graph

43 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen 2cd7361294 Add memusage(2).
Switch xz to memusage(2) and fix native self-cross issue.

This is a compatible ABI change.
2023-03-09 20:27:17 +01:00
auronandace 292aeb3fe7 Rename CLOCK_BOOT to CLOCK_BOOTTIME. 2022-02-22 18:01:57 +00:00
Jonas 'Sortie' Termansen 9f1965f36e Prioritize the interrupt worker thread. 2017-05-18 22:40:46 +02:00
Jonas 'Sortie' Termansen acc32ccb49 Make interrupt work thread reliable. 2017-04-12 23:22:09 +02:00
Jonas 'Sortie' Termansen 86ac3d3725 Fix the signal dispatch handler is callable from user-space. 2017-04-12 23:22:09 +02:00
Meisaka Yukara 961ba9ec6c Add cache-aware memory mapping functions.
This commit is joint work by Meisaka Yukara <Meisaka.Yukara@gmail.com> and
Jonas 'Sortie' Termansen <sortie@maxsi.org>.
2017-02-19 12:13:32 +01:00
Jonas 'Sortie' Termansen ce54be34da Add VirtualBox Guest Additions. 2016-11-27 11:18:49 +01:00
Jonas 'Sortie' Termansen ecfe121a8c Add assertions to Signal::DispatchHandler callers. 2016-03-28 17:37:37 +02:00
Jonas 'Sortie' Termansen 2b72262b4f Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.

All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.

All imported code from other projects is compatible with this license.

All GPL licensed code from other projects had previously been removed.

Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-05 22:21:50 +01:00
Jonas 'Sortie' Termansen 3487b62152 Remove dead MTRR code from the kernel. 2016-02-29 01:37:31 +01:00
Jonas 'Sortie' Termansen 02c6316e95 Remove kernel debugger, old kernel US layout and kernel symbol code.
The debugger has fallen behind and has become a maintenance burden.  It was
the only user of the old kernel US layout system, which is good to get rid
of.  The debugger didn't work with graphical output and was likely to
conflict with the new keyboard system if used, which no longer triggered it.
The kernel symbol code was removed to simplify the kernel.

The kernel debugger was an useful debugging feature, but it needs to be done
in a better way before it can be added back.
2016-02-22 00:12:26 +01:00
Jonas 'Sortie' Termansen ebdb2a844f Disable PS/2 port testing.
This is reportedly a problem with some emulated PS/2 controllers.
glauxosdever reported his computer responds 0x50 0x00 instead of just 0x00.
OpenBSD has commented out this check in sys/dev/ic/pckbc.c, claiming it's a
problem with some controllers and that some might even hang.

I doubt not testing ports is going to be a problem, as the identitication
code runs next and verifies devices and all relevant modern hardware
probably has this working well enough.
2016-02-18 22:15:17 +01:00
Jonas 'Sortie' Termansen 16c5738a20 Fix typo in PS/2 error string.
Discovered by Alexandros Alexandrou.
2016-02-13 20:07:47 +01:00
Jonas 'Sortie' Termansen fe067c5150 Refactor boot page availability testing. 2016-01-26 17:51:25 +01:00
Jonas 'Sortie' Termansen 2e3d7c45af Add paging no-execute and write protection support.
Enable the NX bit on x86_64 and set if not PROT_EXEC and enable the write
protection mode (CR0.WP) that disables the default behavior where the kernel
is able to write to read-only memory. Fix kernel broken assumptions it can
access read-only memory and take care to never set PROT_KWRITE on user-space
pages unless PROT_WRITE is also set, otherwise user-space will be able to
write to read-only memory.

This achieves X^W in the whole system except for the core kernel itself as
it is currently don't know the purpose of pages when identity mapping the
first 4 MiB.
2016-01-25 17:39:57 +01:00
Jonas 'Sortie' Termansen 306709fc4a Add PS/2 controller driver. 2016-01-23 00:50:53 +01:00
Jonas 'Sortie' Termansen ff8b2be515 Implement CLOCK_THREAD_CPUTIME_ID and CLOCK_THREAD_SYSTIME_ID. 2016-01-09 02:28:44 +01:00
Jonas 'Sortie' Termansen 73a182f80c Add interface to get 32-bit pages. 2015-08-28 15:24:54 +02:00
Jonas 'Sortie' Termansen a79aeed0c1 Remove __BEGIN_DECLS and __END_DECLS. 2015-08-26 14:52:44 +02:00
Jonas 'Sortie' Termansen 77467b7768 Detect physical memory before initializing the kernel log. 2015-08-21 21:25:00 +02:00
Jonas 'Sortie' Termansen 218875eb79 Initialize paging before KernelInit. 2015-08-21 21:25:00 +02:00
Jonas 'Sortie' Termansen a422c394b8 Initialize the GDT in the bootstrap assembly. 2015-08-21 21:25:00 +02:00
Jonas 'Sortie' Termansen 4f7c5ebdd3 Fix PCI code. 2015-02-08 22:58:32 +01:00
Jonas 'Sortie' Termansen ba1e0882ec Initialize system call table at compile time. 2014-12-03 14:19:49 +01:00
Jonas 'Sortie' Termansen 59262f6bf2 Refactor interrupt handler registration. 2014-12-02 21:30:39 +01:00
Jonas 'Sortie' Termansen 78d9620b0f Clean up kernel attribute packed use. 2014-12-02 19:36:20 +01:00
Jonas 'Sortie' Termansen 35708fa900 Retire calltrace support in favor of the kernel debugger. 2014-12-01 21:38:06 +01:00
Jonas 'Sortie' Termansen 749d123331 Maintain counts of physical frames used for particular purposes. 2014-11-26 22:27:04 +01:00
Jonas 'Sortie' Termansen c1af231897 Optimize reading the CMOS real time clock. 2014-11-25 19:42:28 +01:00
Jonas 'Sortie' Termansen 12eaf46873 Let kernel debugger know how it was invoked. 2014-11-21 00:12:46 +01:00
Jonas 'Sortie' Termansen 25e07a9083 Refactor kernel interrupt and thread register support. 2014-11-18 20:33:21 +01:00
Jonas 'Sortie' Termansen 25b4125840 Relocate kernel IO port functions to <sortix/kernel/ioport.h>. 2014-11-18 18:10:22 +01:00
Jonas 'Sortie' Termansen 79f7312a49 Fix page protection bugs. 2014-11-06 00:09:55 +01:00
Jonas 'Sortie' Termansen 30cd318c17 Implement signals.
Note: This is an incompatible ABI change.
2014-07-22 13:25:39 +02:00
Jonas 'Sortie' Termansen af23f7ad5e Add rdmsr(2) and wrmsr(2). 2014-05-29 17:14:30 +02:00
Jonas 'Sortie' Termansen 1f72c1637c Maintain fsbase and gsbase as per-thread registers.
Note: This is an incompatible ABI change.
2014-05-29 17:07:42 +02:00
Jonas 'Sortie' Termansen 24321b0f96 Fix wrong TSS limit. 2014-04-22 18:06:00 +02:00
Jonas 'Sortie' Termansen 8c00a4145c Refactor kernel PAT, MTRR, and MSR usage. 2014-03-17 19:22:13 +01:00
Jonas 'Sortie' Termansen a133a7717e Refactor i386 and x86_64 interrupt support. 2014-03-17 19:22:13 +01:00
Jonas 'Sortie' Termansen 093d583dea Fix print format warnings in kernel/x86-family/memorymanagement.cpp. 2014-03-01 14:37:42 +01:00
Jonas 'Sortie' Termansen 6d79781497 Update kernel/x86-family/x86-family.{cpp,h} to current coding conventions. 2014-03-01 14:37:41 +01:00
Jonas 'Sortie' Termansen a099f82890 Update kernel memory management to current coding conventions. 2014-03-01 14:37:40 +01:00
Jonas 'Sortie' Termansen 98a87fa1e5 Rename Sortix kernel directory to kernel. 2014-03-01 14:37:39 +01:00