Commit graph

125 commits

Author SHA1 Message Date
DrDeano
f189fa8976
Fix the size alignment
The size alignment need to use alignAllocLen and not alignForward as the size align may not be a power of 2.
2020-07-22 10:35:47 +01:00
DrDeano
d600be874c
Initial scheduler
Fix TSS

Also change to .{} syntax where appropriate.
Added the SS segment
Fixed spelling

Refactoring GDT


Multitasking working for now


WIP scheduler

Refactored Bitmap a bit

WIP still


Task switching working

Handlers return the stack pointer that will be used to restore the tasks stack, normal handlers will return the same stack pointer it was called with where task switching will return the stack pointer of the next task and restore its state using the interrupt stub.

Initial scheduler done


Created a stage 2 init task


Change u32 to usize


Move Task to arch specific


WIP


WIP2


Removed esp from task, replaced with stack_pointer


Removed the debug logs


Fixed init task stack


Change pickNextTask to pointer manipulation

This allows less allocations so faster switching

Temporary enable interrupts for some runtime tests

PIT and RTC need interrupts enabled to run their runtime tests

Renamed schedule => pickNextTask, comptime bitmap for pids not task init

And some other stuff: No pub for the task anymore
Use the leak detector allocator

Fmt


Fix unit tests

And some other stuff :P

PR review

Moved Task out of arch and have the stack init in the arch file
Mocking clean up
Removed commented code
Renamed createTask to scheduleTask where the user will have to provide a task to schedule
Removed redundant pub in log runtime test
Removed global allocator for scheduler
Cleaner assembly in paging

Fmt


Added new Scheduler test mode


Added new test mode to CI


Removed one of the prints


Added doc comment, task test for i386


Removed test


WIP


Runtime tests work

Have a global set in one task and reacted to in another. Also test that local variables are preserved after a task switch.

Removed new lines


Increased line length


Move the allocation of the bool above the task creation
2020-07-18 22:46:24 +01:00
Sam Tebbs
6d4b3e90a4 Replace buddy allocator with free list allocator 2020-07-14 19:38:20 +01:00
DrDeano
8acf4e03cb
A comptime bitmap
This allows for a bitmap that doesn't need an allocator.
2020-07-13 23:49:41 +01:00
Sam Tebbs
afcaf96e6e Replace var with anytype 2020-07-12 18:10:00 +01:00
Sam Tebbs
f3ba8c3e05 Fix heap freeing one too many blocks 2020-07-08 15:31:14 +01:00
Sam Tebbs
36a0f24fc8 Insert the correct address into the allocations map 2020-07-06 14:50:33 +01:00
Sam Tebbs
d60164bec6 Update for latest zig 2020-07-06 14:17:59 +01:00
Sam Tebbs
04896f1168 Update to new allocator interface 2020-07-01 22:33:08 +01:00
Sam Tebbs
e7635142ed Fix the kernel VMM start address 2020-06-24 20:59:29 +01:00
DrDeano
2c91e6f9d0
Remove the old and in with the new
Added the new testing to the OS files

Some spelling
INOUT => IN/OUT
Added some doc comments to log

Added the new runtime to the build + added the None test mode

Moved some stuff around
None test mode is the default to run/build the OS normally with no runtime tests.

Add the new runtime testing to the CI


Updated README and CI


Increased timeout


Print the log message


Spelling


Move runtime to test folder


Add new RT to tty


Add a log to use the unmapped memory to cause page fault in release


Ensure the integer overflow happens even in release builds
2020-06-23 12:43:52 +01:00
Sam Tebbs
28128dd18a Add virtual filesystem 2020-06-22 19:00:13 +01:00
Sam Tebbs
951ef07b9b Fix x86 payload passing 2020-06-22 18:55:01 +01:00
Sam Tebbs
e2533a2264 Move tty to arch 2020-06-18 22:19:41 +01:00
Sam Tebbs
5101990044 Pass boot payload to serial init 2020-06-12 11:48:36 +01:00
Sam Tebbs
ecc3de413c Make serial arch-dependent 2020-06-07 17:38:42 +01:00
Sam Tebbs
cec5d3c68d Move linker script 2020-06-04 12:01:53 +01:00
Sam Tebbs
368ecd30a0 Remove start.asm and start.s 2020-06-01 11:33:52 +01:00
Sam Tebbs
554b9706f2 Abstract away boot modules and memory map 2020-05-30 23:24:45 +01:00
Sam Tebbs
39fd5a151c Make some integers usize 2020-05-15 14:13:46 +01:00
Sam Tebbs
f5a22fdd4b Add heap allocator 2020-05-06 23:19:11 +01:00
DrDeano
16b07bfbcf
Log CPU state on page fault
Moved CR assembly to arch file


