]> git.corax.cc Git - corax/log
corax
5 years agoAdd VGA system process elf-loader
Matthias Kruk [Wed, 6 May 2020 04:00:45 +0000 (13:00 +0900)]
Add VGA system process

5 years agolibc: Call _exit() after returning from main()
Matthias Kruk [Wed, 6 May 2020 03:59:40 +0000 (12:59 +0900)]
libc: Call _exit() after returning from main()

5 years agolibc: Clean up syscall assembly stubs
Matthias Kruk [Wed, 6 May 2020 03:17:35 +0000 (12:17 +0900)]
libc: Clean up syscall assembly stubs

5 years agolibc: Rename assembly stub for SYS_EXIT from exit to _exit
Matthias Kruk [Wed, 6 May 2020 03:16:03 +0000 (12:16 +0900)]
libc: Rename assembly stub for SYS_EXIT from exit to _exit

5 years agosys/kbd: Remove unused variable
Matthias Kruk [Tue, 5 May 2020 17:26:06 +0000 (02:26 +0900)]
sys/kbd: Remove unused variable

5 years agokernel/core: Execute system processes from initfs once the kernel has been initialized
Matthias Kruk [Tue, 5 May 2020 17:24:55 +0000 (02:24 +0900)]
kernel/core: Execute system processes from initfs once the kernel has been initialized

5 years agokernel/core: Finish execeve() implementation
Matthias Kruk [Tue, 5 May 2020 17:23:39 +0000 (02:23 +0900)]
kernel/core: Finish execeve() implementation

5 years agolibc: Add snprintf() implementation
Matthias Kruk [Tue, 5 May 2020 17:21:37 +0000 (02:21 +0900)]
libc: Add snprintf() implementation

5 years agolibc: Add memcpy() implementation, fix bug in memset()
Matthias Kruk [Tue, 5 May 2020 17:20:33 +0000 (02:20 +0900)]
libc: Add memcpy() implementation, fix bug in memset()

5 years agokernel/arch: Don't pass uninitialized variables to pg_dir_map() in pg_dir_mmap()
Matthias Kruk [Tue, 5 May 2020 03:07:53 +0000 (12:07 +0900)]
kernel/arch: Don't pass uninitialized variables to pg_dir_map() in pg_dir_mmap()

5 years agokernel/core: Make elf_phdr_foreach() calculate the address of the headers correctly
Matthias Kruk [Mon, 4 May 2020 19:20:41 +0000 (04:20 +0900)]
kernel/core: Make elf_phdr_foreach() calculate the address of the headers correctly

5 years agokernel/core: Update the process's tasks' t_kstack member when the process's page...
Matthias Kruk [Mon, 4 May 2020 17:08:32 +0000 (02:08 +0900)]
kernel/core: Update the process's tasks' t_kstack member when the process's page directory is changed

5 years agoinclude: Add missing prototype for execeve() to unistd.h
Matthias Kruk [Mon, 4 May 2020 09:30:08 +0000 (18:30 +0900)]
include: Add missing prototype for execeve() to unistd.h

5 years agoAdd a simple kbd binary to the initfs for testing purposes
Matthias Kruk [Mon, 4 May 2020 08:53:31 +0000 (17:53 +0900)]
Add a simple kbd binary to the initfs for testing purposes

5 years agosys: Use the _binary_*_size symbol to determine the size of binaries in the initfs
Matthias Kruk [Mon, 4 May 2020 08:52:34 +0000 (17:52 +0900)]
sys: Use the _binary_*_size symbol to determine the size of binaries in the initfs

5 years agokernel/core: Add missing parameter in call to dbg_printf()
Matthias Kruk [Mon, 4 May 2020 08:49:16 +0000 (17:49 +0900)]
kernel/core: Add missing parameter in call to dbg_printf()

5 years agoMerge branch 'libc' into elf-loader
Matthias Kruk [Mon, 4 May 2020 08:30:09 +0000 (17:30 +0900)]
Merge branch 'libc' into elf-loader

5 years agoMerge branch 'initfs' into elf-loader
Matthias Kruk [Mon, 4 May 2020 08:29:50 +0000 (17:29 +0900)]
Merge branch 'initfs' into elf-loader

5 years agokernel/core: Implement sys_execeve() syscall handler
Matthias Kruk [Mon, 4 May 2020 08:28:53 +0000 (17:28 +0900)]
kernel/core: Implement sys_execeve() syscall handler

