]>
git.corax.cc Git - corax/log
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
Matthias Kruk [Wed, 18 Dec 2019 06:57:42 +0000 (15:57 +0900)]
Fix order in that objects in the kernel code are linked
Matthias Kruk [Wed, 18 Dec 2019 06:57:01 +0000 (15:57 +0900)]
Fix function names and prototypes for klibc's heap implementation
Matthias Kruk [Wed, 18 Dec 2019 06:38:18 +0000 (15:38 +0900)]
Add heap implementation for use in drivers and system services
Matthias Kruk [Mon, 16 Dec 2019 14:13:16 +0000 (23:13 +0900)]
Make the sbrk() syscall behave as specified in brk(2) with regards to the return value
Matthias Kruk [Thu, 12 Dec 2019 09:33:11 +0000 (18:33 +0900)]
Smaller fixes to the paging code:
- Make pg_dir_sbrk() return the address where the heap would start, if there is no heap
- Don't map any segments but the kernel BSS and TEXT segments into process page directories
Matthias Kruk [Tue, 10 Dec 2019 08:46:37 +0000 (17:46 +0900)]
Print the affected page directory and page table entries, when a page fault occurs; make sure PAGE_ATTR_WRITABLE is set on the page table, if it contains writable pages
Matthias Kruk [Mon, 2 Dec 2019 10:09:21 +0000 (19:09 +0900)]
Move _kernel_cr3 back into the .bss segment since we can't get around mapping that into the process page directories anyway
Matthias Kruk [Mon, 2 Dec 2019 09:37:16 +0000 (18:37 +0900)]
Switch back to the user page directory after having modified the _cpu structure, so it can be removed from the process's page directory
Matthias Kruk [Mon, 2 Dec 2019 09:27:06 +0000 (18:27 +0900)]
Remove unused reference to _kernel_cr3 from arch/init.S
Matthias Kruk [Mon, 2 Dec 2019 09:26:31 +0000 (18:26 +0900)]
Move _kernel_cr3 symbol to .text segment
Matthias Kruk [Mon, 2 Dec 2019 08:12:40 +0000 (17:12 +0900)]
Implement sbrk() POSIX syscall
- Implement sys_sbrk() syscall handler
- Add brk() and sbrk() syscall stubs to klibc
- Add prototypes for brk() and sbrk() to unistd.h
Matthias Kruk [Mon, 2 Dec 2019 08:09:00 +0000 (17:09 +0900)]
Implement page-directory-level functions to handle heaps
- Add pg_dir_sbrk() function to handle heap allocation and size adjustments
- Add pg_dir_get_heap() function to locate the base of the heap
- Add documentation for pg_dir_map() function
Matthias Kruk [Mon, 2 Dec 2019 08:05:33 +0000 (17:05 +0900)]
Add ssize_t type to sys/types.h
Matthias Kruk [Fri, 29 Nov 2019 05:10:04 +0000 (14:10 +0900)]
Include corax/types.h from corax/ipc.h
Matthias Kruk [Wed, 27 Nov 2019 06:27:21 +0000 (15:27 +0900)]
Implement message handling in stdio process
Matthias Kruk [Wed, 27 Nov 2019 06:25:03 +0000 (15:25 +0900)]
Add stddef.h header with offsetof() macro
Matthias Kruk [Tue, 26 Nov 2019 09:52:49 +0000 (18:52 +0900)]
Remove unused local variable from _clone_kernel_region()
Matthias Kruk [Mon, 25 Nov 2019 07:23:15 +0000 (16:23 +0900)]
Add a fixed-length wait queue to mutexes, to speed up locking and unlocking operations; make use of sched_task_suspend() and sched_task_resume() in mutex implementation
Matthias Kruk [Mon, 25 Nov 2019 07:20:32 +0000 (16:20 +0900)]
Add sched_task_resume() function
Matthias Kruk [Mon, 25 Nov 2019 07:19:57 +0000 (16:19 +0900)]
Add definition of EBUSY to corax/errno.h
Matthias Kruk [Mon, 25 Nov 2019 07:11:04 +0000 (16:11 +0900)]
Make sched.h visible to all parts of the kernel
Matthias Kruk [Mon, 25 Nov 2019 06:22:45 +0000 (15:22 +0900)]
Suspend the executing task, if the caller of sched_task_suspend() is attempting to suspend itself
Matthias Kruk [Mon, 25 Nov 2019 06:09:31 +0000 (15:09 +0900)]
Add missing implementation of process_suspend()
Matthias Kruk [Mon, 25 Nov 2019 06:08:43 +0000 (15:08 +0900)]
Implement sched_task_suspend() function
Matthias Kruk [Mon, 25 Nov 2019 05:44:12 +0000 (14:44 +0900)]
Lock the process in process_task_foreach()
Matthias Kruk [Mon, 25 Nov 2019 05:43:17 +0000 (14:43 +0900)]
Protect processes with a spinlock
Matthias Kruk [Mon, 25 Nov 2019 05:39:53 +0000 (14:39 +0900)]
Add process_task_foreach() function
Matthias Kruk [Mon, 25 Nov 2019 05:36:15 +0000 (14:36 +0900)]
Protect tasks with a spinlock
Matthias Kruk [Mon, 25 Nov 2019 05:16:19 +0000 (14:16 +0900)]
Exclude networking code from compilation for now
Matthias Kruk [Mon, 25 Nov 2019 05:08:51 +0000 (14:08 +0900)]
Remove fds from processes in the kernel
Matthias Kruk [Mon, 25 Nov 2019 05:06:12 +0000 (14:06 +0900)]
Use a static-size array to keep track of the tasks in a process for now
Matthias Kruk [Mon, 25 Nov 2019 05:00:42 +0000 (14:00 +0900)]
Add definition of EBADFD to corax/errno.h
Matthias Kruk [Sat, 23 Nov 2019 06:45:24 +0000 (15:45 +0900)]
Make use of fork() and execfve() to spawn STDIO and NET daemons
Matthias Kruk [Sat, 23 Nov 2019 06:43:48 +0000 (15:43 +0900)]
Move cxsend(), cxrecv(), cxsendrecv() syscalls from core into klibc
Matthias Kruk [Sat, 23 Nov 2019 06:37:49 +0000 (15:37 +0900)]
Move fork() and execfve() syscalls from core to klibc
Matthias Kruk [Sat, 23 Nov 2019 06:32:04 +0000 (15:32 +0900)]
Add spinlock implementation (should have been in commit
aa0e4586dd3efe434b34ae7956a4c27220cb798d )
Matthias Kruk [Sat, 23 Nov 2019 06:30:35 +0000 (15:30 +0900)]
Add execfve() syscall
Matthias Kruk [Thu, 21 Nov 2019 08:33:28 +0000 (17:33 +0900)]
Add mutex implementation to klibc
Matthias Kruk [Thu, 21 Nov 2019 07:22:16 +0000 (16:22 +0900)]
Add spinlock implementation to klibc
Matthias Kruk [Tue, 19 Nov 2019 06:55:01 +0000 (15:55 +0900)]
Use standard C functions from klibc within the kernel
Matthias Kruk [Tue, 19 Nov 2019 06:45:26 +0000 (15:45 +0900)]
Add memset() function to klibc
Matthias Kruk [Tue, 19 Nov 2019 06:42:26 +0000 (15:42 +0900)]
Add standard C library for use inside the kernel
Matthias Kruk [Mon, 18 Nov 2019 11:37:24 +0000 (20:37 +0900)]
Add CONFIG_DEBUG_HEAP definition to config.h
Matthias Kruk [Mon, 18 Nov 2019 11:36:57 +0000 (20:36 +0900)]
Add unistd.h header
Matthias Kruk [Mon, 18 Nov 2019 11:36:27 +0000 (20:36 +0900)]
Add SYS_SLEEP and SYS_EXECFVE definitions to corax/syscall.h
Matthias Kruk [Mon, 18 Nov 2019 11:29:26 +0000 (20:29 +0900)]
Skip kernel regions in _fork_region() and _vfork_region()
Matthias Kruk [Mon, 18 Nov 2019 11:28:40 +0000 (20:28 +0900)]
Add kernel regions correctly in pg_dir_map_region(), use pg_dir_map_region() in _clone_kernel_region() function
Matthias Kruk [Mon, 18 Nov 2019 09:02:55 +0000 (18:02 +0900)]
Directly map read-only regions instead of copying them, when forking a process
Matthias Kruk [Mon, 18 Nov 2019 08:56:38 +0000 (17:56 +0900)]
Make use of pg_dir_foreach_region() function in process_create() function to clone or map memory regions of the parent process, where necessary
Matthias Kruk [Mon, 18 Nov 2019 08:55:30 +0000 (17:55 +0900)]
Add pg_dir_clone_region() method for copying a region from one page directory into another one
Matthias Kruk [Mon, 18 Nov 2019 08:25:01 +0000 (17:25 +0900)]
Make several amendments to the paging code to facilitate process memory management:
- Move definition of struct region to kernel-wide arch.h header
- Make page directories refer to their regions through a pointer array rather than a linked list
- Add pg_dir_foreach_region() function for iterating over the mappings in a page directory
- Add pg_dir_map_region() function for mapping a region from one page directory into another
- Add a reference counter to each region
- Add flags to regions so they can be marked as private, shared, or kernel-related
Matthias Kruk [Mon, 18 Nov 2019 08:23:51 +0000 (17:23 +0900)]
Add some paging and permission-related configuration options
Matthias Kruk [Mon, 18 Nov 2019 07:57:15 +0000 (16:57 +0900)]
Add definition of ERANGE
Matthias Kruk [Thu, 14 Nov 2019 07:46:53 +0000 (16:46 +0900)]
Add task_move_stack() function, which moves the current stack and updates ESP and EBP
Matthias Kruk [Wed, 13 Nov 2019 07:35:01 +0000 (16:35 +0900)]
Add some methods for process_t types:
- process_set_pagedir() / process_get_pagedir() - Convenience functions to access the process's pagedir
- process_setuid() - Set the process's user id
- process_setgid() - Set the process's group id
Matthias Kruk [Wed, 13 Nov 2019 07:34:40 +0000 (16:34 +0900)]
Add definitions for EPERM and EACCES
Matthias Kruk [Tue, 12 Nov 2019 09:06:54 +0000 (18:06 +0900)]
Start implementation of facilities to support userspace processes
- Add crxstd.h header with prototypes for Corax-specific syscalls
- Add dummy NET process
- Add dummy STDIO process
- Start NET and STDIO processes from process daemon
Matthias Kruk [Tue, 12 Nov 2019 07:31:34 +0000 (16:31 +0900)]
Make kernel spawn the idle and init processes in main.c, perform any other testing in the init process, once it's working
Matthias Kruk [Wed, 6 Nov 2019 06:51:42 +0000 (15:51 +0900)]
Implement process ownership and inheritance
Matthias Kruk [Wed, 6 Nov 2019 06:38:47 +0000 (15:38 +0900)]
Add dummy process_suspend() function
Matthias Kruk [Wed, 6 Nov 2019 06:13:55 +0000 (15:13 +0900)]
Implement some basic handling of POSIX signals
Matthias Kruk [Wed, 6 Nov 2019 06:12:37 +0000 (15:12 +0900)]
Add prototype of _pg_dir_vpxlate() to arch.h
Matthias Kruk [Wed, 6 Nov 2019 06:12:09 +0000 (15:12 +0900)]
Add signal.h header
Matthias Kruk [Tue, 5 Nov 2019 07:20:36 +0000 (16:20 +0900)]
Add prototype for _pg_dir_vpxlate() to arch/paging.h
Matthias Kruk [Mon, 4 Nov 2019 09:28:55 +0000 (18:28 +0900)]
Add uid_t and gid_t types, and definitions for UID_ROOT and GID_ROOT
Matthias Kruk [Mon, 4 Nov 2019 08:35:24 +0000 (17:35 +0900)]
Implement process_detach() method, to create a new session for a process, i.e. detach it from its parent
Matthias Kruk [Mon, 4 Nov 2019 02:06:34 +0000 (11:06 +0900)]
Modify process_create() function to finalize sys_fork() implementation:
- Copy the contents of the user-mode stack
- Call task_prepare_fork to copy/modify the new task's kernel-mode stack
- Set the state of the new task to TASK_STATE_FORKED
- Set t_pgdir and other values that would normally be set by task_prepare
Matthias Kruk [Mon, 4 Nov 2019 02:03:50 +0000 (11:03 +0900)]
Allow forked processes to be enqueued using sched_enqueue()
Matthias Kruk [Mon, 4 Nov 2019 02:03:15 +0000 (11:03 +0900)]
Add task_prepare_fork method and modify task_switch to facilitate the implementation of sys_fork()
Matthias Kruk [Mon, 4 Nov 2019 02:01:45 +0000 (11:01 +0900)]
Change the signature of sys_posixcall() so it can modify the caller's stackframe in the case of sys_fork()
Matthias Kruk [Mon, 4 Nov 2019 01:46:32 +0000 (10:46 +0900)]
Move definition of struct stack_frame to arch.h
Matthias Kruk [Wed, 30 Oct 2019 08:14:20 +0000 (17:14 +0900)]
Add implementation of process_fork(), modify process_create() so that it can be used to fork a running process
Matthias Kruk [Wed, 30 Oct 2019 08:08:18 +0000 (17:08 +0900)]
Call process_fork() from sys_fork() and sys_vfork()
Matthias Kruk [Tue, 29 Oct 2019 05:11:41 +0000 (14:11 +0900)]
Call process_exit() from sys_exit()
Matthias Kruk [Tue, 29 Oct 2019 05:09:56 +0000 (14:09 +0900)]
Add process_exit() function
Matthias Kruk [Tue, 29 Oct 2019 05:07:20 +0000 (14:07 +0900)]
Minor improvements to the scheduler:
- Make _unq() return an error if it didn't succeed
- Add sched_dequeue() function
- Modify sched_tick() not to put tasks with TASK_STATE_EXIT back onto the ready queue
- Add a header with prototypes for the functions implemented in sched.c