Page 6 of 7
Re: Tornado64 x86 emulator
Posted: Mon Feb 16, 2015 7:49 pm
by Geri
not yet, maybe marc/april
Re: Tornado64 x86 emulator
Posted: Tue Feb 17, 2015 11:29 am
by Geri
lets face some facts:
-i want smp
-i suck with understanding the x86 architecture, beyond this level, i do not really even understand the required features (i am not sure, what should i duplicate, even after reading the SMP documentations on this page, i still watching them as: WTF is this)
-i still want smp, its must have
-but i will not able to write it
-i still want smp
-other x86 emulators suck at smp too, i dont know, why (they dont really accelerate from it).
i find out, how can i implement smp, without implementing the smp.
i will implement a HLE like emulation system for examining and executing the running the userspace threads and processes of the system. at the first round, i will implement this feature for linux. i will detect/collect the required informations about the running threads/processes in the system, and based on a smart algorythm, i will be able to execute them parallelly.
(shedulers, process switching, api calls, access to non-managed memory tables, exceptions - its not public yet, how i can do it, and i am not sure if i can do it aniway)
according to my quick calculations, with this i can offer unlimited hardware threads without even implementing smp.
i must modify my cpu monolit a bit for this, it will be tricky to avoid becoming the process to slow down.
Re: Tornado64 x86 emulator
Posted: Wed Feb 18, 2015 1:28 pm
by Geri
-implemented some missing opcodes, however, they will show warnings on console when they called, such as storing ldt. its very shocking that there is NO peoper documentation available how it ecsactly should behave, like should i esoterically recalculate it, or what, or how the opcode is even encoded... i would check it in other emulators once i will care enough about it
-cursor keys was mistbehaved. fixed
-added cursor keys on console mode.
Re: Tornado64 x86 emulator
Posted: Wed Feb 18, 2015 10:03 pm
by Geri
SpyderTL: i changed my mind, and released it today. I will have different priorities until the begin of summer.
2015, feb. 19.
-10% speed-up
-Fixed a crash with xvesa
-Less memory usage.
-Resizing window in compact mode on resolution change if smooth is disabled, to ensure best rendering performance.
-Added a few missing opcodes. Calling these will give a warning on console.
-Cursor keys was wrong. I fixed the directions.
-Added cursor key support on console mode.
-Keyboard and timer interrupts sometimes not arrived. I fixed this.
-Pagetable writes in kernel mode was bugous. Fixed.
-Manual RTC frequency set was wrong.
-Added sysenter/sysexit. In theory, it should work.
-Page faults was able to render the emulator into an infinite cycle in some special cases, causing a crash. This is fixed now.
-The legacy-runtime binaries for x86 are the previous version, i dont have an old compilation environment at the moment.
-Very experimental ARM binaries with GUI added.
http://Tornado64.tk
Re: Tornado64 x86 emulator
Posted: Thu Feb 19, 2015 12:46 am
by SpyderTL
Awesome. I was hoping you'd change your mind.
I'll try it out tomorrow. Brain is already fried from working on FAT12 support. (Just dumped my first complete file to the screen. Awww Yeah!)
Re: Tornado64 x86 emulator
Posted: Thu Feb 19, 2015 7:06 am
by Geri
also, i not yet have implemented the sound card support. maybe in the next version.
Re: Tornado64 x86 emulator
Posted: Wed Mar 04, 2015 9:50 pm
by Geri
i readed the smp initialisation with clean mind on a different site, and suprisingly, now i understand almost everything.
generic smp needs a new advenced interrupt controller, which is probably not just used to communicate with the cpus, instead, used widely by the operating system if it detects it. so this does not looks a good idea now.
however, after googleing a bit, it seems, SMP is possible without apic.
in this extremely legacy mode, only the 0th cpu receives all the interrupts (PERFECT!!!).
mp tables are still needed, however, and there is a trick needed to activate all the cpus, which i will not know about,
and it will be not compatible with every operating system, but linux supports SMP without apic, or at least some versions do it.
so finally, i can do somewhat proper smp support.
Re: Tornado64 x86 emulator
Posted: Sat Mar 21, 2015 5:09 pm
by Geri
i have issues with testing mmx opcodes. i attempted to compile trivial codes to test mmx, however, gcc basically refuses to compile mmx code.
Code: Select all
a[0]+=b[0];
a[1]+=b[1];
a[2]+=b[2];
a[3]+=b[3];
a[4]+=b[4];
a[5]+=b[5];
a[6]+=b[6];
a[7]+=b[7];
a[8]+=b[8];
a[9]+=b[9];
a[10]+=b[10];
a[11]+=b[11];
a[12]+=b[12];
a[13]+=b[13];
a[14]+=b[14];
a[15]+=b[15];
much of this for multiple data types.
g++ simdtest.c -o simdtest -m32 -march=pentium-mmx -mtune=pentium-mmx -S -O3 -mmmx
however, there is no MMX opcode being created by the compiler at all.
until i get a solution, i suspend any future development of more modern opcodes.
Re: Tornado64 x86 emulator
Posted: Sat Mar 21, 2015 5:14 pm
by Combuster
What if the last line before that code sequence of yours was this:
could you still optimise that sequence as such?
Re: Tornado64 x86 emulator
Posted: Sat Mar 21, 2015 5:27 pm
by Geri
nothing, i even added __attribute__ ((aligned (16))) now, but still no mmx opcodes at all. i putted the whole thing into cycles, into a[w]=b[w]+c[w] type formula, but nothing. it seems gcc is not able to produce mmx opcodes any more.
Re: Tornado64 x86 emulator
Posted: Sat Mar 21, 2015 6:26 pm
by Geri
i am able to get mmx instructions with this syntax:
Code: Select all
#include <stdio.h>
#include <x86intrin.h>
int main(){
char __attribute__ ((aligned (16))) a[16], b[16], c[16];
for(int w=0;w<16;w++){
a[w]=w;
b[w]=w+10;
c[w]=w+20;
}
__m64 *av, *bv, *cv;
av = (__m64*)a; // assume 8-byte aligned
bv = (__m64*)b; // assume 8-byte aligned
cv = (__m64*)c; // assume 8-byte aligned
printf("signed char:");
for(int i = 0; i < 16/8; i++) av[i] = _mm_add_pi8(bv[i], cv[i]);
for(int w=0;w<16;w++) printf("%d ", a[w]);
printf("\n");
}
better than nothing, however, besides this, gcc does not compiles any mmx opcodes any more.
Re: Tornado64 x86 emulator
Posted: Sat Mar 21, 2015 7:27 pm
by Geri
i quckly implemented the folowing opcodes:
-PUNPCKHDQ
-PUNPCKHWD
-PUNPCKHBW
(i will forget what these do within one day. gcc does not compile anything from them aniway)
-PSUBUSB
-PSUBUSW
-PADDUSB
-PADDUSW
-PADDUSDW
-PMULHW
-PSUBSB
-PSUBSW
-PADDSB
-PADDSW
-PMADDWD
-PSUBB
-PSUBW
-PSUBD
-PADDB
-PADDW
-PADDD
(they will not work without movq, however)
Re: Tornado64 x86 emulator
Posted: Sat Mar 21, 2015 8:16 pm
by Geri
two movq opcode addded, 64 bit wide memory access complitely rewritten, and properly wired into mmap devices.
Re: Tornado64 x86 emulator
Posted: Sat Mar 21, 2015 8:31 pm
by Geri
movd added.
these opcodes will be tested (and fixed) soon.
Re: Tornado64 x86 emulator
Posted: Sat Mar 21, 2015 9:13 pm
by Geri
PACKUSWB PCMPGTD PCMPGTW PCMPGTB added
PACKSSDW PUNPCKLBW PUNPCKLWD PUNPCKLDQ PACKSSWB added
okay, i hate x86