]> git.corax.cc Git - corax/log
corax
6 years agoFix a bug in task_switch() that would cause the TSS update to be skipped
Matthias Kruk [Wed, 25 Sep 2019 09:57:58 +0000 (18:57 +0900)]
Fix a bug in task_switch() that would cause the TSS update to be skipped

6 years agoLeave interrupts disabled until we switch to user-space
Matthias Kruk [Wed, 25 Sep 2019 09:40:05 +0000 (18:40 +0900)]
Leave interrupts disabled until we switch to user-space

6 years agoUse KERNEL_CODE macro when initializing the IDT, instead of numerals
Matthias Kruk [Wed, 25 Sep 2019 09:24:53 +0000 (18:24 +0900)]
Use KERNEL_CODE macro when initializing the IDT, instead of numerals

6 years agoSet the limit of the TSS descriptor to TSS_SIZE + 1
Matthias Kruk [Wed, 25 Sep 2019 08:47:30 +0000 (17:47 +0900)]
Set the limit of the TSS descriptor to TSS_SIZE + 1

6 years agoUpdate the ESP0 and SS0 TSS entries when switching tasks
Matthias Kruk [Wed, 25 Sep 2019 08:07:48 +0000 (17:07 +0900)]
Update the ESP0 and SS0 TSS entries when switching tasks

6 years agoEnsure that PAGE_ATTR_USER is set and PAGE_ATTR_WRITABLE is not set on kernel code...
Matthias Kruk [Wed, 25 Sep 2019 08:07:03 +0000 (17:07 +0900)]
Ensure that PAGE_ATTR_USER is set and PAGE_ATTR_WRITABLE is not set on kernel code/data segments in user-space page directories

6 years agoImplement functions to spawn and run processes
Matthias Kruk [Tue, 24 Sep 2019 08:42:12 +0000 (17:42 +0900)]
Implement functions to spawn and run processes

6 years agoFix several paging-related issues; implement functions to get the addresses of the...
Matthias Kruk [Tue, 24 Sep 2019 08:39:34 +0000 (17:39 +0900)]
Fix several paging-related issues; implement functions to get the addresses of the kernel and user-space stack that is mapped within a page directory

6 years agoDisable interrupts while we don't have a valid stack in task_switch()
Matthias Kruk [Tue, 24 Sep 2019 08:38:26 +0000 (17:38 +0900)]
Disable interrupts while we don't have a valid stack in task_switch()

6 years agoMove the per-process kernel stack to 0xffffe000
Matthias Kruk [Tue, 24 Sep 2019 08:32:40 +0000 (17:32 +0900)]
Move the per-process kernel stack to 0xffffe000

6 years agoFix control flow in task_switch function; add userspace esp argument to task_prepare...
Matthias Kruk [Sat, 21 Sep 2019 02:31:50 +0000 (11:31 +0900)]
Fix control flow in task_switch function; add userspace esp argument to task_prepare function

6 years agoAdd code for debugging of PAE paging structures
Matthias Kruk [Fri, 20 Sep 2019 06:15:59 +0000 (15:15 +0900)]
Add code for debugging of PAE paging structures

6 years agoImplement pg_frame_free() function; add code for debugging physical page tables ...
Matthias Kruk [Fri, 20 Sep 2019 05:48:14 +0000 (14:48 +0900)]
Implement pg_frame_free() function; add code for debugging physical page tables (legacy IA-32 mode)

6 years agoMake debug messages in heap.c depend on CONFIG_DEBUG_HEAP instead of CONFIG_DEBUG...
Matthias Kruk [Fri, 20 Sep 2019 05:00:43 +0000 (14:00 +0900)]
Make debug messages in heap.c depend on CONFIG_DEBUG_HEAP instead of CONFIG_DEBUG since they cause a lot of output

6 years agoMake the hacky reboot-upon-keyboard-interrupt behavior depend on CONFIG_DEBUG
Matthias Kruk [Fri, 20 Sep 2019 04:58:23 +0000 (13:58 +0900)]
Make the hacky reboot-upon-keyboard-interrupt behavior depend on CONFIG_DEBUG

6 years agoRename pg_dir_alloc() method to pg_dir_create()
Matthias Kruk [Thu, 19 Sep 2019 11:18:51 +0000 (20:18 +0900)]
Rename pg_dir_alloc() method to pg_dir_create()

