[mammoth] Create a method for getting initial caps.
This commit is contained in:
parent
4c936623b5
commit
528723e490
15 changed files with 108 additions and 22 deletions
|
|
@ -17,8 +17,6 @@
|
|||
#define ZC_PROC_SPAWN_PROC 0x100
|
||||
#define ZC_PROC_SPAWN_THREAD 0x101
|
||||
|
||||
#define Z_INIT_PROC_SELF 0x1
|
||||
|
||||
// Thread Calls.
|
||||
#define Z_THREAD_CREATE 0x10
|
||||
#define Z_THREAD_START 0x11
|
||||
|
|
@ -28,15 +26,11 @@
|
|||
#define Z_ADDRESS_SPACE_MAP 0x21
|
||||
#define Z_ADDRESS_SPACE_UNMAP 0x22
|
||||
|
||||
#define Z_INIT_VMAS_SELF 0x20
|
||||
|
||||
#define Z_MEMORY_OBJECT_CREATE 0x30
|
||||
#define Z_MEMORY_OBJECT_CREATE_PHYSICAL 0x31
|
||||
|
||||
#define Z_TEMP_PCIE_CONFIG_OBJECT_CREATE 0x3F
|
||||
|
||||
#define Z_INIT_BOOT_VMMO 0x31
|
||||
|
||||
// IPC Calls
|
||||
#define Z_CHANNEL_CREATE 0x40
|
||||
#define Z_CHANNEL_SEND 0x41
|
||||
|
|
|
|||
6
zion/include/zinit.h
Normal file
6
zion/include/zinit.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#define Z_INIT_PROC_SELF 0x00
|
||||
#define Z_INIT_VMAS_SELF 0x01
|
||||
|
||||
#define Z_BOOT_DENALI_VMMO 0x1000
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
#include "boot/boot_info.h"
|
||||
#include "debug/debug.h"
|
||||
#include "include/zcall.h"
|
||||
#include "include/zinit.h"
|
||||
#include "lib/ref_ptr.h"
|
||||
#include "memory/paging_util.h"
|
||||
#include "object/process.h"
|
||||
|
|
@ -71,7 +72,7 @@ uint64_t LoadElfProgram(Process& dest_proc, uint64_t base, uint64_t offset) {
|
|||
program.type, program.flags, program.offset, program.vaddr,
|
||||
program.paddr, program.filesz, program.memsz, program.align);
|
||||
#endif
|
||||
auto mem_obj = MakeRefCounted<MemoryObject>(program.filesz);
|
||||
auto mem_obj = MakeRefCounted<MemoryObject>(program.memsz);
|
||||
mem_obj->CopyBytesToObject(base + program.offset, program.filesz);
|
||||
dest_proc.vmas()->MapInMemoryObject(program.vaddr, mem_obj);
|
||||
}
|
||||
|
|
@ -137,7 +138,7 @@ void LoadInitProgram() {
|
|||
auto port = MakeRefCounted<Port>();
|
||||
uint64_t port_cap = proc->AddNewCapability(port, ZC_READ | ZC_WRITE);
|
||||
|
||||
uint64_t vmmo_id = Z_INIT_BOOT_VMMO;
|
||||
uint64_t vmmo_id = Z_BOOT_DENALI_VMMO;
|
||||
ZMessage vmmo_msg{
|
||||
.type = 0,
|
||||
.num_bytes = 8,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "debug/debug.h"
|
||||
#include "include/zcall.h"
|
||||
#include "include/zinit.h"
|
||||
#include "memory/paging_util.h"
|
||||
#include "memory/physical_memory.h"
|
||||
#include "object/thread.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue