Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-14 Thread Arkady V.Belousov
Hi!

14-Фев-2004 16:04 [EMAIL PROTECTED] (Luchezar Georgiev) wrote to
[EMAIL PROTECTED]:

LG> for 80186 or 80386. It only depends on what CPU fmemcpy in main.c is
LG> compiled for. If it's compiled for 80386, it crashes. If it's compiled for

 Now check from which places main::fmemcpy is called and check which
place (may) depend on 32-bit registers.




---
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_id56&alloc_id438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-14 Thread Luchezar Georgiev
On Sat, 14 Feb 2004 16:04:17 +0200, Luchezar Georgiev <[EMAIL PROTECTED]> wrote:

Here are my latest news. If I compile ALL the kernel for 80186, and ONLY the fmemcpy function in main.c for 80386 (using #pragma option -3 and -1, all the other functions in main.c are compiled for 80186 too), it crashes! I tried all other possible combinations, and it turned out that it doesn't depend on whether ANY other file or ANY other function in main.c is compiled for 80186 or 80386. It only depends on what CPU fmemcpy in main.c is compiled for. If it's compiled for 80386, it crashes. If it's compiled for 80186, it doesn't. So I'll now try to implement Bart's idea of using ASMSUPT.ASM in the INIT code. I believe that this will solve the problem once and forever.
Just did that, but the result is catastrophic so far. Some of these functions don't work and the kernel dumps only the compiler and CPU and crashes. Even the signon message is not displayed. I'll have to check how the functions are called. I've declared them as ASMPASCAL. Struggle continues...

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-14 Thread Luchezar Georgiev
Here are my latest news. If I compile ALL the kernel for 80186, and ONLY the fmemcpy function in main.c for 80386 (using #pragma option -3 and -1, all the other functions in main.c are compiled for 80186 too), it crashes! I tried all other possible combinations, and it turned out that it doesn't depend on whether ANY other file or ANY other function in main.c is compiled for 80186 or 80386. It only depends on what CPU fmemcpy in main.c is compiled for. If it's compiled for 80386, it crashes. If it's compiled for 80186, it doesn't. So I'll now try to implement Bart's idea of using ASMSUPT.ASM in the INIT code. I believe that this will solve the problem once and forever.

Lucho

P.S. It seems that I'm in the black list of SourceForce, but only for the kernel mailing list, as I receive only half of the articles there. The other mailing lists work well. I'll keep trying...

---
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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-13 Thread Luchezar Georgiev
On Fri, 13 Feb 2004 12:05:53 + (GMT), Bart Oldeman wrote:

well in dosemu it would just be:

DOS=HIGH,UMB
INSTALL=C:\DOS\CTMOUSE.EXE
So DOESMU provides XMS and UMB itself? Great.

anyway, I didn't get your private email yet... You might want to resend
it. But don't hurry, I'm off next week so won't be able to reply until
Monday 23 Feb.
Just re-sent it, this time directly to Bristol ;-)

Happy holidays, and happy UPX hacking, Bart ;-)

(and then, good luck with Mr. Markus Franz Xaver Johannes Oberhumer ;-)

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-13 Thread Bart Oldeman
On Fri, 13 Feb 2004, Luchezar Georgiev wrote:

