fix: correction Xprintf avec %% BIS et augmentation du test avec 150mo de RAM

This commit is contained in:
Nicolas Hordé 2018-11-30 19:19:52 +01:00
parent 73c70d20bd
commit b8e26a000b
2 changed files with 4 additions and 3 deletions

View File

@ -89,7 +89,7 @@ int testmem()
u8* test; u8* test;
print("**** AVANT ALLOCATION\r\n"); print("**** AVANT ALLOCATION\r\n");
mem(); mem();
test=vmalloc(4096*10); /* 10 pages */ test=vmalloc(150*1024*1024); /* 10 pages */
print("**** APRES ALLOCATION\r\n"); print("**** APRES ALLOCATION\r\n");
mem(); mem();
vfree(test); vfree(test);
@ -104,7 +104,7 @@ int mem()
{ {
u32 libre=getmemoryfree(); u32 libre=getmemoryfree();
u32 total=physical_getmemorysize(); u32 total=physical_getmemorysize();
printf("Memoire physique (TOTAL)\r\n -libre \33[40D\33[15C%H (%.2f%%)\r\n -occupee \33[40D\33[15C%H\r\n -total \33[40D\33[15C%H\r\n\r\n",libre,(float) libre/total*100,total-libre,total); printf("Memoire physique (TOTAL)\r\n -libre \33[40D\33[15C%H (%.2f%%)\r\n -occupee \33[40D\33[15C%H\r\n -total \33[40D\33[15C%H\r\n\r\n",libre,((float) libre/total*100.0f),total-libre,total);
printf("Memoire HEAP (NOYAU) - % u blocs\r\n -libre \33[40D\33[15C%H\r\n -occupee \33[40D\33[15C%H\r\n -allouables \33[40D\33[15C%H\r\n\r\n",getmallocnb(),getmallocfree(),getmallocused(),getmallocnonallocated()); printf("Memoire HEAP (NOYAU) - % u blocs\r\n -libre \33[40D\33[15C%H\r\n -occupee \33[40D\33[15C%H\r\n -allouables \33[40D\33[15C%H\r\n\r\n",getmallocnb(),getmallocfree(),getmallocused(),getmallocnonallocated());
printf("Plan de memoire (NOYAU)\r\n -IDT \33[40D\33[15C%X\r\n -GDT \33[40D\33[15C%X\r\n -PGD \33[40D\33[15C%X\r\n -STACK \33[40D\33[15C%X\r\n -CODE \33[40D\33[15C%X\r\n -PAGES \33[40D\33[15C%X\r\n -HEAP \33[40D\33[15C%X\r\n -VESAFB \33[40D\33[15C%X\r\n\r\n",IDT_ADDR,GDT_ADDR,KERNEL_PD_ADDR,KERNEL_STACK_ADDR,KERNEL_CODE_ADDR,KERNEL_PAGES,KERNEL_HEAP,VESA_FBMEM); printf("Plan de memoire (NOYAU)\r\n -IDT \33[40D\33[15C%X\r\n -GDT \33[40D\33[15C%X\r\n -PGD \33[40D\33[15C%X\r\n -STACK \33[40D\33[15C%X\r\n -CODE \33[40D\33[15C%X\r\n -PAGES \33[40D\33[15C%X\r\n -HEAP \33[40D\33[15C%X\r\n -VESAFB \33[40D\33[15C%X\r\n\r\n",IDT_ADDR,GDT_ADDR,KERNEL_PD_ADDR,KERNEL_STACK_ADDR,KERNEL_CODE_ADDR,KERNEL_PAGES,KERNEL_HEAP,VESA_FBMEM);
printf("Memoire Virtuelle (NOYAU)\r\n -pages libres \33[40D\33[16C% u\r\n -pages occupees \33[40D\33[16C% u\r\n",virtual_getpagesfree(),virtual_getpagesused()); printf("Memoire Virtuelle (NOYAU)\r\n -pages libres \33[40D\33[16C% u\r\n -pages occupees \33[40D\33[16C% u\r\n",virtual_getpagesfree(),virtual_getpagesused());

View File

@ -1162,6 +1162,7 @@ u32 format(const u8 * string, va_list args, u32 maxsize, u32 (*fonction)(u8* src
fonction(&achar,string,1); fonction(&achar,string,1);
counter++; counter++;
flag = false; flag = false;
break;
case 'c': case 'c':
temp = (u8) va_arg(args, u8); temp = (u8) va_arg(args, u8);
fonction(&temp,string,1); fonction(&temp,string,1);