1/* 2 * Copyright (c) 2003-2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 35 unchanged lines hidden (view full) --- 44#include "mem/physical.hh" 45#include "sim/byteswap.hh" 46#include "sim/system.hh" 47#include "sim/debug.hh" 48 49#if FULL_SYSTEM 50#include "arch/vtophys.hh" 51#include "kern/kernel_stats.hh" |
52#include "mem/vport.hh" |
53#else 54#include "params/System.hh" 55#endif 56 57using namespace std; 58using namespace TheISA; 59 60vector<System *> System::systemList; 61 62int System::numSystemsRunning = 0; 63 64System::System(Params *p) 65 : SimObject(p), physmem(p->physmem), _numContexts(0), 66#if FULL_SYSTEM 67 init_param(p->init_param), |
68 loadAddrMask(p->load_addr_mask), 69#else 70 page_ptr(0), 71 next_PID(0), 72#endif 73 memoryMode(p->mem_mode), _params(p) 74{ 75 // add self to global system list --- 4 unchanged lines hidden (view full) --- 80 if (!debugSymbolTable) 81 debugSymbolTable = new SymbolTable; 82 83 84 /** 85 * Get a functional port to memory 86 */ 87 Port *mem_port; |
88 functionalPort = new FunctionalPort(name() + "-fport"); |
89 mem_port = physmem->getPort("functional"); |
90 functionalPort->setPeer(mem_port); 91 mem_port->setPeer(functionalPort); |
92 |
93 virtPort = new VirtualPort(name() + "-fport"); |
94 mem_port = physmem->getPort("functional"); |
95 virtPort->setPeer(mem_port); 96 mem_port->setPeer(virtPort); |
97 98 99 /** 100 * Load the kernel code into memory 101 */ 102 if (params()->kernel == "") { 103 inform("No kernel set for full system simulation. Assuming you know what" 104 " you're doing...\n"); 105 } else { 106 // Load kernel code 107 kernel = createObjectFile(params()->kernel); 108 inform("kernel located at: %s", params()->kernel); 109 110 if (kernel == NULL) 111 fatal("Could not load kernel file %s", params()->kernel); 112 113 // Load program sections into memory |
114 kernel->loadSections(functionalPort, loadAddrMask); |
115 116 // setup entry points 117 kernelStart = kernel->textBase(); 118 kernelEnd = kernel->bssBase() + kernel->bssSize(); 119 kernelEntry = kernel->entryPoint(); 120 121 // load symbols 122 if (!kernel->loadGlobalSymbols(kernelSymtab)) --- 206 unchanged lines hidden --- |