> On Thu, 12 Feb 2004 16:41:58 + (GMT), Bart Oldeman wrote:
>
> > yes, please send me a minimal failing kernel + mapfile + minimal
> > config.sys and the command you're installing high (which should also be as
> > small as possible and open source).
> >
> > Please leave kernel.sys *uncompressed*. This is very important as it
> > greatly simplifies debugging for me (setting break points in startup
> > code with DOSEMU without needing explicit int3's + recompilation).
>
> Thank you - just sent you a private message with the requested files, and will now 
> reply to yours.
>
> The minimal FDCONFIG.SYS with which it fails is:
>
> DOS=HIGH,UMB
> DEVICE=D:\NU-MEGA\S-ICE.EXE /TRA 300 /SYM 40
> DEVICE=C:\DOS\HIMEM64.EXE /VERBOSE
> DEVICE=D:\NU-MEGA\UMB.SYS
> INSTALL=C:\DOS\CTMOUSE.EXE

well in dosemu it would just be:

DOS=HIGH,UMB
INSTALL=C:\DOS\CTMOUSE.EXE

anyway, I didn't get your private email yet... You might want to resend
it. But don't hurry, I'm off next week so won't be able to reply until
Monday 23 Feb.

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-13 Thread Luchezar Georgiev
Then I press Y another two times and when CTMOUSE starts, digits "2323" or "23" are shown on the screen on a new line, and then the fault occurs.
To clarify, this happens *after* CTMOUSE loads itself successfully. If there are other install commands, the fault happens after *all* of them install successfully. Again, this has nothing to do with CTMOUSE or any other commands themselves. Things don't depend on what exactly is installed high. The fault always happens when and only when there are ANY commands installed in an UMB, after ALL install commands are processed, but before the shell is loaded. To be precise, the fault happens just at the moment the kernel() function enters. If I add a printf at its very beginning, it doesn't get a chance to show - the fault happens before it. If I add a printf just before the kernel() call in FreeDOSmain(), it shows itself and very often the fault doesn't happen at all.

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-12 Thread Luchezar Georgiev
On Thu, 12 Feb 2004 16:41:58 + (GMT), Bart Oldeman wrote:

yes, please send me a minimal failing kernel + mapfile + minimal
config.sys and the command you're installing high (which should also be as
small as possible and open source).
Please leave kernel.sys *uncompressed*. This is very important as it
greatly simplifies debugging for me (setting break points in startup
code with DOSEMU without needing explicit int3's + recompilation).
Thank you - just sent you a private message with the requested files, and will now reply to yours.

The minimal FDCONFIG.SYS with which it fails is:

DOS=HIGH,UMB
DEVICE=D:\NU-MEGA\S-ICE.EXE /TRA 300 /SYM 40
DEVICE=C:\DOS\HIMEM64.EXE /VERBOSE
DEVICE=D:\NU-MEGA\UMB.SYS
INSTALL=C:\DOS\CTMOUSE.EXE
Of course, you may want to remove the SoftICE line and use a different UMB manager. I normally use UMBPCI, but it won't work in a virtual environment. The INSTALLed command doesn't matter - I tried CTMOUSE.EXE but any other installed command causes the same "invalid instruction" fault. Note that although the command is INSTALL and not INSTALLHIGH, CTMOUSE still allocates itself in an UMB!

At the time of the invalid instruction, SoftICE showed me different things depending on whether the kernel was compressed or not. For the compressed kernel, the register dump was this:

EAX=997D9900 EBX=BCD0 ECX=0 EDX=643 SP=6410 EBP=50 ESI=E2 EDI=99BD
FS=0 GS=0 DS=433F ES=6 SS=99BD CS=99BD IP=BCD0 FLAGS=odIszaPCt
99BD:BCD0   INVALID
For the uncompressed kernel I sent you, the register dump was this:

EAX=997D0045 EBX=0 ECX=4330 EDX=0 SP=6414 EBP=6412 ESI=6423 EDI=6422
FS=0 GS=0 DS=997D ES=D1 SS=997D CS=997D IP=2077 FLAGS=odISzaPCt
997D:2077 637E0D  ARPL [BP+0D],DI  SS:641F=6567
Note some interesting things. The high word of EAX=DS=SS=CS in the second case and pretty close to it in the first case. EDI=SS=CS and EBX=IP in the first case. High word of EAX is always 997D.

I press F8 at kernel start-up and press Y two times. When SoftICE starts, I enter it and set "bpr 0:0 a000:0 t", then press F5 to go. Then I press Y another two times and when CTMOUSE starts, digits "2323" or "23" are shown on the screen on a new line, and then the fault occurs. SoftICE pops up and shows the resister dumps above. But when I do "show 1", it shows only the last instruction repeated endlessly. What am I doing wrong? I'm a newbie in SoftICE, that's why I ask.

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-12 Thread Luchezar Georgiev
On Thu, 12 Feb 2004 19:07:10 +0100, tom ehlert wrote:

DEVICE=C:\NUMEGA\S-ICE.EXE /TRA 30 /SYM 400
You've written me "/tra 300 /sym 40" last year so I've set it that way (not that I understand what it means :) - which is better?

DEVICE=C:\system\himem.sys /TESTMEM:OFF
DEVICE=C:\NUMEGA\umb.sys
UMB.SYS is the s-ice UMB provider, and should work similar to emm386
Of course! How couldn't it come to my mind! So I just tried and SoftICE caught the moment of the crash! However, when I had enabled back trace by "bpr 0:0 a000:0 t" and it happened, "show 1" gave me an endless line of "RET" (C3) instructions at 00BD:2938, whereas the middle window says "99BD:BCD0, BCD2, BCD4" and so on and  "INVALID" everywhere. As a beginner, I don't know how to get around this and get to the real code :-(

LG> All this just for a tiny refused patch?!
No. but the problem lies somewhere else.
fmemcpy() uses EAX in a very correct way, and the compiler will issue
some
mov EAX,4[bp]
whenever it finds appropriate.
somewhere else, sooner or later, where it will again cause trouble.
thus the proplem is just delayed, not solved.
You're right! I agreed with this in an earlier post of mine which didn't yet arrive or vanished :(

Will keep trying tomorrow. Now I'm already too tired. Also tomorrow I'll send a kernel to Bart. (Bart, I almost deleted your message but then saw it unintentionally. I'm not crafty but lucky ;-)

Thanks,
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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-12 Thread tom ehlert
Hello Luchezar,

LG> Maybe later I could try it too... but first I must learn
LG> Bochs!

try
DEVICE=C:\NUMEGA\S-ICE.EXE /TRA 30 /SYM 400
DEVICE=C:\system\himem.sys /TESTMEM:OFF
DEVICE=C:\NUMEGA\umb.sys
...
installhigh=

UMB.SYS is the s-ice UMB provider, and should work similar to emm386

LG> All this just for a tiny refused patch?!
No. but the problem lies somewhere else.
fmemcpy() uses EAX in a very correct way, and the compiler will issue
some
mov EAX,4[bp]

whenever it finds appropriate.
somewhere else, sooner or later, where it will again cause trouble.

thus the proplem is just delayed, not solved.


tom




---
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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-12 Thread Bart Oldeman
On Thu, 12 Feb 2004, Luchezar Georgiev wrote:

> So, I guess learning Bochs is inevitable to me... Any other candidates
> (besides Tom) to whom I can send the failing kernel plus mapfile that
> are willing to give it a try? Remember - INSTALLHIGH!

yes, please send me a minimal failing kernel + mapfile + minimal
config.sys and the command you're installing high (which should also be as
small as possible and open source).

Please leave kernel.sys *uncompressed*. This is very important as it
greatly simplifies debugging for me (setting break points in startup
code with DOSEMU without needing explicit int3's + recompilation).

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-12 Thread Luchezar Georgiev
On Thu, 12 Feb 2004 15:48:35 + (GMT), Bart Oldeman wrote:

the problem is that your patch is a workaround *and* there may be other
places where eax may be used too. If you can find the place where it
really hurts then it would be better for all of us, since it could
potentially point to a bug that just hasn't shown up in other situations
(inc. other compilers) so far.
Yes, I agree. I confirmed that you're right this morning, but perhaps my post hasn't arrived yet. By the way, it contained a simple macro optimisation patch gaining 240 bytes. Did you get it?

(Now I get most articles I post to this maling list, but still not all or at least very delayed.)

As to the specific case of fmemcpy, the proper (IMHO) way to do it is to
use something like
nasm -DINIT asmsupt.asm -o initaspt.obj
and link that object into the main kernel.
Indeed, I was thinking of exactly the same, and after we fix the bug, it'd be good idea to do it.

But that is still not a bug fix.
Alas, I must agree! :-(

So, I guess learning Bochs is inevitable to me... Any other candidates (besides Tom) to whom I can send the failing kernel plus mapfile that are willing to give it a try? Remember - INSTALLHIGH!

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-12 Thread Bart Oldeman
On Thu, 12 Feb 2004, Luchezar Georgiev wrote:

> Maybe later I could try it too... but first I must learn Bochs! All this
> just for a tiny refused patch?!

the problem is that your patch is a workaround *and* there may be other
places where eax may be used too. If you can find the place where it
really hurts then it would be better for all of us, since it could
potentially point to a bug that just hasn't shown up in other situations
(inc. other compilers) so far.

As to the specific case of fmemcpy, the proper (IMHO) way to do it is to
use something like
nasm -DINIT asmsupt.asm -o initaspt.obj
and link that object into the main kernel.

But that is still not a bug fix.

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-12 Thread Luchezar Georgiev
On Thu, 12 Feb 2004 13:56:20 + (GMT), Bart Oldeman wrote:

Sorry! Because it fails only if UMBPCI is loaded and INSTALLHIGH
performed, I have to load UMBPCI, but SoftICE seems incompatible with
it. I can't load even the Watcom kernel without a General Protection
Violation in SoftICE just after UMBPCI is loaded at 04BE:3395 and when I
type "C" to continue, an Interrupt divide by zero, stack: 3395 04BE 3302
02FD  004D 5FEE 5FD2    0007 04BE. Without SoftICE, it
works. What more can I do?
It's only INSTALLHIGH+UMBPCI? Not INSTALLHIGH+(FD)EMM386 either?
Just tried - it happens with our EMM386 too! So I think I can't use SoftICE because EMM386 works in protected mode which conflicts with SoftICE.

Well, as Eric said you could try to reproduce it in Bochs... although
UMBPCI won't work there, the UMBs will just be there.
Maybe later I could try it too... but first I must learn Bochs! All this just for a tiny refused patch?! No, I definitely must learn how to work together in open-source communities. I'm a newbie!

(old newbie ;-)

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Borland C 386 bug

2004-02-12 Thread Bart Oldeman
On Thu, 12 Feb 2004, Luchezar Georgiev wrote:

> Sorry! Because it fails only if UMBPCI is loaded and INSTALLHIGH
> performed, I have to load UMBPCI, but SoftICE seems incompatible with
> it. I can't load even the Watcom kernel without a General Protection
> Violation in SoftICE just after UMBPCI is loaded at 04BE:3395 and when I
> type "C" to continue, an Interrupt divide by zero, stack: 3395 04BE 3302
> 02FD  004D 5FEE 5FD2    0007 04BE. Without SoftICE, it
> works. What more can I do?

It's only INSTALLHIGH+UMBPCI? Not INSTALLHIGH+(FD)EMM386 either?

Well, as Eric said you could try to reproduce it in Bochs... although
UMBPCI won't work there, the UMBs will just be there.

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=1356&alloc_id=3438&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel