Exemplo n.º 1
0
static int devices_init(void)
{
	int rc;

	/* extended memory only */
	add_mem_device("ram0", 0x0, bios_get_memsize() << 10,
		       IORESOURCE_MEM_WRITEABLE);
	add_generic_device("biosdrive", -1, NULL, 0, 0, IORESOURCE_MEM, NULL);

	if (pers_env_size != PATCH_AREA_PERS_SIZE_UNUSED) {
		rc = devfs_add_partition("biosdisk0",
				pers_env_storage * 512,
				(unsigned)pers_env_size * 512,
				DEVFS_PARTITION_FIXED, "env0");
		printf("Partition: %d\n", rc);
	} else
		printf("No persistent storage defined\n");

        return 0;
}
Exemplo n.º 2
0
static int x86_mem_malloc_init(void)
{
#ifdef CONFIG_MEMORY_LAYOUT_DEFAULT
	unsigned long memory_size;

	memory_size = bios_get_memsize();
	memory_size <<= 10;	/* BIOS reports in kiB */

	/*
	 * We do not want to conflict with the kernel. So, we keep the
	 * area from 0x100000 ... 0xFFFFFF free from usage
	 */
	if (memory_size >= (15 * 1024 * 1024 + MALLOC_SIZE))
		mem_malloc_init((void*)(16 * 1024 * 1024),
				(void*)(16 * 1024 * 1024 + MALLOC_SIZE - 1));
	else
		return -1;
#else
	mem_malloc_init((void *)MALLOC_BASE,
			(void *)(MALLOC_BASE + MALLOC_SIZE - 1));
#endif
	return 0;
}