Commit graph

105 commits

Author SHA1 Message Date
Drew Galbraith
6986f534f8 Add a method for blocking threads on ports.
Additionally add the first lock class since we are becoming more
concurrent.
2023-06-12 20:56:25 -07:00
Drew Galbraith
b6735d3175 [zion] Fix an over-allocation bug when creating a memory object 2023-06-12 20:55:53 -07:00
Drew Galbraith
0f0e39d1e9 Further parse AHCI information.
Send an IDENTIFY command to each drive and set up a hook to handle
interrupts.
2023-06-12 19:20:51 -07:00
Drew Galbraith
4e1888bd24 Set eflags properly for jump to userspace 2023-06-12 19:20:42 -07:00
Drew Galbraith
8ac5366882 [zion] Add ability to dump MADT (APIC) tables 2023-06-12 19:17:00 -07:00
Drew Galbraith
7cf54c0dd2 [mammoth] Fix accidental switch fall through in crash 2023-06-12 19:14:30 -07:00
Drew Galbraith
832d2f6961 Allow default constructing mammoth threads 2023-06-12 19:13:55 -07:00
Drew Galbraith
f907c189bb Add a memcpy utility to libc 2023-06-12 19:13:16 -07:00
Drew Galbraith
c35cef65fe Don't mistakenly mask interrupts in user space 2023-06-12 19:01:09 -07:00
Drew Galbraith
30bb10207e Add the Denali disk driver.
Begin enumerating information from the PCI structure and HBA AHCI
structures.

Currently the PCI structure address is hardcoded but it should be
passed via a capability from the init process in the future.
2023-06-08 02:36:59 -07:00
Drew Galbraith
47e3d11060 Add a syscall for creating a physical memory VMO 2023-06-08 02:36:47 -07:00
Drew Galbraith
50201fe6df Updated PCIe walk to be recursive and dump the offset of the sata drive 2023-06-08 00:24:50 -07:00
Drew Galbraith
a2fd14a9a8 Update sprintf to allow 64 bit types 2023-06-08 00:22:24 -07:00
Drew Galbraith
56789400d7 Allow mapping the PCI Config so Yellowstone can map it.
This is a temp system call. Evemtually we should probably supply the
root process with all of the system physical memory objects.
2023-06-07 22:45:42 -07:00
Drew Galbraith
71a601362d [mammoth] Update dbgln to use sprintf 2023-06-07 22:45:24 -07:00
Drew Galbraith
20dd43cdfb [libc] Add basic sprintf function 2023-06-07 22:44:11 -07:00
Drew Galbraith
bd32e85164 Fix race condition in page fault handler.
We enabled interrupts before getting the value of cr2 in the handler.
If the handler was preempted, cr2 could have been overriden by a page
fault in a separate thread or process.
2023-06-07 22:24:50 -07:00
Drew Galbraith
3e1e37bf03 Probe RSDP for PCIe Config 2023-06-07 16:24:13 -07:00
Drew Galbraith
4bd7f972c1 Add additional physical memory logging 2023-06-07 16:22:39 -07:00
Drew Galbraith
53ff49b265 Add preprocessor directives to supress logs per file.
Makes the output much cleaner by default but allows for getting more
infor if debugging in the future.
2023-06-07 13:51:13 -07:00
Drew Galbraith
add533071b Use APIC for interrupts rather than PIC.
Still rely on the PIT for now rather than the local APIC timer.
2023-06-07 13:40:36 -07:00
Drew Galbraith
7c9d1075eb Move sys/test to Yellowstone init process. 2023-06-07 11:18:35 -07:00
Drew Galbraith
6f81520918 Refactor compile flags 2023-06-07 11:09:27 -07:00
Drew Galbraith
010e261dc7 Add a libcxx with a new operator 2023-06-07 10:48:59 -07:00
Drew Galbraith
dcc05f2741 Add a libc skeleton with a primitive malloc. 2023-06-07 10:33:10 -07:00
Drew Galbraith
eb04242a59 Add a debug mode for the KernelHeap. 2023-06-07 10:01:22 -07:00
Drew Galbraith
40b21d9c75 [Mammoth] Add Channel object for simple IPC messages 2023-06-07 09:37:16 -07:00
Drew Galbraith
65439c163a Compile sys libraries without exceptions. 2023-06-07 09:36:14 -07:00
Drew Galbraith
3243b6024b Update init bg script to inclue AR 2023-06-07 09:29:38 -07:00
Drew Galbraith
a5c4d40575 Refactor error types and error reporting 2023-06-07 08:51:23 -07:00
Drew Galbraith
81b925eea0 Add a basic IPC setup with Channel Object.
Pass a process a channel endpoint on startup that it will use to
get it's initial capabilities.
2023-06-07 08:24:10 -07:00
Drew Galbraith
b79ec07636 Return Z_OK on all syscall paths 2023-06-07 07:15:25 -07:00
Drew Galbraith
55340e2917 Make Capability RefCounted 2023-06-07 06:21:36 -07:00
Drew Galbraith
6c10c57bfa Mass rename memory object variables.
Use shorthand:
AddressSpace -> vmas
MemoryObject -> vmmo

The VM prefix makes these a little more distinguishable in code.
2023-06-07 00:30:26 -07:00
Drew Galbraith
a8a4f8d9ab Add checks to mammoth thread lib 2023-06-07 00:25:04 -07:00
Drew Galbraith
e246f28d9c Get the second process elf from a MemoryObject instead of hardcoding.
Allows us to delete the CopyIntoNonResidentProcess function and simply
rely on the MemoryObject copy functions.
2023-06-07 00:19:15 -07:00
Drew Galbraith
eb454300e6 Move elf loader into the init loader in the kernel 2023-06-07 00:08:21 -07:00
Drew Galbraith
23895b5c6c Spawn Processes using memory primitives rather than and elf loader.
This allows us to remove the temporary syscall for that style of process
spawn.
2023-06-07 00:04:53 -07:00
Drew Galbraith
b06c76e477 Create a MemoryObject class and use it to load programs. 2023-06-06 21:44:10 -07:00
Drew Galbraith
1fda0f3fae Move VirtualMemory to AddressSpace Object 2023-06-06 20:43:15 -07:00
Drew Galbraith
b5ad454ad1 Move Process & Thread to the object folder. 2023-06-06 20:18:53 -07:00
Drew Galbraith
4e278a4664 Make a KernelObject base class for all Capabilities. 2023-06-06 20:13:07 -07:00
Drew Galbraith
d358c1d672 Move process be to RefCounted 2023-06-06 19:12:46 -07:00
Drew Galbraith
2e1357255c Create a RefCounted type and use it for Thread.
This should prevent me from actually creating 2 shared ptrs of
a single kernel object with their separate ref counts.
2023-06-06 19:05:03 -07:00
Drew Galbraith
d9b17d96d7 Cleanup Thread constructor 2023-06-06 18:40:32 -07:00
Drew Galbraith
41d25a7b46 Reformat includes 2023-06-06 17:12:08 -07:00
Drew Galbraith
174d4b10fb Move threading calls into a basic user space library. 2023-06-06 16:56:19 -07:00
Drew Galbraith
b0c2a6732b Always create threads in CREATED state.
Simplify the process class to have threads marked as runnable
separately.
2023-06-06 16:27:25 -07:00
Drew Galbraith
ef8eb5d993 Add a threading syscall API. 2023-06-06 16:24:03 -07:00
Drew Galbraith
e2aad55a8a Only dump bootloader modules once. 2023-06-06 15:04:34 -07:00