Esempio n. 1
0
func NewApic(info *DeviceInfo) (Device, error) {

	apic := new(Apic)

	// Figure out our Apic addresses.
	// See the note above re: fixed addresses.
	apic.IOApic = platform.IOApic()
	apic.LApic = platform.LApic()

	return apic, apic.init(info)
}
Esempio n. 2
0
func NewPciBus(info *DeviceInfo) (Device, error) {

	// Create the bus.
	bus := new(PciBus)
	bus.devices = make([]*PciDevice, 0, 0)
	bus.PioDevice.IoMap = IoMap{
		// Our configuration ports.
		MemoryRegion{0xcf8, 4}: &PciConfAddr{PciBus: bus},
		MemoryRegion{0xcfc, 4}: &PciConfData{PciBus: bus},
	}

	// Sensible default.
	// We reserve our memory hole from 256mb below 4gb to the IOApic.
	bus.Hole.Start = 0xf0000000
	bus.Hole.Size = uint64(platform.IOApic() - bus.Hole.Start)

	// Return our bus and device.
	return bus, bus.init(info)
}