5 years agokernel/core: Add simple ELF file support
Matthias Kruk [Mon, 4 May 2020 08:27:43 +0000 (17:27 +0900)]
kernel/core: Add simple ELF file support

5 years agokernel/arch: Add pg_dir_memset() function, enhance pg_dir_mmap() function to support...
Matthias Kruk [Mon, 4 May 2020 08:26:15 +0000 (17:26 +0900)]
kernel/arch: Add pg_dir_memset() function, enhance pg_dir_mmap() function to support mapping of virtual memory for text and data segments

5 years agokernel: Add execeve syscall for execution of ELF files
Matthias Kruk [Sun, 3 May 2020 17:22:24 +0000 (02:22 +0900)]
kernel: Add execeve syscall for execution of ELF files

5 years agolibc: Add dummy _start function libc
Matthias Kruk [Fri, 1 May 2020 09:41:48 +0000 (18:41 +0900)]
libc: Add dummy _start function

5 years agolibc: Add signal handling code from klibc
Matthias Kruk [Fri, 1 May 2020 09:41:09 +0000 (18:41 +0900)]
libc: Add signal handling code from klibc

5 years agolibc: Add debug and sigaction syscall stubs
Matthias Kruk [Fri, 1 May 2020 09:40:17 +0000 (18:40 +0900)]
libc: Add debug and sigaction syscall stubs

5 years agolibc: Add memset() function
Matthias Kruk [Fri, 1 May 2020 09:39:21 +0000 (18:39 +0900)]
libc: Add memset() function

5 years agocorax/sys: Add initfs infrastructure initfs
Matthias Kruk [Fri, 1 May 2020 05:36:09 +0000 (14:36 +0900)]
corax/sys: Add initfs infrastructure

5 years agokernel/core: Wake up sleeping processes upon signal reception sched-next
Matthias Kruk [Fri, 1 May 2020 01:41:40 +0000 (10:41 +0900)]
kernel/core: Wake up sleeping processes upon signal reception

5 years agosched/lazy: Fix bug in _lazy_tick() causing waiting processes to be scheduled
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

5 years agokernel/kbd: Add debug output to see what's going on in kbd_main()
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()

5 years agokernel/core: Make mailbox_get() return -EINTR if the call to sem_wait() failed
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

5 years agoklibc/sem: Make sem_wait() return -EINTR if interrupted due to a signal
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

5 years agokernel/kbd: Make the interrupt handler print something
Matthias Kruk [Fri, 27 Mar 2020 03:07:19 +0000 (12:07 +0900)]
kernel/kbd: Make the interrupt handler print something

5 years agokernel/core: Make init process wait() indefinitely, for now
Matthias Kruk [Fri, 27 Mar 2020 03:04:34 +0000 (12:04 +0900)]
kernel/core: Make init process wait() indefinitely, for now

5 years agosched/lazy: Make sure _lazy_tick() doesn't break if ctask is NULL, which happens...
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

5 years agokernel/arch: Fix task_lock() and task_unlock() functions
Matthias Kruk [Sat, 21 Mar 2020 17:12:25 +0000 (02:12 +0900)]
kernel/arch: Fix task_lock() and task_unlock() functions

5 years agocore/process: Use new scheduler calls, fix compiler warnings
Matthias Kruk [Sat, 21 Mar 2020 09:15:42 +0000 (18:15 +0900)]
core/process: Use new scheduler calls, fix compiler warnings

5 years agokernel/core: Include <sys/wait.h> from main.c
Matthias Kruk [Sat, 21 Mar 2020 09:13:40 +0000 (18:13 +0900)]
kernel/core: Include <sys/wait.h> from main.c

5 years agocore/posixcall: Use sched_sleep() to suspend running task, instead of process_wait...
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

5 years agokernel/include: Remove prototypes for old scheduler functions
Matthias Kruk [Sat, 21 Mar 2020 09:11:07 +0000 (18:11 +0900)]
kernel/include: Remove prototypes for old scheduler functions

5 years agoinclude/sys: Add sys/wait.h header
Matthias Kruk [Sat, 21 Mar 2020 09:09:50 +0000 (18:09 +0900)]
include/sys: Add sys/wait.h header

5 years agokernel/vga: Remove unused variable
Matthias Kruk [Sat, 21 Mar 2020 09:08:35 +0000 (18:08 +0900)]
kernel/vga: Remove unused variable

