Re: [Freedos-kernel] [patch] #1758 - fix incorrect AskSingleLine function

2004-06-15 Thread Bernd Blaauw
Arkady V.Belousov schreef:
- 123? present and statement not from selected menu? Skip.
- ! present? Don't skip.
- ? present or single step? Ask.
Your proposal changes behavior: now it will look so:
- 123? present and statement not from selected menu? Skip.
- ? present? Ask.
- single step and not ! present? Ask.
I wanted
0123?!ECHO?=DUMMY.SYS
also to be asked (because it contains ?= part)
in current FreeDOS kernel, the ?= part is ignored because ! is 
present. cases 4 and 8 go wrong here (auto-executed..)

echo=1// only ask when F8
echo?=2   // always ask
!echo=3   // should never ask
!echo?=4  // should always ask, even if F8
012?echo=5// only ask when F8 (and ofcourse menu 1, 2,or 3 selected)
012?echo?=6   // always ask
012?!echo=7   // never ask
012?!echo?=8  // should always ask, even if F8
ANY ?= should raise the ASK-question, even if ! is present.
Eric optimized the function a bit :)

Well... I hardly rework config.c and fix many bugs (most of them are not
check input validness - for example, break=offk accepted as on). Also I
add above your changes. If you wish/can/may, I send you my config.c for
testing.
I'll gladly receive your config.c
please send entire file, not a patch.
(I haven't learned using DIFF/PATCH yet, but learned compiling a bit)
Bernd
---
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] [patch] #1758 - fix incorrect AskSingleLine function

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

13--2004 19:39 [EMAIL PROTECTED] (Bernd Blaauw) wrote to
[EMAIL PROTECTED]:

BB Eric and I have been working a few hours on a patch to correct the
BB ask-user-to-execute-config.sys-line algorythm.
BB essentially (config.c, line 806 I think):
BB/* !device= never ask / device?= always ask / device= ask if singleStep */
BB/* ! does override singleStep but not ?, so !device?= will ask... */

 As I understand, currently behavior is this:

- 123? present and statement not from selected menu? Skip.
- ! present? Don't skip.
- ? present or single step? Ask.

Your proposal changes behavior: now it will look so:

- 123? present and statement not from selected menu? Skip.
- ? present? Ask.
- single step and not ! present? Ask.

 I think, this is valid.

BBif (! ( (singleStep  !DontAskThisSingleCommand) ||
BB(askThisSingleCommand) ) )
BB  return FALSE; /* do not skip, and do not ask either */

 This is identical to (simpler):

if ((!singleStep || DontAskThisSingleCommand) 
!askThisSingleCommand)
  return FALSE; /* do not skip, and do not ask either */

but I think this better will look so:

if (!(askThisSingleCommand ||   /* ? */
  singleStep  !DontAskThisSingleCommand)) /* not ! */
  return FALSE; /* do not skip, and do not ask either */

Well... I hardly rework config.c and fix many bugs (most of them are not
check input validness - for example, break=offk accepted as on). Also I
add above your changes. If you wish/can/may, I send you my config.c for
testing.




---
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


[Freedos-kernel] [patch] #1758 - fix incorrect AskSingleLine function

2004-06-13 Thread Bernd Blaauw
Eric and I have been working a few hours on a patch to correct the
ask-user-to-execute-config.sys-line algorythm.
essentially (config.c, line 806 I think):
  /* !device= never ask / device?= always ask / device= ask if singleStep */
  /* ! does override singleStep but not ?, so !device?= will ask... */
  if (! ( (singleStep  !DontAskThisSingleCommand) ||
  (askThisSingleCommand) ) )
return FALSE; /* do not skip, and do not ask either */
Eric also made some more changes. See below for the complete DIFF against 2035
Next steps *I* would like to take (still a non-programmer!) are:
-don't auto-add 0 as a menu-item
-set menudefault to lowest menu-item ('0' currently)
-don't show menu unless at least 2 different menu-items are available.
Bernd
http://www.coli.uni-sb.de/~eric/dos-config-patch.zip
--- config.old  Tue May 25 01:02:46 2004
+++ config.cSun Jun 13 00:23:56 2004
@@ -549,7 +549,7 @@
 umb_base_seg = umb_max = umb_start = umb_seg;
 UMB_top = umb_size;
-/* there can be more UMB's !
+/* there can be more UMBs !
this happens, if memory mapped devces are in between
like UMB memory c800..c8ff, d8ff..efff with device at d000..d7ff
However some of the xxxHIGH commands still only work with
@@ -801,14 +801,15 @@
   /* 123?device=EMM386.EXE NOEMS */
   if ( MenuLine != 0 
   (MenuLine  (1  MenuSelected)) == 0)
-return TRUE;
-
-  if (DontAskThisSingleCommand) /* !files=30 */
-return FALSE;
+return TRUE;   /* skip the line */
-  if (!askThisSingleCommand  !singleStep)
-return FALSE;
+  /* !device= never ask / device?= always ask / device= ask if singleStep */
+  /* ! does override singleStep but not ?, so !device?= will ask... */
+  if (! ( (singleStep  !DontAskThisSingleCommand) ||
+  (askThisSingleCommand) ) )
+return FALSE; /* do not skip, and do not ask either */
+  /* if ( (s.s.  d.a.t.s.c) || (a.t.s.c) ) then ASK THE USER */
   printf(%s[Y,N]?, pLine);
   for (;;)
@@ -902,6 +903,7 @@
   /* Get the argument */
   if (GetNumArg(pLine, nBuffers))
 Config.cfgBuffers = nBuffers;
+  /* Second argument (0..8 buffers for read-ahead) not supported yet. */
 }
 /**
@@ -1004,7 +1006,10 @@
 }
 /*
-UmbState of confidence, 1 is sure, 2 maybe, 4 unknown and 0 no way.
+UmbState of confidence, 1 is sure, 2 maybe, 0 no way.
+Transitions: 0 - 0/2 depending on DOS=UMB, try init (2 - 1)
+after each driver load, as it could have been the UMB driver.
+If UMB really found, state 1 is reached and MCBs are adjusted.
 */
 STATIC VOID Dosmem(BYTE * pLine)
@@ -1205,7 +1210,7 @@
 #endif
   if (!LoadCountryInfoHardCoded(filename, ctryCode, codePage))
-return;
+return; /* error message already displayed by LoadCountry... */
 error:
   CfgFailure(pLine);
@@ -1293,17 +1298,24 @@
 STATIC VOID DeviceHigh(BYTE * pLine)
 {
-  if (UmbState == 1)
+  if (UmbState == 1)   /* UMB already initialized? */
   {
 if (LoadDevice(pLine, MK_FP(umb_start + UMB_top, 0), TRUE) == DE_NOMEM)
 {
-  printf(Not enough free memory in UMB's: loading low\n);
+  printf(Not enough free memory in UMBs: loading low\n);
   LoadDevice(pLine, lpTop, FALSE);
 }
   }
   else
   {
-printf(UMB's unavailable!\n);
+if (!umb_base_seg) /* only warn once */
+{
+  printf(UMBs unavailable!\n);
+  umb_base_seg = 0x;   /* first 0, non-0 after umb_init success */
+}
+/* if UmbState is 2: still waiting for the UMB driver, after it is */
+/* found, UmbState will be 1 and umb_base_seg will be initialized. */
+/* UmbState 0 means that we do not want UMBs at all, DOS=NOUMB case. */
 LoadDevice(pLine, lpTop, FALSE);
   }
 }

---
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel