Package org.jnode.driver

Examples of org.jnode.driver.DriverException


                    this.redMask = 0x00FF0000; // TODO get from modeInfoBlock
                    this.greenMask = 0x0000FF00; // TODO get from modeInfoBlock
                    this.blueMask = 0x000000FF; // TODO get from modeInfoBlock
                    break;
                default:
                    throw new DriverException("Unknown bits/pixel value " + bitsPerPixel);
            }
            bitmapGraphics = new SoftwareCursor(graphics);

            String transparency = SystemProperties.getProperty("org.jnode.awt.transparency");
            if ((bitsPerPixel == 32) && (transparency != null) && "true".equals(transparency)) {
View Full Code Here


            // Detect deviceID
            deviceId = getVMWareID();
            if (deviceId == SVGA_ID_0 || deviceId == SVGA_ID_INVALID) {
                dumpState();
                throw new DriverException("No supported VMWare SVGA found, found id 0x" +
                    NumberUtils.hex(deviceId));
            } else {
                log.debug("VMWare SVGA ID: 0x" + NumberUtils.hex(deviceId));
            }

            // Initialize and start FIFO
            fifoMem = initFifo(device, rm);

            // Read info
            this.capabilities = getReg32(SVGA_REG_CAPABILITIES);
            this.fifoCapabilities = hasCapability(SVGA_CAP_EXTENDED_FIFO) ? getFIFO(SVGA_FIFO_CAPABILITIES) : 0;
            this.videoRamSize = getReg32(SVGA_REG_FB_MAX_SIZE);
            this.maxWidth = getReg32(SVGA_REG_MAX_WIDTH);
            this.maxHeight = getReg32(SVGA_REG_MAX_HEIGHT);
            final int bitsPerPixel = getReg32(SVGA_REG_BITS_PER_PIXEL);
            this.bytesPerLine = getReg32(SVGA_REG_BYTES_PER_LINE);

            // Allocate framebuffer memory
            final Address videoRamAddr;
            if (device.getConfig().getDeviceID() == PCI_DEVICE_ID_VMWARE_SVGA2) {
                videoRamAddr =
                    Address.fromLong(device.getConfig().asHeaderType0().getBaseAddresses()[1].getMemoryBase());
            } else {
                videoRamAddr = Address.fromIntZeroExtend(SVGA_REG_FB_START);

            }
            this.videoRam = rm.claimMemoryResource(device, videoRamAddr, videoRamSize, ResourceManager.MEMMODE_NORMAL);
            this.bitsPerPixel = bitsPerPixel;
            switch (bitsPerPixel) {
                case 8:
                    bitmapGraphics =
                        BitmapGraphics.create8bppInstance(videoRam, width, height,
                            bytesPerLine, 0);
                    break;
                case 16:
                    bitmapGraphics =
                        BitmapGraphics.create16bppInstance(videoRam, width, height,
                            bytesPerLine, 0);
                    break;
                case 24:
                    bitmapGraphics =
                        BitmapGraphics.create24bppInstance(videoRam, width, height,
                            bytesPerLine, 0);
                    break;
                case 32:
                    bitmapGraphics =
                        BitmapGraphics.create32bppInstance(videoRam, width, height,
                            bytesPerLine, 0);
                    break;
                default:
                    throw new DriverException("Unknown bits/pixel value " + bitsPerPixel);
            }
            this.redMask = getReg32(SVGA_REG_RED_MASK);
            this.greenMask = getReg32(SVGA_REG_GREEN_MASK);
            this.blueMask = getReg32(SVGA_REG_BLUE_MASK);
            String transparency = SystemProperties.getProperty("org.jnode.awt.transparency");
View Full Code Here

                }
            });
        } catch (ResourceNotFreeException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new DriverException("Unknown exception", ex);
        }
    }
View Full Code Here

                if (((ep.getDescriptor().getAttributes() & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) &&
                        ((ep.getDescriptor().getEndPointAddress() & USB_DIR_IN) == 0))
                    break;
            }
            if (this.ep == null)
                throw new DriverException(
                        "Found no interrupt endpoint, HID specs required at least one.");

            //
            log.debug("Interval " + ep.getDescriptor().getInterval());

            // Create the interrupt request
            old = new byte[8];
            intData = new USBPacket(ep.getDescriptor().getMaxPacketSize());
            intPipe = (USBDataPipe) ep.getPipe();
            intPipe.addListener(this);
            intPipe.open();
            final USBRequest req = intPipe.createRequest(intData);
            intPipe.asyncSubmit(req);

            // Configure the default keyboard layout and register the KeyboardAPI
            KeyboardLayoutManager mgr = InitialNaming.lookup(KeyboardLayoutManager.NAME);
            apiAdapter.setKbInterpreter(mgr.createDefaultKeyboardInterpreter());
            dev.registerAPI(KeyboardAPI.class, apiAdapter);

            // Start the key event thread
            keyEventThread =
                    new ByteQueueProcessorThread(dev.getId() + "-daemon", keyCodeQueue, this);
            keyEventThread.start();
        } catch (USBException ex) {
            throw new DriverException(ex);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find keyboard layout manager", ex);
        } catch (KeyboardInterpreterException ex) {
            throw new DriverException(ex);
        }
    }
View Full Code Here

     */
    protected void startDevice() throws DriverException {
        try {
            kernel = new NVidiaCore(this, architecture, model, (PCIDevice) getDevice());
        } catch (ResourceNotFreeException ex) {
            throw new DriverException(ex);
        }
        super.startDevice();
        final Device dev = getDevice();
        dev.registerAPI(DisplayDataChannelAPI.class, kernel);
        dev.registerAPI(HardwareCursorAPI.class, kernel.getHardwareCursor());
View Full Code Here

    }

    private static final int parseArchitecture(ConfigurationElement config) throws DriverException {
        final String arch = config.getAttribute("architecture");
        if (arch == null) {
            throw new DriverException("Architecture must be set");
        } else if (arch.equals("NV04A")) {
            return NV04A;
        } else if (arch.equals("NV10A")) {
            return NV10A;
        } else if (arch.equals("NV11")) {
            return NV10A;
        } else if (arch.equals("NV11DDR")) {
            return NV10A;
        } else if (arch.equals("NV20A")) {
            return NV20A;
        } else if (arch.equals("NV28M")) {
            return NV28M;
        } else if (arch.equals("NV30A")) {
            return NV30A;
        } else {
            throw new DriverException("Unknown architecture " + arch);
        }
    }
View Full Code Here

                bootInfo = vgaIO.getReg32(NV32_NVSTRAPINFO2);
                CrystalFreqKHz = ((bootInfo & 0x00000040) != 0) ? 14318 : 13500;
                MaxVClockFreqKHz = 200000;
                break;
            default:
                throw new DriverException("Unknown architecture " + architecture);
        }
        log.debug("Memory size     =" + memSize + "MB");
        log.debug("CrystalFreqKHz  =" + CrystalFreqKHz);
        log.debug("MaxVClockFreqKHz=" + MaxVClockFreqKHz);
    }
View Full Code Here

     */
    protected void startDevice() throws DriverException {
        try {
            driver = new CirrusCore(this, architecture, model, (PCIDevice) getDevice());
        } catch (ResourceNotFreeException ex) {
            throw new DriverException(ex);
        }
        super.startDevice();
        @SuppressWarnings("unused")
        final Device dev = getDevice();
        //dev.registerAPI(DisplayDataChannelAPI.class, driver);
View Full Code Here

                        }
                    });
        } catch (ResourceNotFreeException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new DriverException("Unknown exception", ex);
        }
    }
View Full Code Here

     */
    protected void startDevice() throws DriverException {
        try {
            kernel = new Mach64Core(this, model, (PCIDevice) getDevice());
        } catch (ResourceNotFreeException ex) {
            throw new DriverException(ex);
        }
        super.startDevice();
        // final Device dev = getDevice();
        // dev.registerAPI(DisplayDataChannelAPI.class, kernel);
        // dev.registerAPI(HardwareCursorAPI.class, kernel.getHardwareCursor());
View Full Code Here

TOP

Related Classes of org.jnode.driver.DriverException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.