void flash_1mbit_readfiles()
{
        FILE *f;
	int is_ami = ((romset == ROM_REVENGE) || (romset == ROM_PLATO) || (romset == ROM_ENDEAVOR));
	int has_dmi = ((romset == ROM_430HX) || (romset == ROM_430VX) || (romset == ROM_430TX) || (romset == ROM_440FX) || (romset == ROM_KN97));
	int is_bxb = ((romset == ROM_ACERV35N) || (romset == ROM_ACERV12LC));

        memset(&rom[is_ami ? 0xd000 : (is_bxb ? 0x2000 : 0x1d000)], 0xFF, 0x1000);

	configure_path();
	fn = (char *) malloc(255);
	strcpy(fn, path);
	strcat(fn, "escd.bin");
        f = romfopen(fn, "rb");
        if (f)
        {
                fread(&rom[is_ami ? 0xd000 : (is_bxb ? 0x2000 : 0x1d000)], 0x1000, 1, f);
                fclose(f);
        }
	if (has_dmi || is_bxb)
	{
		strcpy(fn, path);
		strcat(fn, "dmi.bin");
	        f = romfopen(fn, "rb");
	        if (f)
	        {
	                fread(&rom[is_bxb ? 0x3000 : 0x1c000], 0x1000, 1, f);
	                fclose(f);
	        }
	}
}
Beispiel #2
0
void flash_1mbit_readfiles()
{
        FILE *f;
	int q = ((romset == ROM_REVENGE) || (romset == ROM_ENDEAVOR));

        memset(&rom[q ? 0xd000 : 0x1d000], 0xFF, 0x1000);

	configure_path();
	fn = (char *) malloc(255);
	/* strcpy(fn, path);
	strcat(fn, "oemlogo.bin");
        f = romfopen(fn, "rb");
        if (f)
        {
                fread(&rom[0x1c000], 0x1000, 1, f);
                fclose(f);
        } */
	strcpy(fn, path);
	strcat(fn, "escd.bin");
        f = romfopen(fn, "rb");
        if (f)
        {
                fread(&rom[q ? 0xd000 : 0x1d000], 0x1000, 1, f);
                fclose(f);
        }
}
Beispiel #3
0
void intel_flash_close(void *p)
{
        FILE *f;
        flash_t *flash = (flash_t *)p;
	int q = ((romset == ROM_REVENGE) || (romset == ROM_ENDEAVOR));

	configure_path();
	fn = (char *) malloc(255);
	/* strcpy(fn, path);
	strcat(fn, "oemlogo.bin");
        f = romfopen(fn, "wb");
        fwrite(&rom[0x1c000], 0x1000, 1, f);
        fclose(f); */
	strcpy(fn, path);
	strcat(fn, "escd.bin");
        f = romfopen(fn, "wb");
        fwrite(&rom[q ? 0xd000 : 0x1d000], 0x1000, 1, f);
        fclose(f);

        free(flash);
}
void intel_flash_close(void *p)
{
        FILE *f;
        flash_t *flash = (flash_t *)p;
	int is_ami = ((romset == ROM_REVENGE) || (romset == ROM_PLATO) || (romset == ROM_ENDEAVOR));
	int has_dmi = ((romset == ROM_430HX) || (romset == ROM_430VX) || (romset == ROM_430TX) || (romset == ROM_440FX) || (romset == ROM_KN97));
	int is_bxb = ((romset == ROM_ACERV35N) || (romset == ROM_ACERV12LC));

	if (closed)  return;

	configure_path();
	fn = (char *) malloc(255);
	strcpy(fn, path);
	strcat(fn, "escd.bin");
        f = romfopen(fn, "wb");
        fwrite(&rom[is_ami ? 0xd000 : (is_bxb ? 0x2000 : 0x1d000)], 0x1000, 1, f);
        fclose(f);
#if 0
        f = romfopen("romkek.$$$", "wb");
        fwrite(&rom[0], 0x20000, 1, f);
        fclose(f);
#endif
	if (has_dmi || is_bxb)
	{
		strcpy(fn, path);
		strcat(fn, "dmi.bin");
	        f = romfopen(fn, "wb");
	        if (f)
	        {
	                fwrite(&rom[is_bxb ? 0x3000 : 0x1c000], 0x1000, 1, f);
	                fclose(f);
	        }
	}

	closed = 1;

        free(flash);
}
void *intel_flash_init()
{
        FILE *f;
        flash_t *flash = malloc(sizeof(flash_t));
	int is_ami = ((romset == ROM_REVENGE) || (romset == ROM_PLATO) || (romset == ROM_ENDEAVOR));
	int has_dmi = ((romset == ROM_430HX) || (romset == ROM_430VX) || (romset == ROM_430TX) || (romset == ROM_440FX) || (romset == ROM_KN97));
	int is_bxb = ((romset == ROM_ACERV35N) || (romset == ROM_ACERV12LC));
        memset(flash, 0, sizeof(flash_t));

        mem_mapping_add(&flash->read_mapping,
       	            0xe0000, 
               	    0x20000,
       	            flash_read, NULL, NULL,
                    NULL, NULL, NULL,
               	    NULL, MEM_MAPPING_EXTERNAL, (void *)flash);
        mem_mapping_add(&flash->write_mapping,
                    0xe0000, 
       	            0x20000,
       	            NULL, NULL, NULL,
                    flash_write, NULL, NULL,
       	            NULL, MEM_MAPPING_EXTERNAL, (void *)flash);
        mem_mapping_add(&ext_read_mapping,
       	            0xfffe0000, 
               	    0x20000,
       	            flash_read, NULL, NULL,
                    NULL, NULL, NULL,
               	    NULL, MEM_MAPPING_EXTERNAL, (void *)flash);
        mem_mapping_add(&ext_write_mapping,
                    0xfffe0000, 
       	            0x20000,
       	            NULL, NULL, NULL,
                    flash_write, NULL, NULL,
       	            NULL, MEM_MAPPING_EXTERNAL, (void *)flash);
        mem_mapping_disable(&flash->read_mapping);
        mem_mapping_disable(&ext_read_mapping);

	if (!is_ami)
	{
		/* Non-AMI BIOS'es talk to the flash in high RAM. */
		if (romset != ROM_440FX)
		{
			mem_mapping_disable(&flash->write_mapping);
		}
		else
		{
			mem_mapping_set_addr(&flash->write_mapping, 0xf0000, 0x10000);
		}
		mem_mapping_enable(&ext_write_mapping);
	}
	else
	{
		/* AMI BIOS'es talk to the flash in low RAM. */
		mem_mapping_enable(&flash->write_mapping);
		mem_mapping_set_addr(&flash->write_mapping, 0xe0000, 0x20000);
		mem_mapping_disable(&ext_write_mapping);
	}

        flash->command = CMD_READ_ARRAY;
        flash->status = 0;
        
        memset(&rom[is_ami ? 0xd000 : (is_bxb ? 0x2000 : 0x1d000)], 0xFF, 0x1000);

	configure_path();
	fn = (char *) malloc(255);
	strcpy(fn, path);
	strcat(fn, "escd.bin");
        f = romfopen(fn, "rb");
        if (f)
        {
                fread(&rom[is_ami ? 0xd000 : (is_bxb ? 0x2000 : 0x1d000)], 0x1000, 1, f);
                fclose(f);
        }
	if (has_dmi || is_bxb)
	{
		strcpy(fn, path);
		strcat(fn, "dmi.bin");
	        f = romfopen(fn, "rb");
	        if (f)
	        {
	                fread(&rom[is_bxb ? 0x3000 : 0x1c000], 0x1000, 1, f);
	                fclose(f);
	        }
	}

	closed = 0;
        
        return flash;
}
Beispiel #6
0
void *intel_flash_init()
{
        FILE *f;
        flash_t *flash = malloc(sizeof(flash_t));
	int q = ((romset == ROM_REVENGE) || (romset == ROM_ENDEAVOR));
        memset(flash, 0, sizeof(flash_t));

	/* if (romset == ROM_440BX)
	{
	        mem_mapping_add(&flash->read_mapping,
        	            0x80000, 
                	    0x20000,
        	            flash_read, NULL, NULL,
	                    NULL, NULL, NULL,
                	    NULL, MEM_MAPPING_EXTERNAL, (void *)flash);
	        mem_mapping_add(&flash->write_mapping,
	                    0x80000, 
        	            0x20000,
        	            NULL, NULL, NULL,
	                    flash_write, NULL, NULL,
        	            NULL, MEM_MAPPING_EXTERNAL, (void *)flash);
	} */
        mem_mapping_add(&flash->read_mapping,
       	            0xe0000, 
               	    0x20000,
       	            flash_read, NULL, NULL,
                    NULL, NULL, NULL,
               	    NULL, MEM_MAPPING_EXTERNAL, (void *)flash);
        mem_mapping_add(&flash->write_mapping,
                    0xe0000, 
       	            0x20000,
       	            NULL, NULL, NULL,
                    flash_write, NULL, NULL,
       	            NULL, MEM_MAPPING_EXTERNAL, (void *)flash);
        mem_mapping_disable(&flash->read_mapping);
        flash->command = CMD_READ_ARRAY;
        flash->status = 0;
        
        memset(&rom[q ? 0xd000 : 0x1d000], 0xFF, 0x1000);

	configure_path();
	fn = (char *) malloc(255);
	/* strcpy(fn, path);
	strcat(fn, "oemlogo.bin");
        f = romfopen(fn, "rb");
        if (f)
        {
                fread(&rom[0x1c000], 0x1000, 1, f);
                fclose(f);
        } */
	strcpy(fn, path);
	strcat(fn, "escd.bin");
        f = romfopen(fn, "rb");
        if (f)
        {
                fread(&rom[q ? 0xd000 : 0x1d000], 0x1000, 1, f);
                fclose(f);
        }
        
        return flash;
}