Tornado64 x86 emulator

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post by Geri »

not yet, maybe marc/april
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post 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.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post 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.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post 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
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Tornado64 x86 emulator

Post 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!)
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post by Geri »

also, i not yet have implemented the sound card support. maybe in the next version.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post 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.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post 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.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Tornado64 x86 emulator

Post by Combuster »

What if the last line before that code sequence of yours was this:

Code: Select all

 a = &(b[1]); 
could you still optimise that sequence as such?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post 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.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post 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.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post 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)
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post by Geri »

two movq opcode addded, 64 bit wide memory access complitely rewritten, and properly wired into mmap devices.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post by Geri »

movd added.

these opcodes will be tested (and fixed) soon.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Tornado64 x86 emulator

Post by Geri »

PACKUSWB PCMPGTD PCMPGTW PCMPGTB added
PACKSSDW PUNPCKLBW PUNPCKLWD PUNPCKLDQ PACKSSWB added

Image

okay, i hate x86
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
Post Reply