]>
git.corax.cc Git - corax/log
Matthias Kruk [Fri, 1 May 2020 09:41:48 +0000 (18:41 +0900)]
libc: Add dummy _start function
Matthias Kruk [Fri, 1 May 2020 09:41:09 +0000 (18:41 +0900)]
libc: Add signal handling code from klibc
Matthias Kruk [Fri, 1 May 2020 09:40:17 +0000 (18:40 +0900)]
libc: Add debug and sigaction syscall stubs
Matthias Kruk [Fri, 1 May 2020 09:39:21 +0000 (18:39 +0900)]
libc: Add memset() function
Matthias Kruk [Fri, 1 May 2020 01:41:40 +0000 (10:41 +0900)]
kernel/core: Wake up sleeping processes upon signal reception
Matthias Kruk [Fri, 1 May 2020 01:39:36 +0000 (10:39 +0900)]
sched/lazy: Fix bug in _lazy_tick() causing waiting processes to be scheduled
Matthias Kruk [Fri, 1 May 2020 01:35:12 +0000 (10:35 +0900)]
kernel/kbd: Add debug output to see what's going on in kbd_main()
Matthias Kruk [Sat, 4 Apr 2020 15:57:57 +0000 (00:57 +0900)]
kernel/core: Make mailbox_get() return -EINTR if the call to sem_wait() failed
Matthias Kruk [Sat, 4 Apr 2020 15:57:03 +0000 (00:57 +0900)]
klibc/sem: Make sem_wait() return -EINTR if interrupted due to a signal
Matthias Kruk [Fri, 27 Mar 2020 03:07:19 +0000 (12:07 +0900)]
kernel/kbd: Make the interrupt handler print something
Matthias Kruk [Fri, 27 Mar 2020 03:04:34 +0000 (12:04 +0900)]
kernel/core: Make init process wait() indefinitely, for now
Matthias Kruk [Sat, 21 Mar 2020 17:45:19 +0000 (02:45 +0900)]
sched/lazy: Make sure _lazy_tick() doesn't break if ctask is NULL, which happens the first time it is called
Matthias Kruk [Sat, 21 Mar 2020 17:12:25 +0000 (02:12 +0900)]
kernel/arch: Fix task_lock() and task_unlock() functions
Matthias Kruk [Sat, 21 Mar 2020 09:15:42 +0000 (18:15 +0900)]
core/process: Use new scheduler calls, fix compiler warnings
Matthias Kruk [Sat, 21 Mar 2020 09:13:40 +0000 (18:13 +0900)]
kernel/core: Include <sys/wait.h> from main.c
Matthias Kruk [Sat, 21 Mar 2020 09:12:32 +0000 (18:12 +0900)]
core/posixcall: Use sched_sleep() to suspend running task, instead of process_wait(), fix compiler warning
Matthias Kruk [Sat, 21 Mar 2020 09:11:07 +0000 (18:11 +0900)]
kernel/include: Remove prototypes for old scheduler functions
Matthias Kruk [Sat, 21 Mar 2020 09:09:50 +0000 (18:09 +0900)]
include/sys: Add sys/wait.h header
Matthias Kruk [Sat, 21 Mar 2020 09:08:35 +0000 (18:08 +0900)]
kernel/vga: Remove unused variable
Matthias Kruk [Sat, 14 Mar 2020 09:03:39 +0000 (18:03 +0900)]
kernel/core: Use IPC mailboxes in process and cxipc implementation
Matthias Kruk [Fri, 13 Mar 2020 18:14:05 +0000 (03:14 +0900)]
kernel/core: Finish IPC mailbox implementation
Matthias Kruk [Fri, 13 Mar 2020 18:11:03 +0000 (03:11 +0900)]
kernel/core: Add -nostdinc -fno-builtin -fno-builtin-memcpy to Makefile
Matthias Kruk [Fri, 13 Mar 2020 17:08:27 +0000 (02:08 +0900)]
Add header with documentation for IPC mailboxes, along with a half-baked implementation
Matthias Kruk [Fri, 13 Mar 2020 16:48:42 +0000 (01:48 +0900)]
Add sizeof_a() convenience macro for determining the number of elements in a static array
Matthias Kruk [Tue, 18 Feb 2020 12:00:21 +0000 (21:00 +0900)]
kernel/klibc: Add FCFS-semaphore implementation
- Add ffs type and ffs_* functions
- Fix grammar in documentation of sem_* functions
- Make sure lines in sem.h don't exceed 80 columns
Matthias Kruk [Mon, 10 Feb 2020 11:48:40 +0000 (20:48 +0900)]
klibc/sem: Add sem_peek() method and documentation for all semaphore functions
Matthias Kruk [Mon, 10 Feb 2020 10:50:29 +0000 (19:50 +0900)]
kernel/core: Exclude sched.c from compilation
Matthias Kruk [Mon, 10 Feb 2020 10:49:15 +0000 (19:49 +0900)]
sched/common: Define __SCHED_COMMON in common.c so that scheduler-global variables will be declared
Matthias Kruk [Mon, 10 Feb 2020 10:47:05 +0000 (19:47 +0900)]
kernel/core: Initialize the scheduler at boot time
Matthias Kruk [Mon, 10 Feb 2020 10:45:48 +0000 (19:45 +0900)]
arch/interrupt: Remove declaration of sched_wait() and include <sched.h> instead
Matthias Kruk [Mon, 10 Feb 2020 10:42:06 +0000 (19:42 +0900)]
Merge branch 'sched-next' of ssh://corax.cc:2975/home/mk/devel/corax into sched-next
Matthias Kruk [Sat, 8 Feb 2020 15:45:07 +0000 (00:45 +0900)]
klibc/sem: Add semaphore implementation
Matthias Kruk [Sat, 8 Feb 2020 15:42:54 +0000 (00:42 +0900)]
errno: Add definition for EOVERFLOW
Matthias Kruk [Sat, 8 Feb 2020 15:40:35 +0000 (00:40 +0900)]
klibc/mutex: Reduce the amount of code executed in mutex_trylock() while the spinlock is held
Matthias Kruk [Sat, 8 Feb 2020 15:03:25 +0000 (00:03 +0900)]
klibc/mutex: Move mutex definition to mutex.h and remove unused includes
Matthias Kruk [Sat, 8 Feb 2020 14:26:08 +0000 (23:26 +0900)]
klibc/mutex: Avoid priority inversion in the mutex implementation
Wake up all tasks waiting on a mutex when it gets unlocked. This way,
the order in which the waiting tasks will acquire the mutex depends
solely on the scheduler (and the tasks priority), not implicitly on
the mutex.
Matthias Kruk [Tue, 4 Feb 2020 12:37:00 +0000 (21:37 +0900)]
Change pid_t to be a signed integer, in accordance with IEEE Std 1003.1-2004
Matthias Kruk [Tue, 4 Feb 2020 11:31:53 +0000 (20:31 +0900)]
Make sure klibc is the last element in OBJECTS
Matthias Kruk [Tue, 4 Feb 2020 11:21:01 +0000 (20:21 +0900)]
Fix compiler errors and warnings in lazy scheduler
Matthias Kruk [Tue, 4 Feb 2020 11:20:10 +0000 (20:20 +0900)]
Add EINTR to <corax/errno.h>
Matthias Kruk [Mon, 3 Feb 2020 22:34:13 +0000 (07:34 +0900)]
Add "lazy" scheduler implementation
Matthias Kruk [Mon, 3 Feb 2020 22:31:16 +0000 (07:31 +0900)]
Add simple kernel queue implementation to klibc
Matthias Kruk [Mon, 3 Feb 2020 22:26:28 +0000 (07:26 +0900)]
Move CPU_ID macro to kernel/include/arch.h
Matthias Kruk [Sat, 1 Feb 2020 06:47:15 +0000 (15:47 +0900)]
Add generic scheduler interface, to be implemented by all schedulers
Matthias Kruk [Fri, 31 Jan 2020 11:32:06 +0000 (20:32 +0900)]
Clean up message handling in the stdio daemon by moving it into a separate function
Matthias Kruk [Fri, 31 Jan 2020 11:31:20 +0000 (20:31 +0900)]
Initialize the heap when starting the net daemon
Matthias Kruk [Fri, 31 Jan 2020 11:30:45 +0000 (20:30 +0900)]
Remove some unused code from main.c
Matthias Kruk [Fri, 31 Jan 2020 11:29:32 +0000 (20:29 +0900)]
Implement several of the syscalls of the socket interface
Matthias Kruk [Fri, 31 Jan 2020 11:28:30 +0000 (20:28 +0900)]
Add some more refined definitions for ipc messages to corax/ipc.h (but don't use them yet)
Matthias Kruk [Fri, 31 Jan 2020 11:26:41 +0000 (20:26 +0900)]
Correctly check the return value of cxrecv() in vga daemon, print a message during startup
Matthias Kruk [Fri, 31 Jan 2020 11:24:53 +0000 (20:24 +0900)]
Add strlen() function to userspace libc
Matthias Kruk [Fri, 31 Jan 2020 11:23:55 +0000 (20:23 +0900)]
Add fork and execfve syscall stubs to userspace libc
Matthias Kruk [Sat, 25 Jan 2020 07:46:31 +0000 (16:46 +0900)]
Add functions to raise sleeping processes and tasks
- Implement sched_task_raise()
- Implement sched_raise()
Matthias Kruk [Sat, 25 Jan 2020 07:41:55 +0000 (16:41 +0900)]
Fix some minor problems in the process implementation
- Don't lock tasks in process_task_foreach()
- Wake up processes when they receive signals
Matthias Kruk [Sun, 19 Jan 2020 09:11:43 +0000 (18:11 +0900)]
Deliver signals to processes by storing pending signals and accompanying
signal information in the destination process structure, from where the
destination process will retrieve it before returning from an interrupt
or system call. Exception delivery is not affected by this because
exceptions can be delivered directly.
Function implementations added:
- task_signal_handle()
- process_put_signal()
- process_get_signal()
- process_clear_signal()
- process_set_sighandler()
Matthias Kruk [Sun, 19 Jan 2020 09:08:58 +0000 (18:08 +0900)]
Add definitions for SA_* flags to signal.h
Matthias Kruk [Sat, 18 Jan 2020 08:30:42 +0000 (17:30 +0900)]
Deliver keyboard interrupts to keyboard driver
Matthias Kruk [Sat, 18 Jan 2020 08:17:45 +0000 (17:17 +0900)]
Clean up kernel/include/arch.h a little and add IRQ() macro
Matthias Kruk [Sat, 18 Jan 2020 07:39:58 +0000 (16:39 +0900)]
Change return type of _process_hwint_deliver() so that the caller can find out whether or not the interrupt has been successfully delivered
Matthias Kruk [Thu, 16 Jan 2020 10:49:51 +0000 (19:49 +0900)]
Use parentheses in the definition of sigset_t's val member, otherwise it will be 16 times as large as intended
Matthias Kruk [Tue, 14 Jan 2020 12:23:45 +0000 (21:23 +0900)]
Implement mechanism to deliver hardware interrupts to userspace processes by
co-opting the sigaction() syscall in combination with a new signal, SIGHWINT.
The signal mask that is passed to sigaction() by means of a struct sigaction
is used to notify the kernel which interrupts the process would like to receive.
Processes that choose to use the same handler for multiple hardware interrupts
should set the SA_SIGINFO flag in the sigaction structure. The interrupt handler
will then be passed an additional siginfo_t structure (and a struct ucontext*)
which can be used to find out the hardware interrupt number by inspecting the
siginfo_t structure's si_trapno member.
Matthias Kruk [Tue, 14 Jan 2020 12:07:34 +0000 (21:07 +0900)]
Extend task_signal_deliver() function to allow passing of a siginfo_t to the signal handler
Matthias Kruk [Tue, 14 Jan 2020 12:03:03 +0000 (21:03 +0900)]
Move several definitions from kernel/arch/defs.h to kernel/include/arch.h to make them visible to other parts of the kernel (especially device drivers)
Matthias Kruk [Tue, 14 Jan 2020 11:44:16 +0000 (20:44 +0900)]
Provide a dummy errno.h
Matthias Kruk [Tue, 14 Jan 2020 11:37:18 +0000 (20:37 +0900)]
Provide a dummy printf() function in klibc
Matthias Kruk [Tue, 14 Jan 2020 11:27:24 +0000 (20:27 +0900)]
Implement functions for manipulating sigset_t types in klibc
- sigemptyset()
- sigfillset()
- sigaddset()
- sigdelset()
- sigismember()
Matthias Kruk [Tue, 14 Jan 2020 11:27:07 +0000 (20:27 +0900)]
Add prototypes for functions manipulating sigset_t types
Matthias Kruk [Tue, 14 Jan 2020 10:56:13 +0000 (19:56 +0900)]
Add assembly stub for sigaction syscall to klibc
Matthias Kruk [Tue, 14 Jan 2020 10:55:13 +0000 (19:55 +0900)]
Add definition for SYS_SIGACTION
Matthias Kruk [Tue, 14 Jan 2020 10:53:28 +0000 (19:53 +0900)]
Correct/amend signal.h
- Add the correct definitions of sigset_t and sigval_t
- Wrap struct sigaction's sa_handler and sa_sigaction members in a union
- Add the prototype for sigaction()
Matthias Kruk [Sun, 5 Jan 2020 11:28:07 +0000 (20:28 +0900)]
Add remark about signal handling in user-mode
Matthias Kruk [Sun, 5 Jan 2020 11:13:12 +0000 (20:13 +0900)]
Also deliver a signal to a process causing a page fault
Matthias Kruk [Sun, 5 Jan 2020 08:01:19 +0000 (17:01 +0900)]
sys_debug: Make sure strings are properly NUL-terminated before passing them to dbg_printf()
Matthias Kruk [Sun, 5 Jan 2020 07:56:47 +0000 (16:56 +0900)]
Add prototype for debug() syscall
Matthias Kruk [Sun, 5 Jan 2020 07:56:12 +0000 (16:56 +0900)]
Add SIGMAX definition to signal.h
Matthias Kruk [Sun, 5 Jan 2020 07:55:54 +0000 (16:55 +0900)]
Deliver a POSIX signal to a process that has caused an exception
Matthias Kruk [Sun, 5 Jan 2020 07:52:36 +0000 (16:52 +0900)]
Implement _task_sig_stub assembly function for tasks executing signal handlers on the way out from the kernel
Matthias Kruk [Sun, 5 Jan 2020 07:50:48 +0000 (16:50 +0900)]
Add process_get_sighandler() function
Matthias Kruk [Sun, 5 Jan 2020 06:27:34 +0000 (15:27 +0900)]
Add debug syscall for low-level/last-resort debugging
Matthias Kruk [Thu, 2 Jan 2020 07:46:59 +0000 (16:46 +0900)]
Add a cast when assigning the return value in sys_mmap(), to avoid compiler warnings
Matthias Kruk [Thu, 2 Jan 2020 07:41:15 +0000 (16:41 +0900)]
Deliver signals to processes causing exceptions, panic only if the kernel itself causes an exception
Matthias Kruk [Thu, 2 Jan 2020 07:39:45 +0000 (16:39 +0900)]
Make a thread execute the signal handler itself if it is delivering a signal to the current process (instead of going through the trouble of electing a handling task)
Matthias Kruk [Thu, 2 Jan 2020 07:37:03 +0000 (16:37 +0900)]
Add prototype for process_signal_deliver() to kernel/include/process.h
Matthias Kruk [Thu, 2 Jan 2020 07:32:58 +0000 (16:32 +0900)]
Add _exit() syscall to klibc
Matthias Kruk [Thu, 2 Jan 2020 07:28:21 +0000 (16:28 +0900)]
Add parantheses to SEGM_CS() and SEGM_DS() macros to avoid ambiguousness
Matthias Kruk [Tue, 31 Dec 2019 06:05:37 +0000 (15:05 +0900)]
Fix return values of sys_inb() and sys_outb()
Matthias Kruk [Tue, 31 Dec 2019 06:01:54 +0000 (15:01 +0900)]
Statically link against libgcc for now, because of __udivdi3 and __umoddi3
Matthias Kruk [Tue, 31 Dec 2019 06:00:34 +0000 (15:00 +0900)]
Disable output from dbg_printf() once the init process has been spawned
Matthias Kruk [Tue, 31 Dec 2019 05:57:46 +0000 (14:57 +0900)]
Include stdio.c in klibc compilation
Matthias Kruk [Tue, 31 Dec 2019 05:05:47 +0000 (14:05 +0900)]
Fix %% and %c conversion specifications in snprintf() format strings
Matthias Kruk [Tue, 31 Dec 2019 04:49:07 +0000 (13:49 +0900)]
Add snprintf() implementation to klibc
Matthias Kruk [Thu, 26 Dec 2019 05:46:48 +0000 (14:46 +0900)]
Make sure _pg_dir_xfer() doesn't copy more data than was requested
Matthias Kruk [Thu, 26 Dec 2019 02:58:33 +0000 (11:58 +0900)]
Implement sys_cxsendrecv() function
Matthias Kruk [Tue, 24 Dec 2019 14:44:04 +0000 (23:44 +0900)]
Add simple processes for vga and keyboard handling
Matthias Kruk [Mon, 23 Dec 2019 07:32:39 +0000 (16:32 +0900)]
Add sys_inb() and sys_outb() syscalls
Matthias Kruk [Mon, 23 Dec 2019 07:29:46 +0000 (16:29 +0900)]
Add io_inb and io_outb methods for IO-port access on Intel-based platforms
Matthias Kruk [Wed, 18 Dec 2019 09:26:18 +0000 (18:26 +0900)]
Implement sys_mmap() function
Matthias Kruk [Wed, 18 Dec 2019 09:24:13 +0000 (18:24 +0900)]
Add assembly stubs, definitions, and prototypes for mmap() and munmap() syscalls
Matthias Kruk [Wed, 18 Dec 2019 08:44:15 +0000 (17:44 +0900)]
Add pg_dir_mmap() and pg_dir_munmap() functions to implement the low-level half of the mmap() and munmap() syscalls
Matthias Kruk [Wed, 18 Dec 2019 08:28:35 +0000 (17:28 +0900)]
Add off_t type definition to corax/types.h