Example #1
0
static void
readSettings(struct sis_info *info)
{
	const char *parameter;

	void *handle = load_driver_settings("sis900");
	if (handle == NULL)
		return;

	parameter = get_driver_parameter(handle, "duplex", "auto", "auto");
	if (!strcasecmp(parameter, "full"))
		info->fixedMode = LINK_FULL_DUPLEX;
	else if (!strcasecmp(parameter, "half"))
		info->fixedMode = LINK_HALF_DUPLEX;

	parameter = get_driver_parameter(handle, "speed", "auto", "auto");
	if (!strcasecmp(parameter, "100"))
		info->fixedMode |= LINK_SPEED_100_MBIT;
	else if (!strcasecmp(parameter, "10"))
		info->fixedMode |= LINK_SPEED_10_MBIT;
	else if (!strcasecmp(parameter, "1"))
		info->fixedMode |= LINK_SPEED_HOME;

	// it's either all or nothing

	if ((info->fixedMode & LINK_DUPLEX_MASK) == 0
		|| (info->fixedMode & LINK_SPEED_MASK) == 0)
		info->fixedMode = 0;
	
	unload_driver_settings(handle);
}
Example #2
0
status_t
arch_debug_console_init_settings(kernel_args *args)
{
	uint32 baudRate = kSerialBaudRate;
	uint16 basePort = sSerialBasePort;
	uint16 divisor;
	void *handle;

	// get debug settings
	handle = load_driver_settings("kernel");
	if (handle != NULL) {
		const char *value = get_driver_parameter(handle, "serial_debug_port",
			NULL, NULL);
		if (value != NULL) {
			int32 number = strtol(value, NULL, 0);
			if (number >= MAX_SERIAL_PORTS) {
				// use as port number directly
				basePort = number;
			} else if (number >= 0) {
				// use as index into port array
				if (args->platform_args.serial_base_ports[number] != 0)
					basePort = args->platform_args.serial_base_ports[number];
			} else {
				// ignore value and use default
			}
		}

		value = get_driver_parameter(handle, "serial_debug_speed", NULL, NULL);
		if (value != NULL) {
			int32 number = strtol(value, NULL, 0);
			switch (number) {
				case 9600:
				case 19200:
				case 38400:
				case 57600:
				case 115200:
				//case 230400:
					baudRate = number;
			}
		}

		unload_driver_settings(handle);
	}

	if (sSerialBasePort == basePort && baudRate == kSerialBaudRate)
		return B_OK;

	sSerialBasePort = basePort;
	divisor = (uint16)(115200 / baudRate);

	out8(0x80, sSerialBasePort + SERIAL_LINE_CONTROL);	/* set divisor latch access bit */
	out8(divisor & 0xf, sSerialBasePort + SERIAL_DIVISOR_LATCH_LOW);
	out8(divisor >> 8, sSerialBasePort + SERIAL_DIVISOR_LATCH_HIGH);
	out8(3, sSerialBasePort + SERIAL_LINE_CONTROL);		/* 8N1 */

	return B_OK;
}
status_t
arch_debug_console_init_settings(kernel_args *args)
{
    uint32 baudRate = kSerialBaudRate;
    uint16 basePort = sSerialBasePort;
    void *handle;

    // get debug settings
    handle = load_driver_settings("kernel");
    if (handle != NULL) {
        const char *value = get_driver_parameter(handle, "serial_debug_port",
                            NULL, NULL);
        if (value != NULL) {
            int32 number = strtol(value, NULL, 0);
            if (number >= MAX_SERIAL_PORTS) {
                // use as port number directly
                basePort = number;
            } else if (number >= 0) {
                // use as index into port array
                if (args->platform_args.serial_base_ports[number] != 0)
                    basePort = args->platform_args.serial_base_ports[number];
            } else {
                // ignore value and use default
            }
        }

        value = get_driver_parameter(handle, "serial_debug_speed", NULL, NULL);
        if (value != NULL) {
            int32 number = strtol(value, NULL, 0);
            switch (number) {
            case 9600:
            case 19200:
            case 38400:
            case 57600:
            case 115200:
                //case 230400:
                baudRate = number;
            }
        }

        unload_driver_settings(handle);
    }

    if (sSerialBasePort == basePort && baudRate == kSerialBaudRate)
        return B_OK;

    init_serial_port(sSerialBasePort, kSerialBaudRate);

    return B_OK;
}
Example #4
0
void
load_settings()
{
	void *handle = load_driver_settings(DRIVER_NAME);
	if (handle == 0)
		return;

	gTraceOn = get_driver_boolean_parameter(handle, "trace", gTraceOn, true);
	gTraceState = get_driver_boolean_parameter(handle,
				"trace_state", gTraceState, true);
	gTraceRX = get_driver_boolean_parameter(handle, "trace_rx", gTraceRX, true);
	gTraceTX = get_driver_boolean_parameter(handle, "trace_tx", gTraceTX, true);
	gTraceStats = get_driver_boolean_parameter(handle,
				"trace_stats", gTraceStats, true);
	gTruncateLogFile = get_driver_boolean_parameter(handle,
				"reset_logfile", gTruncateLogFile, true);
	gAddTimeStamp = get_driver_boolean_parameter(handle,
				"add_timestamp", gAddTimeStamp, true);
	const char * logFilePath = get_driver_parameter(handle,
				"logfile", NULL, "/var/log/" DRIVER_NAME ".log");
	if (logFilePath != NULL) {
		gLogFilePath = strdup(logFilePath);
	}

	unload_driver_settings(handle);

	create_log();
}
Example #5
0
status_t
read_midi_settings(struct midi_settings* settings)
{
	if (settings == NULL)
		return B_ERROR;

	BPath path;
	status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path);
	if (status != B_OK)
		return status;

	path.Append(SETTINGS_FILE);
	void* handle = load_driver_settings(path.Path());
	if (handle == NULL)
		return B_ERROR;

	const char* soundfont = get_driver_parameter(handle, "soundfont", NULL,
		NULL);
	if (soundfont == NULL)
		return B_ERROR;
	strlcpy(settings->soundfont_file, soundfont,
		sizeof(settings->soundfont_file));

	unload_driver_settings(handle);
	return B_OK;
}
Example #6
0
void load_settings()
{
	void* handle = load_driver_settings(DRIVER_NAME);
	if (handle == 0)
		return;

	gTraceMask = strtoul(get_driver_parameter(handle, "trace", "1", "0"), 0, 0);
	gTruncateLogFile = get_driver_boolean_parameter(handle,	"truncate_logfile",
						gTruncateLogFile, true);
	gAddTimeStamp = get_driver_boolean_parameter(handle, "add_timestamp",
						gAddTimeStamp, true);
	const char* logFilePath = get_driver_parameter(handle, "logfile",
						NULL, "/var/log/" DRIVER_NAME ".log");
	if (logFilePath != NULL)
		gLogFilePath = strdup(logFilePath);

	unload_driver_settings(handle);

	create_log();
}
Example #7
0
status_t load_settings(void)
{
	void *handle;
	const char *val;
	handle = load_driver_settings("googlefs");
	if (!handle)
		return ENOENT;

	dprintf("googlefs: loaded settings\n");

	val = get_driver_parameter(handle, "server", \
			DEFAULT_GOOGLE_SERVER, DEFAULT_GOOGLE_SERVER);
	strncpy(google_server, val, 20);
	google_server[20-1] = '\0';

	val = get_driver_parameter(handle, "port", "80", "80");
	google_server_port = strtoul(val, NULL, 10);

	val = get_driver_parameter(handle, "max_nodes", "5000", "5000");
	max_vnodes = strtoul(val, NULL, 10);
	max_vnodes = MIN(max_vnodes, 1000000);
	max_vnodes = MAX(max_vnodes, 10);

	val = get_driver_parameter(handle, "max_results", "50", "50");
	max_results = strtoul(val, NULL, 10);
	max_results = MIN(max_results, 1000);
	max_results = MAX(max_results, 5);

	sync_unlink_queries = get_driver_boolean_parameter(handle, "sync_unlink", false, true);

	dprintf("googlefs: settings: server = %s\n", google_server);
	dprintf("googlefs: settings: max_nodes = %lu\n", max_vnodes);
	dprintf("googlefs: settings: max_results = %lu\n", max_results);
	dprintf("googlefs: settings: sync_unlink = %c\n", sync_unlink_queries?'t':'f');
	unload_driver_settings(handle);
	return B_OK;
}
status_t
pci_controller_init(void)
{
	bool search_mech1 = true;
	bool search_mech2 = true;
	bool search_bios = true;
	void *config = NULL;
	status_t status;

	status = pci_x86_irq_init();
	if (status != B_OK)
		return status;

	config = load_driver_settings("pci");
	if (config) {
		const char *mech = get_driver_parameter(config, "mechanism",
			NULL, NULL);
		if (mech) {
			search_mech1 = search_mech2 = search_bios = false;
			if (strcmp(mech, "1") == 0)
				search_mech1 = true;
			else if (strcmp(mech, "2") == 0)
				search_mech2 = true;
			else if (strcmp(mech, "bios") == 0)
				search_bios = true;
			else
				panic("Unknown pci config mechanism setting %s\n", mech);
		}
		unload_driver_settings(config);
	}

	// TODO: check safemode "don't call the BIOS" setting and unset search_bios!

	// PCI configuration mechanism 1 is the preferred one.
	// If it doesn't work, try mechanism 2.
	// Finally, try to fallback to PCI BIOS

	if (search_mech1) {
		// check for mechanism 1
		out32(0x80000000, PCI_MECH1_REQ_PORT);
		if (0x80000000 == in32(PCI_MECH1_REQ_PORT)) {
			dprintf("PCI: mechanism 1 controller found\n");
			return pci_controller_add(&pci_controller_x86_mech1, NULL);
		}
	}

	if (search_mech2) {
		// check for mechanism 2
		out8(0x00, 0xCFB);
		out8(0x00, 0xCF8);
		out8(0x00, 0xCFA);
		if (in8(0xCF8) == 0x00 && in8(0xCFA) == 0x00) {
			dprintf("PCI: mechanism 2 controller found\n");
			return pci_controller_add(&pci_controller_x86_mech2, NULL);
		}
	}

	if (search_bios) {
		// check for PCI BIOS
		if (pci_bios_init() == B_OK) {
			dprintf("PCI: BIOS support found\n");
			return pci_controller_add(&pci_controller_x86_bios, NULL);
		}
	}

	dprintf("PCI: no configuration mechanism found\n");
	return B_ERROR;
}
Example #9
0
status_t
fs_mount(fs_volume *_vol, const char *device, ulong flags, const char *args,
	ino_t *_rootID)
{
	nspace *ns;
	vnode *newNode = NULL;
	char lockname[32];
	void *handle;
	unsigned long mountFlags = 0;
	status_t result = B_NO_ERROR;

	ERRPRINT("fs_mount - ENTER\n");

	ns = ntfs_malloc(sizeof(nspace));
	if (!ns) {
		result = ENOMEM;
		goto exit;
	}

	*ns = (nspace) {
		.state = NF_FreeClustersOutdate | NF_FreeMFTOutdate,
		.show_sys_files = false,
		.ro = false,
		.flags = 0
	};

	strcpy(ns->devicePath,device);

	sprintf(lockname, "ntfs_lock %lx", ns->id);
	recursive_lock_init_etc(&(ns->vlock), lockname, MUTEX_FLAG_CLONE_NAME);

	handle = load_driver_settings("ntfs");
	ns->show_sys_files = ! (strcasecmp(get_driver_parameter(handle,
		"hide_sys_files", "true", "true"), "true") == 0);
	ns->ro = strcasecmp(get_driver_parameter(handle, "read_only", "false",
		"false"), "false") != 0;
	ns->noatime = strcasecmp(get_driver_parameter(handle, "no_atime", "true",
		"true"), "true") == 0;
	unload_driver_settings(handle);

	if (ns->ro || (flags & B_MOUNT_READ_ONLY) != 0) {
		mountFlags |= MS_RDONLY;
		ns->flags |= B_FS_IS_READONLY;
	}

	// TODO: this does not take read-only volumes into account!
	ns->ntvol = utils_mount_volume(device, mountFlags, true);
	if (ns->ntvol != NULL)
		result = B_NO_ERROR;
	else
		result = errno;

	if (result == B_NO_ERROR) {
		*_rootID = FILE_root;
		ns->id = _vol->id;
		_vol->private_volume = (void *)ns;
		_vol->ops = &gNTFSVolumeOps;

		newNode = (vnode*)ntfs_calloc(sizeof(vnode));
		if (newNode == NULL)
			result = ENOMEM;
		else {
			newNode->vnid = *_rootID;
			newNode->parent_vnid = -1;

			result = publish_vnode(_vol, *_rootID, (void*)newNode,
				&gNTFSVnodeOps, S_IFDIR, 0);
			if (result != B_NO_ERROR) {
				free(ns);
				result = EINVAL;
				goto exit;
			} else {
				result = B_NO_ERROR;
				ntfs_mark_free_space_outdated(ns);
				ntfs_calc_free_space(ns);
			}
		}
	}

exit:
	ERRPRINT("fs_mount - EXIT, result code is %s\n", strerror(result));

	return result;
}


