33 #include "pedigree/kernel/Log.h" 34 #include "pedigree/kernel/machine/Bus.h" 35 #include "pedigree/kernel/machine/Controller.h" 36 #include "pedigree/kernel/machine/Device.h" 37 #include "pedigree/kernel/machine/Pci.h" 38 #include "pedigree/kernel/panic.h" 39 #include "pedigree/kernel/utilities/String.h" 40 #include "pedigree/kernel/utilities/Vector.h" 41 #include "pedigree/kernel/utilities/new" 55 if (m_Vga.initialise() ==
false)
56 panic(
"Pc: Vga initialisation failed");
59 Rtc &rtc = Rtc::instance();
61 panic(
"Pc: Rtc initialisation phase 1 failed");
65 Acpi &acpi = Acpi::instance();
71 Smp &smp = Smp::instance();
79 uint64_t localApicAddress = 0;
83 bool bLocalApicValid =
false;
85 if ((bLocalApicValid = acpi.validApicInfo()) ==
true)
86 localApicAddress = acpi.getLocalApicAddress();
89 if (bLocalApicValid ==
false && (bLocalApicValid = smp.valid()) ==
true)
90 localApicAddress = smp.getLocalApicAddress();
95 if (bLocalApicValid ==
true && localApicAddress &&
96 m_LocalApic.initialise(localApicAddress))
98 NOTICE(
"Local APIC initialised");
119 NOTICE(
"Falling back to dual 8259 PIC Mode");
124 panic(
"Pc: Pic initialisation failed");
138 panic(
"Pc: Rtc initialisation phase 2 failed");
143 panic(
"Pc: Pit initialisation failed");
146 m_Ps2Controller.initialise();
151 m_SMBios.initialise();
154 m_bInitialised =
true;
157 void Pc::deinitialise()
159 m_bInitialised =
false;
162 #if defined(MULTIPROCESSOR) 163 void Pc::initialiseProcessor()
168 if (m_LocalApic.initialiseProcessor() ==
false)
169 panic(
"Pc::initialiseProcessor(): Failed to initialise the local APIC");
175 m_Keyboard.startReaderThread();
208 m_IsaBus.
addChild(&m_Ps2Controller);
225 return &m_pSerial[n];
250 #ifdef MULTIPROCESSOR 259 return &Rtc::instance();
272 #ifdef MULTIPROCESSOR 273 void Pc::stopAllOtherProcessors()
275 m_LocalApic.interProcessorInterruptAllExcludingThis(
276 IPI_HALT_VECTOR, 0 );
281 : m_Vga(0x3C0, 0xB8000), m_pKeyboard(0)
291 m_Keyboard(&m_Ps2Controller), m_IsaBus(
"ISA"), m_Ps2Controller()
293 m_pKeyboard = &m_Keyboard;
virtual void initialise3()
Called after processor startup - for thread creation etc.
virtual void setKeyboard(Keyboard *kb)
virtual Timer * getTimer()
virtual void setInterruptNumber(uintptr_t n)
virtual Vector< Address * > & addresses()
static void addToRoot(Device *device)
virtual Serial * getSerial(size_t n)
bool initialise1() INITIALISATION_ONLY
virtual Keyboard * getKeyboard()
virtual void setBase(uintptr_t nBaseAddr)
virtual SchedulerTimer * getSchedulerTimer()
virtual void setSpecificType(String str)
void addChild(Device *pDevice)
void setParent(Device *p)
virtual size_t getNumVga()
virtual size_t getNumSerial()
bool initialise() INITIALISATION_ONLY
void EXPORTED_PUBLIC panic(const char *msg) NORETURN
bool initialise2() INITIALISATION_ONLY
virtual void initialiseDeviceTree()
virtual Vga * getVga(size_t n)
virtual void initialise()
Initialises the device.
bool initialise() INITIALISATION_ONLY
virtual void initialise() INITIALISATION_ONLY