[Freedos-kernel] Tom's kernel changes vs. CVS

2007-05-15 Thread Bart Oldeman
Hi,

I've put on some effort in merging Tom's changes into the current CVS
('stable').
Thanks to Eric for forwarding the patch. Committing them back into CVS
is mostly done now.

Many of the changes in Tom's kernel, when compared to 2035 plain, were
already there (or in a slightly different form), some are not.

I'm left with the small diff below of changes I do not understand.
Tom, can you explain?

1. config.c. Why use  instead of =? Is there a corner case with equality?
2. initoem.c:
+ if (ramsize == peek(0, RAMSIZE))
if (ramsize * 64 == ebdaseg  ramsize  640  peek(0, RAMSIZE) == ramsize)
   the extra double check looks strange to me, why check twice?
Something strange with short-circuit boolean evaluation?
3. int21/ax=3301. The comment and the code are out of sync. By falling
through it reports the new state of break_ena in DL (not AL).
Moreover, RBIL tells us that Novell DOS 7 report the *old* state
(instead of the new state) in DL. What is the intended logic here?

Thanks,
Bart

--- ke2035/kernel/config.c  2004-05-25 01:02:46.0 -0400
+++ ke2035ctom/kernel/config.c  2007-05-14 12:43:46.0 -0400
@@ -753,8 +753,8 @@
  if (timeout = 0) do
   {

 r.a.x = 0x0100; /* are there keys available ? */

 init_call_intr(0x16, r);

-if ((unsigned)(GetBiosTime() - startTime) = timeout * 18u)

+if ((unsigned)(GetBiosTime() - startTime)  timeout * 18u)

   return 0x;

   }

   while (r.flags  FLG_ZERO);

diff -urb ke2035/kernel/dsk.c ke2035ctom/kernel/dsk.c
+++ ke2035ctom/kernel/initoem.c 2007-05-14 12:43:46.0 -0400
@@ -58,7 +59,8 @@
   unsigned ebdaseg = peek(0, EBDASEG);

   unsigned ramsize = ram_top;



+  if (ramsize == peek(0, RAMSIZE))

   if (ramsize * 64 == ebdaseg  ramsize  640  peek(0, RAMSIZE) == ramsize)

   {

 unsigned ebdasz = peekb(ebdaseg, 0);

diff -urb ke2035/kernel/inthndlr.c ke2035ctom/kernel/inthndlr.c
--- ke2035/kernel/inthndlr.c2004-05-30 20:31:06.0 -0400
+++ ke2035ctom/kernel/inthndlr.c2007-05-14 12:43:46.0 -0400
@@ -78,17 +78,17 @@
 case 0x33:

   switch (irp-AL)

   {

+  /* Set Ctrl-C flag; returns al = break_ena  */

+case 0x01:

+  break_ena = irp-DL  1;

+  /* fall through */

+

   /* Get Ctrl-C flag  */

 case 0x00:

   irp-DL = break_ena;

   break;



-  /* Set Ctrl-C flag  */

-case 0x01:

-  break_ena = irp-DL  1;

-  break;

-

 case 0x02: /* andrew schulman: get/set extended
control break  */

   {

 UBYTE tmp = break_ena;

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Tom's kernel changes vs. CVS

2007-05-15 Thread tom ehlert
Hi Bart,

nice to see you're still alive :)

 Tom, can you explain?

 1. config.c. Why use  instead of =? Is there a corner case with equality?

IMO = is correct (timeout 0 should exit immediately)


 2. initoem.c:
 + if (ramsize == peek(0, RAMSIZE))
 if (ramsize * 64 == ebdaseg  ramsize  640  peek(0, RAMSIZE) == ramsize)
the extra double check looks strange to me, why check twice?
 Something strange with short-circuit boolean evaluation?

looks strange, and I have no idea why exactly this is there.

But since I put it in after ke2035, I just assume I did that
intentionally. (this was changed on or before 11.07.2004)

I'd leave it under 'it doesn't hurt'

 3. int21/ax=3301. The comment and the code are out of sync.

 By falling
 through it reports the new state of break_ena in DL (not AL).
right

besides that, the code should do the same in both cases (DL should be
00 or 01)

I don't mind much

Tom

 Moreover, RBIL tells us that Novell DOS 7 report the *old* state
 (instead of the new state) in DL. What is the intended logic here?

 Thanks,
 Bart

 --- ke2035/kernel/config.c  2004-05-25 01:02:46.0 -0400
 +++ ke2035ctom/kernel/config.c  2007-05-14 12:43:46.0 -0400
 @@ -753,8 +753,8 @@
   if (timeout = 0) do
{

  r.a.x = 0x0100; /* are there keys available ? */

  init_call_intr(0x16, r);

 -if ((unsigned)(GetBiosTime() - startTime) = timeout * 18u)

 +if ((unsigned)(GetBiosTime() - startTime)  timeout * 18u)

return 0x;

}

while (r.flags  FLG_ZERO);

 diff -urb ke2035/kernel/dsk.c ke2035ctom/kernel/dsk.c
 +++ ke2035ctom/kernel/initoem.c   2007-05-14 12:43:46.0 -0400
 @@ -58,7 +59,8 @@
unsigned ebdaseg = peek(0, EBDASEG);

unsigned ramsize = ram_top;



 +  if (ramsize == peek(0, RAMSIZE))

if (ramsize * 64 == ebdaseg  ramsize  640  peek(0, RAMSIZE) == 
 ramsize)

{

  unsigned ebdasz = peekb(ebdaseg, 0);

 diff -urb ke2035/kernel/inthndlr.c ke2035ctom/kernel/inthndlr.c
 --- ke2035/kernel/inthndlr.c2004-05-30 20:31:06.0 -0400
 +++ ke2035ctom/kernel/inthndlr.c2007-05-14 12:43:46.0 -0400
 @@ -78,17 +78,17 @@
  case 0x33:

switch (irp-AL)

{

 +  /* Set Ctrl-C flag; returns al = break_ena  */

 +case 0x01:

 +  break_ena = irp-DL  1;

 +  /* fall through */

 +

/* Get Ctrl-C flag  */

  case 0x00:

irp-DL = break_ena;

break;



 -  /* Set Ctrl-C flag  */

 -case 0x01:

 -  break_ena = irp-DL  1;

 -  break;

 -

  case 0x02: /* andrew schulman: get/set extended
 control break  */

{

  UBYTE tmp = break_ena;

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Freedos-kernel mailing list
 Freedos-kernel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Mit freundlichen Grüßen / Kind regards,
Tom Ehlert
+49-241-79886


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Tom's kernel changes vs. CVS

2007-05-15 Thread Eric Auer

Hi Bart, Tom,

some extra comment for

 2. initoem.c:
 + if (ramsize == peek(0, RAMSIZE))
 if (ramsize * 64 == ebdaseg  ramsize  640  peek(0, RAMSIZE) == ramsize)
the extra double check looks strange to me, why check twice?
 Something strange with short-circuit boolean evaluation?

... I got the recommendation do not move EBDA unless it starts
at the segment where low DOS RAM ends according to 40[13], as
another location could mean that something else fiddled with the
location / memory already. Of course that does not answer the
question why ramsize == peek(0, RAMSIZE) is checked for twice.

Eric

PS: Bart, could you make a list which things you merged in from
Tom's kernel and which you did not? I would like to compare it
to my own list... Thanks :-).

PPS: Did you also check in the changes from the kernel on my
homepage? If so, I hope you grabbed some of the changelog and
put it into the cvs logs. Good cvs logs are always very useful.
If you did not check in my changes yet, remind me to do myself ;-).


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel