Discussion:
RDOS Tss structure in OW potential problem
(too old to reply)
Jiri Malak
2012-04-30 06:27:13 UTC
Permalink
Raw Message
Hi Leif,

With regards to reported "Trap build error" problem I checked what happend.
During investigation I found out potential problem in Tss structure
definition for RDOS.
There is field with following definition:
...
long double st[8];
...
Be careful because long double is in OW same as double by default.
Also use of FP type links mathlib into application even if it is not
necessary.
Probably best will be to change definition of FPU registers in Fss to be
something like
...
struct {
unsigned char b[10];
} st[8]
...

Jiri
Leif Ekblad
2012-05-01 09:35:05 UTC
Permalink
Raw Message
Indeed, this was a problem as the code that reads / writes thread state uses
a 10-byte float-type. I think this is why the pad was there.

I fixed it by using OWs xreal type instead. Turns out that the x86 FPU state
is already defined with xreal type.

OTOH, in order to use xreal type, I had to include machtype.h, which outside
of
OW build environment doesn't work as machtype.h is not exported, and it
additionally uses watcom.h and some other files that are not available
outside of
the build environment. I fixed this by extracting the type definition
itself, removing
the dependencies, and then I placed this file in RDOS repository.

Linking with mathlib should be no problem as RDOS newer requires the FPU
emulator (when it runs on 386 or other processors without FPU it emulates
the FPU so the application have no idea if the FPU exist or not).

Leif Ekblad
Post by Jiri Malak
Hi Leif,
With regards to reported "Trap build error" problem I checked what happend.
During investigation I found out potential problem in Tss structure
definition for RDOS.
...
long double st[8];
...
Be careful because long double is in OW same as double by default.
Also use of FP type links mathlib into application even if it is not
necessary.
Probably best will be to change definition of FPU registers in Fss to be
something like
...
struct {
unsigned char b[10];
} st[8]
...
Jiri
Loading...