]>
git.corax.cc Git - corax/log
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
Matthias Kruk [Tue, 29 Oct 2019 05:06:21 +0000 (14:06 +0900)]
Add TASK_STATE_EXIT state to identify tasks that are exitting
Matthias Kruk [Mon, 28 Oct 2019 09:35:32 +0000 (18:35 +0900)]
Add an argument to process_create() so the caller may request the process to be created with a specific pid
Matthias Kruk [Mon, 28 Oct 2019 09:33:46 +0000 (18:33 +0900)]
Add syscall stubs for some POSIX process management syscalls (fork, vfork, exit, ...)
Matthias Kruk [Sun, 27 Oct 2019 16:20:19 +0000 (01:20 +0900)]
Temporarily add assembly stubs for syscalls, to avoid having to link against the C library
Matthias Kruk [Sun, 27 Oct 2019 16:18:53 +0000 (01:18 +0900)]
Add some IPC testing code to main.c
Matthias Kruk [Sun, 27 Oct 2019 15:58:17 +0000 (00:58 +0900)]
Make debug output in IPC code depend on CONFIG_DEBUG_IPC
Matthias Kruk [Sun, 27 Oct 2019 15:53:51 +0000 (00:53 +0900)]
Signal the receiving process in process_inbox_put()
Matthias Kruk [Sun, 27 Oct 2019 15:52:27 +0000 (00:52 +0900)]
Print the address and pid of the executing context when an exception occurs
Matthias Kruk [Sat, 26 Oct 2019 07:24:58 +0000 (16:24 +0900)]
Implement various IPC and scheduling improvements:
- Implement signalling/waiting facilities for processes and tasks
- Implement primitive message passing between processes
- Implement helper functions for accesing properties of a process
- Also keep the pid within the task structure, for faster access
- Add a wait-queue to the scheduler, to keep track of waiting processes
Matthias Kruk [Sat, 26 Oct 2019 07:23:06 +0000 (16:23 +0900)]
Add CONFIG_IPC_MSGSIZE configuration option
Matthias Kruk [Sat, 26 Oct 2019 07:22:49 +0000 (16:22 +0900)]
Add definitions for ENOTSUP, EOPNOTSUPP, and ENOENT
Matthias Kruk [Sat, 26 Oct 2019 05:17:03 +0000 (14:17 +0900)]
Add typedef for pid_t
Matthias Kruk [Sat, 26 Oct 2019 05:12:54 +0000 (14:12 +0900)]
Implement process_memcpy_ptop() function for copying data directly between processes
Matthias Kruk [Fri, 25 Oct 2019 06:45:33 +0000 (15:45 +0900)]
Add mbuf type and functions to allocate and free them
Matthias Kruk [Sat, 5 Oct 2019 07:22:14 +0000 (16:22 +0900)]
Add sobind() function stub and call it from sys_bind()
Matthias Kruk [Sat, 5 Oct 2019 07:14:17 +0000 (16:14 +0900)]
Also compile libc from the top-level Makefile
Matthias Kruk [Sat, 5 Oct 2019 07:13:21 +0000 (16:13 +0900)]
Add dummy soshutdown() function and call it from sys_shutdown()
Matthias Kruk [Sat, 5 Oct 2019 07:06:45 +0000 (16:06 +0900)]
Start implementation of a statically linked standard C library:
- Add implementation of network-related syscalls
Matthias Kruk [Sat, 5 Oct 2019 06:32:37 +0000 (15:32 +0900)]
Implement sys_getsockopt() and sys_setsockopt() functions
Matthias Kruk [Sat, 5 Oct 2019 06:31:45 +0000 (15:31 +0900)]
Add (incomplete) sosetopt() and sogetopt() functions
Matthias Kruk [Sat, 5 Oct 2019 06:14:44 +0000 (15:14 +0900)]
Implement functions for copying memory between page directories
Matthias Kruk [Sat, 5 Oct 2019 06:00:07 +0000 (15:00 +0900)]
Add definition for EADDRNOTAVAIL
Matthias Kruk [Fri, 4 Oct 2019 07:06:42 +0000 (16:06 +0900)]
Add definition for SOL_SOCKET
Matthias Kruk [Fri, 4 Oct 2019 06:50:39 +0000 (15:50 +0900)]
Add definitions for various socket options
Matthias Kruk [Fri, 4 Oct 2019 06:40:10 +0000 (15:40 +0900)]
Call soclose() from sys_close()
Matthias Kruk [Fri, 4 Oct 2019 06:39:33 +0000 (15:39 +0900)]
Initialize a new socket's refcount to 1
Matthias Kruk [Fri, 4 Oct 2019 06:38:29 +0000 (15:38 +0900)]
Add soclose() and sofree() functions
Matthias Kruk [Fri, 4 Oct 2019 06:37:58 +0000 (15:37 +0900)]
Add process_flookup() and process_get_current() functions
Matthias Kruk [Thu, 3 Oct 2019 09:44:13 +0000 (18:44 +0900)]
Add a comment to task.S high-lighting a possible future problem with regards to EBX
Matthias Kruk [Thu, 3 Oct 2019 09:43:29 +0000 (18:43 +0900)]
Add a pointer to struct task that points to the process the task is a part of
Matthias Kruk [Thu, 3 Oct 2019 09:42:28 +0000 (18:42 +0900)]
Include socket.c file in compilation of kernel core
Matthias Kruk [Thu, 3 Oct 2019 09:41:38 +0000 (18:41 +0900)]
Call socreate() function from sys_socket()
Matthias Kruk [Thu, 3 Oct 2019 09:41:17 +0000 (18:41 +0900)]
Add very simplistic socreate() implementation
Matthias Kruk [Thu, 3 Oct 2019 09:39:51 +0000 (18:39 +0900)]
Add infrastructure to allocate file descriptors to processes
Matthias Kruk [Thu, 3 Oct 2019 09:38:08 +0000 (18:38 +0900)]
Add some definitions to sys/socket.h that can be used to check the validity of parameters passed to socket()
Matthias Kruk [Thu, 3 Oct 2019 09:36:44 +0000 (18:36 +0900)]
Add some error numbers needed by the socket layer:
- EAFNOSUPPORT
- EMFILE
- EBADF
- ENFILE
Matthias Kruk [Thu, 3 Oct 2019 09:36:05 +0000 (18:36 +0900)]
Add CONFIG_SOCKET_MAX configuration option to adjust the system-wide socket limit
Matthias Kruk [Wed, 2 Oct 2019 07:36:55 +0000 (16:36 +0900)]
Add definitions for syscall interrupt vectors to corax/syscall.h