6 years agoUse the kernel stack passed to task_prepare on the stack, instead of the (invalid...
Matthias Kruk [Thu, 19 Sep 2019 10:38:42 +0000 (19:38 +0900)]
Use the kernel stack passed to task_prepare on the stack, instead of the (invalid) pointer in the task structure

6 years agoKeep a pointer to the kernel stack in struct task, instead of the entire stack
Matthias Kruk [Thu, 19 Sep 2019 10:34:19 +0000 (19:34 +0900)]
Keep a pointer to the kernel stack in struct task, instead of the entire stack

6 years agoRemove the kernel stack from the struct cpu structure, since each task will be alloca...
Matthias Kruk [Thu, 19 Sep 2019 10:05:46 +0000 (19:05 +0900)]
Remove the kernel stack from the struct cpu structure, since each task will be allocated its own kernel-mode stack; instead, the initial kernel stack will start at 0x200000 and disappear when the kernel switches into user mode

6 years agoRename struct region's reg_flags member to reg_type
Matthias Kruk [Thu, 19 Sep 2019 09:39:49 +0000 (18:39 +0900)]
Rename struct region's reg_flags member to reg_type

6 years agoDynamically allocate the region structures that are associated with page directories
Matthias Kruk [Thu, 19 Sep 2019 05:33:12 +0000 (14:33 +0900)]
Dynamically allocate the region structures that are associated with page directories

6 years agoChange the definition of PAGE_ATTR_NO_EXEC for now, since we don't support it yet...
Matthias Kruk [Thu, 19 Sep 2019 05:31:12 +0000 (14:31 +0900)]
Change the definition of PAGE_ATTR_NO_EXEC for now, since we don't support it yet anyways

6 years agoAdd symbols to identify the rodata, data, bss sections in the linker script and page...
Matthias Kruk [Thu, 19 Sep 2019 05:30:04 +0000 (14:30 +0900)]
Add symbols to identify the rodata, data, bss sections in the linker script and page-align the start of the kernel heap

6 years agoRemove h_pgdir member from kernel heap structure
Matthias Kruk [Thu, 19 Sep 2019 04:29:06 +0000 (13:29 +0900)]
Remove h_pgdir member from kernel heap structure

6 years agoAdd CONFIG_DEBUG definition to config.h
Matthias Kruk [Wed, 18 Sep 2019 07:13:57 +0000 (16:13 +0900)]
Add CONFIG_DEBUG definition to config.h

6 years agoFix a bug in heap_grow() that would cause the heap list to be bent into a loop
Matthias Kruk [Wed, 18 Sep 2019 07:13:21 +0000 (16:13 +0900)]
Fix a bug in heap_grow() that would cause the heap list to be bent into a loop

6 years agoMake _pg_dir_map_legacy() map large pages, where possible
Matthias Kruk [Tue, 17 Sep 2019 07:48:40 +0000 (16:48 +0900)]
Make _pg_dir_map_legacy() map large pages, where possible

6 years agoAdd errno.h header with some preliminary error definitions
Matthias Kruk [Tue, 17 Sep 2019 07:22:55 +0000 (16:22 +0900)]
Add errno.h header with some preliminary error definitions

6 years agoImplement methods to allocate and populate page directories
Matthias Kruk [Tue, 17 Sep 2019 07:22:03 +0000 (16:22 +0900)]
Implement methods to allocate and populate page directories

6 years agoMake kmalloc() wipe the newly allocated memory
Matthias Kruk [Tue, 17 Sep 2019 07:18:34 +0000 (16:18 +0900)]
Make kmalloc() wipe the newly allocated memory

6 years agoFix start and size of the kernel heap memory region
Matthias Kruk [Mon, 16 Sep 2019 15:15:33 +0000 (00:15 +0900)]
Fix start and size of the kernel heap memory region

6 years agoImplement growing of kernel heap
Matthias Kruk [Mon, 16 Sep 2019 14:47:51 +0000 (23:47 +0900)]
Implement growing of kernel heap

6 years agoMake page frame allocations available to other kernel functions; move ALIGNED() and...
Matthias Kruk [Mon, 16 Sep 2019 14:14:32 +0000 (23:14 +0900)]
Make page frame allocations available to other kernel functions; move ALIGNED() and ALIGN() macros to paging.h

6 years agoAdd simple kernel heap implementation
Matthias Kruk [Mon, 16 Sep 2019 08:17:12 +0000 (17:17 +0900)]
Add simple kernel heap implementation

6 years agoClean up the paging code; fix known issues with the frame set
Matthias Kruk [Mon, 16 Sep 2019 06:12:34 +0000 (15:12 +0900)]
Clean up the paging code; fix known issues with the frame set

6 years agoRemove unused pg_dir_create() function
Matthias Kruk [Mon, 16 Sep 2019 04:54:05 +0000 (13:54 +0900)]
Remove unused pg_dir_create() function

6 years agoFix curly brackets
Matthias Kruk [Mon, 16 Sep 2019 04:45:10 +0000 (13:45 +0900)]
Fix curly brackets

6 years agoMove definition of struct task from arch/task.h to include/arch.h; add proper impleme...
Matthias Kruk [Fri, 6 Sep 2019 17:52:58 +0000 (02:52 +0900)]
Move definition of struct task from arch/task.h to include/arch.h; add proper implementations of task_prepare() and task_switch()

6 years agoMake symbol _int_restore global so that it can be used for task switching
Matthias Kruk [Fri, 6 Sep 2019 17:50:45 +0000 (02:50 +0900)]
Make symbol _int_restore global so that it can be used for task switching

6 years agoRemove arch_init() prototype from arch.h
Matthias Kruk [Fri, 6 Sep 2019 14:24:24 +0000 (23:24 +0900)]
Remove arch_init() prototype from arch.h

6 years agoRemove inclusion of corax/errno.h from arch/interrupt.c
Matthias Kruk [Fri, 6 Sep 2019 11:50:43 +0000 (20:50 +0900)]
Remove inclusion of corax/errno.h from arch/interrupt.c

6 years agoMask the keyboard interrupt while were not handling it properly
Matthias Kruk [Fri, 6 Sep 2019 08:50:39 +0000 (17:50 +0900)]
Mask the keyboard interrupt while were not handling it properly

6 years agoAdd stub code to handle POSIX interrupts in _sys_handle()
Matthias Kruk [Fri, 6 Sep 2019 08:48:54 +0000 (17:48 +0900)]
Add stub code to handle POSIX interrupts in _sys_handle()

6 years agoCreate code and data segments for all privilege levels in order to allow more fine...
Matthias Kruk [Fri, 6 Sep 2019 08:34:56 +0000 (17:34 +0900)]
Create code and data segments for all privilege levels in order to allow more fine-grained separation of processes in the future

6 years agoUpdate copyright header in config.h
Matthias Kruk [Fri, 6 Sep 2019 08:32:55 +0000 (17:32 +0900)]
Update copyright header in config.h

6 years agoAdd CONFIG_POSIX feature to config.h
Matthias Kruk [Fri, 6 Sep 2019 06:04:52 +0000 (15:04 +0900)]
Add CONFIG_POSIX feature to config.h

6 years agoAdd FEATURE macro to config.h
Matthias Kruk [Fri, 6 Sep 2019 06:04:06 +0000 (15:04 +0900)]
Add FEATURE macro to config.h

6 years agoMove the arch_init() call out of the #if 0 preprocessor directive
Matthias Kruk [Fri, 6 Sep 2019 04:47:29 +0000 (13:47 +0900)]
Move the arch_init() call out of the #if 0 preprocessor directive

6 years agoRemove task-related code from main.c
Matthias Kruk [Tue, 3 Sep 2019 16:42:44 +0000 (01:42 +0900)]
Remove task-related code from main.c

6 years agoPreserve the value of the ebx register in cpu_get_capabilities()
Matthias Kruk [Tue, 3 Sep 2019 16:42:00 +0000 (01:42 +0900)]
Preserve the value of the ebx register in cpu_get_capabilities()

6 years agoInclude config.h from kernel/arch/cpu.h
Matthias Kruk [Tue, 3 Sep 2019 16:41:20 +0000 (01:41 +0900)]
Include config.h from kernel/arch/cpu.h

6 years agoDon't leave the cr3 variable in pg_init() uninitialized; remove unused braces and...
Matthias Kruk [Tue, 3 Sep 2019 16:02:29 +0000 (01:02 +0900)]
Don't leave the cr3 variable in pg_init() uninitialized; remove unused braces and calls to dbg_printf()

6 years agoMake sure the upper half of eax as returned by cpu_set_pstate() is zero
Matthias Kruk [Tue, 3 Sep 2019 16:00:49 +0000 (01:00 +0900)]
Make sure the upper half of eax as returned by cpu_set_pstate() is zero

6 years agoModify arch_init() to preserve the contents of the ebx register
Matthias Kruk [Tue, 3 Sep 2019 15:51:19 +0000 (00:51 +0900)]
Modify arch_init() to preserve the contents of the ebx register

6 years agoRemove object files that were added in error; add current state of the source
Matthias Kruk [Tue, 3 Sep 2019 15:12:59 +0000 (00:12 +0900)]
Remove object files that were added in error; add current state of the source

6 years agoInitial commit, starting with the code base from github master
Matthias Kruk [Tue, 3 Sep 2019 07:05:17 +0000 (16:05 +0900)]
Initial commit, starting with the code base from github