Commit Graph

821 Commits

Author SHA1 Message Date
Justin C. Miller
2955e6c9c1 Add debugging files to build process 2019-03-10 23:34:47 -07:00
Justin C. Miller
cd2ccb4e06 Move QEMU monitor to telnet 2019-03-10 12:57:43 -07:00
Justin C. Miller
722ee4c52c Recycle old initial pml4 v0.2.2 2019-03-10 00:51:39 -08:00
Justin C. Miller
67b9f45004 Offset-map the entire offset region with 1G pages
Instead of building nested page tables for the offset region, just
offset map the entire thing into kernel memory with one PDP mapping
1GiB large pages. This is more efficient and avoids the "need a
page table to map in a page table" dependency loop.
2019-03-09 14:55:48 -08:00
Justin C. Miller
2035fffa1c Fix loading large process images.
2MiB large pages were being used for any large page mapping, but the
page manager doesn't correctly handle them everywhere yet. Now only
allow them for offset pointers (eg MMIO space) that will never be
unmapped.
2019-03-09 13:10:10 -08:00
Justin C. Miller
97ac3c09fa Implement initial fork syscall 2019-03-09 12:18:21 -08:00
Justin C. Miller
241e1dacb0 Consolidate testing memory setup 2019-03-07 23:53:38 -08:00
Justin C. Miller
ac19d3f532 Allow page table copying and unmapping
Lots of rearranging in page_manager as well, moving constants out as
well as helper structs.
2019-03-03 01:52:21 -08:00
Justin C. Miller
194527e0fe Fix address-marking bugs
* Non-blocksize-aligned regions could fail to be found. Have the
  bootloader load them aligned.
* Consolidating used frame blocks in the bootstrap means these would
  have been impossible to free as address space
* mark_permanent wasn't actually removing blocks from the free list
2019-03-03 01:42:32 -08:00
Justin C. Miller
28cf5562ac Use the address_manager to place allocations 2019-02-28 00:37:00 -08:00
Justin C. Miller
8cdc39fdee Switch page_manager to use frame_allocator.
Removed the frame allocation logic from page_manager and replaced it
with using an instance of frame_allocator instead. This had several
major ripple effects:

- memory_initalize() had to change to support this new world
  - Where to map used blocks is now passed as a flag, since blocks don't
    track their virtual address anymore
  - Instead of the complicated "find N contiguous pages that can be
    mapped in with one page table", we now just have the bootloader give
    us some (currently 64) pages to use both for tables and scratch
    space.
  - frame_allocator initialization was split into two steps to allow
    mapping used blocks before std::move()ing them over
2019-02-28 00:37:00 -08:00
Justin C. Miller
626eec4a31 Frame allocator class added 2019-02-28 00:37:00 -08:00
Justin C. Miller
5901237fee Genericize buddy allocator 2019-02-28 00:37:00 -08:00
Justin C. Miller
24316ca0c4 Build native targets with debug symbols 2019-02-28 00:37:00 -08:00
Justin C. Miller
f9d964cccb Adding address manager 2019-02-28 00:37:00 -08:00
Justin C. Miller
a9ac30b991 Allow heap_manager to use non-contiguous blocks.
* Heap manager can now manage non-contiguous blocks of memory (currently
  all sized at the max block size only)
* Fix a bug where heap manager would try to buddy-merge max-sized blocks
2019-02-28 00:37:00 -08:00
Justin C. Miller
61df9cf32c Add -ggdb to tests build 2019-02-28 00:37:00 -08:00
Justin C. Miller
bbd31929ba Rename memory_manager to heap_manager 2019-02-28 00:37:00 -08:00
Justin C. Miller
ec20e9f3d9 Stripping the kernel
Strip the kernel version that we put into the disk image, but keep the
debug symbols in a separate file for GDB.
2019-02-17 23:43:59 -08:00
Justin C. Miller
3bcd83f5a3 Notes update 2019-02-17 23:38:40 -08:00
Justin C. Miller
341ba5146a Forgot to comment third arg for gdt_write 2019-02-17 23:38:40 -08:00
Justin C. Miller
83b37ef536 Give qemu.sh better option handling 2019-02-10 10:31:43 -08:00
Justin C. Miller
1965197ccd Fix sysroot ld setting 2019-02-10 10:31:16 -08:00
Justin C. Miller
29747f4891 Allow modules to specify defines
The modules.yaml now has an optional defines: list per module that adds
preprocessor definitions to the build scripts. Also added a --debug flag
to qemu.sh to run QEMU's debugger host.
2019-02-08 21:22:53 -08:00
Justin C. Miller
aca442ee87 First pass at message syscalls 2019-02-07 18:19:22 -08:00
Justin C. Miller
8e85ae5318 Added getpid system call 2019-02-07 17:52:57 -08:00
Justin C. Miller
8c32471e0d Pass CPU state as a pointer
Previously CPU statue was passed on the stack, but the compiler is
allowed to clobber values passed to it on the stack in the SysV x86 ABI.
So now leave the state on the stack but pass a pointer to it into the
ISR functions.
2019-02-07 17:47:42 -08:00
Justin C. Miller
79711be46a Dump compiler args and defines.
As part of the build, dump the compiler arguments and defines per target
into files.
2019-02-07 17:39:10 -08:00
Justin C. Miller
863e5bda15 Turning console into a class 2019-02-04 00:48:18 -08:00
Justin C. Miller
d19cedb12a adding kernel crti/crtn but ctors/dtors not called yet 2019-02-03 18:59:09 -08:00
Justin C. Miller
f2d39f7df8 Refactoring build system for more control of inputs 2019-02-03 18:32:45 -08:00
Justin C. Miller
579f6f64e6 First step of moving bootloader to C++ 2019-02-03 01:38:12 -08:00
Justin C. Miller
a71af1be96 Updating NOTES 2019-02-03 00:26:35 -08:00
Justin C. Miller
237c242f96 Fix ninja not reloading buildfiles on regen 2019-02-03 00:20:01 -08:00
Justin C. Miller
c4dc52c06c Fix a version parsing issue when on a tagged version 2019-02-03 00:06:39 -08:00
Justin C. Miller
e1d8dd3124 Updating README to reflect new build process v0.2.1 2019-02-02 23:56:47 -08:00
Justin C. Miller
38a1197d9e Removing old waf build scripts and vendored libcxx 2019-02-02 21:39:19 -08:00
Justin C. Miller
bc01a37452 Ninja-based buildsystem now building a running kernel! 2019-02-02 21:35:39 -08:00
Justin C. Miller
acdca19f59 Ninja buildsystem produces working bootloader 2019-02-02 18:24:58 -08:00
Justin C. Miller
a1fe745a53 Changing to __POPCORN__ for defining code that is host-only 2019-02-02 14:44:35 -08:00
Justin C. Miller
73df20d195 Ninja-based system now builds the disk images 2019-02-02 14:43:55 -08:00
Justin C. Miller
7e1933d79b Give makerd a cwd argument, and upgrade cpptoml 2019-02-02 12:18:20 -08:00
Justin C. Miller
8d23fac6cc Allow for ninja files to regenerate themselves 2019-02-02 11:52:05 -08:00
Justin C. Miller
0f8efdb55e Moving to a ninja-based build system 2019-02-02 02:59:45 -08:00
Justin C. Miller
523d0b3b8c sysroot and cross-compiler based build WIP 2019-01-17 00:51:45 -08:00
Justin C. Miller
591ca7c83c libc WIP 2018-09-24 11:13:18 -07:00
Justin C. Miller
dffdcc095d Vendoring libc++ in external/ 2018-09-22 07:55:00 -07:00
Justin C. Miller
229c1e4965 Moved cpptoml to just makerd's includes 2018-09-21 20:36:01 -07:00
Justin C. Miller
d8399e3c07 Fix for page faults under KVM
Under KVM we were hitting what look like out-of-order and/or issues
during initialization when writing to the page tables and then
immediately writing to the mapped memory.  Adding a memory barrier and
an io_wait() in memory_bootstrap.cpp fixed it.
2018-09-21 20:34:26 -07:00
Justin C. Miller
f1bb3556eb Update NOTES 2018-09-21 09:52:21 -07:00