Commit Graph

899 Commits

Author SHA1 Message Date
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
Justin C. Miller
cef0a71bce Use uintptr_t instead of addr_t
They're never actually going to change independently, and it's also
brining in kutil headers more places than they should be.
2018-09-20 09:37:30 -07:00
Justin C. Miller
a9d72b8102 Fixing APIC timer log message 2018-09-18 17:33:11 -07:00
Justin C. Miller
d469482a7f Better spurious interrupt handling 2018-09-16 23:50:54 -07:00
Justin C. Miller
c67c1bd6a2 Give processes multiple quanta before rescheduling 2018-09-16 23:34:42 -07:00
Justin C. Miller
5e6769036c APIC timer calibration
Now the APIC timer is calibrated against the PIT, and the interval for
timer_enable takes a number of microseconds instead of raw ticks and a
divisor.
2018-09-16 18:56:01 -07:00
Justin C. Miller
482b9f50fc Initial process waiting/waking
Processes can now wait on signals/children/time. There is no clock
currently so "time" is just a monotonically increating tick count. Added
a SLEEP syscall to test this waiting/waking.
2018-09-16 12:22:52 -07:00
Justin C. Miller
f4e7eaeb40 Fixing #include error in linked_list.h 2018-09-16 12:20:14 -07:00
Justin C. Miller
8c2ff33c40 Reduce number of DEbuG syscalls in nulldrv 2018-09-15 00:40:30 -07:00
Justin C. Miller
1308864061 MSR and syscall changes
- Moved MSR code to separate files with an enum class
- Implemented syscall_enable in C++ using new MSR calls
2018-09-15 00:37:49 -07:00
Justin C. Miller
62c559043d Pause syscall and int 0xee interrupt syscalls
The syscall/sysret instructions don't swap stacks. This was bad but
passable until syscalls caused the scheduler to run, and scheduling a
task that paused due to interrupt.

Adding a new (hopefully temporary) syscall interrupt `int 0xee` to allow
me to test syscalls without stack issues before I tackle the
syscall/sysret issue.

Also implemented a basic `pause` syscall that causes the calling process
to become unready. Because nothing can wake a process yet, it never
returns.
2018-09-12 20:59:08 -07:00
Justin C. Miller
c2f85ce61b Some enum_bitfield helper operators
Added:
  set += flag -> set = set | flag
  set -= flag -> set = set & ~flag
  set && flag -> (set & flag) == flag
2018-09-12 20:57:15 -07:00
Justin C. Miller
5808599005 Getting rid of 'boogity!'.. end of an era.
Since I'm doing a lot of work on task scheduling, 'boogity!' simply
isn't the "we're all good and we're done!" message that it used to be.
2018-09-12 20:51:50 -07:00
Justin C. Miller
fafe582802 Initial priority-based scheduler
- Scheduler now has multiple linked_lists of processes at different
  priorities
- Process structure improvements
- scheduler::tick() and scheduler::schedule() separation
2018-09-11 22:37:00 -07:00
Justin C. Miller
593cda3ee8 Convert page_block to use kutil::linked_list
- Created a new linked_list-based slab allocator
- Simplified memory bootstrap code by using the slab allocator and
  linked_lists
2018-09-11 20:46:48 -07:00
Justin C. Miller
d5c44645eb New templatized linked_list collection
Also updated tests to work with memory changes
2018-09-09 15:32:10 -07:00
Justin C. Miller
e7a509176d Move makerd to TOML-based manifest
Added the cpptoml library (and license), and moved to using that for
the initrd manifest. It's now possible to specify the `executable`
flag for files, and the kernel correctly only launches new processes
for the initrd files marked `executable`.
2018-09-08 12:54:35 -07:00
Justin C. Miller
3a39d9440a Made syscall ids 64 bits in rax 2018-09-07 10:29:22 -07:00
Justin C. Miller
cabfec3f1e Clearing up kutil/kernel memory code separation 2018-09-07 10:08:47 -07:00
Justin C. Miller
956efabd8f Update NOTES 2018-09-06 09:49:44 -07:00
Justin C. Miller
f146a96298 Cleaning up interrupts.s and adding missing IRQs 2018-09-06 09:48:18 -07:00
Justin C. Miller
585abe9a18 Simple ELF program loader
Now any initrd file is treated like a program image and passed to the
loader to load as a process. Very rudimentary elf loading just allocates
pages, copies sections, and sets the ELF's entrypoint as the RIP to
iretq to.
2018-09-06 01:35:56 -07:00
Justin C. Miller
3d0b262435 Add null driver
This will be the target of our real ELF loader
2018-09-05 23:01:05 -07:00