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
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
3f264b4490
Add syscall enum, clean up handler debug prints
2018-09-05 22:49:56 -07:00
Justin C. Miller
1758ee4215
Initial ramdisk support
...
- Create initrd library to support definitions and loading
- Allow tools compiled for the host machine to be built by wscript
- Create makerd tool to build initrd from manifest
- Move screenfont to initrd, so don't load framebuffer initially
2018-09-05 22:45:30 -07:00
Justin C. Miller
dc40c2f6ad
Changes from the reorg branch
...
Add CR4 options: global pages, FXSAVE, PCIDs
Better page manager page-in flags
Remove obsolete rflags-saving in create_process
2018-09-05 22:26:23 -07:00
Justin C. Miller
2fb92e8592
Move AHCI driver into separate drivers/ directory
2018-09-05 22:17:56 -07:00
Justin C. Miller
5d861d243a
Loading processes from within their memory space
...
The scheduler's create_process now sets up the stack to iretq into a
load_process function, which will load the process image into memory
from within the process' own virtual memory space. Currently this
loading is just copying the old 'taskA' function from kernel space.
2018-09-05 10:09:00 -07:00
Justin C. Miller
f1b84ab370
Default to non-user in all kernel pages now
...
This causes the user tasks to just PF, so we'll need to actually have a
real loader now.
2018-09-04 09:27:57 -07:00
Justin C. Miller
d5b8902d8f
Moving the rest (except ACPI tables) to high mem
...
Also the debug messaging to verify it.
2018-09-03 15:15:19 -07:00
Justin C. Miller
799fbbdd10
_Actually_ move the kernel to the last TiB.
...
More work on process page tables, including only mapping the last 2 pml4
entries (the highest 1TiB of the address space, ie, kernel space) into a
new table.
Includes the work of actually moving the kernel there, which I had
apparently done in name only previously. Oops.
2018-09-01 14:54:12 -07:00
Justin C. Miller
647801f096
Initial work on swapping page tables per process
2018-08-29 15:49:02 -07:00
Justin C. Miller
cd09c17d71
Commented out CPUID log messages, they're never differnet under qemu
2018-08-27 06:41:09 -07:00
Justin C. Miller
f74f3f03d1
Include prog_if in PCI device class log message
2018-08-27 06:40:30 -07:00
Justin C. Miller
23006b2b43
Fixed number of args in ahci interrupt log call
2018-08-27 06:39:31 -07:00
Justin C. Miller
7f69a6c9b1
Clean up AHCI: volatile, and sata_reset
2018-05-22 00:31:01 -07:00
Justin C. Miller
1726d10554
Unify syscall/interrupt handling of rsp
2018-05-21 22:57:43 -07:00
Justin C. Miller
e187679f93
Add 2 more chars to log names
2018-05-21 09:07:53 -07:00
Justin C. Miller
2597e2002b
Get super basic ring3 task switching working
...
* It looks like UEFI enables SSE, so we need to tell clang -mno-sse for
now to not use XMM* until we're ready to save them.
* SYSCALL is working from ring3 tasks, calling console printf!
2018-05-21 09:07:53 -07:00
Justin C. Miller
e6f819ed90
Fix non-packed TSS struct
2018-05-21 09:07:53 -07:00
Justin C. Miller
0c8bcb2400
Add get_rip/get_rsp helpers
2018-05-21 09:07:53 -07:00
Justin C. Miller
24ccf65aba
WIP ring3
2018-05-21 09:07:52 -07:00
Justin C. Miller
814d6f1de6
Minor GDT fixes
2018-05-21 09:07:52 -07:00
Justin C. Miller
bfaab294e6
Set up initial task switching (ring0 only)
2018-05-21 09:07:52 -07:00
Justin C. Miller
0ddcf668cb
Allow for 2MiB large pages
2018-05-21 09:07:52 -07:00
Justin C. Miller
4005e9e791
Split gdt.* from interrupts.*
2018-05-21 09:07:52 -07:00
Justin C. Miller
abaa007c54
Set TSS and load it
2018-05-21 09:07:52 -07:00
Justin C. Miller
87d80f84c2
Remove AHCI debug dumps
2018-05-21 09:07:32 -07:00
Justin C. Miller
79b95d0045
Move FIS creation into make_command
2018-05-20 17:59:08 -07:00
Justin C. Miller
1e66e5cd82
Re-add CFL setting that was lost
2018-05-20 16:34:15 -07:00
Justin C. Miller
193d9939f0
Add some AHCI debugging dumps
2018-05-20 02:02:06 -07:00
Justin C. Miller
81fc559802
Add initial ATA identify support to AHCI driver
2018-05-17 00:34:29 -07:00
Justin C. Miller
0d75cc999c
Add GPT partition handling as virtual block devices
2018-05-16 10:14:40 -07:00
Justin C. Miller
a5da56d02f
Add guid type
2018-05-16 09:52:06 -07:00
Justin C. Miller
93e60cc136
Give kassert its own vector instead of DBZ
2018-05-15 21:38:44 -07:00
Justin C. Miller
5f7ec50055
Add fixes I made while looking for VBox bug
2018-05-15 21:37:27 -07:00
Justin C. Miller
0fc369789e
Change GDT code to enforce correct CS
2018-05-14 22:52:28 -07:00
Justin C. Miller
09f72f5ac6
GDT and GPF changes to track down Vbox bugs
2018-05-13 23:22:39 -07:00
Justin C. Miller
716109bab5
Add block device management to device manager
2018-05-12 20:27:46 -07:00
Justin C. Miller
0684fcf7e9
Separate read function into blocking and async portions
2018-05-12 20:16:25 -07:00
Justin C. Miller
289104cde0
Enable AHCI interrupts.
...
* Implement MSI style interrupts
* Move interrupt handling to device_manager for IRQs
* Give device_manager the ability to allocate IRQs
* Move achi::port to an interrupt-based scheme
2018-05-12 18:38:47 -07:00
Justin C. Miller
c9277e4b12
Split ahci read into separate functions
2018-05-12 13:55:09 -07:00
Justin C. Miller
08125fc2a5
Fix AHCI reads
2018-05-12 00:35:04 -07:00
Justin C. Miller
d06dd2ef43
Rearrange AHCI code, attempt to read WIP
2018-05-11 01:45:39 -07:00
Justin C. Miller
8ae3eea19c
Move AHCI ports to their own class
2018-05-11 01:25:54 -07:00
Justin C. Miller
a1bc76f305
Move malloc into kutil
2018-05-11 01:25:54 -07:00
Justin C. Miller
045bede481
Improve stack tracing
2018-05-11 01:25:40 -07:00
Justin C. Miller
87e7c5f00a
Updating wscripts to use custom tasks
2018-05-09 10:21:21 -07:00