Commit graph

102 commits

Author SHA1 Message Date
iamgweej
e90d861554 Changed to Int in std.meta 2020-11-29 13:05:51 +00:00
Sam Tebbs
0a45b733eb Add ELF loader 2020-11-22 22:38:51 +00:00
DrDeano
fab372a6cf
Initial FAT32 interface
Include code page 437

This is now moved to a better location

Fixed initrd doc for allocator


Added test files

 Plus minor extras

Created initial FAT32 filesystem

This initial FAT32 filesystem will parse a stream, which could be a HDD or a in memory filesystem and produce a FAT32 filesystem. This will check if the raw bytes is a valid FAT32 filesystem as descibed in the spec.

This is only a skeleton with no open, read or write functionality.

Part of #216

logger -> log


Fmt


Removed 'zero_' from struct fields


number_free_cluster -> number_free_clusters


Return non allocated FAT32FS


prefix test_


Added doc comment for boot sector arrays


Moved code_page.zig


info -> debug for init FAT32


Abstracted getting code page table
2020-11-22 21:37:39 +00:00
Sam Tebbs
6bbdadfa94 Rework copyDataToVMM to work in both directions 2020-11-20 17:44:01 +00:00
DrDeano
788bef5029
Rename the logger to log to make is all consistent
Move to `log`


Fixed kmain log
2020-11-13 19:16:25 +00:00
Sam Tebbs
307ea7a52e Add user mode 2020-11-07 09:00:10 +00:00
Sam Tebbs
238e050c8c Check for memory leaks in all tests that allocate memory 2020-11-05 18:50:55 +00:00
Sam Tebbs
1453540bae Add symlink support 2020-11-05 18:21:13 +00:00
Sam Tebbs
08cd95d592 Update to zig master 2020-11-02 18:21:15 +00:00
iamgweej
e96c3165a2 Converted Read and Write from silce returning to slice accepting 2020-10-26 17:38:54 +00:00
Sam Tebbs
9005cce68b Update to zig master 2020-10-18 18:59:20 +01:00
DrDeano
abc712233b
Initial PCI interface
Closes #244

Move PCI to arch

Plus spelling

Added new out and in functions


Added new out and in to mocking


Return pci devices as a list


Improved comment


Removed mask for the return


Removed type for OUT


Added new types
2020-10-10 00:35:20 +01:00
Sam Tebbs
1616ec19a4 Update to zig master 2020-09-07 17:06:12 +01:00
iamgweej
24a5e7c135 Minor change: reorder destroy() and deinit() 2020-08-29 18:33:45 +03:00
Sam Tebbs
1a74b085b8 Use vmm.virtToPhys in x86 paging 2020-08-25 17:43:07 +01:00
Sam Tebbs
b7c3084f09 Fix for TailQueue and std.log changes 2020-08-23 14:42:56 +01:00
iamgweej
34bc8d0ae1 Added file closing in VFS functions 2020-08-16 11:43:29 +01:00
Sam Tebbs
95885f4407 Add new parameters for resize and alloc 2020-08-15 21:35:31 +01:00
Sam Tebbs
73d0b2fd3d Add keyboard and an x86 driver 2020-08-06 19:40:24 +01:00
DrDeano
7b5f921d9f
File system files to new folder and use FixedBufferStream for initrd
Fixed non-header aligned sizes

When allocating a size that isn't aligned to the Header, then we get a incorrect alignment.
To fix this, added additional alignment padding to the next free header.

Fixed adding strings to build options
2020-08-06 18:13:53 +01:00
Sam Tebbs
e914841ade Add virtToPhys and physToVirt 2020-07-30 09:18:01 +01:00
Sam Tebbs
154f7c6d6c Don't override attributes when creating a new paging table 2020-07-26 14:30:52 +01:00
DrDeano
1ea9dbe79d
Fix mapping of addresses that span the 4MB boundary
Also removed unused variables

Fixed unmapping of addresses that span the 4MB boundary


Fixed clearing directory


Fmt


Improved paging maps and unmaps
2020-07-26 13:21:06 +01:00
DrDeano
bcc1712737
Created ramdisk build step
Refactored tests for the scheduler and task


Revert "Refactored tests for the scheduler and task"

This reverts commit 2bf56a368bc18f2bd2d33c385e3672d07e4431d9.

Refactored tests for the scheduler and task


Task fmt


Task fmt again >:(


Ramdisk


Added NotOpened error for file read and write
Added vfs init to initialise the root node
Added the ramdisk.initrd file to grub
Update makeiso to copy the ramdisk to the modules folder
Add a ramdisk step to create a ramdisk to be leaded by grub and parsed by the kernel
Add test files for runtime tests of ramdisk

vfs.init => vfs.setRoot


Improved ramdisk step

Also spelling

Changed name for the initrd


Rename RamdiskFS => InitrdFS


Add deinit for initrd

Fixed VMM unmap

{}
2020-07-25 11:18:19 +01:00
DrDeano
1030633d1d
WIP
Page fault loop

Fixed up the virtual memory mapping

Removed un-used parameters in arch.init
Some doc comments
Name changes
2020-07-24 23:51:27 +01:00
DrDeano
fbd135c437
Move to std.log
Removed nothing to pass tests


Removed log imports

Plus some spelling
2020-07-23 20:47:56 +01:00
DrDeano
6bca2de1c6
Add newline parsing
The symbol name can have spaces.
Changed the parseName to use the newline parsing.
Also used str.len

Missed whitespace => newline


Add a nothing to run release safe tests
2020-07-23 11:42:18 +01:00
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