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.
This commit is contained in:
Drew Galbraith 2023-06-16 01:31:23 -07:00
parent ccfe1b15ab
commit e5da93757a
11 changed files with 171 additions and 84 deletions

View file

@ -6,14 +6,34 @@
#include "hw/pcie.h"
uint64_t main() {
int main() {
dbgln("Yellowstone Initializing.");
uint64_t vaddr;
check(ZAddressSpaceMap(Z_INIT_VMAS_SELF, 0, Z_INIT_BOOT_VMMO, &vaddr));
Channel local;
check(SpawnProcessFromElfRegion(vaddr, local));
local.WriteStr("Hello!");
DenaliRead read{
.device_id = 0,
.lba = 0,
.size = 1,
};
check(ZChannelSend(local.cap(), DENALI_READ, sizeof(DenaliRead),
reinterpret_cast<uint8_t*>(&read), 0, nullptr));
DenaliReadResponse resp;
uint64_t mem_cap, type, bytes, caps;
check(ZChannelRecv(local.cap(), sizeof(resp),
reinterpret_cast<uint8_t*>(&resp), 1, &mem_cap, &type,
&bytes, &caps));
dbgln("Resp: %u", type);
check(ZAddressSpaceMap(Z_INIT_VMAS_SELF, 0, mem_cap, &vaddr));
uint32_t* mbr = reinterpret_cast<uint32_t*>(vaddr + 0x1FE);
dbgln("MBR: %x", *mbr);
DumpPciEDevices();