Commit graph

123 commits

Author SHA1 Message Date
Drew Galbraith
75b1f2d21c [zion] Store capability ids on the CapabilityTable.
This is preferable to storing it in the capability itself since the id
is really just an index for the containing process.
2023-06-16 15:27:09 -07:00
Drew Galbraith
b27672d5de [zion] Update LinkedList iterator semantics. 2023-06-16 15:24:38 -07:00
Drew Galbraith
242a18ae3c [zion] Finish cleaning up process capability interface.
Make all functions generic and specify existing/vs new cap.
2023-06-16 15:09:15 -07:00
Drew Galbraith
fc94bc5bf5 [zion] Update process interface to simplify capability insertion.
Take a templated KernelObject with explicit permissions.
2023-06-16 15:04:33 -07:00
Drew Galbraith
a47bac9966 [zion] Dynamically check Capability type.
Instead of passing an enum with the capability when creating it, relying
on polymorphism and a template struct tag to determine the object type
at runtime.

This is cleaner and avoids errors where we pass the wrong capability
type with the cap and do a bad cast at runtime.
2023-06-16 14:53:57 -07:00
Drew Galbraith
b4902a79ef [zion] Add per-process CapabilityTable object
Store this information in it's own object to make the API clearer.
2023-06-16 14:25:54 -07:00
Drew Galbraith
be12fa9a19 Add mutex fixme 2023-06-16 14:25:23 -07:00
Drew Galbraith
4e328c2f7a Set RSP0 on context switch
Previously we only set it on thread init which caused interrupts to
stomp on the stack of the most recently started thread, potentially
overwriting their cr3 and other variables and causing a crash.
2023-06-16 01:52:59 -07:00
Drew Galbraith
e5da93757a Working AHCI DMA IPC from yellowstone to denali.
We have a weird bug in context switching where a process's rsp0 ends up
pointing at the wrong value sometimes which crashes the OS.
2023-06-16 01:31:23 -07:00
Drew Galbraith
ccfe1b15ab Compile with -fno-rtti 2023-06-16 01:30:31 -07:00
Drew Galbraith
f154d11626 Add deletion functions 2023-06-16 01:30:08 -07:00
Drew Galbraith
6e20e5a610 Add more accessors to mammoth classes 2023-06-16 01:29:49 -07:00
Drew Galbraith
71e51730b7 Mark unblocked threads as runnable before enqueueing them 2023-06-16 01:29:00 -07:00
Drew Galbraith
ffa2d97a64 First iteration of denali server 2023-06-15 16:20:29 -07:00
drew
82b1a5c4db Build GCC/Binutils toolchain in tree. (#1)
Adds a x86_64-pc-acadia target triple.

Co-authored-by: Drew Galbraith <dgalbraith33@gmail.com>
Reviewed-on: https://gitea.tiramisu.one/drew/acadia/pulls/1
2023-06-15 18:39:14 -04:00
Drew Galbraith
b8b6576b7f Cleanup AHCI Ident a bit and reduce logging 2023-06-12 23:32:24 -07:00
Drew Galbraith
72885190e9 Resolved page faults from user stacks 2023-06-12 23:28:23 -07:00
Drew Galbraith
6c13fdc801 Add a memory region type to mammoth 2023-06-12 23:24:05 -07:00
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