OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 6:06 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 100 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next
Author Message
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Mon Feb 16, 2015 7:49 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
not yet, maybe marc/april

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Tue Feb 17, 2015 11:29 am 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Wed Feb 18, 2015 1:28 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
-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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Wed Feb 18, 2015 10:03 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Thu Feb 19, 2015 12:46 am 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1074
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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Thu Feb 19, 2015 7:06 am 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Wed Mar 04, 2015 9:50 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Sat Mar 21, 2015 5:09 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
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:
  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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Sat Mar 21, 2015 5:14 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
What if the last line before that code sequence of yours was this:
Code:
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 ]


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Sat Mar 21, 2015 5:27 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Sat Mar 21, 2015 6:26 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
i am able to get mmx instructions with this syntax:

Code:
#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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Sat Mar 21, 2015 7:27 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Sat Mar 21, 2015 8:16 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
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


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Sat Mar 21, 2015 8:31 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
movd added.

these opcodes will be tested (and fixed) soon.

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Tornado64 x86 emulator
PostPosted: Sat Mar 21, 2015 9:13 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 100 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 46 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group