5 years agokernel/core: Use IPC mailboxes in process and cxipc implementation
Matthias Kruk [Sat, 14 Mar 2020 09:03:39 +0000 (18:03 +0900)]
kernel/core: Use IPC mailboxes in process and cxipc implementation

5 years agokernel/core: Finish IPC mailbox implementation
Matthias Kruk [Fri, 13 Mar 2020 18:14:05 +0000 (03:14 +0900)]
kernel/core: Finish IPC mailbox implementation

5 years agokernel/core: Add -nostdinc -fno-builtin -fno-builtin-memcpy to Makefile
Matthias Kruk [Fri, 13 Mar 2020 18:11:03 +0000 (03:11 +0900)]
kernel/core: Add -nostdinc -fno-builtin -fno-builtin-memcpy to Makefile

5 years agoAdd header with documentation for IPC mailboxes, along with a half-baked implementation
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

5 years agoAdd sizeof_a() convenience macro for determining the number of elements in a static...
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

5 years agokernel/klibc: Add FCFS-semaphore implementation
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

5 years agoklibc/sem: Add sem_peek() method and documentation for all semaphore functions
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

5 years agokernel/core: Exclude sched.c from compilation
Matthias Kruk [Mon, 10 Feb 2020 10:50:29 +0000 (19:50 +0900)]
kernel/core: Exclude sched.c from compilation

5 years agosched/common: Define __SCHED_COMMON in common.c so that scheduler-global variables...
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

5 years agokernel/core: Initialize the scheduler at boot time
Matthias Kruk [Mon, 10 Feb 2020 10:47:05 +0000 (19:47 +0900)]
kernel/core: Initialize the scheduler at boot time

5 years agoarch/interrupt: Remove declaration of sched_wait() and include <sched.h> instead
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

5 years agoMerge branch 'sched-next' of ssh://corax.cc:2975/home/mk/devel/corax into sched-next
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

5 years agoklibc/sem: Add semaphore implementation mutex
Matthias Kruk [Sat, 8 Feb 2020 15:45:07 +0000 (00:45 +0900)]
klibc/sem: Add semaphore implementation

5 years agoerrno: Add definition for EOVERFLOW
Matthias Kruk [Sat, 8 Feb 2020 15:42:54 +0000 (00:42 +0900)]
errno: Add definition for EOVERFLOW

5 years agoklibc/mutex: Reduce the amount of code executed in mutex_trylock() while the spinlock...
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

5 years agoklibc/mutex: Move mutex definition to mutex.h and remove unused includes
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

5 years agoklibc/mutex: Avoid priority inversion in the mutex implementation
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.

5 years agoChange pid_t to be a signed integer, in accordance with IEEE Std 1003.1-2004
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

5 years agoMake sure klibc is the last element in OBJECTS
Matthias Kruk [Tue, 4 Feb 2020 11:31:53 +0000 (20:31 +0900)]
Make sure klibc is the last element in OBJECTS

5 years agoFix compiler errors and warnings in lazy scheduler
Matthias Kruk [Tue, 4 Feb 2020 11:21:01 +0000 (20:21 +0900)]
Fix compiler errors and warnings in lazy scheduler

5 years agoAdd EINTR to <corax/errno.h>
Matthias Kruk [Tue, 4 Feb 2020 11:20:10 +0000 (20:20 +0900)]
Add EINTR to <corax/errno.h>

5 years agoAdd "lazy" scheduler implementation
Matthias Kruk [Mon, 3 Feb 2020 22:34:13 +0000 (07:34 +0900)]
Add "lazy" scheduler implementation

5 years agoAdd simple kernel queue implementation to klibc
Matthias Kruk [Mon, 3 Feb 2020 22:31:16 +0000 (07:31 +0900)]
Add simple kernel queue implementation to klibc

5 years agoMove CPU_ID macro to kernel/include/arch.h
Matthias Kruk [Mon, 3 Feb 2020 22:26:28 +0000 (07:26 +0900)]
Move CPU_ID macro to kernel/include/arch.h

5 years agoAdd generic scheduler interface, to be implemented by all schedulers
Matthias Kruk [Sat, 1 Feb 2020 06:47:15 +0000 (15:47 +0900)]
Add generic scheduler interface, to be implemented by all schedulers

5 years agoClean up message handling in the stdio daemon by moving it into a separate function
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

5 years agoInitialize the heap when starting the net daemon
Matthias Kruk [Fri, 31 Jan 2020 11:31:20 +0000 (20:31 +0900)]
Initialize the heap when starting the net daemon

5 years agoRemove some unused code from main.c
Matthias Kruk [Fri, 31 Jan 2020 11:30:45 +0000 (20:30 +0900)]
Remove some unused code from main.c

5 years agoImplement several of the syscalls of the socket interface
Matthias Kruk [Fri, 31 Jan 2020 11:29:32 +0000 (20:29 +0900)]
Implement several of the syscalls of the socket interface

5 years agoAdd some more refined definitions for ipc messages to corax/ipc.h (but don't use...
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)

5 years agoCorrectly check the return value of cxrecv() in vga daemon, print a message during...
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

5 years agoAdd strlen() function to userspace libc
Matthias Kruk [Fri, 31 Jan 2020 11:24:53 +0000 (20:24 +0900)]
Add strlen() function to userspace libc

5 years agoAdd fork and execfve syscall stubs 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

5 years agoAdd functions to raise sleeping processes and tasks
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()

5 years agoFix some minor problems in the process implementation
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

5 years agoDeliver signals to processes by storing pending signals and accompanying
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()

5 years agoAdd definitions for SA_* flags to signal.h
Matthias Kruk [Sun, 19 Jan 2020 09:08:58 +0000 (18:08 +0900)]
Add definitions for SA_* flags to signal.h

5 years agoDeliver keyboard interrupts to keyboard driver
Matthias Kruk [Sat, 18 Jan 2020 08:30:42 +0000 (17:30 +0900)]
Deliver keyboard interrupts to keyboard driver

5 years agoClean up kernel/include/arch.h a little and add IRQ() macro
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

5 years agoChange return type of _process_hwint_deliver() so that the caller can find out whethe...
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

5 years agoUse parentheses in the definition of sigset_t's val member, otherwise it will be...
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

5 years agoImplement mechanism to deliver hardware interrupts to userspace processes by
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.

5 years agoExtend task_signal_deliver() function to allow passing of a siginfo_t to the signal...
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

5 years agoMove several definitions from kernel/arch/defs.h to kernel/include/arch.h to make...
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)

5 years agoProvide a dummy errno.h
Matthias Kruk [Tue, 14 Jan 2020 11:44:16 +0000 (20:44 +0900)]
Provide a dummy errno.h

5 years agoProvide a dummy printf() function in klibc
Matthias Kruk [Tue, 14 Jan 2020 11:37:18 +0000 (20:37 +0900)]
Provide a dummy printf() function in klibc

5 years agoImplement functions for manipulating sigset_t types 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()

5 years agoAdd prototypes for functions manipulating sigset_t types
Matthias Kruk [Tue, 14 Jan 2020 11:27:07 +0000 (20:27 +0900)]
Add prototypes for functions manipulating sigset_t types

5 years agoAdd assembly stub for sigaction syscall to klibc
Matthias Kruk [Tue, 14 Jan 2020 10:56:13 +0000 (19:56 +0900)]
Add assembly stub for sigaction syscall to klibc

5 years agoAdd definition for SYS_SIGACTION
Matthias Kruk [Tue, 14 Jan 2020 10:55:13 +0000 (19:55 +0900)]
Add definition for SYS_SIGACTION

5 years agoCorrect/amend signal.h
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()

5 years agoAdd remark about signal handling in user-mode
Matthias Kruk [Sun, 5 Jan 2020 11:28:07 +0000 (20:28 +0900)]
Add remark about signal handling in user-mode

5 years agoAlso deliver a signal to a process causing a page fault
Matthias Kruk [Sun, 5 Jan 2020 11:13:12 +0000 (20:13 +0900)]
Also deliver a signal to a process causing a page fault

5 years agosys_debug: Make sure strings are properly NUL-terminated before passing them to dbg_p...
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()

5 years agoAdd prototype for debug() syscall
Matthias Kruk [Sun, 5 Jan 2020 07:56:47 +0000 (16:56 +0900)]
Add prototype for debug() syscall

5 years agoAdd SIGMAX definition to signal.h
Matthias Kruk [Sun, 5 Jan 2020 07:56:12 +0000 (16:56 +0900)]
Add SIGMAX definition to signal.h

5 years agoDeliver a POSIX signal to a process that has caused an exception
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

5 years agoImplement _task_sig_stub assembly function for tasks executing signal handlers on...
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