Esempio n. 1
0
        internal static void LoadELFLibrary(string name, Multiboot.Header mboot, SymbolTable stab)
        {
            Formatter.Write("Loading library: ", arch.BootInfoOutput);
            Formatter.Write(name, arch.BootInfoOutput);
            Formatter.Write("... ", arch.BootInfoOutput);

            Multiboot.Module mod        = find_module(mboot.modules, name);
            ulong            mod_vaddr  = map_in(mod);
            ulong            load_vaddr = ElfReader.LoadModule(arch.VirtualRegions, arch.VirtMem, stab, mod_vaddr, mod.base_addr, name);

            ElfReader.LoadSymbols(stab, mod_vaddr, load_vaddr);

            Formatter.WriteLine("done", arch.BootInfoOutput);
            Formatter.Write(name, arch.DebugOutput);
            Formatter.Write(" library loaded, load address: ", arch.DebugOutput);
            Formatter.Write(load_vaddr, "X", arch.DebugOutput);
            Formatter.WriteLine(arch.DebugOutput);
        }
Esempio n. 2
0
        internal static Process LoadELFModule(ulong base_addr, ulong len, string name, Multiboot.Header mboot, SymbolTable stab, Dictionary <string, Process> running_processes, ulong stack_size,
                                              object[] parameters)
        {
            Formatter.Write("Loading module: ", arch.BootInfoOutput);
            Formatter.Write(name, arch.BootInfoOutput);
            Formatter.Write(" from ", arch.BootInfoOutput);
            Formatter.Write(base_addr, "X", arch.BootInfoOutput);
            Formatter.WriteLine(arch.BootInfoOutput);

            ulong e_point = ElfReader.LoadObject(arch.VirtualRegions, arch.VirtMem, stab, base_addr, base_addr, name, out var tls_size);

            Process p = Process.Create(name, e_point, stack_size, arch.VirtualRegions, stab, parameters, tls_size);

            Formatter.Write(name, arch.DebugOutput);
            Formatter.Write(" process created, entry point: ", arch.DebugOutput);
            Formatter.Write(e_point, "X", arch.DebugOutput);
            Formatter.WriteLine(arch.DebugOutput);

            return(p);
        }
Esempio n. 3
0
 protected abstract void ReadDescriptor(ElfReader reader, uint descriptorLength);
Esempio n. 4
0
 internal void ReadDescriptorInternal(ElfReader reader, uint descriptorLength)
 {
     ReadDescriptor(reader, descriptorLength);
 }
Esempio n. 5
0
 protected override void Read(ElfReader reader)
 {
     // This is not read by this instance but by ElfReader directly
 }