status_t
fs_unmount(fs_volume *_vol)
{
	nspace *ns = (nspace*)_vol->private_volume;
	status_t result = B_NO_ERROR;

	ERRPRINT("fs_unmount - ENTER\n");

	ntfs_umount(ns->ntvol, true);

	recursive_lock_destroy(&(ns->vlock));

	free(ns);

	ERRPRINT("fs_unmount - EXIT, result is %s\n", strerror(result));

	return result;
}
Example #10
0
File: driver.c Project: DonCN/haiku
status_t
init_driver(void) {
	void *settings_handle;

	// get driver/accelerant settings, apsed
	settings_handle  = load_driver_settings (DRIVER_PREFIX ".settings");
	if (settings_handle != NULL) {
		const char *item;
		char       *end;
		uint32      value;

		// for driver
		item = get_driver_parameter (settings_handle, "accelerant", "", "");
		if ((strlen (item) > 0) && (strlen (item) < sizeof (current_settings.accelerant) - 1)) {
			strcpy (current_settings.accelerant, item);
		}
		current_settings.dumprom = get_driver_boolean_parameter (settings_handle, "dumprom", false, false);

		// for accelerant
		item = get_driver_parameter (settings_handle, "logmask", "0x00000000", "0x00000000");
		value = strtoul (item, &end, 0);
		if (*end == '\0') current_settings.logmask = value;

		item = get_driver_parameter (settings_handle, "memory", "0", "0");
		value = strtoul (item, &end, 0);
		if (*end == '\0') current_settings.memory = value;

		current_settings.hardcursor = get_driver_boolean_parameter (settings_handle, "hardcursor", false, false);
		current_settings.usebios = get_driver_boolean_parameter (settings_handle, "usebios", false, false);
		current_settings.switchhead = get_driver_boolean_parameter (settings_handle, "switchhead", false, false);
		current_settings.force_pci = get_driver_boolean_parameter (settings_handle, "force_pci", false, false);
		current_settings.unhide_fw = get_driver_boolean_parameter (settings_handle, "unhide_fw", false, false);
		current_settings.pgm_panel = get_driver_boolean_parameter (settings_handle, "pgm_panel", false, false);

		unload_driver_settings (settings_handle);
	}

	/* get a handle for the pci bus */
	if (get_module(B_PCI_MODULE_NAME, (module_info **)&pci_bus) != B_OK)
		return B_ERROR;

	/* get a handle for the isa bus */
	if (get_module(B_ISA_MODULE_NAME, (module_info **)&isa_bus) != B_OK)
	{
		put_module(B_PCI_MODULE_NAME);
		return B_ERROR;
	}

	/* get a handle for the agp bus if it exists */
	get_module(B_AGP_GART_MODULE_NAME, (module_info **)&agp_bus);

	/* driver private data */
	pd = (DeviceData *)calloc(1, sizeof(DeviceData));
	if (!pd) {
		if (agp_bus)
			put_module(B_AGP_GART_MODULE_NAME);
		put_module(B_ISA_MODULE_NAME);
		put_module(B_PCI_MODULE_NAME);
		return B_ERROR;
	}
	/* initialize the benaphore */
	INIT_BEN(pd->kernel);
	/* find all of our supported devices */
	probe_devices();
	return B_OK;
}
Example #11
0
status_t
Settings::ReadSwapSettings()
{
	void* settings = load_driver_settings(kVirtualMemorySettings);
	if (settings == NULL)
		return kErrorSettingsNotFound;
	CObjectDeleter<void, status_t> settingDeleter(settings,
		&unload_driver_settings);

	const char* enabled = get_driver_parameter(settings, "vm", NULL, NULL);
	const char* automatic = get_driver_parameter(settings, "swap_auto",
		NULL, NULL);
	const char* size = get_driver_parameter(settings, "swap_size", NULL, NULL);
	const char* volume = get_driver_parameter(settings, "swap_volume_name",
		NULL, NULL);
	const char* device = get_driver_parameter(settings,
		"swap_volume_device", NULL, NULL);
	const char* filesystem = get_driver_parameter(settings,
		"swap_volume_filesystem", NULL, NULL);
	const char* capacity = get_driver_parameter(settings,
		"swap_volume_capacity", NULL, NULL);

	if (enabled == NULL	|| automatic == NULL || size == NULL || device == NULL
		|| volume == NULL || capacity == NULL || filesystem == NULL)
		return kErrorSettingsInvalid;

	off_t volCapacity = atoll(capacity);

	SetSwapEnabled(get_driver_boolean_parameter(settings,
		"vm", true, false));
	SetSwapAutomatic(get_driver_boolean_parameter(settings,
		"swap_auto", true, false));
	SetSwapSize(atoll(size));

	int32 bestScore = -1;
	dev_t bestVol = -1;

	BVolume vol;
	fs_info volStat;
	BVolumeRoster roster;
	while (roster.GetNextVolume(&vol) == B_OK) {
		if (!vol.IsPersistent() || vol.IsReadOnly() || vol.IsRemovable()
			|| vol.IsShared())
			continue;
		if (fs_stat_dev(vol.Device(), &volStat) == 0) {
			int32 score = 0;
			if (strcmp(volume, volStat.volume_name) == 0)
				score += 4;
			if (strcmp(device, volStat.device_name) == 0)
				score += 3;
			if (volCapacity == volStat.total_blocks * volStat.block_size)
				score += 2;
			if (strcmp(filesystem, volStat.fsh_name) == 0)
				score += 1;
			if (score >= 4 && score > bestScore) {
				bestVol = vol.Device();
				bestScore = score;
			}
		}
	}

	SetSwapVolume(bestVol);
	fInitialSettings = fCurrentSettings;

	if (bestVol < 0)
		return kErrorVolumeNotFound;

	return B_OK;
}
Example #12
0
static void
GetDriverSettings(void)
{
	void *settings_handle = NULL;

	SHOW_FLOW0( 1, "" );
	
	// init settings to defaults;
	current_settings = def_settings;
	
	// get driver/accelerant settings, apsed
	settings_handle  = load_driver_settings ("radeon.settings");
	if (settings_handle != NULL) {
		const char *item;
		char       *end;
		uint32      value;

		item = get_driver_parameter (settings_handle, "loginfo", "2", "2");
		value = strtoul (item, &end, 0);
		if (*end == '\0' && value <= 4) {
			current_settings.loginfo = value;
			SHOW_INFO( 1, "Log Info Level now %ld/4", value );
		}
		
		item = get_driver_parameter (settings_handle, "logflow", "2", "2");
		value = strtoul (item, &end, 0);
		if (*end == '\0' && value <= 4) {
			current_settings.logflow = value;
			SHOW_INFO( 1, "Log Flow Level now %ld/4", value );
		}

		item = get_driver_parameter (settings_handle, "logerror", "2", "2");
		value = strtoul (item, &end, 0);
		if (*end == '\0' && value <= 4) {
			current_settings.logerror = value;
			SHOW_INFO( 1, "Log Error Level now %ld/4", value );
		}
		
		current_settings.switchhead = get_driver_boolean_parameter (settings_handle, "switchhead", false, false);
		current_settings.force_lcd = get_driver_boolean_parameter (settings_handle, "force_lcd", false, false);
		current_settings.dynamic_clocks = get_driver_boolean_parameter (settings_handle, "dynamic_clocks", true, true);
		current_settings.force_pci = get_driver_boolean_parameter (settings_handle, "force_pci", true, true);
		current_settings.unhide_fastwrites = get_driver_boolean_parameter (settings_handle, "unhide_fw", false, false);
		current_settings.force_acc_dma = get_driver_boolean_parameter (settings_handle, "force_acc_dma", false, false);
		current_settings.force_acc_mmio = get_driver_boolean_parameter (settings_handle, "force_acc_mmio", false, false);
		current_settings.acc_writeback = get_driver_boolean_parameter (settings_handle, "acc_writeback", false, false);

		if ( current_settings.switchhead != def_settings.switchhead )
			SHOW_INFO0( 1, "Switch Head = True" );
		if ( current_settings.force_lcd != def_settings.force_lcd )
			SHOW_INFO0( 1, "Force LCD ON" );
		if ( current_settings.dynamic_clocks != def_settings.dynamic_clocks )
			SHOW_INFO0( 1, "Mobility Power Saving Disabled (Dynamic Clocks)" );
		if ( current_settings.force_pci != def_settings.force_pci )
			SHOW_INFO0( 1, "Force PCI = True" );
		if ( current_settings.unhide_fastwrites != def_settings.unhide_fastwrites )
			SHOW_INFO0( 1, "use Fastwrites ON" );
		if ( current_settings.force_acc_dma != def_settings.force_acc_dma )
			SHOW_INFO0( 1, "DMA ACC Enabled" );
		if ( current_settings.force_acc_mmio != def_settings.force_acc_mmio )
			SHOW_INFO0( 1, "DMA ACC Disabled" );
		if ( current_settings.acc_writeback != def_settings.acc_writeback )
			SHOW_INFO0( 1, "DMA WriteBack Disabled" );
			
		unload_driver_settings (settings_handle);
	}
}
Example #13
0
status_t
BRepositoryInfo::_SetTo(const BEntry& entry)
{
	BFile file(&entry, B_READ_ONLY);
	status_t result = file.InitCheck();
	if (result != B_OK)
		return result;

	off_t size;
	if ((result = file.GetSize(&size)) != B_OK)
		return result;

	BString configString;
	char* buffer = configString.LockBuffer(size);
	if (buffer == NULL)
		return B_NO_MEMORY;

	if ((result = file.Read(buffer, size)) < size) {
		configString.UnlockBuffer(0);
		return (result >= 0) ? B_IO_ERROR : result;
	}

	buffer[size] = '\0';
	configString.UnlockBuffer(size);

	void* settingsHandle = parse_driver_settings_string(configString.String());
	if (settingsHandle == NULL)
		return B_BAD_DATA;
	CObjectDeleter<void, status_t> settingsHandleDeleter(settingsHandle,
		&unload_driver_settings);

	const char* name = get_driver_parameter(settingsHandle, "name", NULL, NULL);
	const char* url = get_driver_parameter(settingsHandle, "url", NULL, NULL);
	const char* vendor
		= get_driver_parameter(settingsHandle, "vendor", NULL, NULL);
	const char* summary
		= get_driver_parameter(settingsHandle, "summary", NULL, NULL);
	const char* priorityString
		= get_driver_parameter(settingsHandle, "priority", NULL, NULL);
	const char* architectureString
		= get_driver_parameter(settingsHandle, "architecture", NULL, NULL);

	if (name == NULL || *name == '\0' || url == NULL || *url == '\0'
		|| vendor == NULL || *vendor == '\0'
		|| summary == NULL || *summary == '\0'
		|| priorityString == NULL || *priorityString == '\0'
		|| architectureString == NULL || *architectureString == '\0') {
		return B_BAD_DATA;
	}

	BPackageArchitecture architecture;
	if (BPackageInfo::GetArchitectureByName(architectureString, architecture)
			!= B_OK || architecture == B_PACKAGE_ARCHITECTURE_ANY) {
		return B_BAD_DATA;
	}

	fName = name;
	fOriginalBaseURL = url;
	fVendor = vendor;
	fSummary = summary;
	fPriority = atoi(priorityString);
	fArchitecture = architecture;

	return B_OK;
}
Example #14
0
status_t
init_driver(void)
{
	void *settings;

	// get driver/accelerant settings
	settings = load_driver_settings(DRIVER_PREFIX ".settings");
	if (settings != NULL) {
		const char *item;
		char *end;
		uint32 value;

		// for driver
		item = get_driver_parameter(settings, "accelerant", "", "");
		if (item[0] && strlen(item) < sizeof(sSettings.accelerant) - 1)
			strcpy (sSettings.accelerant, item);

		item = get_driver_parameter(settings, "primary", "", "");
		if (item[0] && strlen(item) < sizeof(sSettings.primary) - 1)
			strcpy(sSettings.primary, item);

		sSettings.dumprom = get_driver_boolean_parameter(settings,
			"dumprom", false, false);

		// for accelerant
		item = get_driver_parameter(settings, "logmask",
			"0x00000000", "0x00000000");
		value = strtoul(item, &end, 0);
		if (*end == '\0')
			sSettings.logmask = value;

		item = get_driver_parameter(settings, "memory", "0", "0");
		value = strtoul(item, &end, 0);
		if (*end == '\0')
			sSettings.memory = value;

		sSettings.hardcursor = get_driver_boolean_parameter(settings,
			"hardcursor", false, false);
		sSettings.usebios = get_driver_boolean_parameter(settings,
			"usebios", false, false);
		sSettings.switchhead = get_driver_boolean_parameter(settings,
			"switchhead", false, false);
		sSettings.pgm_panel = get_driver_boolean_parameter(settings,
			"pgm_panel", false, false);
		sSettings.force_sync = get_driver_boolean_parameter(settings,
			"force_sync", false, false);
		sSettings.force_ws = get_driver_boolean_parameter(settings,
			"force_ws", false, false);

		item = get_driver_parameter(settings, "gpu_clk", "0", "0");
		value = strtoul(item, &end, 0);
		if (*end == '\0')
			sSettings.gpu_clk = value;

		item = get_driver_parameter(settings, "ram_clk", "0", "0");
		value = strtoul(item, &end, 0);
		if (*end == '\0')
			sSettings.ram_clk = value;

		unload_driver_settings(settings);
	}

	/* get a handle for the pci bus */
	if (get_module(B_PCI_MODULE_NAME, (module_info **)&pci_bus) != B_OK)
		return B_ERROR;

	/* get a handle for the isa bus */
	if (get_module(B_ISA_MODULE_NAME, (module_info **)&isa_bus) != B_OK) {
		put_module(B_PCI_MODULE_NAME);
		return B_ERROR;
	}

	/* driver private data */
	pd = (DeviceData *)calloc(1, sizeof(DeviceData));
	if (!pd) {
		put_module(B_PCI_MODULE_NAME);
		return B_ERROR;
	}
	/* initialize the benaphore */
	INIT_BEN(pd->kernel);
	/* find all of our supported devices */
	probe_devices();
	return B_OK;
}