Re: [Freedos-kernel] Borland C 386 bug

2004-02-12 Thread Luchezar Georgiev
On Thu, 12 Feb 2004 13:34:33 +0300 (MSK), Arkady V.Belousov wrote:

Unfortunately, I don't know, how to turn return target processor option
back - target may be 386, but it may be also 8086. Probably, next (after
fmemcpy() definition) should work:
#ifdef __BORLANDC__
# pragma option -3.
#endif
Yes, it does work, but this is even worse than my workaround.

Lucho

---
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps  Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356alloc_id=3438op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


[Freedos-kernel] Borland C 386 bug

2004-02-11 Thread Luchezar Georgiev
Salve,

As I again don't receive messages from the kernel mailing list, I again had to wade through the web interface to find the critics below, and suddently SF said it's in read-only mode, so I guess it's in big trouble now :-(

I'm sorry but I think that's a hack^2. Since you have absolutely no
guarantee that Borland C won't use EAX anywhere else and not in the future
either. There really should be push/pop wrapper somewhere instead,
using the Protect386Registers and Restore386Registers asm macros defined
in hdr\stacks.inc
The question is now, where does eax get destroyed? Did you double check
if entry.asm includes them for your configuration (%ifdef I386). Or
perhaps all that is needed is that the high parts need to be cleared
after calling a device driver or somewhere else?
I didn't check because I don't know what to check. Browsed entry.asm and understood nothing. Do apply your ideas and I'll be serving as a live compiler, as I'm obviously only good for that.

My god - what a sad story.

boot a kernel that works.
load device=softice.
insert floppy with bad kernel.
SIceboot

SIce still is in memory, and will popup at the faulting instruction,
or you can insert some int(3) to trace the offending code.
Sorry, Tom - as you know, I've never been a professional programmer, only an amateur here... Actually, I'm an electronics engineer and never studied programming or computer science ;-)

don't like it that way.
EAX register may be used next week by a different function, or Arkady
optimizes the memcpy() functions, and the error pops up again.
I'd propose to add/fix some Borland RTL library to handle this issue.
probably not too much work, as the only used functions are
xxxMUL32/xxxDIV32 and they are fairly short.
Is it the RTL or the compiler itself?! How dares Datalight use it for their ROM-DOS, written just like FreeDOS in 95% C, 5% assembler?!

Sorry, guys - FECI QUOD POTUI, FACIANT MELIORA POTENTES!

Lucho

---
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Borland C 386 bug

2004-02-11 Thread Bart Oldeman
On Wed, 11 Feb 2004, Luchezar Georgiev wrote:

 INIT_FMEMCPY:  |INIT_FMEMCPY:
  enter   8,0|pushBP
  mov DX,4[BP]   |mov BP,SP
  mov EAX,0Ah[BP]|mov DX,4[BP]
  mov -4[BP],EAX |jmp short   L76
  mov EAX,6[BP]  |L64:les BX,6[BP]
  mov -8[BP],EAX |mov AL,ES:[BX]
  jmp short   L92|les BX,0Ah[BP]
 L80:les BX,-8[BP]  |mov ES:[BX],AL
  mov AL,ES:[BX] |inc word ptr 6[BP]
  les BX,-4[BP]  |inc word ptr 0Ah[BP]
  mov ES:[BX],AL |L76:mov AX,DX
  inc word ptr -8[BP]|dec DX
  inc word ptr -4[BP]|or  AX,AX
 L92:mov AX,DX  |jne L64
  dec DX |pop BP
  or  AX,AX  |ret 0Ah
  jne L80|
  leave  |
  ret 0Ah|

Well I see no bug in this fmemcpy. One other thing I can imagine being a
problem is that some device drivers or programs you use rely on the high
word of eax being zero.

since you said:
after the install commands are processed  (if any). This means that if
no install was present no problems occurred?

so what you could try is to add a xor eax, eax at a strategic place,
ie.
_exec_user:

xor eax, eax

in procsupt.asm. Also execrh.asm for device drivers.

Hmm, reminds of some bug in bugzilla ...

Bart



---
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps  Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356alloc_id=3438op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel