]>
git.corax.cc Git - corax/log
Matthias Kruk [Wed, 30 Dec 2020 02:33:06 +0000 (11:33 +0900)]
kernel/arch: Add vm_* functions for low-level page table handling
To improve portability and separate the software and hardware sides
of paging more cleanly, move the low-level page table handling into
a separate file.
Matthias Kruk [Wed, 30 Dec 2020 02:16:03 +0000 (11:16 +0900)]
kernel/arch: Add functions for enabling and disabling paging
The new paging implementation needs to access paging structures in
physical memory, making it necessary to temporarily disable paging.
This commit adds the necessary functions to explicitly disable and
enable paging on a processor.
Matthias Kruk [Wed, 30 Dec 2020 02:08:45 +0000 (11:08 +0900)]
Remove unused source file cpu.S
The source file cpu.S is currently not included in the compilation
and does not contain necessary code. This commit removes the file.
Matthias Kruk [Wed, 30 Dec 2020 01:57:58 +0000 (10:57 +0900)]
Implement new frame map for 64bit physical address spaces
The current frame map implementation does not support physical
address spaces larger than 32 bits, which is necessary for PAE
support. This commit adds a new frame map that can be used with
64 bit address spaces.
Matthias Kruk [Thu, 5 Nov 2020 04:07:11 +0000 (13:07 +0900)]
kernel/arch: Decide whether or not to use PAE based on CPU support
Make the paging code decide whether to use PAE or not based on whether
the executing CPU supports PAE, not the amount of available memory.
Matthias Kruk [Thu, 5 Nov 2020 04:03:36 +0000 (13:03 +0900)]
kernel/arch: Clean up cpu_get_capabilities() implementation
Reverse the order of the dwords returned so that the most important
features are in the lower dword and add macros that can be used to
test for feature support on the executing processor.
Matthias Kruk [Mon, 10 Aug 2020 06:57:48 +0000 (15:57 +0900)]
libc: Add cx_array dynamic array type
Matthias Kruk [Mon, 10 Aug 2020 04:50:14 +0000 (13:50 +0900)]
include: Include sys/types.h from stdlib.h
Matthias Kruk [Sun, 9 Aug 2020 07:23:27 +0000 (16:23 +0900)]
libc: Add simple mmap() based heap implementation
Matthias Kruk [Sat, 8 Aug 2020 10:27:27 +0000 (19:27 +0900)]
libc: Add cx_spinlock_t type
Matthias Kruk [Sat, 1 Aug 2020 06:08:47 +0000 (15:08 +0900)]
sys/test: Add userspace process for libc testing
Matthias Kruk [Sat, 1 Aug 2020 06:06:24 +0000 (15:06 +0900)]
libc: Include unistd.c in the compilation
Matthias Kruk [Sat, 8 Aug 2020 09:13:16 +0000 (18:13 +0900)]
Merge branch 'io' into unstable
Matthias Kruk [Sat, 8 Aug 2020 08:49:36 +0000 (17:49 +0900)]
kernel/core: Remove unused code that was left over from the attempt to implement the network stack in the kernel
Matthias Kruk [Sat, 8 Aug 2020 08:32:55 +0000 (17:32 +0900)]
kernel/klibc: Remove unused kheap type
Matthias Kruk [Sat, 8 Aug 2020 08:31:40 +0000 (17:31 +0900)]
libc: Remove brk() and sbrk() syscalls
Matthias Kruk [Sat, 8 Aug 2020 08:30:42 +0000 (17:30 +0900)]
kernel: Remove brk() and sbrk() syscalls and related functions
Matthias Kruk [Sat, 8 Aug 2020 08:07:26 +0000 (17:07 +0900)]
kernel/arch: Add missing manpage-style comments to paging functions
Matthias Kruk [Sun, 2 Aug 2020 05:41:18 +0000 (14:41 +0900)]
kernel/arch: Rename _pg_dir_memset() to _pg_dir_memset_page()
Matthias Kruk [Sat, 1 Aug 2020 17:06:35 +0000 (02:06 +0900)]
kernel/arch: Split _pg_dir_debug_arch() into three functions, add documentation for pg_dir_memcpy()
Matthias Kruk [Sat, 1 Aug 2020 15:59:37 +0000 (00:59 +0900)]
Merge branch 'mm-cleanup' of ssh://corax.cc:2975/home/mk/devel/corax into mm-cleanup
Matthias Kruk [Sat, 1 Aug 2020 15:59:20 +0000 (00:59 +0900)]
kernel/arch: Reformat text flow of documentation
Matthias Kruk [Sat, 1 Aug 2020 13:37:22 +0000 (22:37 +0900)]
kernel/arch: Add documentation for several paging functions
Matthias Kruk [Sat, 1 Aug 2020 09:21:27 +0000 (18:21 +0900)]
kernel/arch: Split pg_init() function into smaller, more comprehensible functions
- Split the pg_init() function into several functions
- the _identity_map() function, for creating the identity map
- the _pae_identity_map() function, for the actual work on PAE systems
- the _legacy_identity_map() function, for the actual work on non-PAE systems
- the _clear_available_frames() function, to clear usable frames from the frame map
- Add comments explaining all of the new functions
- Expand existing comments where necessary
Matthias Kruk [Sat, 1 Aug 2020 07:36:18 +0000 (16:36 +0900)]
kernel/arch: Move computation of the end of usable memory into a separate function, add documentation
* Move computation of the end of usable memory from pg_init() into _get_memory_end
* Add documentation to the following functions
- _pg_dir_debug_regions()
- _pg_dir_debug_arch()
- _get_memory_end()
- pg_init()
Matthias Kruk [Sat, 1 Aug 2020 07:35:03 +0000 (16:35 +0900)]
kernel/include: Make sure gcc does not add alignment to multiboot structures
Matthias Kruk [Fri, 31 Jul 2020 19:52:59 +0000 (04:52 +0900)]
kernel/arch: Add comments describing how the _phys_alloc(), pg_frame_alloc_start(), pg_frame_alloc_end(), pg_frame_free() functions work
Matthias Kruk [Fri, 31 Jul 2020 17:06:45 +0000 (02:06 +0900)]
kernel/arch: Add page_attrs_t type for page attributes
Matthias Kruk [Fri, 31 Jul 2020 16:22:32 +0000 (01:22 +0900)]
kernel/arch: Add region_type_t and region_opts_t types to describe the type and options of memory regions
Matthias Kruk [Wed, 29 Jul 2020 11:09:00 +0000 (20:09 +0900)]
Merge remote-tracking branch 'origin/userstack' into io
Matthias Kruk [Wed, 29 Jul 2020 00:54:42 +0000 (09:54 +0900)]
kernel: Grow the userspace stack if an application runs out of stack space
Matthias Kruk [Tue, 28 Jul 2020 13:24:20 +0000 (22:24 +0900)]
include: Add some file descriptor flags to include/fcntl.h
Matthias Kruk [Tue, 28 Jul 2020 13:23:46 +0000 (22:23 +0900)]
sys: Include IO process in initfs compilation
Matthias Kruk [Tue, 28 Jul 2020 13:22:15 +0000 (22:22 +0900)]
libc: Add pipe() function for use in userspace processes
Matthias Kruk [Tue, 28 Jul 2020 13:19:33 +0000 (22:19 +0900)]
sys/io: Add dummy IO process
Matthias Kruk [Tue, 28 Jul 2020 13:13:50 +0000 (22:13 +0900)]
include/corax: Add IPC message definitions for IO process
Matthias Kruk [Tue, 28 Jul 2020 13:12:26 +0000 (22:12 +0900)]
include/corax: Add PID_IO to ipc.h and simplify struct cxmsg definition
Matthias Kruk [Sun, 26 Jul 2020 08:12:19 +0000 (17:12 +0900)]
libc, kernel/klibc: Fix bug in snprintf() that would cause the wrong string length to be compied for %s formats under certain circumstances
Matthias Kruk [Sun, 26 Jul 2020 08:09:52 +0000 (17:09 +0900)]
libc, kernel/klibc: Fix bug in memcpy() where quantities less than 4 byte wouldn't be copied correctly (replacing the implementation with an assembly one)
Matthias Kruk [Sun, 26 Jul 2020 04:16:46 +0000 (13:16 +0900)]
libc: Add _exit syscall stub
Matthias Kruk [Sun, 26 Jul 2020 04:15:38 +0000 (13:15 +0900)]
include: Add global errno variable to errno.h
Matthias Kruk [Sun, 26 Jul 2020 04:13:47 +0000 (13:13 +0900)]
include/corax: Add definition for ECONNREFUSED
Matthias Kruk [Sun, 17 May 2020 05:45:08 +0000 (14:45 +0900)]
libc: Add implementation for _exit(), add vfork() dummy implementation
Matthias Kruk [Fri, 8 May 2020 14:19:56 +0000 (23:19 +0900)]
kernel/core: Fix some compiler warnings
Matthias Kruk [Wed, 6 May 2020 07:00:29 +0000 (16:00 +0900)]
kernel/core: Clean up the init process
Matthias Kruk [Wed, 6 May 2020 06:50:34 +0000 (15:50 +0900)]
kernel/core: Assign pids starting with 0
Matthias Kruk [Wed, 6 May 2020 06:50:03 +0000 (15:50 +0900)]
kernel/core: Clean up and remove unused code in main.c
Matthias Kruk [Wed, 6 May 2020 06:42:22 +0000 (15:42 +0900)]
kernel/core: Remove pid argument from process_create()
Matthias Kruk [Wed, 6 May 2020 04:34:56 +0000 (13:34 +0900)]
kernel: Remove kbd and vga processes from kernel tree
Matthias Kruk [Wed, 6 May 2020 04:00:45 +0000 (13:00 +0900)]
Add VGA system process
Matthias Kruk [Wed, 6 May 2020 03:59:40 +0000 (12:59 +0900)]
libc: Call _exit() after returning from main()
Matthias Kruk [Wed, 6 May 2020 03:17:35 +0000 (12:17 +0900)]
libc: Clean up syscall assembly stubs
Matthias Kruk [Wed, 6 May 2020 03:16:03 +0000 (12:16 +0900)]
libc: Rename assembly stub for SYS_EXIT from exit to _exit
Matthias Kruk [Tue, 5 May 2020 17:26:06 +0000 (02:26 +0900)]
sys/kbd: Remove unused variable
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
Matthias Kruk [Tue, 5 May 2020 17:23:39 +0000 (02:23 +0900)]
kernel/core: Finish execeve() implementation
Matthias Kruk [Tue, 5 May 2020 17:21:37 +0000 (02:21 +0900)]
libc: Add snprintf() implementation
Matthias Kruk [Tue, 5 May 2020 17:20:33 +0000 (02:20 +0900)]
libc: Add memcpy() implementation, fix bug in memset()
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()
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
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
Matthias Kruk [Mon, 4 May 2020 09:30:08 +0000 (18:30 +0900)]
include: Add missing prototype for execeve() to unistd.h
Matthias Kruk [Mon, 4 May 2020 08:53:31 +0000 (17:53 +0900)]
Add a simple kbd binary to the initfs for testing purposes
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
Matthias Kruk [Mon, 4 May 2020 08:49:16 +0000 (17:49 +0900)]
kernel/core: Add missing parameter in call to dbg_printf()
Matthias Kruk [Mon, 4 May 2020 08:30:09 +0000 (17:30 +0900)]
Merge branch 'libc' into elf-loader
Matthias Kruk [Mon, 4 May 2020 08:29:50 +0000 (17:29 +0900)]
Merge branch 'initfs' into elf-loader
Matthias Kruk [Mon, 4 May 2020 08:28:53 +0000 (17:28 +0900)]
kernel/core: Implement sys_execeve() syscall handler
Matthias Kruk [Mon, 4 May 2020 08:27:43 +0000 (17:27 +0900)]
kernel/core: Add simple ELF file 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
Matthias Kruk [Sun, 3 May 2020 17:22:24 +0000 (02:22 +0900)]
kernel: Add execeve syscall for execution of ELF files
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 05:36:09 +0000 (14:36 +0900)]
corax/sys: Add initfs infrastructure
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