Fixed new line


Moved control registers from arch to paging
2020-05-06 23:04:13 +01:00
Sam Tebbs
2646f8b74b Start kernel VMM at second block 2020-04-22 23:56:16 +01:00
Sam Tebbs
cf11b17542 Add start to alloc result 2020-04-22 23:56:05 +01:00
Sam Tebbs
02ce6a5923 Add virtual memory manager 2020-04-14 03:58:25 +01:00
DrDeano
1f97a5c6c8
Updating to zig master
Added cpu model


Moved logging to defer done log

Moved mem.init to bottom

Updated again to new zig master
2020-04-12 22:26:34 +01:00
Sam Tebbs
2352a04928 Update zig code 2020-02-01 20:58:02 +00:00
DrDeano
7ab180f622
Added RTC
Added I/O waits to PIC remapping

Added fmt step to build 

When building will format all the code to the standard

Fixed cascading interrupts

Re-named to selectAnd*Register. Moved switching on registers into emun


Removed build fmt step
2020-01-15 19:50:47 +00:00
ED
0746048a00
Run unit tests under the building architecture
This also removed the need for `@intCase()`
Also move the making directories and copying to a script to the build is simpler.

Install qemu earler
Added chmod +x
Fixed copy elf


Added missing switch for qemu binary


Spelling


Make makeiso.sh executable

No longer chmod makeiso.sh

Use the cache root to set the output directory
2020-01-09 13:08:11 +00:00
Sam Tebbs
7043ccd6b9 Add a physical memory manager 2020-01-09 12:47:05 +00:00
Sam Tebbs
33136033c1 Update calling convention syntax 2020-01-07 13:30:54 +00:00
Sam Tebbs
91b2a61acf Update code to work with zig master 2020-01-06 14:28:09 +00:00
Sam Tebbs
f0161f0ec9 Add simple stacktrace logging 2019-12-06 20:28:28 +00:00
Sam Tebbs
7b2d4c1190 Fix T() style casts 2019-11-10 22:07:20 +00:00
Sam Tebbs
01490f051c Load grub modules on mem init 2019-11-08 22:09:01 +00:00
Sam Tebbs
9b9bfdfa58 Move virtToPhys to mem.zig and add physToVirt 2019-11-08 21:57:42 +00:00
ED
89a1873e7c No more assembly
Pure zig
Added doc comments


Feedback
2019-11-06 21:31:44 +00:00
ED
419d8ad585 Added run time tests for PIT
Also changed the TTY a bit
Merged new run time testing


Code layout change


Feedback


Feedback 2
2019-11-06 21:21:27 +00:00
Sam Tebbs
36aeced2c3 Add log tests 2019-10-25 20:08:59 +01:00
Sam Tebbs
35b76d5f1c Add serial tests 2019-10-15 17:20:22 +01:00
Sam Tebbs
1deaab2ad7 Add formatting check to CI 2019-10-06 19:49:45 +01:00
ED
2906d6ca13 Added unit and runtime tests
Also changed up panic call
Fixed rebasing


Feedback
2019-10-06 17:40:12 +01:00
ED
42bdbf6b7f Added unit and runtime tests
Also fixed some typos
Also changed the panic a bit
Removed changed to unnecessary files


Fixed merge


Feedback


Fixed tests
2019-10-05 20:46:31 +01:00
Sam Tebbs
7fb55437e3 Add x86 paging runtime tests 2019-10-01 23:08:19 +01:00
ED
2a0c2e4708 Added unit tests for PIC
Removed I/O wait as it isn't needed and uses the syscall interrupt.
Added runtime tests

Fixed styling for TTY
Fixed runtime tests


Now they are fixed
2019-10-01 17:59:42 +01:00
ED
60164d9252 Added runtime tests for TTY
Removed types
Styling
Added printing error and multi line string for logo


Fix panic after rebase
2019-10-01 11:52:23 +01:00
ED
420a09f039 Added runtime tests for VGA
Added doc comments as well
A little refactor of code
Reordered


Removed types
2019-09-29 12:55:34 +01:00
Sam Tebbs
48d80d92ae Add 4kb paging 2019-09-24 11:43:30 +01:00
Sam Tebbs
a18444e911 Add syscall args to syscall handler type 2019-09-21 17:11:40 +01:00
Sam Tebbs
f11bcd88f3 Import syscall tests into x86/arch.zig 2019-09-17 23:04:01 +01:00
ED
4d9b963310 Added IDT unit and run-time tests 2019-09-17 18:24:44 +01:00
ED
07cc1ae89b Added gdt unit and runtime tests
Updated runtime tests


Added doc comments for runtime tests


PR review


WIP


Fixed testing


Import GDT to run the unit tests


Removed redundant arch tests


Removed whitespace
2019-09-16 22:19:33 +01:00
Sam Tebbs
8a961d7e6d Replace alignment functions with stdlib's 2019-09-12 22:15:00 +01:00
ED
d5d4082a66 Fixed tesing
Add mocking of functions


Added new function type


Fixed up the mock testing


Working mock_framework :), fixed up all tests for VGA and TTY


Adding tests


VGA testing done


Fin vga and tty mock testing


Fixed build


Removed white spaces


WIP


Added tests for all build modes + reduced import string length for testing


Added comments refactoring


Re-added constants


Added some comments


Updated to master of zig


Added unit tests to pipeline


PR comments


Fixed typos
2019-09-08 20:48:23 +01:00
Andrew Kelley
798b1c1d34 Update to zig master and simplify build script 2019-09-05 16:33:43 +01:00
Sam Tebbs
60ba451aec Add x86 syscalls 2019-09-02 20:37:59 +01:00
Sam Tebbs
b8f0b3131c Add infrastructure for build options 2019-09-01 17:29:50 +01:00
Sam Tebbs
811ee30f17 Merge pull request #48 from SamTebbs33/feature/runtime-testing
Add runtime testing harness
2019-07-09 23:27:44 +01:00
Sam Tebbs
35cfbd1686 Add runtime testing harness 2019-07-09 23:25:52 +01:00
Sam Tebbs
9b0fcbab20 Add arch.registerInterruptHandler 2019-07-06 20:34:10 +01:00
Sam Tebbs
e1511f7924 Add x86 paging 2019-06-29 12:02:42 +01:00
ED
1e951691a9 Added PIT interface
Ready for PR


Code review changes


Minor changes
2019-06-26 18:42:38 +01:00
Sam Tebbs
7e5b7b2331 Add logging 2019-06-25 20:10:26 +01:00
Sam Tebbs
d980ce5524 Add serial output 2019-06-24 22:49:24 +01:00
ED
1fc534b9a4 Added the PIC interface
Also added doc comments to functions
2019-06-02 17:14:02 +01:00
ED
995268b04e Added GDT, IDT, IRQ, updated build.zig
Added new build.zig


Interrupts no work :(


Added isr


Interrupts work


Added spurious irq


Code review comments


New name


Refactor


Build asm
2019-05-31 07:41:28 +01:00
Sam Tebbs
08dbf09e00 Refactor compilation of architecture-specific code 2019-05-29 08:18:14 +01:00
ED
faeb433bb0 Add TTY and VGA interface
Line endings


Removed redundant files


Line ending
2019-05-22 20:12:46 +01:00
Sam Tebbs
3c12803954 Pass multiboot magic and header to kmain 2019-05-19 17:39:27 +01:00
Sam Tebbs
49d6f19516 Separate arch-specific and arch-agnostic code 2019-05-13 21:10:03 +01:00
Sam Tebbs
24249a5f40 Move boot_page_directory while increment 2019-04-23 19:59:11 +01:00
Sam Tebbs
80b88c7d03 Move branch quota change to top of boot_page_directory init 2019-04-23 18:50:58 +01:00
Sam Tebbs
b6d7e5d5c4 Add multiboot setup code 2019-04-19 21:11:04 +01:00
Edward Dean
bee7416b08 Feature/hello world kernel land, closes #3 (#4)
* prints hello world

* Builds with the zig build system
2019-04-17 17:40:26 +01:00
Edward Dean
7678019e03 Feature/bootloader (#2), closes #1
* Added bootloader files

* Changed to spaces from tabs
2019-03-27 21:33:59 +00:00