[OSy] problem s KoHlTo kernelem?

Vaclav Klecanda vencax at centrum.cz
Mon Jan 8 17:44:46 CET 2007


Zdravim,
  nemuzeme zaboha odladit nasledujici problem. 

Nejprve allokujeme pomoci vmalloc 32Kb pameti od adresy 0 (coz je v USEG). A pak zkousime do tohoto naalokovaneho mista nakopirovat kod z simulace HDD. Avsak na tomoto miste nam to pada. Uz si nevime absolutne rady. Nemohla by byt chyba nekde v allokatoru? Prosime o jakoukoli radu. Dalsi otazka je: alokuje allokator vmalloc pamet sekvencne?
Prikladame kod:

#define PROGRAM_BEGIN_ADDRESS 0x00000000

#define CODE_SEGMENT_SIZE (32*1024)

#define EXT_DEVICE_BEGIN 0x9fc00400


uint8_t * src;
uint8_t * dest;

void *where = (void *)PROGRAM_BEGIN_ADDRESS;

retVal = vmalloc(&where, CODE_SEGMENT_SIZE, 
		(VF_VA_USER << VF_VA_SHIFT) | (VF_AT_KUSEG << VF_AT_SHIFT) );

src = (uint32_t *)EXT_DEVICE_BEGIN;
dest = (uint32_t *)PROGRAM_BEGIN_ADDRESS;

for(i = 0; i < (CODE_SEGMENT_SIZE / sizeof(uint8_t)); i++)
	{
		dprintk("%d\n", i);
		dest[i] = src[i];      // tady to spadava kolem i=6160;
                src[i] = dest[i];      // toto funguje :(




More information about the NSWI004 mailing list