io = rm.claimIOResource(owner, iobase, iolength);
io = claimPorts(rm, owner, iobase, iolength);
	public Ne2000Core(		Ne2000PCIDriver driver,		ResourceOwner owner,		Device device,		Ne2000Flags flags)	throws ResourceNotFreeException, DriverException {			final int irq = getIRQ(device, flags);		this.driver = driver;		this.flags = flags;		this.tx_active = false;		// Get the start of the IO address space		iobase = getIOBase(device, flags);		final int iolength = getIOLength(device, flags);		final ResourceManager rm;		try {			rm = (ResourceManager)InitialNaming.lookup(ResourceManager.NAME);		} catch (NameNotFoundException ex) {			throw new DriverException("Cannot find ResourceManager");		}		this.irq = rm.claimIRQ(owner, irq, this, true);		try {			io = rm.claimIOResource(owner, iobase, iolength);		} catch (ResourceNotFreeException ex) {			this.irq.release();			throw ex;		}		// Reset the device		reset();		// Load the hw address, todo this we must first do some initialization,		// otherwise the hw address cannot be read.		setReg(NE_P0_CR, NE_CR_NODMA | NE_CR_PS0 | NE_CR_STP); // Select page 0		setReg(NE_P0_DCR, 0x49); // Set word-wide access		setReg(NE_P0_RBCR0, 0x00); // Clear count regs		setReg(NE_P0_RBCR1, 0x00);		setReg(NE_P0_IMR, 0x00); // Mask completion irq		setReg(NE_P0_ISR, 0xff);		setReg(NE_P0_RCR, NE_RXOFF);		setReg(NE_P0_TCR, NE_TXOFF);		// Load the start page				this.nic_start = probeNicMemoryStart();		this.tx_start = nic_start;		this.rx_start = tx_start + TX_PAGES;		this.rx_end = nic_start + (flags.getMemSize() / NE_PAGESIZE);		final byte[] saprom = new byte[32];		getNicData(0, saprom, 0, 32);		if (flags.is16bit()) {			this.hwAddress =				new EthernetAddress(					saprom[0],					saprom[2],					saprom[4],					saprom[6],					saprom[8],					saprom[10]);		} else {			this.hwAddress = new EthernetAddress(saprom, 0);		}		log.debug(			"Found "				+ flags.getName()				+ " IRQ="				+ irq				+ ", IOBase=0x"				+ NumberUtils.hex(iobase)				+ ", MAC Address="				+ hwAddress);	}