www.digitalmars.com         C & C++   DMDScript  

c++.dos.32-bits - kbhit() crashes on Toshiba 7220 with WIN98SE

reply ernest wxs.nl writes:
Hi All.  I have been using Symantec C++ for years and years.  I thought that it
was abandoned long ago, so I was pleased to accidentally find it, renewed and
still alive and being updated.  Paid $500 back then, including all the updates.
I bought it because it could address multiple megabytes of memory without any of
the near and far nonsense.  It required the DOS extender of course, which was
included.  I simply needed that much memory, and I was developing on another
platform that uses a 68000 processor, no problem with multiple megabytes.
It worked fine most of the time.  Now I bought a Toshiba portege 7220 with
WIN98SE the US version and now my application crashes. It works on other
machines, but on this notebook, that I bought especially for development, it
crashes while awaiting input.  Sigh.  If I write a simple program that contains

printf("\nPress a key...\n");
while( !kbhit() )
; /* null statement */

it crashes after a few seconds when it is compiled with the -mx x32lib switch.
It crashes with my original Symantec version and also with the DM and the latest
X32.
Anyone else has problems like this on this or other particular hardware
environments?
Also, someone complained that my program does not work under XP.  That has been
posted here already, but I suppose there is no word on whether or not an update
might be int the works?

Thanks for your time to read this and any replies that might be posted.
Regards, Ernest R. Schreurs.
Sep 12 2002
next sibling parent reply Heinz Saathoff <hsaat bre.ipnet.de> writes:
ernest wxs.nl schrieb...
 [multimegabyte app in DOSX]
 printf("\nPress a key...\n");
 while( !kbhit() )
 ; /* null statement */
 
 it crashes after a few seconds when it is compiled with the -mx x32lib switch.
 It crashes with my original Symantec version and also with the DM and the
latest
 X32.
 Anyone else has problems like this on this or other particular hardware
 environments?
The original DOSX had a problem when a machine has too much memory and HIMEM is istalled. There can also be problems with EMM386. The actual DOSX downloaded from the link at the DM page works for me now. Also be sure to link in cx.obj from the X32 lib (not the one from the sc\lib or dm\lib). I've installed the X32 stuff in a separete directory X32VW and manually link it. Example: sc -c -mx test.cpp link c:\x32vw\lib\cx+test,test,test,c:\x32vm\lib\x32 /noi HTH, Heinz
Sep 12 2002
parent ernest wxs.nl writes:
In article <MPG.17ebaa1bef990bcb9896b0 news.digitalmars.com>, Heinz Saathoff
says...
The original DOSX had a problem when a machine has too much memory and 
HIMEM is istalled. There can also be problems with EMM386. The actual 
DOSX downloaded from the link at the DM page works for me now. 
Also be sure to link in cx.obj from the X32 lib (not the one from the 
sc\lib or dm\lib). I've installed the X32 stuff in a separete directory 
X32VW and manually link it.
Example:

  sc -c -mx test.cpp
  link c:\x32vw\lib\cx+test,test,test,c:\x32vm\lib\x32 /noi
I tried that, but the result is the same. I know there was a problem with more than 64Mb memory in the machine, but that was already fixed by some Symantec update. My program runs on various machines ranging from 386 with DOS to machines with NT 4.0, Win98, Win ME and Win 2000 with up to 512 Mb. Just not on this notebook. I do not even get an exception, it just shows an alert that the program has performed an illegal operation. It runs a few seconds in the loop, anywhere from 1 to 5 seconds, and then I get the alert box. If I reboot that machine in Windows DOS mode it works. It must be some task switching issue, or processor state or whatever. Thanks for the advice though. Still looking for a solution.
Sep 13 2002
prev sibling parent reply ernest wxs.nl writes:
In article <alr0s2$2kpi$1 digitaldaemon.com>, ernest wxs.nl says...
If I write a simple program that contains

printf("\nPress a key...\n");
while( !kbhit() )
; /* null statement */

it crashes after a few seconds when it is compiled with the -mx x32lib switch.
I discovered through experimenting that the kbhit() does not work properly if the Toshiba utilitities are installed. These are drivers for the ACPI stuff and keyboard tools. I do not yet know which specific utility causes the incompatibility. Anyone else with any Toshiba notebook have the same problems? If I de-install these tools my applications runs okay. But then I can no longer control the toshiba hardware features. Is this a bug in kbhit(), the Toshiba stuff, or both?
Sep 26 2002
parent reply roland <rv ronetech.com> writes:
ernest wxs.nl a écrit :

 In article <alr0s2$2kpi$1 digitaldaemon.com>, ernest wxs.nl says...
If I write a simple program that contains

printf("\nPress a key...\n");
while( !kbhit() )
; /* null statement */

it crashes after a few seconds when it is compiled with the -mx x32lib switch.
I discovered through experimenting that the kbhit() does not work properly if the Toshiba utilitities are installed. These are drivers for the ACPI stuff and keyboard tools. I do not yet know which specific utility causes the incompatibility. Anyone else with any Toshiba notebook have the same problems?
No, i have a Satellite 4030. perhaps because i use to "clean" a pc as soon i recieve it ?
 If I de-install these tools my applications runs okay. But then I can no longer
 control the toshiba hardware features. Is this a bug in kbhit(), the Toshiba
 stuff, or both?
try "tsetup" in MS-DOS mode (oops does MS-DOS mode still exists ??) roland
Sep 27 2002
parent reply ernest wxs.nl writes:
In article <3D94922A.912C5BDA ronetech.com>, roland says...

Anyone else with any Toshiba notebook have the same problems?
No, i have a Satellite 4030. perhaps because i use to "clean" a pc as soon i recieve it ?
You mean you do not have these Toshiba utilities installed? I have no problems if I de-install them either, but they are needed to control the special hardware like the switch in the display panel that causes a standby when the lid is cloded. In essence, I need to know who is at fault. If the problem is inside the utilities, I can ask Toshiba to fix it. Otherwise, it is a problem in the compiler´s runtime stuff..
 If I de-install these tools my applications runs okay. But then I can no longer
 control the toshiba hardware features. Is this a bug in kbhit(), the Toshiba
 stuff, or both?
try "tsetup" in MS-DOS mode (oops does MS-DOS mode still exists ??)
Trying to run tsetup, what would I have to do or what would this accomplish?
Oct 01 2002
parent reply roland <rv ronetech.com> writes:
ernest wxs.nl a écrit :

 In article <3D94922A.912C5BDA ronetech.com>, roland says...

Anyone else with any Toshiba notebook have the same problems?
No, i have a Satellite 4030. perhaps because i use to "clean" a pc as soon i recieve it ?
You mean you do not have these Toshiba utilities installed? I have no problems if I de-install them either, but they are needed to control the special hardware like the switch in the display panel that causes a standby when the lid is cloded. In essence, I need to know who is at fault. If the problem is inside the utilities, I can ask Toshiba to fix it. Otherwise, it is a problem in the compiler´s runtime stuff..
Sorry i thought you were telling about Toshiba Hardware Setup in the control Panel. Toshiba Utilities remind me something but i don't have it now at least in my control panel and my start folder. Where it is suposed to be ? It never missed me and the screen shut up when i close the lid .. but my pc don't go to sleep. Perhaps it is because i removed Toshiba utilities that my pc often wake up in a bad mood when it goes sleeping ? It is 3 year old and i don't remember all what i removed when i recieved it. Generaly i use to uninstall the maximum of thing, specialy resident programs, in a new pc and reinstall them if needed. There is often useless "utilities" that slow down machine startup and take ressources.
 If I de-install these tools my applications runs okay. But then I can no longer
 control the toshiba hardware features. Is this a bug in kbhit(), the Toshiba
 stuff, or both?
try "tsetup" in MS-DOS mode (oops does MS-DOS mode still exists ??)
Trying to run tsetup, what would I have to do or what would this accomplish?
same as Toshiba Hardware Setup roland
Oct 02 2002
parent reply ernest wxs.nl writes:
In article <3D9B4583.4904FADA ronetech.com>, roland says...
Sorry i thought you were telling about Toshiba Hardware Setup in the control
Panel.
Toshiba Utilities remind me something but i don't have it now at least in my
control
panel and my
start folder. Where it is suposed to be ?
Look in the control panel and see if it is listed under de.install software. I do not know where they are stored and what files are involved. I do get some in my task list.
It never missed me and the screen shut up when i close the lid .. but my pc
don't go
to sleep.
You can configure the action taken upon closing the lid with these utilities. You can set it to sleep or hibernate too.
Perhaps it is because i removed Toshiba utilities that my pc often wake up in a
bad
mood when it goes sleeping ?
Probably not. Maybe your battery is bad after three years?
try "tsetup" in MS-DOS mode (oops does MS-DOS mode still exists ??)
Trying to run tsetup, what would I have to do or what would this accomplish?
same as Toshiba Hardware Setup
So, what would it accomplish since it seemed to me you offered this as a solution to my problem, and I fail to see how running a program can solve anything unless you configure something different. You did not tell me what to configure, so I cannot do anything sensible with this advice. So anyway, on your machine the kbhit loop works even when compiled with dos extender. The toshiba utilities are on the driver CD and can be downloaded, so you can install the afterwards. But you indicated you prefer not to. Thanks for your time. Still wondering which of the two is at fault here.
Oct 03 2002
parent reply roland <rv ronetech.com> writes:
ernest wxs.nl a écrit :

 In article <3D9B4583.4904FADA ronetech.com>, roland says...
Sorry i thought you were telling about Toshiba Hardware Setup in the control
Panel.
Toshiba Utilities remind me something but i don't have it now at least in my
control
panel and my
start folder. Where it is suposed to be ?
Look in the control panel and see if it is listed under de.install software. I do not know where they are stored and what files are involved. I do get some in my task list.
It never missed me and the screen shut up when i close the lid .. but my pc
don't go
to sleep.
You can configure the action taken upon closing the lid with these utilities. You can set it to sleep or hibernate too.
Perhaps it is because i removed Toshiba utilities that my pc often wake up in a
bad
mood when it goes sleeping ?
Probably not. Maybe your battery is bad after three years?
try "tsetup" in MS-DOS mode (oops does MS-DOS mode still exists ??)
Trying to run tsetup, what would I have to do or what would this accomplish?
same as Toshiba Hardware Setup
So, what would it accomplish since it seemed to me you offered this as a solution to my problem,
see at the beginning of my post, i wrote:
Sorry i thought you were telling about Toshiba Hardware Setup in the control
Panel.
 So anyway, on your machine the kbhit loop works even when compiled with dos
 extender.
 The toshiba utilities are on the driver CD and can be downloaded, so you can
 install the afterwards.
 But you indicated you prefer not to.
 Thanks for your time.  Still wondering which of the two is at fault here.
don't think DOSX is in fault: we installed our DOSX program on a lot of different chipset, laptop or desktop and never had problem with kbhit. roland
Oct 04 2002
parent reply ernest wxs.nl writes:
In article <3D9D4D3E.EAC6A10C ronetech.com>, roland says...

 Thanks for your time.  Still wondering which of the two is at fault here.
don't think DOSX is in fault: we installed our DOSX program on a lot of different chipset, laptop or desktop and never had problem with kbhit.
I am sure Toshiba will claim they have their utilitites installed on every notebook shipped and they never had a problem either. Ever tried convincing such a company about a problem in their software? You have to have proof, telling them what the problem is, i.e. a corrupted stack or register. I do not have this information, nor can I figure out how to obtain this or why kbhit crashes, since I do not have the source code to that stuff. I sent them a compiled version with source code, and they said it crashes on all their machines, Yet it did not impress them, they probably think the user software is the problem.
Oct 06 2002
parent roland <rv ronetech.com> writes:
ernest wxs.nl a écrit :

 In article <3D9D4D3E.EAC6A10C ronetech.com>, roland says...

 I am sure Toshiba will claim they have their utilitites installed on every
 notebook shipped and they never had a problem either.
sure: there machine are made for windows, don't care DOSX, are just beginning to care about Linux compatibility...
 Ever tried convincing such a company about a problem in their software?
i'm too little for such a big company
 You have to have proof, telling them what the problem is, i.e. a corrupted
stack
 or register.
 I do not have this information, nor can I figure out how to obtain this or why
 kbhit crashes, since I do not have the source code to that stuff. I sent them a
 compiled version with source code, and they said it crashes on all their
 machines, Yet it did not impress them, they probably think the user software is
 the problem.
they tried on all there machine ? congratulation ! the problem interest me. i made some test .. .. sorry my pc still don't want to crash.. I reinstalled Toshiba utilities: Tools & Utilities CD ROM \Win98\WINUTIL\FRENCH\DSK1\SETUP.EXE. I keep the default configuration. Don't see any new program: just i have more options available in the Power Management program in the Control Panel. here is my test program: //---------------------------------------------------------------------------------------------------- #include <dos.h> #include <stdio.h> #define _ZF (1u<<6) int bios_kbhit() { REGS regs; regs.h.ah = 1; int86_real(0x16,&regs,&regs); return ((regs.x.flags&_ZF)==0); } int main() { //test stdio::kbhit puts("stdio kbhit: press key"); while(!kbhit()) {} getch(); //test bios kbhit puts("bios kbhit: press key"); while(!bios_kbhit()) {} getch(); puts("Okay! still alive !"); return 0; } //---------------------------------------------------------------------------------------------------- compiled: sc bkbhit.cpp -cpp -p -mx -o+time -5 -a4 -c -obkbhit.obj sorry, this program does _not_ crash in a Windows dos box nor in pure dos mode: if i were you i might try: 1- uninstall all "utilities" and reinstall only needed one, 2- try bios_kbhit function as a replacement to stdio::kbhit(), 3- trap int 9 to an isr that doen't do anything exept call the original isr. if it does'nt prevent crash, perhaps messages will be more explicit. 4- unassemble int 16 fc 1 and rewrite it so that your program stays in 32 bit protected mode. thats all, i stop wasting your time and mine: can't help roland
Oct 07 2002